view SaveLoad.cpp @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children 540178ef9b18
line wrap: on
line source

#include <io.h>
#include <direct.h>

#include "SaveLoad.h"

#include "mm7_data.h"





unsigned int uNumSavegameFiles;
unsigned int pSavegameUsedSlots[45];
struct SavegameList *pSavegameList;
struct RGBTexture *pSavegameThumbnails;



//----- (0045E297) --------------------------------------------------------
void SavegameList::Initialize(unsigned int a1)
{
  signed int v1; // edi@4
  unsigned int v2; // eax@6
  unsigned int v3; // [sp+10h] [bp-4h]@1

  v3 = a1;
  memset(&pSavegameList, 0, 0x3138u);
  _chdir("saves");
  uNumSavegameFiles = 0;
  if ( !v3 && _access(pGlobalTXT_LocalizationStrings[613], 0) != -1 )
    strcpy(pSavegameList->pSavesNames[uNumSavegameFiles++], pGlobalTXT_LocalizationStrings[613]);
  v1 = 0;
  do
  {
    sprintfex(pTmpBuf, "save%03d.mm7", v1);
    if ( _access(pTmpBuf, 0) != -1 )
    {
      v2 = v1;
      if ( !v3 )
        v2 = uNumSavegameFiles;
      strcpy(pSavegameList->pSavesNames[v2], pTmpBuf);
      ++uNumSavegameFiles;
    }
    ++v1;
  }
  while ( v1 < 40 );
  _chdir("..");
}