From dff6fbfafba2659216ed63d38bfb074c4e44767f Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sat, 9 Nov 2024 03:42:07 +0100 Subject: [PATCH] remove some unused things from WorldMapRender --- Aquaria/GridRender.h | 2 -- Aquaria/WorldMapRender.cpp | 45 +++++--------------------------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/Aquaria/GridRender.h b/Aquaria/GridRender.h index e7ff2bf..3cc4b39 100644 --- a/Aquaria/GridRender.h +++ b/Aquaria/GridRender.h @@ -119,7 +119,6 @@ protected: Quad *addHintQuad1, *addHintQuad2; AquariaMenuItem *helpButton; float doubleClickTimer; - Vector restoreVel; float inputDelay; BitmapText *areaLabel, *areaLabel2, *areaLabel3; WorldMapTile *originalActiveTile; @@ -127,7 +126,6 @@ protected: void clearVis(WorldMapTile *tile); bool on; void onUpdate(float dt); - Quad *bg; unsigned char *savedTexData; bool mb; Vector lastMousePosition; // See FIXME in WorldMapRender.cpp --achurch diff --git a/Aquaria/WorldMapRender.cpp b/Aquaria/WorldMapRender.cpp index 28843cb..f260feb 100644 --- a/Aquaria/WorldMapRender.cpp +++ b/Aquaria/WorldMapRender.cpp @@ -52,11 +52,8 @@ namespace WorldMapRenderNamespace const VisMethod visMethod = VIS_VERTEX; WorldMapRevealMethod revMethod = REVEAL_DEFAULT; - std::vector tiles; - Quad *activeQuad=0, *lastActiveQuad=0, *originalActiveQuad=0; - Quad *lastVisQuad=0, *visQuad=0; - WorldMapTile *lastVisTile=0; + Quad *activeQuad=0; float xMin, yMin, xMax, yMax; @@ -74,7 +71,6 @@ namespace WorldMapRenderNamespace using namespace WorldMapRenderNamespace; -std::vector grid; class GemMover; @@ -414,7 +410,7 @@ protected: typedef std::list GemMovers; GemMovers gemMovers; -typedef std::list BeaconRenders; +typedef std::vector BeaconRenders; BeaconRenders beaconRenders; std::vector quads; @@ -425,11 +421,7 @@ void WorldMapRender::setProperTileColor(WorldMapTile *tile) { if (tile->q) { - if (!tile->revealed) - tile->q->alphaMod = 0; - - if (tile->revealed) - tile->q->alphaMod = 0.5f; + tile->q->alphaMod = tile->revealed ? 0.5f : 0.0f; if (activeTile && (tile->layer != activeTile->layer || (tile->layer > 0 && activeTile != tile))) tile->q->alphaMod *= 0.5f; @@ -573,11 +565,9 @@ void WorldMapRender::setVis(WorldMapTile *tile) } else if (visMethod == VIS_WRITE) { + assert(!savedTexData); savedTexData = tileDataToAlpha(tile); } - - lastVisQuad = tile->q; - lastVisTile = tile; } void WorldMapRender::clearVis(WorldMapTile *tile) @@ -607,11 +597,6 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper() editorActive=false; mb = false; activeQuad=0; - lastActiveQuad=0; - originalActiveQuad=0; - lastVisQuad=0; - visQuad=0; - lastVisTile=0; originalActiveTile = activeTile = 0; @@ -630,8 +615,6 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper() lastMousePosition = core->mouse.position; - bg = 0; - savedTexData = 0; @@ -653,8 +636,6 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper() } } - tiles.clear(); - if(num) dsq->texmgr.loadBatch(&texs[0], &textodo[0], num); @@ -678,10 +659,7 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper() if (tile == activeTile) activeQuad = q; - if (revMethod == REVEAL_PARTIAL || activeQuad == q) - { - setVis(tile); - } + setVis(tile); setProperTileColor(tile); @@ -692,8 +670,6 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper() } addChild(q, PM_POINTER); - - tiles.push_back(q); } } shareAlphaWithChildren = 1; @@ -1320,9 +1296,6 @@ void WorldMapRender::toggle(bool turnON) this->on = turnON; if (on) { - restoreVel = game->avatar->vel; - game->avatar->vel = Vector(0,0,0); - game->togglePause(true); core->sound->playSfx("menu-open"); @@ -1365,9 +1338,6 @@ void WorldMapRender::toggle(bool turnON) } } - if (bg) - bg->alpha.interpolateTo(1, 0.2f); - alpha.interpolateTo(1, 0.2f); @@ -1434,9 +1404,6 @@ void WorldMapRender::toggle(bool turnON) core->sound->playSfx("Menu-Close"); - if (bg) - bg->alpha.interpolateTo(0, 0.2f); - alpha.interpolateTo(0, 0.2f); game->togglePause(false); @@ -1460,8 +1427,6 @@ void WorldMapRender::toggle(bool turnON) (*i)->safeKill(); } beaconRenders.clear(); - - game->avatar->vel = restoreVel; } }