From: Laszlo T. <ave...@us...> - 2005-12-04 21:09:42
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GAMImporter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12632/plugins/GAMImporter Modified Files: GAMImp.cpp Log Message: added code to handle formations better continued implementation of ActionsWindow Index: GAMImp.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GAMImporter/GAMImp.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** GAMImp.cpp 24 Nov 2005 17:44:09 -0000 1.65 --- GAMImp.cpp 4 Dec 2005 21:09:32 -0000 1.66 *************** *** 111,114 **** --- 111,119 ---- str->ReadWord( &newGame->Formations[i] ); } + //hack for PST + if (version==GAM_VER_PST) { + newGame->Formations[0] = newGame->WhichFormation; + newGame->WhichFormation = 0; + } str->ReadDword( &newGame->PartyGold ); str->ReadDword( &newGame->WeatherBits ); *************** *** 529,538 **** { int i; ! char Signature[8]; ieDword tmpDword = 0; memcpy( Signature, "GAMEV0.0", 8); Signature[5]+=game->version/10; ! if (game->version==12) { //pst version Signature[7]+=1; } --- 534,543 ---- { int i; ! char Signature[10]; ieDword tmpDword = 0; memcpy( Signature, "GAMEV0.0", 8); Signature[5]+=game->version/10; ! if (game->version==GAM_VER_PST) { //pst version Signature[7]+=1; } *************** *** 544,550 **** memset(Signature, 0, sizeof(Signature)); stream->WriteDword( &game->GameTime ); ! stream->WriteWord( &game->WhichFormation ); ! for(i=0;i<5;i++) { ! stream->WriteWord( &game->Formations[i]); } stream->WriteDword( &game->PartyGold ); --- 549,561 ---- memset(Signature, 0, sizeof(Signature)); stream->WriteDword( &game->GameTime ); ! //pst has a single preset of formations ! if (game->version==GAM_VER_PST) { ! stream->WriteWord( &game->Formations[0]); ! stream->Write( Signature, 10); ! } else { ! stream->WriteWord( &game->WhichFormation ); ! for(i=0;i<5;i++) { ! stream->WriteWord( &game->Formations[i]); ! } } stream->WriteDword( &game->PartyGold ); |