void cScenarioAmiga::iniLoad( string pFile, bool pLocalFile ) { size_t size = 0, count = 0; bool done = false; byte *fileBuffer = g_DuneEngine->resourcesGet()->fileRead( pFile, size, false ); byte *buffer = fileBuffer; count = size; while(!done) { byte sectionID = *buffer++; byte keyID = *buffer++; switch(sectionID) { case 0: // [BASIC] load_Basic( keyID, &buffer ); break; case 1: load_Map( keyID, &buffer ); break; case 2: case 3: case 4: case 5: load_House( sectionID, keyID, &buffer ); break; case 6: { sChoam choam; choam.mCount = get_word( &buffer ); choam.mUnitType = g_DuneEngine->resourcesGet()->unitGet( keyID )->Name; mChoam.push_back( choam ); break; } case 7: load_Teams( keyID, &buffer ); break; case 8: load_Units( keyID, &buffer ); break; case 9: load_Structures( keyID, &buffer ); break; case 10: load_Reinforcements( keyID, &buffer ); break; case 0xFF: done = true; break; } } delete fileBuffer; }
void test_maps_load () { int x, y; int map_layout[MAX_X][MAX_Y] = {{0}}; // just for testing load_Map (map_layout); }