Skip to content

Commit

Permalink
Partial revert of: Initialize fog color after palette reload
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Mar 1, 2022
1 parent 1a3835e commit 9310e24
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/lighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,6 @@ void setDefaultFogColour()
}
}

void reInitPaletteAndFog()
{
pal_Init();
setDefaultFogColour();
}

#define MIN_DROID_LIGHT_LEVEL 96
#define DROID_SEEK_LIGHT_SPEED 2

Expand Down
1 change: 0 additions & 1 deletion src/lighting.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void initLighting(UDWORD x1, UDWORD y1, UDWORD x2, UDWORD y2);
void doBuildingLights();
void updateFogDistance(float distance);
void setDefaultFogColour();
void reInitPaletteAndFog();
void calcDroidIllumination(DROID *psDroid);

#endif // __INCLUDED_SRC_LIGHTNING_H__
3 changes: 1 addition & 2 deletions src/multiint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
#include "notifications.h"
#include "radar.h"
#include "lib/framework/wztime.h"
#include "lighting.h" // for reInitPaletteAndFog()

#include "multiplay.h"
#include "multiint.h"
Expand Down Expand Up @@ -8380,7 +8379,7 @@ bool WZGameReplayOptionsHandler::restoreOptions(const nlohmann::json& object, Em
levShutDown();
levInitialise();
rebuildSearchPath(mod_multiplay, true); // MUST rebuild search path for the new maps we just got!
reInitPaletteAndFog(); //Update palettes.
pal_Init(); //Update palettes.
if (!buildMapList())
{
debug(LOG_ERROR, "Failed to build map list");
Expand Down
4 changes: 2 additions & 2 deletions src/multiopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "lib/framework/wzapp.h"
#include "lib/framework/physfs_ext.h"

#include "lib/ivis_opengl/piepalette.h" // for pal_Init()
#include "lib/ivis_opengl/piestate.h"

#include "map.h"
Expand All @@ -45,7 +46,6 @@
#include "configuration.h" // lobby cfg.
#include "clparse.h"

#include "lighting.h" // for reInitPaletteAndFog()
#include "component.h"
#include "console.h"
#include "multiplay.h"
Expand Down Expand Up @@ -273,7 +273,7 @@ bool recvOptions(NETQUEUE queue)
}
else
{
reInitPaletteAndFog(); // Palette could be modded. // Why is this here - isn't there a better place for it?
pal_Init(); // Palette could be modded. // Why is this here - isn't there a better place for it?
return FileRequestResult::FileExists; // Have the file already.
}

Expand Down
3 changes: 2 additions & 1 deletion src/multiplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "lib/framework/input.h"
#include "lib/framework/strres.h"
#include "lib/framework/physfs_ext.h"
#include "lib/ivis_opengl/piepalette.h" // for pal_Init()
#include "map.h"

#include "game.h" // for loading maps
Expand Down Expand Up @@ -2043,7 +2044,7 @@ bool recvMapFileData(NETQUEUE queue)
levShutDown();
levInitialise();
rebuildSearchPath(mod_multiplay, true); // MUST rebuild search path for the new maps we just got!
reInitPaletteAndFog(); //Update palettes.
pal_Init(); //Update palettes.
if (!buildMapList())
{
return false;
Expand Down

0 comments on commit 9310e24

Please sign in to comment.