X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fplayer.c;h=6a803a151b1588e206a404e9e5fcb57b66608c83;hb=e406060913a5544c83de81409148690275ffce95;hp=2d781a33716c1c36f7fb29154749b485fb3698bd;hpb=90e960736c16dc6d5031f55a7d8b0cccc6453a37;p=flatwaifu.git diff --git a/src/player.c b/src/player.c index 2d781a3..6a803a1 100644 --- a/src/player.c +++ b/src/player.c @@ -1,24 +1,19 @@ -/* - Copyright (C) Prikol Software 1996-1997 - Copyright (C) Aleksey Volynskov 1996-1997 - Copyright (C) 2011 - - This file is part of the Doom2D:Rembo project. - - Doom2D:Rembo is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. - - Doom2D:Rembo is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see or - write to the Free Software Foundation, Inc., - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ +/* Copyright (C) 1996-1997 Aleksey Volynskov + * Copyright (C) 2011 Rambo + * Copyright (C) 2020 SovietPony + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License ONLY. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "glob.h" #include @@ -68,114 +63,6 @@ byte plr_goanim[]="BDACDA"; byte plr_dieanim[]="HHHHIIIIJJJJKKKKLLLLMMMM"; byte plr_slopanim[]="OOPPQQRRSSTTUUVVWW"; -static void PL_save_player (player_t *p, FILE *h) { - myfwrite32(p->o.x, h); - myfwrite32(p->o.y, h); - myfwrite32(p->o.xv, h); - myfwrite32(p->o.yv, h); - myfwrite32(p->o.vx, h); - myfwrite32(p->o.vy, h); - myfwrite32(p->o.r, h); - myfwrite32(p->o.h, h); - myfwrite32(p->looky, h); - myfwrite32(p->st, h); - myfwrite32(p->s, h); - myfwrite32(p->life, h); - myfwrite32(p->armor, h); - myfwrite32(p->hit, h); - myfwrite32(p->hito, h); - myfwrite32(p->pain, h); - myfwrite32(p->air, h); - myfwrite32(p->invl, h); - myfwrite32(p->suit, h); - myfwrite8(p->d, h); - myfwrite32(p->frag, h); - myfwrite32(p->ammo, h); - myfwrite32(p->shel, h); - myfwrite32(p->rock, h); - myfwrite32(p->cell, h); - myfwrite32(p->fuel, h); - myfwrite32(p->kills, h); - myfwrite32(p->secrets, h); - myfwrite8(p->fire, h); - myfwrite8(p->cwpn, h); - myfwrite8(p->csnd, h); - myfwrite8(p->amul, h); - myfwrite16(p->wpns, h); - myfwrite8(p->wpn, h); - myfwrite8(p->f, h); - myfwrite8(p->drawst, h); - myfwrite8(p->color, h); - myfwrite32(p->id, h); - myfwrite8(p->keys, h); - myfwrite8(p->lives, h); - // k* not saved -} - -void PL_savegame (FILE *h) { - PL_save_player(&pl1, h); - if (_2pl) { - PL_save_player(&pl2, h); - } - myfwrite32(PL_JUMP, h); - myfwrite32(PL_RUN, h); - myfwrite8(p_immortal, h); -} - -static void PL_load_player (player_t *p, FILE *h) { - p->o.x = myfread32(h); - p->o.y = myfread32(h); - p->o.xv = myfread32(h); - p->o.yv = myfread32(h); - p->o.vx = myfread32(h); - p->o.vy = myfread32(h); - p->o.r = myfread32(h); - p->o.h = myfread32(h); - p->looky = myfread32(h); - p->st = myfread32(h); - p->s = myfread32(h); - p->life = myfread32(h); - p->armor = myfread32(h); - p->hit = myfread32(h); - p->hito = myfread32(h); - p->pain = myfread32(h); - p->air = myfread32(h); - p->invl = myfread32(h); - p->suit = myfread32(h); - p->d = myfread8(h); - p->frag = myfread32(h); - p->ammo = myfread32(h); - p->shel = myfread32(h); - p->rock = myfread32(h); - p->cell = myfread32(h); - p->fuel = myfread32(h); - p->kills = myfread32(h); - p->secrets = myfread32(h); - p->fire = myfread8(h); - p->cwpn = myfread8(h); - p->csnd = myfread8(h); - p->amul = myfread8(h); - p->wpns = myfread16(h); - p->wpn = myfread8(h); - p->f = myfread8(h); - p->drawst = myfread8(h); - p->color = myfread8(h); - p->id = myfread32(h); - p->keys = myfread8(h); - p->lives = myfread8(h); - // k* not saved -} - -void PL_loadgame (FILE *h) { - PL_load_player(&pl1, h); - if (_2pl) { - PL_load_player(&pl2, h); - } - PL_JUMP = myfread32(h); - PL_RUN = myfread32(h); - p_immortal = myfread8(h); -} - static int nonz (int a) { return a ? a : 1; }