diff --git a/src/game.c b/src/game.c
index b540223a46028b5beaddaa4265a6722987b8f8aa..202f0f2b15f3095c3bfa4682bcaf9c68d7e3133b 100644 (file)
--- a/src/game.c
+++ b/src/game.c
-/*
- Copyright (C) Prikol Software 1996-1997
- Copyright (C) Aleksey Volynskov 1996-1997
- Copyright (C) <ARembo@gmail.com> 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 <http://www.gnu.org/licenses/> 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 <http://www.gnu.org/licenses/>.
+ */
#include "glob.h"
#include <stdio.h>
#include "error.h"
#include "input.h"
+#include "save.h"
#define LT_DELAY 8
#define LT_HITTIME 6
int dm_pl1p;
int dm_pl2p;
pos_t dm_pos[100];
+byte cheat;
static void *telepsnd;
g_trans=1;g_transt=0;
}
-void G_savegame (FILE* h) {
- myfwrite8(_2pl, h);
- myfwrite8(g_dm, h);
- myfwrite8(g_exit, h);
- myfwrite8(g_map, h);
- myfwrite32(g_time, h);
- myfwrite32(dm_pl1p, h);
- myfwrite32(dm_pl2p, h);
- myfwrite32(dm_pnum, h);
- int i = 0;
- while (i < dm_pnum) {
- myfwrite32(dm_pos[i].x, h);
- myfwrite32(dm_pos[i].y, h);
- myfwrite8(dm_pos[i].d, h);
- i += 1;
- }
- myfwrite8(cheat, h);
- myfwrite(g_music, 8, 1, h);
-}
-
-void G_loadgame (FILE* h) {
- _2pl = myfread8(h);
- g_dm = myfread8(h);
- g_exit = myfread8(h);
- g_map = myfread8(h);
- g_time = myfread32(h);
- dm_pl1p = myfread32(h);
- dm_pl2p = myfread32(h);
- dm_pnum = myfread32(h);
- int i = 0;
- while (i < dm_pnum) {
- dm_pos[i].x = myfread32(h);
- dm_pos[i].y = myfread32(h);
- dm_pos[i].d = myfread8(h);
- i += 1;
- }
- cheat = myfread8(h);
- myfread(g_music, 8, 1, h);
- F_loadmus(g_music);
-}
-
-int G_load (FILE *h) {
- switch (blk.t) {
- case MB_MUSIC:
- myfread(g_music, 8, 1, h);
- if (music_random) {
- F_randmus(g_music);
- }
- F_loadmus(g_music);
- return 1;
- }
- return 0;
-}
-
void load_game (int n) {
- F_freemus();
+ MUS_free();
W_init();
F_loadgame(n);
set_trans(GS_GAME);
BM_mark(&pl1.o,BM_PLR1);
if(_2pl) BM_mark(&pl2.o,BM_PLR2);
MN_mark();
- S_startmusic(music_time);
+ //MUS_start(music_time);
+ MUS_start(0);
}
void G_start (void) {
char s[8];
-
- F_freemus();
+ MUS_free();
sprintf(s,"MAP%02u",(word)g_map);
F_loadmap(s);
set_trans(GS_GAME);
BM_mark(&pl1.o,BM_PLR1);
if(_2pl) BM_mark(&pl2.o,BM_PLR2);
MN_mark();
- S_startmusic(music_time);
+ //MUS_start(music_time);
+ MUS_start(0);
}
#define GGAS_TOTAL (MN__LAST-MN_DEMON+16+10)
int i,j;
char s[9];
- logo("G_init: настройка ресурсов игры ");
+ logo("G_init: setup game resources ");
logo_gas(5,GGAS_TOTAL);
telepsnd=Z_getsnd("TELEPT");
ltnsnd[0]=Z_getsnd("THUND1");
G_start();
} else {
g_st = GS_BVIDEO;
- F_freemus();
+ MUS_free();
}
}
#endif
if(g_exit==1) {
if(G_end_video()) {
- F_freemus();
+ MUS_free();
g_st=GS_EVIDEO;
return;
}
case 31: case 32: g_map=16;set_trans(GS_INTER);break;
default: ++g_map;set_trans(GS_INTER);break;
}
- F_freemus();
- if(g_st==GS_INTER) {
- F_loadmus("INTERMUS");
- }else {F_loadmus("\x8a\x8e\x8d\x85\x96\x0");if(mus_vol>0) {S_volumemusic(128);} }
- S_startmusic(0);
+ MUS_free();
+ if (g_st == GS_INTER) {
+ MUS_load("INTERMUS");
+ } else {
+ MUS_load("\x8a\x8e\x8d\x85\x96\x0");
+ MUS_volume(128);
+ }
+ MUS_start(0);
}else if(g_exit==2) {
switch(g_map) {
case 31: g_map=32;set_trans(GS_INTER);break;
case 32: g_map=16;set_trans(GS_INTER);break;
default: g_map=31;set_trans(GS_INTER);break;
}
- F_freemus();
- F_loadmus("INTERMUS");
- S_startmusic(0);
+ MUS_free();
+ MUS_load("INTERMUS");
+ MUS_start(0);
}
#ifdef DEMO