author | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Thu, 14 Dec 2017 14:48:35 +0000 (00:48 +1000) | ||
committer | GitHub <noreply@github.com> | |
Thu, 14 Dec 2017 14:48:35 +0000 (00:48 +1000) |
Build for macOS
24 files changed:
INSTALL | patch | blob | history | |
src/CMakeLists.txt | patch | blob | history | |
src/config.c | patch | blob | history | |
src/dots.c | patch | blob | history | |
src/error.c | patch | blob | history | |
src/files.c | patch | blob | history | |
src/fx.c | patch | blob | history | |
src/game.c | patch | blob | history | |
src/items.c | patch | blob | history | |
src/keyb.c | patch | blob | history | |
src/main.c | patch | blob | history | |
src/memory.c | patch | blob | history | |
src/miscc.c | patch | blob | history | |
src/monster.c | patch | blob | history | |
src/music.c | patch | blob | history | |
src/my.c | patch | blob | history | |
src/my.h | [new file with mode: 0644] | patch | blob |
src/player.c | patch | blob | history | |
src/smoke.c | patch | blob | history | |
src/sound.c | patch | blob | history | |
src/sound.h | patch | blob | history | |
src/switch.c | patch | blob | history | |
src/view.c | patch | blob | history | |
src/weapons.c | patch | blob | history |
index c61339aca3500b4685bea42bf909b1a4aaab17c9..b010ef4a5b316a3ad22f07fbd2dcb001a2fd452c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
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:
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index eb576502cbd1a5f3e7ca5f23568d5534e04b979e..c306571ba5e55d209cc5bcdef9300248ebaf6a15 100644 (file)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
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} )
diff --git a/src/config.c b/src/config.c
index 2985a4f8e6e0e427736db2c2a700a49e873601c4..d0c4a9f1322545d2e9b87591a195d8ac6c82bdd0 100644 (file)
--- a/src/config.c
+++ b/src/config.c
#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>
{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}
};
diff --git a/src/dots.c b/src/dots.c
index ddb39a28ab069f83ae44af07623cf9e62baea3ce..d89b9d6122fd359742141cf17d219cbeaa99e2df 100644 (file)
--- a/src/dots.c
+++ b/src/dots.c
*/
#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"
diff --git a/src/error.c b/src/error.c
index 8c8eee9d4890a3f8956a73224b3ab117ee4bc53e..0e3e2afebbe0c5978cf3bbbc931fd52a1f7e3b72 100644 (file)
--- a/src/error.c
+++ b/src/error.c
#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();
diff --git a/src/files.c b/src/files.c
index 1a819de37844f44945e87854fd45872e36fdc569..220d72cd254e4e9957ef83d5ff325aad2c4b4a83 100644 (file)
--- a/src/files.c
+++ b/src/files.c
#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;
diff --git a/src/fx.c b/src/fx.c
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"
diff --git a/src/game.c b/src/game.c
index 194365ecc3a739663131a9eedb7c5f5b87a8705c..f2f346304fc0193487d953b2f553e0a53f636fd9 100644 (file)
--- a/src/game.c
+++ b/src/game.c
#include "files.h"
#include "memory.h"
#include "vga.h"
-#include "error.h"
#include "keyb.h"
#include "sound.h"
#include "view.h"
diff --git a/src/items.c b/src/items.c
index 5910fa5b04db00d82e9529fcb4bf31bd52180d44..06230c9c7f949bf83952a3697da60fbd654351a0 100644 (file)
--- a/src/items.c
+++ b/src/items.c
*/
#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"
#include "monster.h"
#include "things.h"
#include "misc.h"
-#include "memory.h"
#include "map.h"
extern map_block_t blk;
diff --git a/src/keyb.c b/src/keyb.c
index d287b162656b57628842bd6b408bb1bd13ea4106..b0b245c9af3118760d0ad3c3fb7b03ed601c9a3c 100644 (file)
--- a/src/keyb.c
+++ b/src/keyb.c
*/
#include "keyb.h"
+#include "vga.h"
+#include "error.h"
#include <SDL.h>
// стандартная функция обработки клавиш
diff --git a/src/main.c b/src/main.c
index 5f0fe2343b3c2ee257222347a8234115f148d940..2fc47cebd02be20d242e6d82622bb2f822497f85 100644 (file)
--- a/src/main.c
+++ b/src/main.c
#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"
#include "view.h"
#include "menu.h"
#include "player.h"
-#include "misc.h"
+#include "my.h"
#include <SDL.h>
diff --git a/src/memory.c b/src/memory.c
index bec045671e5a8f3202cefb02bd7f615cb5913c4d..5c7953cc813ee93a99753ff327c2618352bd54da 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
#include "glob.h"
#include <stdio.h>
#include <stdlib.h>
-#include <malloc.h>
#include <string.h>
#include "error.h"
#include "files.h"
diff --git a/src/miscc.c b/src/miscc.c
index 13359cd39ccb63d1707e2091cc14861a12eaa702..4fd6353f0c4feadb1d101572052e082b8850346c 100644 (file)
--- a/src/miscc.c
+++ b/src/miscc.c
#include <stdlib.h>
#include "files.h"
#include "memory.h"
-#include "error.h"
#include "vga.h"
#include "sound.h"
#include "view.h"
diff --git a/src/monster.c b/src/monster.c
index ed7604e99f89dcc3f708f19e33675c3f3261e3f7..98b909ebf803eea40342235b1c98770727e85c84 100644 (file)
--- a/src/monster.c
+++ b/src/monster.c
*/
#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"
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;
diff --git a/src/music.c b/src/music.c
index 8f9c13e2fadb4ba3f5a4866d96795c0c31e570de..4f6cc2b83ea8dc4429cd74127bc498257389b4a8 100644 (file)
--- a/src/music.c
+++ b/src/music.c
#include "glob.h"
#include "sound.h"
+#include "files.h"
#include <SDL.h>
#include <SDL_mixer.h>
diff --git a/src/my.c b/src/my.c
index 701dd1d8cceca2518d9017ab6490b01f84109dbd..c7fe41cc48e123680241b4f7015448e83dd90134 100644 (file)
--- a/src/my.c
+++ b/src/my.c
#include <SDL.h>
#include "glob.h"
-#include "keyb.h"
#include "error.h"
#include <stdio.h>
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
--- /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
diff --git a/src/player.c b/src/player.c
index 06bf44e85210d3f7a14c66a05fd86a60b5da1e96..fd1080a4a49a52e34b738f06af873b8ded08d86e 100644 (file)
--- a/src/player.c
+++ b/src/player.c
#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"
diff --git a/src/smoke.c b/src/smoke.c
index 577e402b58c794f8356eca0871e44d22b9d1ad0a..4ec8117a26a12bff82048fc138da3f7eed9b5d43 100644 (file)
--- a/src/smoke.c
+++ b/src/smoke.c
#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"
diff --git a/src/sound.c b/src/sound.c
index cee95a9272077da13635fcd1169a57ad4d3a7ad2..de334340c50f820be2065c5339790bd586cae71e 100644 (file)
--- a/src/sound.c
+++ b/src/sound.c
*/
#include "glob.h"
-#include "files.h"
#include "sound.h"
+#include "error.h"
#include <SDL.h>
#include <SDL_mixer.h>
diff --git a/src/sound.h b/src/sound.h
index 0966bcde3068cd5916d7e13d8ff5f15097b81da7..dc46f7c6538cf8a954984b9d67ea7dd7ed808b42 100644 (file)
--- a/src/sound.h
+++ b/src/sound.h
void S_stopmusic(void);
+void S_updatemusic(void);
+
// громкость звука и музыки (0-128)
extern short snd_vol,mus_vol;
diff --git a/src/switch.c b/src/switch.c
index 51e6eb0e042c03a260b63cfd2a1e98c933ca4a7c..cc418b8bc5287bf7291fe8612e680fe2ff9e6e83 100644 (file)
--- a/src/switch.c
+++ b/src/switch.c
#include "glob.h"
#include <string.h>
-#include "files.h"
#include "view.h"
#include "bmap.h"
#include "switch.h"
diff --git a/src/view.c b/src/view.c
index c1af0ccae607ef58c40636abfaa73ebd981258f3..0d19be0e66e0fc562a7e1ce294c2763d7de937c0 100644 (file)
--- a/src/view.c
+++ b/src/view.c
#include "glob.h"
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include "vga.h"
#include "memory.h"
#include "files.h"
diff --git a/src/weapons.c b/src/weapons.c
index 4ccc73b28ef61c7d127977105267c1cc2cbefbd7..b778a0ec96c484a448264ae979454c9a9e0b70a7 100644 (file)
--- a/src/weapons.c
+++ b/src/weapons.c
#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"