From: Dmitry D. Chernov Date: Thu, 14 Dec 2017 14:48:35 +0000 (+1000) Subject: Merge pull request #1 from djmadcat/feature/macos X-Git-Url: http://deadsoftware.ru/gitweb?p=flatwaifu.git;a=commitdiff_plain;h=8fb3d3f767b8e5d094e8bcbee350f4d16ab17c5a;hp=d1c2d78b536a9d2a340c65e0c14f87452b431cee Merge pull request #1 from djmadcat/feature/macos Build for macOS --- diff --git a/INSTALL b/INSTALL index c61339a..b010ef4 100644 --- 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: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb57650..c306571 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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} ) diff --git a/src/config.c b/src/config.c index 2985a4f..d0c4a9f 100644 --- a/src/config.c +++ b/src/config.c @@ -24,17 +24,14 @@ #include #include #include -//#include -//#include #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 @@ -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} }; diff --git a/src/dots.c b/src/dots.c index ddb39a2..d89b9d6 100644 --- a/src/dots.c +++ b/src/dots.c @@ -21,14 +21,8 @@ */ #include "glob.h" -//#include #include -#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 8c8eee9..0e3e2af 100644 --- a/src/error.c +++ b/src/error.c @@ -23,21 +23,15 @@ #include "glob.h" #include #include -//#include #include #include -#include #include "keyb.h" #include "sound.h" #include "vga.h" #include "memory.h" -#include "files.h" #include "error.h" #include "config.h" -#include - - void close_all(void) { S_done(); S_donemusic(); diff --git a/src/files.c b/src/files.c index 1a819de..220d72c 100644 --- a/src/files.c +++ b/src/files.c @@ -22,25 +22,16 @@ #include "glob.h" #include -//#include -#include -//#include #include #include -//#include -#include "vga.h" +#include #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 - char *S_getinfo(void); extern void *snd_drv; diff --git a/src/fx.c b/src/fx.c index 7212a8a..8a38050 100644 --- a/src/fx.c +++ b/src/fx.c @@ -20,12 +20,10 @@ */ #include "glob.h" -//#include #include #include #include #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 194365e..f2f3463 100644 --- a/src/game.c +++ b/src/game.c @@ -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" diff --git a/src/items.c b/src/items.c index 5910fa5..06230c9 100644 --- a/src/items.c +++ b/src/items.c @@ -21,12 +21,8 @@ */ #include "glob.h" -//#include #include -#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; diff --git a/src/keyb.c b/src/keyb.c index d287b16..b0b245c 100644 --- a/src/keyb.c +++ b/src/keyb.c @@ -21,6 +21,8 @@ */ #include "keyb.h" +#include "vga.h" +#include "error.h" #include // стандартная функция обработки клавиш diff --git a/src/main.c b/src/main.c index 5f0fe23..2fc47ce 100644 --- a/src/main.c +++ b/src/main.c @@ -22,13 +22,8 @@ #include "glob.h" #include -///#include #include -///#include -//#include -///#include #include -#include #include #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 diff --git a/src/memory.c b/src/memory.c index bec0456..5c7953c 100644 --- a/src/memory.c +++ b/src/memory.c @@ -22,7 +22,6 @@ #include "glob.h" #include #include -#include #include #include "error.h" #include "files.h" diff --git a/src/miscc.c b/src/miscc.c index 13359cd..4fd6353 100644 --- a/src/miscc.c +++ b/src/miscc.c @@ -27,7 +27,6 @@ #include #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 ed7604e..98b909e 100644 --- a/src/monster.c +++ b/src/monster.c @@ -21,12 +21,10 @@ */ #include "glob.h" -//#include #include #include #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; diff --git a/src/music.c b/src/music.c index 8f9c13e..4f6cc2b 100644 --- a/src/music.c +++ b/src/music.c @@ -22,6 +22,7 @@ #include "glob.h" #include "sound.h" +#include "files.h" #include #include diff --git a/src/my.c b/src/my.c index 701dd1d..c7fe41c 100644 --- a/src/my.c +++ b/src/my.c @@ -22,7 +22,6 @@ #include #include "glob.h" -#include "keyb.h" #include "error.h" #include @@ -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 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 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 06bf44e..fd1080a 100644 --- a/src/player.c +++ b/src/player.c @@ -23,10 +23,7 @@ #include "glob.h" #include #include -#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 577e402..4ec8117 100644 --- a/src/smoke.c +++ b/src/smoke.c @@ -22,11 +22,7 @@ #include "glob.h" #include -#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 cee95a9..de33434 100644 --- a/src/sound.c +++ b/src/sound.c @@ -21,8 +21,8 @@ */ #include "glob.h" -#include "files.h" #include "sound.h" +#include "error.h" #include #include diff --git a/src/sound.h b/src/sound.h index 0966bcd..dc46f7c 100644 --- a/src/sound.h +++ b/src/sound.h @@ -55,6 +55,8 @@ void S_startmusic(int); 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 51e6eb0..cc418b8 100644 --- a/src/switch.c +++ b/src/switch.c @@ -22,7 +22,6 @@ #include "glob.h" #include -#include "files.h" #include "view.h" #include "bmap.h" #include "switch.h" diff --git a/src/view.c b/src/view.c index c1af0cc..0d19be0 100644 --- a/src/view.c +++ b/src/view.c @@ -22,7 +22,7 @@ #include "glob.h" #include -#include +#include #include "vga.h" #include "memory.h" #include "files.h" diff --git a/src/weapons.c b/src/weapons.c index 4ccc73b..b778a0e 100644 --- a/src/weapons.c +++ b/src/weapons.c @@ -22,10 +22,6 @@ #include "glob.h" #include -//#include -#include "vga.h" -#include "error.h" -#include "sound.h" #include "view.h" #include "bmap.h" #include "dots.h"