Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set(usingMsBuild $<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>)
# TODO: build our own Lua 5.1.2 from source so we can use whichever
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP USE_VFS _CRT_SECURE_NO_DEPRECATE)
add_compile_definitions(CINTERFACE XML_STATIC VFS_STATIC VFS_WITH_SLF VFS_WITH_7ZIP _CRT_SECURE_NO_DEPRECATE)
include_directories(${CMAKE_SOURCE_DIR} "ext/VFS/include" Utils TileEngine TacticalAI ModularizedTacticalAI Tactical Strategic "Standard Gaming Platform" Res Lua Laptop Multiplayer "Multiplayer/raknet" Editor Console)

# external libraries
Expand Down
43 changes: 2 additions & 41 deletions Editor/LoadScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ INT32 iCurrFileShown;
INT32 iLastFileClicked;
INT32 iLastClickTime;

#ifdef USE_VFS
CHAR8 gzProfileName[FILENAME_BUFLEN];//dnl ch81 021213
#endif
CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909
extern INT16 gsSelSectorX;
extern INT16 gsSelSectorY;
Expand Down Expand Up @@ -165,7 +163,6 @@ void LoadSaveScreenEntry()
}

iTopFileShown = iTotalFiles = 0;
#ifdef USE_VFS//dnl ch37 300909
gzProfileName[0] = 0;//dnl ch81 021213
FDLG_LIST* TempFileList = NULL;
vfs::CProfileStack* st = getVFS()->getProfileStack();
Expand Down Expand Up @@ -220,25 +217,6 @@ void LoadSaveScreenEntry()
}
while(FileList->pPrev)
FileList = FileList->pPrev;
#else
if(GetFileFirst("MAPS\\*.dat", &FileInfo))
{
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
{
FileList = AddToFDlgList(FileList, &FileInfo);
iTotalFiles++;
}
while(GetFileNext(&FileInfo))
{
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
{
FileList = AddToFDlgList(FileList, &FileInfo);
iTotalFiles++;
}
}
GetFileClose(&FileInfo);
}
#endif
swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" );

swprintf( gzFilename, L"%S", gubFilename );
Expand Down Expand Up @@ -283,7 +261,8 @@ UINT32 ProcessLoadSaveScreenMessageBoxResult()
{
if( gfReadOnly )
{
FileClearAttributes( gszCurrFilename );
// Other call sites have replaced this with FileDelete(); for VFS, should we do the same here?
//FileClearAttributes( gszCurrFilename );
gfReadOnly = FALSE;
}
FileDelete( gszCurrFilename );
Expand Down Expand Up @@ -468,19 +447,6 @@ UINT32 LoadSaveScreenHandle(void)
}
sprintf(gszCurrFilename, "MAPS\\%S", gzFilename);
gfFileExists = FALSE;
#ifndef USE_VFS
gfReadOnly = FALSE;
if(FileExists(gszCurrFilename))
{
gfFileExists = TRUE;
if(GetFileFirst(gszCurrFilename, &FileInfo))
{
if(FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY))
gfReadOnly = TRUE;
GetFileClose(&FileInfo);
}
}
#else
gfReadOnly = TRUE;
vfs::CProfileStack* st = getVFS()->getProfileStack();
vfs::CProfileStack::Iterator it = st->begin();
Expand All @@ -502,7 +468,6 @@ UINT32 LoadSaveScreenHandle(void)
}
it.next();
}
#endif
if(gfReadOnly)
{
CreateMessageBox(L" File is read only! Choose a different name? ");
Expand Down Expand Up @@ -726,7 +691,6 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
iLastClickTime = iCurrClickTime;
iLastFileClicked = x;
//dnl ch81 021213
#ifdef USE_VFS
gzProfileName[0] = 0;
while(FListNode = FListNode->pPrev)
{
Expand All @@ -737,7 +701,6 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos )
break;
}
}
#endif
break;
}
FListNode = FListNode->pNext;
Expand Down Expand Up @@ -950,7 +913,6 @@ void HandleMainKeyEvents( InputAtom *pEvent )
SetInputFieldStringWith16BitString(0, L"");
wcscpy(gzFilename, L"");
}
#ifdef USE_VFS
gzProfileName[0] = 0;
while(curr = curr->pPrev)
{
Expand All @@ -961,7 +923,6 @@ void HandleMainKeyEvents( InputAtom *pEvent )
break;
}
}
#endif
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions Editor/LoadScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ extern CHAR16 gzErrorCatchString[ 256 ];

//dnl ch81 031213
extern CHAR16 gzFilename[FILENAME_BUFLEN];
#ifdef USE_VFS
extern CHAR8 gzProfileName[FILENAME_BUFLEN];
#endif

#endif
#endif
Loading