view SaveLoad.cpp @ 1:ac0fb48cd27a

Texture, hwl loading, video player
author Nomad
date Tue, 09 Oct 2012 13:09:08 +0200
parents 8b8875f5b359
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("..");
}