From b876a410e81ae58568e263fe2785f0b1a55002ef Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Mon, 26 Dec 2022 04:04:00 +0200 Subject: [PATCH] first attempt to build on the octane, nosound for now --- Makefile | 17 +++++++++-------- libs/ogg/config_types.h | 2 +- src/3dengfx/Makefile | 2 +- src/3dengfx/src/3dengfx/3dscene.cpp | 4 ++++ src/3dengfx/src/3dengfx_config.h | 2 +- src/3dengfx/src/common/types.h | 2 +- src/sumhack.cpp | 8 ++++++++ 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 105f352..db3cb97 100644 --- a/Makefile +++ b/Makefile @@ -2,16 +2,17 @@ src = src/sumhack.cpp src/events.cpp bin = sumhack-thelab include src/parts/Makefile-part -include src/sdlvf/Makefile-part +#include src/sdlvf/Makefile-part obj = $(src:.cpp=.o) $(csrc:.c=.o) -opt = -O1 -opt = -g +opt = -O3 +dbg = -g +def = -DNO_MUSIC incdir = -Isrc/3dengfx/src -Ilibs -Ilibs/png -Ilibs/jpeglib -Ilibs/ogg -Ilibs/vorbis -CXXFLAGS = -ansi -pedantic -Wall $(opt) $(incdir) -MMD `sdl-config --cflags` -CFLAGS = -std=c89 -pedantic -Wall $(opt) $(incdir) -MMD `sdl-config --cflags` -libs = $(libdir) $(libsys) src/3dengfx/lib3dengfx.a `sdl-config --libs` $(libgl) \ +CXXFLAGS = -ansi -pedantic -Wall $(opt) $(dbg) $(incdir) -MMD $(def) +CFLAGS = -std=c89 -pedantic -Wall $(opt) $(dbg) $(incdir) -MMD $(def) +libs = $(libdir) $(libsys) src/3dengfx/lib3dengfx.a $(libgl) \ -lvorbis -logg -ljpeg -lpng -lz -l3ds $(libc) sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/') @@ -19,13 +20,13 @@ ifeq ($(sys), mingw) obj = $(src:.cpp=.w32.o) $(csrc:.c=.w32.o) bin = sumhack-thelab.exe libdir = -Llibs/w32 - libgl = -lopengl32 + libgl = -lopengl32 -lglut32 libsys = -lmingw32 -lgdi32 -mconsole libc = -lm else libdir = -Llibs - libgl = -lGL + libgl = -lGL -lglut libc = -lm endif diff --git a/libs/ogg/config_types.h b/libs/ogg/config_types.h index 4b00047..51905ed 100644 --- a/libs/ogg/config_types.h +++ b/libs/ogg/config_types.h @@ -3,7 +3,7 @@ /* these are filled in by configure */ #define INCLUDE_INTTYPES_H 1 -#define INCLUDE_STDINT_H 1 +/*#define INCLUDE_STDINT_H 1*/ #define INCLUDE_SYS_TYPES_H 1 #if INCLUDE_INTTYPES_H diff --git a/src/3dengfx/Makefile b/src/3dengfx/Makefile index 04824c1..5f9dde4 100644 --- a/src/3dengfx/Makefile +++ b/src/3dengfx/Makefile @@ -1,6 +1,6 @@ PREFIX = /usr/local dbg = -g -opt = -O1 -ffast-math -fomit-frame-pointer +opt = -O3 -ffast-math inc_flags = -Isrc -I../../libs -I../../libs/zlib -I../../libs/libpng -I../../libs/jpeglib warn_flags = -Wall -Wno-sign-compare -Wno-strict-aliasing -Wno-char-subscripts diff --git a/src/3dengfx/src/3dengfx/3dscene.cpp b/src/3dengfx/src/3dengfx/3dscene.cpp index e2f896d..53a0a4f 100644 --- a/src/3dengfx/src/3dengfx/3dscene.cpp +++ b/src/3dengfx/src/3dengfx/3dscene.cpp @@ -29,6 +29,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "common/err_msg.h" #include "dsys/fx.hpp" +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + using std::string; Scene::Scene() { diff --git a/src/3dengfx/src/3dengfx_config.h b/src/3dengfx/src/3dengfx_config.h index 4be19c6..027985c 100644 --- a/src/3dengfx/src/3dengfx_config.h +++ b/src/3dengfx/src/3dengfx_config.h @@ -14,7 +14,7 @@ #define NATIVE_X11 10 #define NATIVE_WIN32 11 -#define GFX_LIBRARY SDL +#define GFX_LIBRARY GLUT #define SINGLE_PRECISION_MATH diff --git a/src/3dengfx/src/common/types.h b/src/3dengfx/src/common/types.h index c710eda..24d0310 100644 --- a/src/3dengfx/src/common/types.h +++ b/src/3dengfx/src/common/types.h @@ -36,7 +36,7 @@ typedef double scalar_t; #define HAVE_STDINT_H #endif /* explicitly set stdint.h availability for some platform */ -#if (__STDC_VERSION__ >= 199900) || defined(__GLIBC__) || defined(HAVE_STDINT_H) +#if (__STDC_VERSION__ >= 199900) || defined(__GLIBC__) || defined(HAVE_STDINT_H) && !defined(__sgi__) #include #elif defined(unix) || defined(__unix__) #include diff --git a/src/sumhack.cpp b/src/sumhack.cpp index 9491e64..5702001 100644 --- a/src/sumhack.cpp +++ b/src/sumhack.cpp @@ -7,7 +7,9 @@ #include "common/err_msg.h" #include "parts/parts.hpp" #include "events.hpp" +#ifndef NO_MUSIC #include "sdlvf/sdlvf.h" +#endif using namespace std; @@ -140,9 +142,11 @@ bool init() { dsys::render_demo(render_fps, render_path); } +#ifndef NO_MUSIC if(music) { sdlvf_init("data/music/red_herring.ogg"); } +#endif timer_reset(&timer); timer_start(&timer); @@ -153,9 +157,11 @@ bool init() { void clean_up() { unsigned long time = timer_getmsec(&timer); +#ifndef NO_MUSIC if(music) { sdlvf_done(); } +#endif fxwt::show_cursor(true); @@ -181,6 +187,7 @@ void clean_up() { void update_gfx() { unsigned long frame_start = timer_getmsec(&timer); +#ifndef NO_MUSIC if(music) { int sdlvf_err; if((sdlvf_err = sdlvf_check()) != SDLVF_PLAYING) { @@ -188,6 +195,7 @@ void update_gfx() { exit(0); } } +#endif if(dsys::update_graphics() == -1) { exit(0); -- 1.7.10.4