static void saveg_write_aimcamera_t(aimcamera_t* cam) { saveg_write_mobjindex(cam->viewmobj); saveg_write32(cam->activator ? cam->activator - players + 1 : 0); }
static void saveg_write_mobjfade_t(mobjfade_t* fade) { saveg_write_mobjindex(fade->mobj); saveg_write32(fade->amount); saveg_write32(fade->destAlpha); saveg_write32(fade->flagReserve); }
static void saveg_write_combine_t(combine_t* combine) { saveg_write32(combine->sector - sectors); }
static void saveg_write_delay_t(delay_t* delay) { saveg_write32(delay->tics); saveg_write32(delay->finishfunc ? 1 : 0); }
static void saveg_write_mobj_t(mobj_t *str) { // thinker_t thinker; saveg_write_thinker_t(&str->thinker); // fixed_t x; saveg_write32(str->x); // fixed_t y; saveg_write32(str->y); // fixed_t z; saveg_write32(str->z); // struct mobj_s* snext; saveg_writep(str->snext); // struct mobj_s* sprev; saveg_writep(str->sprev); // angle_t angle; saveg_write32(str->angle); // spritenum_t sprite; saveg_write_enum(str->sprite); // int frame; saveg_write32(str->frame); // struct mobj_s* bnext; saveg_writep(str->bnext); // struct mobj_s* bprev; saveg_writep(str->bprev); // struct subsector_s* subsector; saveg_writep(str->subsector); // fixed_t floorz; saveg_write32(str->floorz); // fixed_t ceilingz; saveg_write32(str->ceilingz); // fixed_t radius; saveg_write32(str->radius); // fixed_t height; saveg_write32(str->height); // fixed_t momx; saveg_write32(str->momx); // fixed_t momy; saveg_write32(str->momy); // fixed_t momz; saveg_write32(str->momz); // int validcount; saveg_write32(str->validcount); // mobjtype_t type; saveg_write_enum(str->type); // mobjinfo_t* info; saveg_writep(str->info); // int tics; saveg_write32(str->tics); // state_t* state; saveg_write32(str->state - states); // int flags; saveg_write32(str->flags); // int health; saveg_write32(str->health); // int movedir; saveg_write32(str->movedir); // int movecount; saveg_write32(str->movecount); // struct mobj_s* target; saveg_writep(str->target); // int reactiontime; saveg_write32(str->reactiontime); // int threshold; saveg_write32(str->threshold); // struct player_s* player; if (str->player) { saveg_write32(str->player - players + 1); } else { saveg_write32(0); } // int lastlook; saveg_write32(str->lastlook); // mapthing_t spawnpoint; saveg_write_mapthing_t(&str->spawnpoint); // struct mobj_s* tracer; saveg_writep(str->tracer); }
static void saveg_write_player_t(player_t *str) { int i; // mobj_t* mo; saveg_writep(str->mo); // playerstate_t playerstate; saveg_write_enum(str->playerstate); // ticcmd_t cmd; saveg_write_ticcmd_t(&str->cmd); // fixed_t viewz; saveg_write32(str->viewz); // fixed_t viewheight; saveg_write32(str->viewheight); // fixed_t deltaviewheight; saveg_write32(str->deltaviewheight); // fixed_t bob; saveg_write32(str->bob); // int health; saveg_write32(str->health); // int armorpoints; saveg_write16(str->armorpoints); // [STRIFE] 32 -> 16 // int armortype; saveg_write16(str->armortype); // [STRIFE] 32 -> 16 // int powers[NUMPOWERS]; for (i=0; i<NUMPOWERS; ++i) { saveg_write32(str->powers[i]); } // int sigiltype; saveg_write32(str->sigiltype); // [STRIFE] // int nukagecount; saveg_write32(str->nukagecount); // [STRIFE] // int questflags; saveg_write32(str->questflags); // [STRIFE] // int pitch; saveg_write32(str->pitch); // [STRIFE] // int centerview; saveg_write32(str->centerview); // [STRIFE] // inventory_t inventory[NUMINVENTORY]; for(i = 0; i < NUMINVENTORY; ++i) // [STRIFE] { saveg_write_inventory_t(&str->inventory[i]); } // int st_update; saveg_write32(str->st_update); // [STRIFE] // short numinventory; saveg_write16(str->numinventory); // [STRIFE] // short inventorycursor; saveg_write16(str->inventorycursor); // [STRIFE] // short accuracy; saveg_write16(str->accuracy); // [STRIFE] // short stamina; saveg_write16(str->stamina); // [STRIFE] // boolean cards[NUMCARDS]; for (i=0; i<NUMCARDS; ++i) { saveg_write32(str->cards[i]); } // boolean backpack; saveg_write32(str->backpack); // int attackdown; saveg_write32(str->attackdown); // int usedown; saveg_write32(str->usedown); // int inventorydown; saveg_write32(str->inventorydown); // [STRIFE] // int frags[MAXPLAYERS]; for (i=0; i<MAXPLAYERS; ++i) { saveg_write32(str->frags[i]); } // weapontype_t readyweapon; saveg_write_enum(str->readyweapon); // weapontype_t pendingweapon; saveg_write_enum(str->pendingweapon); // boolean weaponowned[NUMWEAPONS]; for (i=0; i<NUMWEAPONS; ++i) { saveg_write32(str->weaponowned[i]); } // int ammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { saveg_write32(str->ammo[i]); } // int maxammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { saveg_write32(str->maxammo[i]); } // int cheats; saveg_write32(str->cheats); // int refire; saveg_write32(str->refire); // short killcount; saveg_write16(str->killcount); // [STRIFE] 32 -> 16 // haleyjd 08/30/10 [STRIFE] No itemcount // int itemcount; //saveg_write32(str->itemcount); // haleyjd 08/30/10 [STRIFE] No secretcount // int secretcount; //saveg_write32(str->secretcount); // char* message; saveg_writep(str->message); // int damagecount; saveg_write32(str->damagecount); // int bonuscount; saveg_write32(str->bonuscount); // mobj_t* attacker; saveg_writep(str->attacker); // int extralight; saveg_write32(str->extralight); // int fixedcolormap; saveg_write32(str->fixedcolormap); // int colormap; [STRIFE] no such field //saveg_write32(str->colormap); // short allegiance; saveg_write16(str->allegiance); // [STRIFE] // pspdef_t psprites[NUMPSPRITES]; for (i=0; i<NUMPSPRITES; ++i) { saveg_write_pspdef_t(&str->psprites[i]); } // int mapstate[40]; for(i = 0; i < 40; ++i) // [STRIFE] { saveg_write32(str->mapstate[i]); } // haleyjd 08/30/10: [STRIFE] No intermission, no secret. // boolean didsecret; //saveg_write32(str->didsecret); }
static void saveg_write_ceiling_t(ceiling_t* ceiling) { saveg_write32(ceiling->type); saveg_write32(ceiling->sector - sectors); saveg_write32(ceiling->bottomheight); saveg_write32(ceiling->topheight); saveg_write32(ceiling->speed); saveg_write32(ceiling->crush); saveg_write32(ceiling->direction); saveg_write32(ceiling->tag); saveg_write32(ceiling->olddirection); saveg_write32(ceiling->instant); saveg_write32(ceiling->thinker.function.acp1 != NULL ? 1 : 0); }
static void saveg_write_laserthinker_t(laserthinker_t* laserthinker) { laser_t* l; saveg_write_mobjindex(laserthinker->dest); for(l = laserthinker->laser; l != NULL; l = l->next) { saveg_write32(l->x1); saveg_write32(l->y1); saveg_write32(l->z1); saveg_write32(l->x2); saveg_write32(l->y2); saveg_write32(l->z2); saveg_write32(l->slopex); saveg_write32(l->slopey); saveg_write32(l->slopez); saveg_write32(l->dist); saveg_write32(l->distmax); saveg_write_mobjindex(l->marker); saveg_write32(l->angle); saveg_write32(l->next ? 1 : 0); } }
static void saveg_write_mobj_t(mobj_t* mo) { saveg_write32(mo->x); saveg_write32(mo->y); saveg_write32(mo->z); saveg_write32(mo->tid); saveg_write_mobjindex(mo->snext); saveg_write_mobjindex(mo->sprev); saveg_write32(mo->angle); saveg_write32(mo->pitch); saveg_write32(mo->sprite); saveg_write32(mo->frame); saveg_write_mobjindex(mo->bnext); saveg_write_mobjindex(mo->bprev); saveg_write32(mo->subsector - subsectors); saveg_write32(mo->floorz); saveg_write32(mo->ceilingz); saveg_write32(mo->radius); saveg_write32(mo->height); saveg_write32(mo->momx); saveg_write32(mo->momy); saveg_write32(mo->momz); saveg_write32(mo->validcount); saveg_write32(mo->state - states); saveg_write32(mo->type); saveg_write32(mo->tics); saveg_write32(mo->flags); saveg_write32(mo->health); saveg_write32(mo->alpha); saveg_write32(mo->blockflag); saveg_write32(mo->movedir); saveg_write32(mo->movecount); saveg_write_mobjindex(mo->target); saveg_write32(mo->reactiontime); saveg_write32(mo->threshold); saveg_write32(mo->player ? mo->player - players + 1 : 0); saveg_write_mapthing_t(&mo->spawnpoint); saveg_write_mobjindex(mo->tracer); saveg_write32(mo->frame_x); saveg_write32(mo->frame_y); saveg_write32(mo->frame_z); saveg_write32(mo->mobjfunc == P_RespawnSpecials ? 1 : 0); }
static void saveg_write_player_t(player_t* p) { int i; saveg_write_mobjindex(p->mo); saveg_write32(p->playerstate); saveg_write_ticcmd_t(&p->cmd); saveg_write32(p->viewz); saveg_write32(p->viewheight); saveg_write32(p->deltaviewheight); saveg_write32(p->bob); saveg_write32(p->recoilpitch); saveg_write32(p->health); saveg_write32(p->armorpoints); saveg_write32(p->armortype); for(i = 0; i < NUMPOWERS; i++) { saveg_write32(p->powers[i]); } for(i = 0; i < NUMCARDS; i++) { saveg_write32(p->cards[i]); saveg_write32(p->tryopen[i]); } saveg_write32(p->artifacts); saveg_write32(p->backpack); for(i = 0; i < MAXPLAYERS; i++) { saveg_write32(p->frags[i]); } saveg_write32(p->readyweapon); saveg_write32(p->pendingweapon); for(i = 0; i < NUMWEAPONS; i++) { saveg_write32(p->weaponowned[i]); } for(i = 0; i < NUMAMMO; i++) { saveg_write32(p->ammo[i]); saveg_write32(p->maxammo[i]); } saveg_write32(p->attackdown); saveg_write32(p->usedown); saveg_write32(p->jumpdown); saveg_write32(p->cheats); saveg_write32(p->refire); saveg_write32(p->killcount); saveg_write32(p->itemcount); saveg_write32(p->secretcount); saveg_write32(p->damagecount); saveg_write32(p->bonuscount); saveg_write32(p->bfgcount); saveg_write_mobjindex(p->attacker); saveg_write_mobjindex(p->cameratarget); for(i = 0; i < NUMPSPRITES; i++) { saveg_write_pspdef_t(&p->psprites[i]); } saveg_write32(p->palette); saveg_write32(p->onground); saveg_write32(p->autoaim); }
// // P_ArchiveWorld // void P_ArchiveWorld(void) { int i; int j; sector_t *sec; line_t *li; side_t *si; light_t *light; // do sectors for(i = 0, sec = sectors; i < numsectors; i++, sec++) { saveg_write16(F2INT(sec->floorheight)); saveg_write16(F2INT(sec->ceilingheight)); saveg_write16(sec->floorpic); saveg_write16(sec->ceilingpic); saveg_write16(sec->special); saveg_write16(sec->tag); saveg_write16(sec->flags); saveg_write16(sec->lightlevel); saveg_write32(sec->xoffset); saveg_write32(sec->yoffset); saveg_write_mobjindex(sec->soundtarget); for(j = 0; j < 5; j++) { saveg_write16(sec->colors[j]); } } // do lines for(i = 0, li = lines; i < numlines; i++, li++) { saveg_write16((li->flags >> 16)); saveg_write16((li->flags & 0xFFFF)); saveg_write16(li->special); saveg_write16(li->tag); for(j = 0; j < 2; j++) { if(li->sidenum[j] == NO_SIDE_INDEX) { continue; } si = &sides[li->sidenum[j]]; saveg_write16(F2INT(si->textureoffset)); saveg_write16(F2INT(si->rowoffset)); saveg_write16(si->toptexture); saveg_write16(si->bottomtexture); saveg_write16(si->midtexture); } } // do lights for(i = 0, light = lights; i < numlights; i++, light++) { saveg_write8(light->base_r); saveg_write8(light->base_g); saveg_write8(light->base_b); saveg_write8(light->active_r); saveg_write8(light->active_g); saveg_write8(light->active_b); saveg_write8(light->r); saveg_write8(light->g); saveg_write8(light->b); saveg_write_pad(); saveg_write16(light->tag); } }
static void saveg_write_marker(int marker) { saveg_write_pad(); saveg_write32(marker); }
static void saveg_write_header(char *description) { int i; int size; char date[32]; byte* tbn; for(i = 0; description[i] != '\0'; i++) { saveg_write8(description[i]); } for(; i < SAVESTRINGSIZE; i++) { saveg_write8(0); } sprintf(date, "%s", saveg_gettime()); size = dstrlen(date); for(i = 0; i < size; i++) { saveg_write8(date[i]); } for(; i < 32; i++) { saveg_write8(0); } size = M_CacheThumbNail(&tbn); saveg_write32(size); for(i = 0; i < size; i++) { saveg_write8(tbn[i]); } Z_Free(tbn); for(i = 0; i < 16; i++) { saveg_write8(passwordData[i]); } saveg_write8(gameskill); saveg_write8(gamemap); saveg_write8(nextmap); saveg_write_pad(); saveg_write16(globalint); // // [kex] 12/26/11 - write total stat info // saveg_write_pad(); saveg_write32(totalkills); saveg_write32(totalitems); saveg_write32(totalsecret); for(i = 0; i < MAXPLAYERS; i++) { saveg_write8(playeringame[i]); } saveg_write8((leveltime >> 16) & 0xff); saveg_write8((leveltime >> 8) & 0xff); saveg_write8(leveltime & 0xff); saveg_write_pad(); }
static void saveg_write_mobjexp_t(mobjexp_t* exp) { saveg_write32(exp->delay); saveg_write32(exp->lifetime); saveg_write32(exp->delaymax); saveg_write_mobjindex(exp->mobj); }
static void saveg_write_plat_t(plat_t* plat) { saveg_write32(plat->sector - sectors); saveg_write32(plat->speed); saveg_write32(plat->low); saveg_write32(plat->high); saveg_write32(plat->wait); saveg_write32(plat->count); saveg_write32(plat->status); saveg_write32(plat->oldstatus); saveg_write32(plat->crush); saveg_write32(plat->tag); saveg_write32(plat->type); saveg_write32(plat->thinker.function.acp1 != NULL ? 1 : 0); }
static void saveg_write_quake_t(quake_t* quake) { saveg_write32(quake->tics); }
static void saveg_write_lightflash_t(lightflash_t* lf) { saveg_write32(lf->sector - sectors); saveg_write32(lf->count); saveg_write32(lf->special); }
static void saveg_writep(void *p) { saveg_write32((intptr_t) p); }
static void saveg_write_fireflicker_t(fireflicker_t* ff) { saveg_write32(ff->sector - sectors); saveg_write32(ff->count); saveg_write32(ff->special); }
static void saveg_write_player_t(player_t *str) { int i; // mobj_t* mo; saveg_writep(str->mo); // playerstate_t playerstate; saveg_write_enum(str->playerstate); // ticcmd_t cmd; saveg_write_ticcmd_t(&str->cmd); // fixed_t viewz; saveg_write32(str->viewz); // fixed_t viewheight; saveg_write32(str->viewheight); // fixed_t deltaviewheight; saveg_write32(str->deltaviewheight); // fixed_t bob; saveg_write32(str->bob); // int health; saveg_write32(str->health); // int armorpoints; saveg_write32(str->armorpoints); // int armortype; saveg_write32(str->armortype); // int powers[NUMPOWERS]; for (i=0; i<NUMPOWERS; ++i) { saveg_write32(str->powers[i]); } // boolean cards[NUMCARDS]; for (i=0; i<NUMCARDS; ++i) { saveg_write32(str->cards[i]); } // boolean backpack; saveg_write32(str->backpack); // int frags[MAXPLAYERS]; for (i=0; i<MAXPLAYERS; ++i) { saveg_write32(str->frags[i]); } // weapontype_t readyweapon; saveg_write_enum(str->readyweapon); // weapontype_t pendingweapon; saveg_write_enum(str->pendingweapon); // boolean weaponowned[NUMWEAPONS]; for (i=0; i<NUMWEAPONS; ++i) { saveg_write32(str->weaponowned[i]); } // int ammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { saveg_write32(str->ammo[i]); } // int maxammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { saveg_write32(str->maxammo[i]); } // int attackdown; saveg_write32(str->attackdown); // int usedown; saveg_write32(str->usedown); // int cheats; saveg_write32(str->cheats); // int refire; saveg_write32(str->refire); // int killcount; saveg_write32(str->killcount); // int itemcount; saveg_write32(str->itemcount); // int secretcount; saveg_write32(str->secretcount); // char* message; saveg_writep(str->message); // int damagecount; saveg_write32(str->damagecount); // int bonuscount; saveg_write32(str->bonuscount); // mobj_t* attacker; saveg_writep(str->attacker); // int extralight; saveg_write32(str->extralight); // int fixedcolormap; saveg_write32(str->fixedcolormap); // int colormap; saveg_write32(str->colormap); // pspdef_t psprites[NUMPSPRITES]; for (i=0; i<NUMPSPRITES; ++i) { saveg_write_pspdef_t(&str->psprites[i]); } // boolean didsecret; saveg_write32(str->didsecret); }
static void saveg_write_inventory_t(inventory_t *str) { saveg_write32(str->sprite); saveg_write32(str->type); saveg_write32(str->amount); }