예제 #1
0
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_read32();

    // int armortype;
    str->armortype = saveg_read32();

    // int powers[NUMPOWERS];
    for (i=0; i<NUMPOWERS; ++i)
    {
        str->powers[i] = saveg_read32();
    }

    // boolean cards[NUMCARDS];
    for (i=0; i<NUMCARDS; ++i)
    {
        str->cards[i] = saveg_read32();
    }

    // boolean backpack;
    str->backpack = saveg_read32();

    // 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 attackdown;
    str->attackdown = saveg_read32();

    // int usedown;
    str->usedown = saveg_read32();

    // int cheats;
    str->cheats = saveg_read32();

    // int refire;
    str->refire = saveg_read32();

    // int killcount;
    str->killcount = saveg_read32();

    // int itemcount;
    str->itemcount = saveg_read32();

    // 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;
    str->colormap = saveg_read32();

    // pspdef_t psprites[NUMPSPRITES];
    for (i=0; i<NUMPSPRITES; ++i)
    {
        saveg_read_pspdef_t(&str->psprites[i]);
    }

    // boolean didsecret;
    str->didsecret = saveg_read32();
}
예제 #2
0
//
// player_t
//
static void saveg_read_player_t(void)
{
    viewplayer->playerstate = (playerstate_t)saveg_read_enum();
    saveg_read_ticcmd_t(&viewplayer->cmd);
    viewplayer->viewz = saveg_read32();
    viewplayer->viewheight = saveg_read32();
    viewplayer->deltaviewheight = saveg_read32();
    viewplayer->momx = saveg_read32();
    viewplayer->momy = saveg_read32();
    viewplayer->health = saveg_read32();
    oldhealth = saveg_read32();
    viewplayer->armorpoints = saveg_read32();
    viewplayer->armortype = (armortype_t)saveg_read_enum();

    for (int i = 0; i < NUMPOWERS; i++)
        viewplayer->powers[i] = saveg_read32();

    for (int i = 0; i < NUMCARDS; i++)
    {
        viewplayer->cards[i] = saveg_read32();
        cardsfound = MAX(cardsfound, viewplayer->cards[i]);
    }

    viewplayer->neededcard = saveg_read32();
    viewplayer->neededcardflash = saveg_read32();
    viewplayer->backpack = saveg_read_bool();
    viewplayer->readyweapon = (weapontype_t)saveg_read_enum();
    viewplayer->pendingweapon = (weapontype_t)saveg_read_enum();

    for (int i = 0; i < NUMWEAPONS; i++)
        viewplayer->weaponowned[i] = oldweaponsowned[i] = saveg_read32();

    for (int i = 0; i < NUMAMMO; i++)
        viewplayer->ammo[i] = saveg_read32();

    for (int i = 0; i < NUMAMMO; i++)
        viewplayer->maxammo[i] = saveg_read32();

    viewplayer->attackdown = saveg_read_bool();
    viewplayer->usedown = saveg_read_bool();
    viewplayer->cheats = saveg_read32();
    viewplayer->refire = saveg_read32();
    viewplayer->killcount = saveg_read32();
    viewplayer->itemcount = saveg_read32();
    viewplayer->secretcount = saveg_read32();
    viewplayer->damagecount = saveg_read32();
    viewplayer->bonuscount = saveg_read32();
    attacker = saveg_read32();
    viewplayer->extralight = saveg_read32();
    viewplayer->fixedcolormap = saveg_read32();
    saveg_read_pspdef_t(&viewplayer->psprites[ps_weapon]);
    saveg_read_pspdef_t(&viewplayer->psprites[ps_flash]);
    viewplayer->didsecret = saveg_read_bool();
    viewplayer->preferredshotgun = (weapontype_t)saveg_read_enum();
    viewplayer->fistorchainsaw = (weapontype_t)saveg_read_enum();
    viewplayer->invulnbeforechoppers = saveg_read_bool();
    viewplayer->chainsawbeforechoppers = saveg_read_bool();
    viewplayer->weaponbeforechoppers = (weapontype_t)saveg_read_enum();
    viewplayer->oldviewz = saveg_read32();
    viewplayer->lookdir = saveg_read32();
    viewplayer->oldlookdir = saveg_read32();
    viewplayer->recoil = saveg_read32();
    viewplayer->oldrecoil = saveg_read32();
    viewplayer->jumptics = saveg_read32();

    if (!mouselook)
    {
        viewplayer->lookdir = 0;
        viewplayer->oldlookdir = 0;
        viewplayer->recoil = 0;
        viewplayer->oldrecoil = 0;
    }

    viewplayer->damageinflicted = saveg_read32();
    viewplayer->damagereceived = saveg_read32();
    viewplayer->cheated = saveg_read32();
    viewplayer->shotshit = saveg_read32();
    viewplayer->shotsfired = saveg_read32();
    viewplayer->deaths = saveg_read32();

    for (int i = 0; i < NUMMOBJTYPES; i++)
        viewplayer->mobjcount[i] = saveg_read32();

    viewplayer->distancetraveled = saveg_read32();
    viewplayer->itemspickedup_ammo_bullets = saveg_read32();
    viewplayer->itemspickedup_ammo_cells = saveg_read32();
    viewplayer->itemspickedup_ammo_rockets = saveg_read32();
    viewplayer->itemspickedup_ammo_shells = saveg_read32();
    viewplayer->itemspickedup_armor = saveg_read32();
    viewplayer->itemspickedup_health = saveg_read32();
}
예제 #3
0
파일: p_saveg.c 프로젝트: directhex/doom64
static void saveg_read_player_t(player_t* p) {
    int i;

    p->mo                   = saveg_read_mobjindex();
    p->playerstate          = saveg_read32();
    saveg_read_ticcmd_t(&p->cmd);
    p->viewz                = saveg_read32();
    p->viewheight           = saveg_read32();
    p->deltaviewheight      = saveg_read32();
    p->bob                  = saveg_read32();
    p->recoilpitch          = saveg_read32();
    p->health               = saveg_read32();
    p->armorpoints          = saveg_read32();
    p->armortype            = saveg_read32();

    for(i = 0; i < NUMPOWERS; i++) {
        p->powers[i]        = saveg_read32();
    }

    for(i = 0; i < NUMCARDS; i++) {
        p->cards[i]         = saveg_read32();
        p->tryopen[i]       = saveg_read32();
    }

    p->artifacts            = saveg_read32();
    p->backpack             = saveg_read32();

    for(i = 0; i < MAXPLAYERS; i++) {
        p->frags[i]         = saveg_read32();
    }

    p->readyweapon          = saveg_read32();
    p->pendingweapon        = saveg_read32();

    for(i = 0; i < NUMWEAPONS; i++) {
        p->weaponowned[i]   = saveg_read32();
    }

    for(i = 0; i < NUMAMMO; i++) {
        p->ammo[i]          = saveg_read32();
        p->maxammo[i]       = saveg_read32();
    }

    p->attackdown           = saveg_read32();
    p->usedown              = saveg_read32();
    p->jumpdown             = saveg_read32();
    p->cheats               = saveg_read32();
    p->refire               = saveg_read32();
    p->killcount            = saveg_read32();
    p->itemcount            = saveg_read32();
    p->secretcount          = saveg_read32();
    p->damagecount          = saveg_read32();
    p->bonuscount           = saveg_read32();
    p->bfgcount             = saveg_read32();
    p->attacker             = saveg_read_mobjindex();
    p->cameratarget         = saveg_read_mobjindex();

    if(!p->cameratarget) {
        p->cameratarget = p->mo;
    }

    for(i = 0; i < NUMPSPRITES; i++) {
        saveg_read_pspdef_t(&p->psprites[i]);
    }

    p->palette              = saveg_read32();
    p->onground             = saveg_read32();
    p->autoaim              = saveg_read32();
}
예제 #4
0
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;
}
예제 #5
0
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();
}