MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SGSXlateTables

Function SGSXlateTables

Descent3/gamesave.cpp:844–885  ·  view source on GitHub ↗

writes out translation tables.

Source from the content-addressed store, hash-verified

842
843// writes out translation tables.
844void SGSXlateTables(CFILE *fp) {
845 START_VERIFY_SAVEFILE(fp);
846 // create object info translation table
847 int16_t i, highest_index = -1;
848
849 for (i = 0; i < MAX_OBJECT_IDS; i++)
850 if (Object_info[i].type != OBJ_NONE)
851 highest_index = i;
852
853 gs_WriteShort(fp, highest_index + 1);
854
855 for (i = 0; i <= highest_index; i++)
856 cf_WriteString(fp, (Object_info[i].type != OBJ_NONE) ? Object_info[i].name : "");
857
858 // write out polymodel list.
859 SAVE_DATA_TABLE(MAX_POLY_MODELS, Poly_models);
860
861 // save out door list
862 SAVE_DATA_TABLE(MAX_DOORS, Doors);
863
864 // save out ship list
865 SAVE_DATA_TABLE(MAX_SHIPS, Ships);
866
867 // save out weapons list
868 SAVE_DATA_TABLE(MAX_WEAPONS, Weapons);
869
870 // save out textures list
871 SAVE_DATA_TABLE(MAX_TEXTURES, GameTextures);
872
873 // write out bitmap handle list. look at all Objects that are fireballs and
874 // save their handles-names.
875 for (i = 0; i <= Highest_object_index; i++)
876 if (Objects[i].type == OBJ_FIREBALL) {
877 if (Objects[i].ctype.blast_info.bm_handle > -1) {
878 gs_WriteShort(fp, Objects[i].ctype.blast_info.bm_handle);
879 cf_WriteString(fp, GameBitmaps[Objects[i].ctype.blast_info.bm_handle].name);
880 }
881 }
882 gs_WriteShort(fp, -1); // terminate bitmap list
883 cf_WriteString(fp, "");
884 END_VERIFY_SAVEFILE(fp, "Xlate save");
885}
886
887extern uint8_t AutomapVisMap[MAX_ROOMS];
888// initializes rooms

Callers 2

SaveGameStateFunction · 0.85
DemoWriteHeaderFunction · 0.85

Calls 1

cf_WriteStringFunction · 0.85

Tested by

no test coverage detected