summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de05b18)
raw | patch | inline | side by side (parent: de05b18)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 21 Mar 2020 16:07:45 +0000 (19:07 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 21 Mar 2020 16:07:45 +0000 (19:07 +0300) |
src/error.c | [deleted file] | patch | blob | history |
src/menu.c | patch | blob | history | |
src/player.c | patch | blob | history | |
src/sdl/main.c | patch | blob | history |
diff --git a/src/error.c b/src/error.c
--- a/src/error.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- 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
-*/
-
-#include "glob.h"
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include "sound.h"
-#include "render.h"
-#include "memory.h"
-#include "error.h"
-#include "config.h"
-#include "music.h"
-
-void logo (const char *s, ...) {
- va_list ap;
- va_start(ap, s);
- vprintf(s, ap);
- va_end(ap);
- fflush(stdout);
-}
-
-void logo_gas (int cur, int all) {
- // stub
-}
-
-static void close_all (void) {
- S_done();
- S_donemusic();
- M_shutdown();
- R_done();
-}
-
-void ERR_failinit (char *s, ...) {
- va_list ap;
- //close_all();
- va_start(ap, s);
- vprintf(s, ap);
- va_end(ap);
- puts("");
- exit(1);
-}
-
-void ERR_fatal (char *s,...) {
- va_list ap;
- close_all();
- puts("\nКРИТИЧЕСКАЯ ОШИБКА:");
- va_start(ap, s);
- vprintf(s, ap);
- va_end(ap);
- puts("");
- exit(2);
-}
-
-void ERR_quit (void) {
- puts("Спасибо за то, что вы играли в Операцию \"Смятка\"!");
- //F_loadres(F_getresid("ENDOOM"),p,0,4000);
- close_all();
- CFG_save();
- exit(0);
-}
diff --git a/src/menu.c b/src/menu.c
index 3d797fc944cbf019c0df7addc2153ce89118fbf9..5a59b877394112821d736056f233368ca5f6772e 100644 (file)
--- a/src/menu.c
+++ b/src/menu.c
msnd4=Z_getsnd("SWTCHX");
msnd5=Z_getsnd("SUDI");
msnd6=Z_getsnd("TUDI");
+ F_loadmus("MENU");
+ S_startmusic(0);
}
diff --git a/src/player.c b/src/player.c
index 4ade1709545a5c70224b9872c3b80dc961e3d940..ecb8b9eb7da879cff18036d1d3850c1b278a147c 100644 (file)
--- a/src/player.c
+++ b/src/player.c
}
void PL_init (void) {
- p_immortal=0;
- PL_JUMP=10;PL_RUN=8;
- aitime=0;
+ pl1.id = -1;
+ pl2.id = -2;
+ p_immortal = 0;
+ PL_JUMP = 10;
+ PL_RUN = 8;
+ aitime = 0;
}
void PL_alloc(void) {
diff --git a/src/sdl/main.c b/src/sdl/main.c
index 3aaad80c00583e818a1401faae5c9793107c6f4a..ef757fc3b6a0c67c3fa9db17a801df21193f5297 100644 (file)
--- a/src/sdl/main.c
+++ b/src/sdl/main.c
*/
#include <SDL.h>
-#include <stdlib.h> // srand
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h> // srand exit
#include <string.h> // strcasecmp
#include "input.h"
#include "my.h" // fexists
#include "player.h" // pl1 pl2
-#include "menu.h" // GM_init G_keyf
+#include "menu.h" // G_keyf
#include "error.h" // logo
#include "files.h" // F_startup F_addwad F_initwads F_allocres
-#include "config.h" // CFG_args CFG_load
+#include "config.h" // CFG_args CFG_load CFG_save
#include "memory.h" // M_startup
-#include "game.h" // G_Init G_act
+#include "game.h" // G_init G_act
#include "sound.h" // S_init S_done
#include "music.h" // S_initmusic S_updatemusic S_donemusic
#include "render.h" // R_init R_draw R_done
static int quit = 0;
+void logo (const char *s, ...) {
+ va_list ap;
+ va_start(ap, s);
+ vprintf(s, ap);
+ va_end(ap);
+ fflush(stdout);
+}
+
+void logo_gas (int cur, int all) {
+ // stub
+}
+
+void ERR_failinit (char *s, ...) {
+ va_list ap;
+ va_start(ap, s);
+ vprintf(s, ap);
+ va_end(ap);
+ puts("");
+ exit(1);
+}
+
+void ERR_fatal (char *s, ...) {
+ va_list ap;
+ R_done();
+ S_done();
+ S_donemusic();
+ M_shutdown();
+ SDL_Quit();
+ puts("\nКРИТИЧЕСКАЯ ОШИБКА:");
+ va_start(ap, s);
+ vprintf(s, ap);
+ va_end(ap);
+ puts("");
+ exit(1);
+}
+
+void ERR_quit (void) {
+ puts("Спасибо за то, что вы играли в Операцию \"Смятка\"!");
+ //F_loadres(F_getresid("ENDOOM"),p,0,4000);
+ quit = 1;
+}
+
static int sdl_to_key (int code) {
switch (code) {
case SDLK_0: return KEY_0;
return 1;
}
SDL_WM_SetCaption("Doom 2D v1.351", "Doom 2D");
- pl1.id = -1; // TODO move to generic code
- pl2.id = -2; // TODO move to generic code
// Player 1 defaults
pl1.ku = KEY_KP_8;
pl1.kd = KEY_KP_5;
F_initwads();
M_startup();
F_allocres();
- G_init();
S_init();
S_initmusic();
R_init();
- GM_init(); // TODO move to game
- F_loadmus("MENU"); // TODO move to menu
- S_startmusic(0); // TODO move to menu
+ G_init();
ticks = SDL_GetTicks();
while (!quit) {
poll_events(&G_keyf);
}
R_draw();
}
+ CFG_save();
R_done();
- S_donemusic();
S_done();
+ S_donemusic();
M_shutdown();
SDL_Quit();
return 0;