static void saveg_read_inventory_t(inventory_t *str) { // int type; str->type = SV_ReadLong(); // int count; str->count = SV_ReadLong(); }
static void saveg_read_ceiling_t(ceiling_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // ceiling_e type; str->type = SV_ReadLong(); // sector_t *sector; i = SV_ReadLong(); str->sector = §ors[i]; // fixed_t bottomheight, topheight; str->bottomheight = SV_ReadLong(); str->topheight = SV_ReadLong(); // fixed_t speed; str->speed = SV_ReadLong(); // boolean crush; str->crush = SV_ReadLong(); // int direction; str->direction = SV_ReadLong(); // int tag; str->tag = SV_ReadLong(); // int olddirection; str->olddirection = SV_ReadLong(); }
static void saveg_read_thinker_t(thinker_t *str) { // struct thinker_s *prev, *next; SV_ReadLong(); str->prev = NULL; SV_ReadLong(); str->next = NULL; // think_t function; SV_ReadLong(); str->function = NULL; }
static void saveg_read_pspdef_t(pspdef_t *str) { // state_t *state; saveg_read_state_ptr(&str->state); // int tics; str->tics = SV_ReadLong(); // fixed_t sx, sy; str->sx = SV_ReadLong(); str->sy = SV_ReadLong(); }
static void saveg_read_state_ptr(state_t **state) { int statenum; statenum = SV_ReadLong(); // We have read a state number, but it is indexed according to the state // table in Vanilla Heretic v1.3. To support v1.0 HHE patches we have // three extra states, so map the state number to our internal state // number. if (statenum >= S_PHOENIXFXIX_1) { statenum = (statenum - S_PHOENIXFXIX_1) + S_PHOENIXPUFF1; } if (statenum == 0) { *state = NULL; } else { *state = &states[statenum]; } }
static void saveg_read_floormove_t(floormove_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // floor_e type; str->type = SV_ReadLong(); // boolean crush; str->crush = SV_ReadLong(); // sector_t *sector; i = SV_ReadLong(); str->sector = §ors[i]; // int direction; str->direction = SV_ReadLong(); // int newspecial; str->newspecial = SV_ReadLong(); // short texture; str->texture = SV_ReadWord(); // fixed_t floordestheight; str->floordestheight = SV_ReadLong(); // fixed_t speed; str->speed = SV_ReadLong(); }
static void saveg_read_vldoor_t(vldoor_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // vldoor_e type; str->type = SV_ReadLong(); // sector_t *sector; i = SV_ReadLong(); str->sector = §ors[i]; // fixed_t topheight; str->topheight = SV_ReadLong(); // fixed_t speed; str->speed = SV_ReadLong(); // int direction; str->direction = SV_ReadLong(); // int topwait; str->topwait = SV_ReadLong(); // int topcountdown; str->topcountdown = SV_ReadLong(); }
static void saveg_read_specialval_t(specialval_t *str) { // This can also be a mobj_t ptr, but we just assume it's // an int. This is probably a really bad assumption that's // likely to end in tears. // int i; str->i = SV_ReadLong(); }
static void saveg_read_glow_t(glow_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // sector_t *sector; i = SV_ReadLong(); str->sector = §ors[i]; // int minlight; str->minlight = SV_ReadLong(); // int maxlight; str->maxlight = SV_ReadLong(); // int direction; str->direction = SV_ReadLong(); }
static void saveg_read_strobe_t(strobe_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // sector_t *sector; i = SV_ReadLong(); str->sector = §ors[i]; // int count; str->count = SV_ReadLong(); // int minlight; str->minlight = SV_ReadLong(); // int maxlight; str->maxlight = SV_ReadLong(); // int darktime; str->darktime = SV_ReadLong(); // int brighttime; str->brighttime = SV_ReadLong(); }
static void saveg_read_lightflash_t(lightflash_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // sector_t *sector; i = SV_ReadLong(); str->sector = §ors[i]; // int count; str->count = SV_ReadLong(); // int maxlight; str->maxlight = SV_ReadLong(); // int minlight; str->minlight = SV_ReadLong(); // int maxtime; str->maxtime = SV_ReadLong(); // int mintime; str->mintime = SV_ReadLong(); }
static void saveg_read_mobj_t(mobj_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // fixed_t x, y, z; str->x = SV_ReadLong(); str->y = SV_ReadLong(); str->z = SV_ReadLong(); // struct mobj_s *snext, *sprev; SV_ReadLong(); str->snext = NULL; SV_ReadLong(); str->sprev = NULL; // angle_t angle; str->angle = SV_ReadLong(); // spritenum_t sprite; str->sprite = SV_ReadLong(); // int frame; str->frame = SV_ReadLong(); // struct mobj_s *bnext, *bprev; SV_ReadLong(); str->bnext = NULL; SV_ReadLong(); str->bprev = NULL; // struct subsector_s *subsector; SV_ReadLong(); str->subsector = NULL; // fixed_t floorz, ceilingz; str->floorz = SV_ReadLong(); str->ceilingz = SV_ReadLong(); // fixed_t radius, height; str->radius = SV_ReadLong(); str->height = SV_ReadLong(); // fixed_t momx, momy, momz; str->momx = SV_ReadLong(); str->momy = SV_ReadLong(); str->momz = SV_ReadLong(); // int validcount; str->validcount = SV_ReadLong(); // mobjtype_t type; str->type = SV_ReadLong(); // An extra thing type was added for v1.0 HHE compatibility. // Map from the v1.3 thing type index to the internal one. if (str->type >= MT_PHOENIXFX_REMOVED) { ++str->type; } // mobjinfo_t *info; SV_ReadLong(); str->info = NULL; // int tics; str->tics = SV_ReadLong(); // state_t *state; saveg_read_state_ptr(&str->state); // int damage; str->damage = SV_ReadLong(); // int flags; str->flags = SV_ReadLong(); // int flags2; str->flags2 = SV_ReadLong(); // specialval_t special1; saveg_read_specialval_t(&str->special1); // specialval_t special2; saveg_read_specialval_t(&str->special2); // Now we have a bunch of hacks to try to NULL out special values // where special[12] contained a mobj_t pointer that isn't valid // any more. This isn't in Vanilla but at least it stops the game // from crashing. switch (str->type) { // Gas pods use special2.m to point to the pod generator // that made it. case MT_POD: str->special2.m = NULL; break; // Several thing types use special1.m to mean 'target': case MT_MACEFX4: // A_DeathBallImpact case MT_WHIRLWIND: // A_WhirlwindSeek case MT_MUMMYFX1: // A_MummyFX1Seek case MT_HORNRODFX2: // A_SkullRodPL2Seek case MT_PHOENIXFX1: // A_PhoenixPuff str->special1.m = NULL; break; default: break; } // int health; str->health = SV_ReadLong(); // int movedir; str->movedir = SV_ReadLong(); // int movecount; str->movecount = SV_ReadLong(); // struct mobj_s *target; SV_ReadLong(); str->target = NULL; // int reactiontime; str->reactiontime = SV_ReadLong(); // int threshold; str->threshold = SV_ReadLong(); // struct player_s *player; i = SV_ReadLong(); if (i != 0) { str->player = &players[i - 1]; str->player->mo = str; } else { str->player = NULL; } // int lastlook; str->lastlook = SV_ReadLong(); // mapthing_t spawnpoint; saveg_read_mapthing_t(&str->spawnpoint); }
static void saveg_read_player_t(player_t *str) { int i; // mobj_t *mo; SV_ReadLong(); str->mo = NULL; // playerstate_t playerstate; str->playerstate = SV_ReadLong(); // ticcmd_t cmd; saveg_read_ticcmd_t(&str->cmd); // fixed_t viewz; str->viewz = SV_ReadLong(); // fixed_t viewheight; str->viewheight = SV_ReadLong(); // fixed_t deltaviewheight; str->deltaviewheight = SV_ReadLong(); // fixed_t bob; str->bob = SV_ReadLong(); // int flyheight; str->flyheight = SV_ReadLong(); // int lookdir; str->lookdir = SV_ReadLong(); // boolean centering; str->centering = SV_ReadLong(); // int health; str->health = SV_ReadLong(); // int armorpoints, armortype; str->armorpoints = SV_ReadLong(); str->armortype = SV_ReadLong(); // inventory_t inventory[NUMINVENTORYSLOTS]; for (i=0; i<NUMINVENTORYSLOTS; ++i) { saveg_read_inventory_t(&str->inventory[i]); } // artitype_t readyArtifact; str->readyArtifact = SV_ReadLong(); // int artifactCount; str->artifactCount = SV_ReadLong(); // int inventorySlotNum; str->inventorySlotNum = SV_ReadLong(); // int powers[NUMPOWERS]; for (i=0; i<NUMPOWERS; ++i) { str->powers[i] = SV_ReadLong(); } // boolean keys[NUMKEYS]; for (i=0; i<NUMKEYS; ++i) { str->keys[i] = SV_ReadLong(); } // boolean backpack; str->backpack = SV_ReadLong(); // signed int frags[MAXPLAYERS]; for (i=0; i<MAXPLAYERS; ++i) { str->frags[i] = SV_ReadLong(); } // weapontype_t readyweapon; str->readyweapon = SV_ReadLong(); // weapontype_t pendingweapon; str->pendingweapon = SV_ReadLong(); // boolean weaponowned[NUMWEAPONS]; for (i=0; i<NUMWEAPONS; ++i) { str->weaponowned[i] = SV_ReadLong(); } // int ammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { str->ammo[i] = SV_ReadLong(); } // int maxammo[NUMAMMO]; for (i=0; i<NUMAMMO; ++i) { str->maxammo[i] = SV_ReadLong(); } // int attackdown, usedown; str->attackdown = SV_ReadLong(); str->usedown = SV_ReadLong(); // int cheats; str->cheats = SV_ReadLong(); // int refire; str->refire = SV_ReadLong(); // int killcount, itemcount, secretcount; str->killcount = SV_ReadLong(); str->itemcount = SV_ReadLong(); str->secretcount = SV_ReadLong(); // char *message; SV_ReadLong(); str->message = NULL; // int messageTics; str->messageTics = SV_ReadLong(); // int damagecount, bonuscount; str->damagecount = SV_ReadLong(); str->bonuscount = SV_ReadLong(); // int flamecount; str->flamecount = SV_ReadLong(); // mobj_t *attacker; SV_ReadLong(); str->attacker = NULL; // int extralight; str->extralight = SV_ReadLong(); // int fixedcolormap; str->fixedcolormap = SV_ReadLong(); // int colormap; str->colormap = SV_ReadLong(); // pspdef_t psprites[NUMPSPRITES]; for (i=0; i<NUMPSPRITES; ++i) { saveg_read_pspdef_t(&str->psprites[i]); } // boolean didsecret; str->didsecret = SV_ReadLong(); // int chickenTics; str->chickenTics = SV_ReadLong(); // int chickenPeck; str->chickenPeck = SV_ReadLong(); // mobj_t *rain1; SV_ReadLong(); str->rain1 = NULL; // mobj_t *rain2; SV_ReadLong(); str->rain2 = NULL; }
static void saveg_read_plat_t(plat_t *str) { int i; // thinker_t thinker; saveg_read_thinker_t(&str->thinker); // sector_t *sector; i = SV_ReadLong(); str->sector = §ors[i]; // fixed_t speed; str->speed = SV_ReadLong(); // fixed_t low; str->low = SV_ReadLong(); // fixed_t high; str->high = SV_ReadLong(); // int wait; str->wait = SV_ReadLong(); // int count; str->count = SV_ReadLong(); // plat_e status; str->status = SV_ReadLong(); // plat_e oldstatus; str->oldstatus = SV_ReadLong(); // boolean crush; str->crush = SV_ReadLong(); // int tag; str->tag = SV_ReadLong(); // plattype_e type; str->type = SV_ReadLong(); }
static void SV_ReadMobj(mobj_t *mo) { // List: thinker links. SV_ReadLong(); SV_ReadLong(); SV_ReadLong(); // Info for drawing: position. mo->x = SV_ReadLong(); mo->y = SV_ReadLong(); mo->z = SV_ReadLong(); // More list: links in sector (if needed) SV_ReadLong(); SV_ReadLong(); //More drawing info: to determine current sprite. mo->angle = SV_ReadLong(); // orientation mo->sprite = SV_ReadLong(); // used to find patch_t and flip value mo->frame = SV_ReadLong(); // might be ORed with FF_FULLBRIGHT // Interaction info, by BLOCKMAP. // Links in blocks (if needed). SV_ReadLong(); SV_ReadLong(); SV_ReadLong(); // The closest interval over all contacted Sectors. mo->floorz = SV_ReadLong(); mo->ceilingz = SV_ReadLong(); // For movement checking. mo->radius = SV_ReadLong(); mo->height = SV_ReadLong(); // Momentums, used to update position. mo->momx = SV_ReadLong(); mo->momy = SV_ReadLong(); mo->momz = SV_ReadLong(); // If == validcount, already checked. mo->valid = SV_ReadLong(); mo->type = SV_ReadLong(); SV_ReadLong(); // &mobjinfo[mobj->type] mo->tics = SV_ReadLong(); // state tic counter mo->state = (state_t *) SV_ReadLong(); mo->flags = SV_ReadLong(); mo->health = SV_ReadLong(); // Movement direction, movement generation (zig-zagging). mo->movedir = SV_ReadLong(); // 0-7 mo->movecount = SV_ReadLong(); // when 0, select a new dir // Thing being chased/attacked (or NULL), // also the originator for missiles. SV_ReadLong(); // Reaction time: if non 0, don't attack yet. // Used by player to freeze a bit after teleporting. mo->reactiontime = SV_ReadLong(); // If >0, the target will be chased // no matter what (even if shot) mo->threshold = SV_ReadLong(); // Additional info record for player avatars only. // Only valid if type == MT_PLAYER mo->player = (player_t *) SV_ReadLong(); // Player number last looked for. mo->lastlook = SV_ReadLong(); // For nightmare respawn. SV_Read(&mo->spawnpoint, 10); // Thing being chased/attacked for tracers. SV_ReadLong(); }
static void SV_ReadPlayer(player_t *pl) { int temp[3]; SV_ReadLong(); pl->playerstate = SV_ReadLong(); SV_Read(temp, 8); pl->plr->viewz = SV_ReadLong(); pl->plr->viewheight = SV_ReadLong(); pl->plr->deltaviewheight = SV_ReadLong(); pl->bob = SV_ReadLong(); pl->health = SV_ReadLong(); pl->armorpoints = SV_ReadLong(); pl->armortype = SV_ReadLong(); SV_Read(pl->powers, NUMPOWERS * 4); SV_Read(pl->cards, NUMCARDS * 4); pl->backpack = SV_ReadLong(); SV_Read(pl->frags, 4 * 4); pl->readyweapon = SV_ReadLong(); pl->pendingweapon = SV_ReadLong(); SV_Read(pl->weaponowned, NUMWEAPONS * 4); SV_Read(pl->ammo, NUMAMMO * 4); SV_Read(pl->maxammo, NUMAMMO * 4); pl->attackdown = SV_ReadLong(); pl->usedown = SV_ReadLong(); pl->cheats = SV_ReadLong(); pl->refire = SV_ReadLong(); pl->killcount = SV_ReadLong(); pl->itemcount = SV_ReadLong(); pl->secretcount = SV_ReadLong(); SV_ReadLong(); pl->damagecount = SV_ReadLong(); pl->bonuscount = SV_ReadLong(); SV_ReadLong(); pl->plr->extralight = SV_ReadLong(); pl->plr->fixedcolormap = SV_ReadLong(); pl->colormap = SV_ReadLong(); SV_Read(pl->psprites, NUMPSPRITES * sizeof(pspdef_t)); pl->didsecret = SV_ReadLong(); }