00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pent_include.h"
00020 #include "FastAreaVisGump.h"
00021 #include "GUIApp.h"
00022 #include "World.h"
00023 #include "CurrentMap.h"
00024 #include "RenderSurface.h"
00025
00026 DEFINE_RUNTIME_CLASSTYPE_CODE(FastAreaVisGump,Gump);
00027
00028 FastAreaVisGump::FastAreaVisGump(void) : Gump(0,0,MAP_NUM_CHUNKS+2,MAP_NUM_CHUNKS+2,0,FLAG_DRAGGABLE|FLAG_DONT_SAVE,LAYER_NORMAL)
00029 {
00030 }
00031
00032 FastAreaVisGump::~FastAreaVisGump(void)
00033 {
00034 }
00035
00036 void FastAreaVisGump::PaintThis(RenderSurface* surf, sint32 lerp_factor, bool scaled)
00037 {
00038 World *world = World::get_instance();
00039 CurrentMap *currentmap = world->getCurrentMap();
00040
00041 surf->Fill32(0xFF0000,0,0,MAP_NUM_CHUNKS+2,MAP_NUM_CHUNKS+2);
00042 surf->Fill32(0,1,1,MAP_NUM_CHUNKS,MAP_NUM_CHUNKS);
00043
00044
00045 for (int y = 0; y < MAP_NUM_CHUNKS; y++)
00046 for (int x = 0; x < MAP_NUM_CHUNKS; x++)
00047 if (currentmap->isChunkFast(x,y)) surf->Fill32(0xFFFFFFFF,x+1,y+1,1,1);
00048 }
00049
00050 void FastAreaVisGump::ConCmd_toggle(const Console::ArgvType &argv)
00051 {
00052 GUIApp *app = GUIApp::get_instance();
00053 Gump *desktop = app->getDesktopGump();
00054 Gump *favg = desktop->FindGump(FastAreaVisGump::ClassType);
00055
00056 if (!favg) {
00057 favg = new FastAreaVisGump;
00058 favg->InitGump(0);
00059 favg->setRelativePosition(TOP_RIGHT, -4, 4);
00060 }
00061 else {
00062 favg->Close();
00063 }
00064 }
00065
00066 uint16 FastAreaVisGump::TraceObjId(int mx, int my)
00067 {
00068 uint16 objid = Gump::TraceObjId(mx,my);
00069
00070 if (!objid || objid == 65535)
00071 if (PointOnGump(mx,my))
00072 objid = getObjId();
00073
00074 return objid;
00075 }