Skip to content

Commit df6cec2

Browse files
committed
refactor(map): Remove unused filename variable from getMapPreviewImage function
1 parent 85add1a commit df6cec2

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

Generals/Code/GameEngine/Source/GameClient/MapUtil.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ static Coord3DList m_techPositions;
8181
static Int m_mapDX = 0;
8282
static Int m_mapDY = 0;
8383

84-
// TheSuperHackers @refactor bobtista 31/10/2025 Remove unused variables and parameter. Function only uses fname directly.
8584
static UnsignedInt calcCRC( AsciiString fname )
8685
{
8786
CRC theCRC;
@@ -216,7 +215,6 @@ static Bool ParseSizeOnlyInChunk(DataChunkInput &file, DataChunkInfo *info, void
216215
return ParseSizeOnly(file, info, userData);
217216
}
218217

219-
// TheSuperHackers @refactor bobtista 31/10/2025 Remove unused variables. Function only uses filename directly.
220218
static Bool loadMap( AsciiString filename )
221219
{
222220
CachedFileInputStream fileStrm;
@@ -566,7 +564,6 @@ Bool MapCache::loadUserMaps()
566564
}
567565
else
568566
{
569-
// TheSuperHackers @refactor bobtista 31/10/2025 Remove unused code block that parsed filename but never used result.
570567
if (TheFileSystem->getFileInfo(tempfilename, &fileInfo)) {
571568
m_seen[tempfilename] = TRUE;
572569
parsedAMap |= addMap(mapDir, *iter, &fileInfo, TheGlobalData->m_buildMapCache);
@@ -1017,12 +1014,8 @@ Image *getMapPreviewImage( AsciiString mapName )
10171014
AsciiString tgaName = mapName;
10181015
AsciiString name;
10191016
AsciiString tempName;
1020-
AsciiString filename;
10211017
tgaName.truncateBy(4); // ".map"
1022-
name = tgaName;//.reverseFind('\\') + 1;
1023-
filename = tgaName.reverseFind('\\') + 1;
1024-
//tgaName = name;
1025-
filename.concat(".tga");
1018+
name = tgaName;
10261019
tgaName.concat(".tga");
10271020

10281021
AsciiString portableName = TheGameState->realMapPathToPortableMapPath(name);

GeneralsMD/Code/GameEngine/Source/GameClient/MapUtil.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ static Coord3DList m_techPositions;
8181
static Int m_mapDX = 0;
8282
static Int m_mapDY = 0;
8383

84-
// TheSuperHackers @refactor bobtista 31/10/2025 Remove unused variables and parameter. Function only uses fname directly.
8584
static UnsignedInt calcCRC( AsciiString fname )
8685
{
8786
CRC theCRC;
@@ -216,7 +215,6 @@ static Bool ParseSizeOnlyInChunk(DataChunkInput &file, DataChunkInfo *info, void
216215
return ParseSizeOnly(file, info, userData);
217216
}
218217

219-
// TheSuperHackers @refactor bobtista 31/10/2025 Remove unused variables. Function only uses filename directly.
220218
static Bool loadMap( AsciiString filename )
221219
{
222220
CachedFileInputStream fileStrm;
@@ -568,7 +566,6 @@ Bool MapCache::loadUserMaps()
568566
}
569567
else
570568
{
571-
// TheSuperHackers @refactor bobtista 31/10/2025 Remove unused code block that parsed filename but never used result.
572569
if (TheFileSystem->getFileInfo(tempfilename, &fileInfo)) {
573570
m_seen[tempfilename] = TRUE;
574571
parsedAMap |= addMap(mapDir, *iter, &fileInfo, TheGlobalData->m_buildMapCache);
@@ -1097,12 +1094,8 @@ Image *getMapPreviewImage( AsciiString mapName )
10971094
AsciiString tgaName = mapName;
10981095
AsciiString name;
10991096
AsciiString tempName;
1100-
AsciiString filename;
11011097
tgaName.truncateBy(4); // ".map"
1102-
name = tgaName;//.reverseFind('\\') + 1;
1103-
filename = tgaName.reverseFind('\\') + 1;
1104-
//tgaName = name;
1105-
filename.concat(".tga");
1098+
name = tgaName;
11061099
tgaName.concat(".tga");
11071100

11081101
AsciiString portableName = TheGameState->realMapPathToPortableMapPath(name);

0 commit comments

Comments
 (0)