Mercurial > might-and-magic-trilogy
view SaveLoad.cpp @ 23:509744251c8e
Player-related members
author | Nomad |
---|---|
date | Sun, 14 Oct 2012 00:27:38 +0200 |
parents | 540178ef9b18 |
children | 93bf1d5f6a6d |
line wrap: on
line source
#include <io.h> #include <direct.h> #include "SaveLoad.h" #include "mm7_data.h" struct SavegameList *pSavegameList = new SavegameList; unsigned int uNumSavegameFiles; unsigned int pSavegameUsedSlots[45]; struct RGBTexture *pSavegameThumbnails = new RGBTexture[45]; SavegameHeader *pSavegameHeader = new SavegameHeader[45]; //----- (0045E297) -------------------------------------------------------- void SavegameList::Initialize(unsigned int bHideEmptySlots) { uNumSavegameFiles = 0; _chdir("saves"); { if (!bHideEmptySlots && _access(pGlobalTXT_LocalizationStrings[613], 0) != -1 ) strcpy(pSavesNames[uNumSavegameFiles++], pGlobalTXT_LocalizationStrings[613]); for (uint i = 0; i < 40; ++i) { sprintf(pTmpBuf, "save%03d.mm7", i); if (_access(pTmpBuf, 0) == -1) continue; uint idx = i; if (!bHideEmptySlots) idx = uNumSavegameFiles; strcpy(pSavesNames[idx], pTmpBuf); ++uNumSavegameFiles; } } _chdir(".."); }