X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameInitDispose.cpp;h=ea0d7366be409a3f4631fce30776b438c60a394f;hb=5e808c58a6397c2cb1ae08293d2ba1fc91b15a0a;hp=47ceb900ff29b8add71b672243465a4a60723e62;hpb=5dc3c16842b5ad0c4fe72fafe0eed61f12fbf93a;p=lugaru.git diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 47ceb90..ea0d736 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -78,16 +78,6 @@ extern float slomospeed; extern char mapname[256]; extern bool gamestarted; -extern int numaccounts; -extern int accountactive; -extern int accountdifficulty[10]; -extern int accountprogress[10]; -extern float accountpoints[10]; -extern float accounthighscore[10][50]; -extern float accountfasttime[10][50]; -extern bool accountunlocked[10][60]; -extern char accountname[10][256]; - extern int numdialogues; extern int numdialogueboxes[20]; extern int dialoguetype[20]; @@ -131,59 +121,11 @@ void Game::Dispose() LOGFUNC; if(endgame==2){ - accountcampaignchoicesmade[accountactive]=0; - accountcampaignscore[accountactive]=0; - accountcampaigntime[accountactive]=0; + accountactive->endGame(); endgame=0; } - - sprintf (mapname, ":Data:Users"); - - FILE *tfile; - tfile=fopen( ConvertFileName(mapname), "wb" ); - if (tfile) - { - fpackf(tfile, "Bi", numaccounts); - fpackf(tfile, "Bi", accountactive); - if(numaccounts>0) - { - for(i=0;i0) - { - for(j=0;j<(int)strlen(accountname[i]);j++) - { - fpackf(tfile, "Bb", accountname[i][j]); - } - } - } - } - - fclose(tfile); - } + Account::saveFile(":Data:Users", accountactive); TexIter it = textures.begin(); for (; it != textures.end(); ++it) @@ -996,73 +938,7 @@ void Game::InitGame() numchallengelevels=14; - /*char tempstring[256]; - sprintf (tempstring, "%s", registrationname); - long num1; - long num2; - long num3; - long num4; - long long longnum; - longnum = MD5_string ( tempstring); - //longnum = 1111111111111111; - num1 = longnum/100000000; - num2 = longnum%100000000; - sprintf (tempstring, "%d-%d-%d-%d", num1/10000, num1%10000, num2/10000, num2%10000); - */ - - FILE *tfile; - - accountactive=-1; - - sprintf (mapname, ":Data:Users"); - tfile=fopen( ConvertFileName(mapname), "rb" ); - if(tfile) - { - funpackf(tfile, "Bi", &numaccounts); - funpackf(tfile, "Bi", &accountactive); - if(numaccounts>0) - { - for(i=0;i= 10) - { - accountcampaignchoices[i][j] = 0; - } - } - funpackf(tfile, "Bf", &accountpoints[i]); - for(j=0;j<50;j++) - { - funpackf(tfile, "Bf", &accounthighscore[i][j]); - funpackf(tfile, "Bf", &accountfasttime[i][j]); - } - for(j=0;j<60;j++) - { - funpackf(tfile, "Bb", &accountunlocked[i][j]); - } - int temp; - funpackf(tfile, "Bi", &temp); - if(temp>0) - { - for(j=0;j