DEADSOFTWARE

Merge pull request #1 from djmadcat/feature/macos
authorDmitry D. Chernov <blackdoomer@yandex.ru>
Thu, 14 Dec 2017 14:48:35 +0000 (00:48 +1000)
committerGitHub <noreply@github.com>
Thu, 14 Dec 2017 14:48:35 +0000 (00:48 +1000)
Build for macOS

24 files changed:
INSTALL
src/CMakeLists.txt
src/config.c
src/dots.c
src/error.c
src/files.c
src/fx.c
src/game.c
src/items.c
src/keyb.c
src/main.c
src/memory.c
src/miscc.c
src/monster.c
src/music.c
src/my.c
src/my.h [new file with mode: 0644]
src/player.c
src/smoke.c
src/sound.c
src/sound.h
src/switch.c
src/view.c
src/weapons.c

diff --git a/INSTALL b/INSTALL
index c61339aca3500b4685bea42bf909b1a4aaab17c9..b010ef4a5b316a3ad22f07fbd2dcb001a2fd452c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -3,17 +3,19 @@ Basic Installation
 
 Currently to install Doom2D:Rembo from sources you need to have:
 
-   1. libSDL headers (SDL.h and SDL_mixer.h) at /usr/include/SDL
+   1. SDL and SDL_mixer (not SDL2!)
 
       In Debian GNU/Linux you can install them with this command:
 
       apt-get install libsdl1.2-dev libsdl-mixer1.2-dev
 
-   2. CMake to configure
+      On macOS (using MacPorts):
+
+      sudo port install libsdl libsdl_mixer
 
-   3. GCC and make to build
+   2. CMake to configure
 
-   4. libSDL.so and libSDL_mixer.so at /usr/lib to run
+   3. GCC or Clang to compile and make to build
 
 To proceed installation:
 
index eb576502cbd1a5f3e7ca5f23568d5534e04b979e..c306571ba5e55d209cc5bcdef9300248ebaf6a15 100644 (file)
@@ -1,26 +1,25 @@
 cmake_minimum_required( VERSION 2.6 )
+
 set( BIN doom2d )
 project( ${BIN} )
+
 set( SOURCE_ROOT ../src )
+
+find_package(SDL REQUIRED)
+find_package(SDL_mixer REQUIRED)
+
 aux_source_directory( ${SOURCE_ROOT} SOURCES )
+
 include_directories( "${SOURCE_ROOT}"
-                       "/usr/include"
-                       "/usr/include/SDL" )
+        "${SDL_INCLUDE_DIR}"
+        "${SDLMIXER_INCLUDE_DIR}" )
+
 set( INSTALL_PATH /usr/local/bin/ )
-set( REQUIRED_LIBRARIES 
-                       SDL
-                       SDL_mixer )
+
 set( CMAKE_CXX_FLAGS "-O2 -Wall -MMD -MP -MF" ) 
+
 add_executable( ${BIN} ${SOURCES} )
 
-target_link_libraries( ${BIN} ${REQUIRED_LIBRARIES} )
+target_link_libraries( ${BIN} "${SDL_LIBRARY}" "${SDLMIXER_LIBRARY}" )
+
 install( TARGETS ${BIN} DESTINATION ${INSTALL_PATH} )
index 2985a4f8e6e0e427736db2c2a700a49e873601c4..d0c4a9f1322545d2e9b87591a195d8ac6c82bdd0 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-//#include <process.h>
-//#include <dos.h>
 #include "config.h"
 #include "vga.h"
 #include "error.h"
 #include "sound.h"
-#include "keyb.h"
 #include "files.h"
-#include "memory.h"
 #include "view.h"
 #include "player.h"
+#include "my.h"
 
 #include <SDL_keyboard.h>
 
@@ -93,7 +90,7 @@ static cfg_t cfg[]={
   {NULL,"pl2_prev", &pl2.kwl,KEY,0},
   {NULL,"pl2_use",  &pl2.kp,KEY,0},
   {"config",NULL,cfg_file,STRING,0},
-  {NULL,NULL,NONE,0}
+  {NULL,NULL,NULL,NONE,0}
 };
 
 
index ddb39a28ab069f83ae44af07623cf9e62baea3ce..d89b9d6122fd359742141cf17d219cbeaa99e2df 100644 (file)
 */
 
 #include "glob.h"
-//#include <stdio.h>
 #include <stdlib.h>
-#include "files.h"
-#include "memory.h"
 #include "vga.h"
-#include "error.h"
-#include "keyb.h"
-#include "sound.h"
 #include "view.h"
 #include "dots.h"
 #include "misc.h"
index 8c8eee9d4890a3f8956a73224b3ab117ee4bc53e..0e3e2afebbe0c5978cf3bbbc931fd52a1f7e3b72 100644 (file)
 #include "glob.h"
 #include <stdio.h>
 #include <string.h>
-//#include <conio.h>
 #include <stdarg.h>
 #include <stdlib.h>
-#include <malloc.h>
 #include "keyb.h"
 #include "sound.h"
 #include "vga.h"
 #include "memory.h"
-#include "files.h"
 #include "error.h"
 #include "config.h"
 
-#include <SDL.h>
-
-
 void close_all(void) {
   S_done();
   S_donemusic();
index 1a819de37844f44945e87854fd45872e36fdc569..220d72cd254e4e9957ef83d5ff325aad2c4b4a83 100644 (file)
 
 #include "glob.h"
 #include <stdio.h>
-//#include <conio.h>
-#include <malloc.h>
-//#include <dos.h>
 #include <string.h>
 #include <stdlib.h>
-//#include <sys\stat.h>
-#include "vga.h"
+#include <sys/stat.h>
 #include "error.h"
-#include "sound.h"
-//#include "snddrv.h"
-#include "memory.h"
 #include "view.h"
 #include "items.h"
 #include "switch.h"
 #include "files.h"
 #include "map.h"
 
-#include <sys/stat.h>
-
 char *S_getinfo(void);
 
 extern void *snd_drv;
index 7212a8ac4c13fdd2a070854609203b326094e1cd..8a38050cf9bfc7789bae981efaa0e6791fe09298 100644 (file)
--- a/src/fx.c
+++ b/src/fx.c
 */
 
 #include "glob.h"
-//#include <io.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include "vga.h"
-#include "error.h"
 #include "view.h"
 #include "fx.h"
 #include "misc.h"
index 194365ecc3a739663131a9eedb7c5f5b87a8705c..f2f346304fc0193487d953b2f553e0a53f636fd9 100644 (file)
@@ -27,7 +27,6 @@
 #include "files.h"
 #include "memory.h"
 #include "vga.h"
-#include "error.h"
 #include "keyb.h"
 #include "sound.h"
 #include "view.h"
index 5910fa5b04db00d82e9529fcb4bf31bd52180d44..06230c9c7f949bf83952a3697da60fbd654351a0 100644 (file)
 */
 
 #include "glob.h"
-//#include <stdio.h>
 #include <stdlib.h>
-#include "vga.h"
 #include "error.h"
-#include "sound.h"
-#include "files.h"
 #include "view.h"
 #include "items.h"
 #include "fx.h"
@@ -34,7 +30,6 @@
 #include "monster.h"
 #include "things.h"
 #include "misc.h"
-#include "memory.h"
 #include "map.h"
 
 extern map_block_t blk;
index d287b162656b57628842bd6b408bb1bd13ea4106..b0b245c9af3118760d0ad3c3fb7b03ed601c9a3c 100644 (file)
@@ -21,6 +21,8 @@
 */
 
 #include "keyb.h"
+#include "vga.h"
+#include "error.h"
 #include <SDL.h>
 
 // стандартная функция обработки клавиш
index 5f0fe2343b3c2ee257222347a8234115f148d940..2fc47cebd02be20d242e6d82622bb2f822497f85 100644 (file)
 
 #include "glob.h"
 #include <stdio.h>
-///#include <process.h>
 #include <stdarg.h>
-///#include <conio.h>
-//#include <time.h>
-///#include <dos.h>
 #include <stdlib.h>
-#include <malloc.h>
 #include <string.h>
 #include "error.h"
 #include "config.h"
@@ -40,7 +35,7 @@
 #include "view.h"
 #include "menu.h"
 #include "player.h"
-#include "misc.h"
+#include "my.h"
 
 #include <SDL.h>
 
index bec045671e5a8f3202cefb02bd7f615cb5913c4d..5c7953cc813ee93a99753ff327c2618352bd54da 100644 (file)
@@ -22,7 +22,6 @@
 #include "glob.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <malloc.h>
 #include <string.h>
 #include "error.h"
 #include "files.h"
index 13359cd39ccb63d1707e2091cc14861a12eaa702..4fd6353f0c4feadb1d101572052e082b8850346c 100644 (file)
@@ -27,7 +27,6 @@
 #include <stdlib.h>
 #include "files.h"
 #include "memory.h"
-#include "error.h"
 #include "vga.h"
 #include "sound.h"
 #include "view.h"
index ed7604e99f89dcc3f708f19e33675c3f3261e3f7..98b909ebf803eea40342235b1c98770727e85c84 100644 (file)
 */
 
 #include "glob.h"
-//#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include "vga.h"
 #include "files.h"
-#include "error.h"
 #include "view.h"
 #include "bmap.h"
 #include "dots.h"
@@ -150,6 +148,8 @@ void MN_savegame(FILE* h) {
 
 static void setst(int,int);
 
+static int MN_hit(int n,int d,int o,int t);
+
 void MN_loadgame(FILE* h) {
   int n,c;
 
index 8f9c13e2fadb4ba3f5a4866d96795c0c31e570de..4f6cc2b83ea8dc4429cd74127bc498257389b4a8 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "glob.h"
 #include "sound.h"
+#include "files.h"
 #include <SDL.h>
 #include <SDL_mixer.h>
 
index 701dd1d8cceca2518d9017ab6490b01f84109dbd..c7fe41cc48e123680241b4f7015448e83dd90134 100644 (file)
--- a/src/my.c
+++ b/src/my.c
@@ -22,7 +22,6 @@
 
 #include <SDL.h>
 #include "glob.h"
-#include "keyb.h"
 #include "error.h"
 #include <stdio.h>
 
@@ -99,7 +98,7 @@ void myrandomize(void)
 int fexists(char * filename)
 {
     FILE *f;
-    if (f = fopen(filename, "r"))
+    if ((f = fopen(filename, "r")))
     {
         fclose(f);
         return 1;
diff --git a/src/my.h b/src/my.h
new file mode 100644 (file)
index 0000000..607cccd
--- /dev/null
+++ b/src/my.h
@@ -0,0 +1,30 @@
+/*
+   Copyright (C) Prikol Software 1996-1997
+   Copyright (C) Aleksey Volynskov 1996-1997
+
+   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
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int fexists(char * filename);
+
+#ifdef __cplusplus
+}
+#endif
index 06bf44e85210d3f7a14c66a05fd86a60b5da1e96..fd1080a4a49a52e34b738f06af873b8ded08d86e 100644 (file)
 #include "glob.h"
 #include <stdlib.h>
 #include <string.h>
-#include "files.h"
-#include "memory.h"
 #include "vga.h"
-#include "error.h"
 #include "keyb.h"
 #include "view.h"
 #include "dots.h"
index 577e402b58c794f8356eca0871e44d22b9d1ad0a..4ec8117a26a12bff82048fc138da3f7eed9b5d43 100644 (file)
 
 #include "glob.h"
 #include <stdlib.h>
-#include "files.h"
-#include "memory.h"
 #include "vga.h"
-#include "error.h"
-#include "sound.h"
 #include "view.h"
 #include "smoke.h"
 #include "fx.h"
index cee95a9272077da13635fcd1169a57ad4d3a7ad2..de334340c50f820be2065c5339790bd586cae71e 100644 (file)
@@ -21,8 +21,8 @@
 */
 
 #include "glob.h"
-#include "files.h"
 #include "sound.h"
+#include "error.h"
 #include <SDL.h>
 #include <SDL_mixer.h>
 
index 0966bcde3068cd5916d7e13d8ff5f15097b81da7..dc46f7c6538cf8a954984b9d67ea7dd7ed808b42 100644 (file)
@@ -55,6 +55,8 @@ void S_startmusic(int);
 
 void S_stopmusic(void);
 
+void S_updatemusic(void);
+
 // громкость звука и музыки (0-128)
 extern short snd_vol,mus_vol;
 
index 51e6eb0e042c03a260b63cfd2a1e98c933ca4a7c..cc418b8bc5287bf7291fe8612e680fe2ff9e6e83 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "glob.h"
 #include <string.h>
-#include "files.h"
 #include "view.h"
 #include "bmap.h"
 #include "switch.h"
index c1af0ccae607ef58c40636abfaa73ebd981258f3..0d19be0e66e0fc562a7e1ce294c2763d7de937c0 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "glob.h"
 #include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include "vga.h"
 #include "memory.h"
 #include "files.h"
index 4ccc73b28ef61c7d127977105267c1cc2cbefbd7..b778a0ec96c484a448264ae979454c9a9e0b70a7 100644 (file)
 
 #include "glob.h"
 #include <stdlib.h>
-//#include <io.h>
-#include "vga.h"
-#include "error.h"
-#include "sound.h"
 #include "view.h"
 #include "bmap.h"
 #include "dots.h"