From 3431131c8263c62896479c904689e325648a289d Mon Sep 17 00:00:00 2001 From: Jackburton79 Date: Mon, 10 Jul 2023 11:50:54 +0200 Subject: [PATCH] Fixed build by removing IE specific stuff --- Makefile | 31 ++++-------------- graphics/Polygon.cpp | 4 ++- graphics/RectUtils.h | 78 -------------------------------------------- timers/Timer.cpp | 6 +--- 4 files changed, 11 insertions(+), 108 deletions(-) diff --git a/Makefile b/Makefile index 8a812989..37ad85fd 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,16 @@ CC = g++ RM = rm -rf -BGEMU = BGEmu -GAMELIB = libgame.a +GAMELIB = libjgame.a LIBS = -lz `sdl2-config --libs` CXXFLAGS = -Wall -Werror -g -O0 `sdl2-config --cflags` SUBDIR = \ -animations \ -archives \ -game \ +audio \ graphics \ -gui \ -resources \ shell \ streams \ -support +support \ +timers OUTDIR = ./bin DIR_OBJ = ./obj @@ -25,14 +21,9 @@ OBJS = $(addprefix $(DIR_OBJ)/, $(SRCS:cpp=o)) # obj/xxx.o obj/folder/xxx .o INC_DIRS = -I./ $(addprefix -I, $(SUBDIR)) #PHONY := all -all: $(BGEMU) +all: $(GAMELIB) -tests: PathFindTest RandTest - -PHONY := $(BGEMU) $(GAMELIB) -$(BGEMU): bgemu.cpp $(GAMELIB) - mkdir -p $(OUTDIR) - $(CC) -o $(OUTDIR)/$@ bgemu.cpp $(DIR_OBJ)/$(GAMELIB) $(LIBS) $(INC_DIRS) $(CXXFLAGS) $(LDFLAGS) +PHONY := $(GAMELIB) $(GAMELIB): $(OBJS) ar rcu $(DIR_OBJ)/$(GAMELIB) $(OBJS) @@ -42,14 +33,6 @@ $(DIR_OBJ)/%.o: %.cpp $(INCS) mkdir -p $(@D) $(CC) -o $@ $(CXXFLAGS) -c $< $(INC_DIRS) -PathFindTest: $(GAMELIB) tests/PathFindTest.cpp - mkdir -p $(OUTDIR) - $(CC) -o $(OUTDIR)/$@ tests/PathFindTest.cpp $(LIBS) $(DIR_OBJ)/$(GAMELIB) $(INC_DIRS) $(CXXFLAGS) $(LDFLAGS) - -RandTest: $(GAMELIB) tests/RandTest.cpp - mkdir -p $(OUTDIR) - $(CC) -o $(OUTDIR)/$@ tests/RandTest.cpp $(LIBS) $(DIR_OBJ)/$(GAMELIB) $(INC_DIRS) $(CXXFLAGS) $(LDFLAGS) - PHONY += clean clean: rm -rf $(OUTDIR)/* $(DIR_OBJ)/* @@ -64,4 +47,4 @@ echoes: @echo "LIB DIR: $(LIB_DIRS)" @echo "SUBDIR: $(SUBDIR)" -.PHONY = $(PHONY) \ No newline at end of file +.PHONY = $(PHONY) diff --git a/graphics/Polygon.cpp b/graphics/Polygon.cpp index bafef060..700ef9ad 100644 --- a/graphics/Polygon.cpp +++ b/graphics/Polygon.cpp @@ -3,8 +3,10 @@ #include "RectUtils.h" #include +#include +#include #include -#include + Polygon::Polygon() : diff --git a/graphics/RectUtils.h b/graphics/RectUtils.h index b8986e5e..e6169a2b 100644 --- a/graphics/RectUtils.h +++ b/graphics/RectUtils.h @@ -3,7 +3,6 @@ #include "Bitmap.h" #include "GraphicsDefs.h" -#include "IETypes.h" static inline GFX::rect @@ -16,18 +15,6 @@ offset_rect(const GFX::rect &rect, sint16 x, sint16 y) } -static inline IE::rect -offset_rect(const IE::rect &rect, sint16 x, sint16 y) -{ - IE::rect newRect = rect; - newRect.x_min += x; - newRect.y_min += y; - newRect.x_max += x; - newRect.y_max += y; - return newRect; -} - - static inline GFX::rect offset_rect_to(const GFX::rect &rect, sint16 x, sint16 y) { @@ -38,16 +25,6 @@ offset_rect_to(const GFX::rect &rect, sint16 x, sint16 y) } -static inline IE::point -offset_point(const IE::point &point, sint16 x, sint16 y) -{ - IE::point newPoint = point; - newPoint.x += x; - newPoint.y += y; - return newPoint; -} - - static inline GFX::point offset_point(const GFX::point &point, sint16 x, sint16 y) { @@ -68,16 +45,6 @@ rects_intersect(const GFX::rect &rectA, const GFX::rect &rectB) } -static inline bool -rect_contains(const GFX::rect& rect, const IE::point& point) -{ - if (point.x >= rect.x && point.x <= rect.x + rect.w - && point.y >= rect.y && point.y <= rect.y + rect.h) - return true; - return false; -} - - static inline bool rect_contains(const GFX::rect& rect, const int16 x, const int16 y) { @@ -88,26 +55,6 @@ rect_contains(const GFX::rect& rect, const int16 x, const int16 y) } -static inline bool -rect_contains(const IE::rect& rect, const IE::point& point) -{ - if (point.x >= rect.x_min && point.x <= rect.x_max - && point.y >= rect.y_min && point.y <= rect.y_max) - return true; - return false; -} - - -static inline bool -polygon_contains(const IE::polygon& poly, const IE::point& point) -{ - if (point.x >= poly.left && point.x <= poly.right - && point.y >= poly.top && point.y <= poly.bottom) - return true; - return false; -} - - static inline GFX::rect center_rect_in_rect(const GFX::rect& toCenter, const GFX::rect& windowRect) { @@ -120,29 +67,4 @@ center_rect_in_rect(const GFX::rect& toCenter, const GFX::rect& windowRect) } -static inline GFX::rect -rect_to_gfx_rect(const IE::rect& rect) -{ - GFX::rect gfxRect( - rect.x_min, - rect.y_min, - rect.Width(), - rect.Height() - ); - return gfxRect; -} - - -static inline IE::rect -gfx_rect_to_rect(const GFX::rect& rect) -{ - IE::rect IERect = { - rect.x, - rect.y, - (int16)(rect.x + rect.w), - (int16)(rect.y + rect.h) - }; - return IERect; -} - #endif // __RECTUTILS_H diff --git a/timers/Timer.cpp b/timers/Timer.cpp index 86a3e9fb..43717a8c 100644 --- a/timers/Timer.cpp +++ b/timers/Timer.cpp @@ -9,8 +9,8 @@ #include "Timer.h" #include "Log.h" -#include "ResManager.h" +#include #include #include @@ -236,10 +236,6 @@ GameTimer::Expired() const void GameTimer::Add(const char* name, uint32 expirationTime) { - std::string expiration = IDTable::GameTimeAt(expirationTime); - std::cout << "Added timer '" << name << "' which expires in "; - std::cout << expiration << "(" << std::dec << expirationTime; - std::cout << ")" << std::endl; timer_map::iterator i = sTimers.find(name); if (i != sTimers.end()) i->second->SetExpiration(expirationTime);