diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index b6305b88b..bf7f3be57 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -3033,12 +3033,12 @@ bool MapLoader::LoadLightmap(MapData* map) return false; int version = fr.ReadInt32(); - if (version < 3) + if (version < LIGHTMAPVER) { - Printf(PRINT_HIGH, "LoadLightmap: This is an old unsupported version of the lightmap lump. Please rebuild the map with a newer version of zdray.\n"); + Printf(PRINT_HIGH, "LoadLightmap: This is an old unsupported version of the lightmap lump. Please rebuild the map with the console commands 'deletelightmap', and then 'savelightmap'.\n"); return false; } - else if (version != 3) + else if (version != LIGHTMAPVER) { Printf(PRINT_HIGH, "LoadLightmap: unsupported lightmap lump version\n"); return false; diff --git a/src/rendering/hwrenderer/doom_levelmesh.cpp b/src/rendering/hwrenderer/doom_levelmesh.cpp index aab151dbb..300d4bf53 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.cpp +++ b/src/rendering/hwrenderer/doom_levelmesh.cpp @@ -2002,11 +2002,13 @@ void SaveMapLumps(FileWriter* writer, const TArray& lumps, const char* void DoomLevelMesh::SaveLightmapLump(FLevelLocals& doomMap) { /* - // LIGHTMAP V3 pseudo-C specification: + // LIGHTMAP version 4 pseudo-C specification: + + (Please update LIGHTMAPVER in version.h when upgrading this) struct LightmapLump { - int version = 2; + int version; uint32_t tileCount; uint32_t pixelCount; uint32_t uvCount; @@ -2046,7 +2048,7 @@ void DoomLevelMesh::SaveLightmapLump(FLevelLocals& doomMap) } } - const int version = 3; + const int version = LIGHTMAPVER; const uint32_t headerSize = sizeof(int) + 2 * sizeof(uint32_t); const uint32_t bytesPerTileEntry = sizeof(uint32_t) * 4 + sizeof(uint16_t) * 2 + sizeof(float) * 9; diff --git a/src/version.h b/src/version.h index f63ca3fea..4feeb2db1 100644 --- a/src/version.h +++ b/src/version.h @@ -127,5 +127,7 @@ const int SAVEPICHEIGHT = 162; const int VID_MIN_WIDTH = 320; const int VID_MIN_HEIGHT = 200; +// Lightmap lump version +#define LIGHTMAPVER 4 #endif //__VERSION_H__