static void saveg_read_floormove_t(floormove_t *str) { int sector; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // floor_e type; str->type = saveg_read_enum(); // boolean crush; str->crush = saveg_read32(); // sector_t* sector; sector = saveg_read32(); str->sector = §ors[sector]; // int direction; str->direction = saveg_read32(); // int newspecial; str->newspecial = saveg_read32(); // short texture; str->texture = saveg_read16(); // fixed_t floordestheight; str->floordestheight = saveg_read32(); // fixed_t speed; str->speed = saveg_read32(); }
static void saveg_read_mapthing_t(mapthing_t *str) { // short x; str->x = saveg_read16(); // short y; str->y = saveg_read16(); // short angle; str->angle = saveg_read16(); // short type; str->type = saveg_read16(); // short options; str->options = saveg_read16(); }
// // ticcmd_t // static void saveg_read_ticcmd_t(ticcmd_t *str) { str->forwardmove = saveg_read8(); str->sidemove = saveg_read8(); str->angleturn = saveg_read16(); str->buttons = saveg_read8(); str->lookdir = saveg_read32(); }
static void saveg_read_header(void) { int i; int size; byte a, b, c; // skip the description field for(i = 0; i < SAVESTRINGSIZE; i++) { saveg_read8(); } // skip the date for(i = 0; i < 32; i++) { saveg_read8(); } size = saveg_read32() / sizeof(int); // skip the thumbnail for(i = 0; i < size; i++) { saveg_read32(); } for(i = 0; i < 16; i++) { passwordData[i] = saveg_read8(); } gameskill = saveg_read8(); gamemap = saveg_read8(); nextmap = saveg_read8(); saveg_read_pad(); globalint = saveg_read16(); // // [kex] 12/26/11 - read total stat info // saveg_read_pad(); totalkills = saveg_read32(); totalitems = saveg_read32(); totalsecret = saveg_read32(); for(i = 0; i < MAXPLAYERS; i++) { playeringame[i] = saveg_read8(); } // get the times a = saveg_read8(); b = saveg_read8(); c = saveg_read8(); leveltime = (a<<16) + (b<<8) + c; saveg_read_pad(); }
// // P_UnArchiveWorld // void P_UnArchiveWorld (void) { int i; int j; sector_t* sec; line_t* li; side_t* si; // do sectors for (i=0, sec = sectors ; i<numsectors ; i++,sec++) { sec->floorheight = saveg_read16() << FRACBITS; sec->ceilingheight = saveg_read16() << FRACBITS; sec->floorpic = saveg_read16(); //sec->ceilingpic = saveg_read16(); [STRIFE] not saved sec->lightlevel = saveg_read16(); sec->special = saveg_read16(); // needed? //sec->tag = saveg_read16(); // needed? [STRIFE] not saved sec->specialdata = 0; sec->soundtarget = 0; } // do lines for (i=0, li = lines ; i<numlines ; i++,li++) { li->flags = saveg_read16(); li->special = saveg_read16(); //li->tag = saveg_read16(); [STRIFE] not saved for (j=0 ; j<2 ; j++) { if (li->sidenum[j] == -1) continue; si = &sides[li->sidenum[j]]; // [STRIFE] offsets not saved. //si->textureoffset = saveg_read16() << FRACBITS; //si->rowoffset = saveg_read16() << FRACBITS; si->toptexture = saveg_read16(); si->bottomtexture = saveg_read16(); si->midtexture = saveg_read16(); } } }
static void saveg_read_ticcmd_t(ticcmd_t *str) { // signed char forwardmove; str->forwardmove = saveg_read8(); // signed char sidemove; str->sidemove = saveg_read8(); // short angleturn; str->angleturn = saveg_read16(); // short consistancy; str->consistancy = saveg_read16(); // byte chatchar; str->chatchar = saveg_read8(); // byte buttons; str->buttons = saveg_read8(); }
// // floormove_t // static void saveg_read_floormove_t(floormove_t *str) { str->type = (floor_e)saveg_read_enum(); str->crush = saveg_read_bool(); str->sector = sectors + saveg_read32(); str->direction = saveg_read32(); str->newspecial = saveg_read32(); str->texture = saveg_read16(); str->floordestheight = saveg_read32(); str->speed = saveg_read32(); str->stopsound = saveg_read32(); }
static void saveg_read_mapthing_t(mapthing_t* mt) { mt->x = saveg_read16(); mt->y = saveg_read16(); mt->z = saveg_read16(); mt->angle = saveg_read16(); mt->type = saveg_read16(); mt->options = saveg_read16(); mt->tid = saveg_read16(); saveg_read_pad(); }
static void saveg_read_floormove_t(floormove_t* floor) { floor->type = saveg_read32(); floor->crush = saveg_read32(); floor->sector = §ors[saveg_read32()]; floor->direction = saveg_read32(); floor->newspecial = saveg_read32(); floor->texture = saveg_read16(); floor->floordestheight = saveg_read32(); floor->speed = saveg_read32(); floor->instant = saveg_read32(); floor->sector->specialdata = floor; }
// // mobj_t // static void saveg_read_mobj_t(mobj_t *str) { str->x = saveg_read32(); str->y = saveg_read32(); str->z = saveg_read32(); str->angle = saveg_read32(); str->sprite = (spritenum_t)saveg_read_enum(); str->frame = saveg_read32(); str->floorz = saveg_read32(); str->ceilingz = saveg_read32(); str->dropoffz = saveg_read32(); str->radius = saveg_read32(); str->height = saveg_read32(); str->momx = saveg_read32(); str->momy = saveg_read32(); str->momz = saveg_read32(); str->type = (mobjtype_t)saveg_read_enum(); str->tics = saveg_read32(); str->state = &states[saveg_read32()]; str->flags = saveg_read32(); str->flags2 = saveg_read32(); str->health = saveg_read32(); str->movedir = saveg_read32(); str->movecount = saveg_read32(); targets[thingindex] = saveg_read32(); str->reactiontime = saveg_read32(); str->threshold = saveg_read32(); if (saveg_read_bool()) { str->player = viewplayer; str->player->mo = str; } saveg_read_mapthing_t(&str->spawnpoint); tracers[thingindex] = saveg_read32(); lastenemies[thingindex] = saveg_read32(); str->floatbob = saveg_read32(); str->shadowoffset = saveg_read32(); str->gear = saveg_read16(); str->bloodsplats = saveg_read32(); str->blood = saveg_read32(); str->interpolate = saveg_read32(); str->oldx = saveg_read32(); str->oldy = saveg_read32(); str->oldz = saveg_read32(); str->oldangle = saveg_read32(); str->nudge = saveg_read32(); str->pitch = saveg_read32(); str->id = saveg_read32(); }
// // ceiling_t // static void saveg_read_ceiling_t(ceiling_t *str) { str->type = (ceiling_e)saveg_read_enum(); str->sector = sectors + saveg_read32(); str->bottomheight = saveg_read32(); str->topheight = saveg_read32(); str->speed = saveg_read32(); str->oldspeed = saveg_read32(); str->crush = saveg_read_bool(); str->newspecial = saveg_read32(); str->texture = saveg_read16(); str->direction = saveg_read32(); str->tag = saveg_read32(); str->olddirection = saveg_read32(); }
// // P_UnArchiveWorld // void P_UnArchiveWorld(void) { sector_t *sec = sectors; line_t *li = lines; // do sectors for (int i = 0; i < numsectors; i++, sec++) { sec->floorheight = saveg_read16() << FRACBITS; sec->ceilingheight = saveg_read16() << FRACBITS; sec->floorpic = saveg_read16(); sec->ceilingpic = saveg_read16(); sec->lightlevel = saveg_read16(); sec->special = saveg_read16(); sec->tag = saveg_read16(); sec->ceilingdata = NULL; sec->floordata = NULL; sec->lightingdata = NULL; soundtargets[MIN(i, TARGETLIMIT - 1)] = saveg_read32(); } // do lines for (int i = 0; i < numlines; i++, li++) { li->flags = saveg_read16(); li->special = saveg_read16(); li->tag = saveg_read16(); for (int j = 0; j < 2; j++) { side_t *si; if (li->sidenum[j] == NO_INDEX) continue; si = sides + li->sidenum[j]; si->textureoffset = saveg_read16() << FRACBITS; si->rowoffset = saveg_read16() << FRACBITS; si->toptexture = saveg_read16(); si->bottomtexture = saveg_read16(); si->midtexture = saveg_read16(); si->missingtoptexture = saveg_read_bool(); si->missingbottomtexture = saveg_read_bool(); si->missingmidtexture = saveg_read_bool(); } } }
// // P_UnArchiveWorld // void P_UnArchiveWorld(void) { int i; int j; sector_t *sec; line_t *li; light_t *light; side_t *si; // do sectors for(i = 0, sec = sectors; i < numsectors; i++, sec++) { sec->floorheight = INT2F(saveg_read16()); sec->ceilingheight = INT2F(saveg_read16()); sec->floorpic = saveg_read16(); sec->ceilingpic = saveg_read16(); sec->special = saveg_read16(); sec->tag = saveg_read16(); sec->flags = saveg_read16(); sec->lightlevel = saveg_read16(); sec->xoffset = saveg_read32(); sec->yoffset = saveg_read32(); saveg_set_mobjtarget(&sec->soundtarget, saveg_read_mobjindex()); for(j = 0; j < 5; j++) { sec->colors[j] = saveg_read16(); } sec->specialdata = 0; } // do lines for(i = 0, li = lines; i < numlines; i++, li++) { li->flags = (saveg_read16() << 16); li->flags = li->flags | (saveg_read16() & 0xFFFF); li->special = saveg_read16(); li->tag = saveg_read16(); for(j = 0; j < 2; j++) { if(li->sidenum[j] == NO_SIDE_INDEX) { continue; } si = &sides[li->sidenum[j]]; si->textureoffset = INT2F(saveg_read16()); si->rowoffset = INT2F(saveg_read16()); si->toptexture = saveg_read16(); si->bottomtexture = saveg_read16(); si->midtexture = saveg_read16(); } } // do lights for(i = 0, light = lights; i < numlights; i++, light++) { light->base_r = saveg_read8(); light->base_g = saveg_read8(); light->base_b = saveg_read8(); light->active_r = saveg_read8(); light->active_g = saveg_read8(); light->active_b = saveg_read8(); light->r = saveg_read8(); light->g = saveg_read8(); light->b = saveg_read8(); saveg_read_pad(); light->tag = saveg_read16(); } }
static void saveg_read_player_t(player_t *str) { int i; // mobj_t* mo; str->mo = saveg_readp(); // playerstate_t playerstate; str->playerstate = saveg_read_enum(); // ticcmd_t cmd; saveg_read_ticcmd_t(&str->cmd); // fixed_t viewz; str->viewz = saveg_read32(); // fixed_t viewheight; str->viewheight = saveg_read32(); // fixed_t deltaviewheight; str->deltaviewheight = saveg_read32(); // fixed_t bob; str->bob = saveg_read32(); // int health; str->health = saveg_read32(); // int armorpoints; str->armorpoints = saveg_read16(); // [STRIFE] 32 -> 16 // int armortype; str->armortype = saveg_read16(); // [STRIFE] 32 -> 16 // int powers[NUMPOWERS]; for (i=0; i<NUMPOWERS; ++i) { str->powers[i] = saveg_read32(); } // int sigiltype; str->sigiltype = saveg_read32(); // [STRIFE] // int nukagecount; str->nukagecount = saveg_read32(); // [STRIFE] // int questflags; str->questflags = saveg_read32(); // [STRIFE] // int pitch; str->pitch = saveg_read32(); // [STRIFE] // int centerview; str->centerview = saveg_read32(); // [STRIFE] // inventory_t inventory[NUMINVENTORY]; for(i = 0; i < NUMINVENTORY; i++) { saveg_read_inventory_t(&(str->inventory[i])); // [STRIFE] } // int st_update; str->st_update = saveg_read32(); // [STRIFE] // short numinventory; str->numinventory = saveg_read16(); // [STRIFE] // short inventorycursor; str->inventorycursor = saveg_read16(); // [STRIFE] // short accuracy; str->accuracy = saveg_read16(); // [STRIFE] // short stamina; str->stamina = saveg_read16(); // [STRIFE] // boolean cards[NUMCARDS]; for (i=0; i<NUMCARDS; ++i) { str->cards[i] = saveg_read32(); } // boolean backpack; str->backpack = saveg_read32(); // int attackdown; str->attackdown = saveg_read32(); // int usedown; str->usedown = saveg_read32(); // int inventorydown; str->inventorydown = saveg_read32(); // [STRIFE] // int frags[MAXPLAYERS]; for (i=0; i<MAXPLAYERS; ++i) { str->frags[i] = saveg_read32(); } // weapontype_t readyweapon; str->readyweapon = saveg_read_enum(); // weapontype_t pendingweapon; str->pendingweapon = saveg_read_enum(); // boolean weaponowned[NUMWEAPONS]; for (i=0; i<NUMWEAPONS; ++i) { str->weaponowned[i] = saveg_read32(); } // int ammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { str->ammo[i] = saveg_read32(); } // int maxammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { str->maxammo[i] = saveg_read32(); } // int cheats; str->cheats = saveg_read32(); // int refire; str->refire = saveg_read32(); // short killcount; str->killcount = saveg_read16(); // [STRIFE] 32 -> 16 // haleyjd 08/30/10 [STRIFE] No itemcount. // int itemcount; //str->itemcount = saveg_read32(); // haleyjd 08/30/10 [STRIFE] No secretcount. // int secretcount; //str->secretcount = saveg_read32(); // char* message; str->message = saveg_readp(); // int damagecount; str->damagecount = saveg_read32(); // int bonuscount; str->bonuscount = saveg_read32(); // mobj_t* attacker; str->attacker = saveg_readp(); // int extralight; str->extralight = saveg_read32(); // int fixedcolormap; str->fixedcolormap = saveg_read32(); // int colormap; - [STRIFE] no such field //str->colormap = saveg_read32(); // short allegiance; str->allegiance = saveg_read16(); // [STRIFE] // pspdef_t psprites[NUMPSPRITES]; for (i=0; i<NUMPSPRITES; ++i) { saveg_read_pspdef_t(&str->psprites[i]); } // int mapstate[40]; for(i = 0; i < 40; ++i) // [STRIFE] { str->mapstate[i] = saveg_read32(); } // haleyjd 08/30/10: [STRIFE] No intermission, no didsecret. // boolean didsecret; //str->didsecret = saveg_read32(); }