From b89f6f2eced163e4f9d1520178993470f0018d04 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 21 Mar 2016 21:10:12 +1100 Subject: [PATCH] Moved and renamed terminal_error.* to fatal_error.* --- client/client_application.cpp | 2 +- client/client_application.hpp | 2 +- client/client_utilities/makefile | 32 ------------------- .../terminal_error.cpp => fatal_error.cpp} | 1 + .../terminal_error.hpp => fatal_error.hpp} | 6 ++-- client/makefile | 3 +- client/scenes/splash_screen.cpp | 7 ++-- 7 files changed, 9 insertions(+), 44 deletions(-) delete mode 100644 client/client_utilities/makefile rename client/{client_utilities/terminal_error.cpp => fatal_error.cpp} (94%) rename client/{client_utilities/terminal_error.hpp => fatal_error.hpp} (83%) diff --git a/client/client_application.cpp b/client/client_application.cpp index c657d37..8b2bcd7 100644 --- a/client/client_application.cpp +++ b/client/client_application.cpp @@ -120,7 +120,7 @@ void ClientApplication::Init(int argc, char* argv[]) { else { std::ostringstream msg; msg << "Failed to retrieve window info: " << SDL_GetError(); - throw(msg.str()); + throw(std::runtime_error(msg.str())); } //------------------------- diff --git a/client/client_application.hpp b/client/client_application.hpp index ea560fe..913d3df 100644 --- a/client/client_application.hpp +++ b/client/client_application.hpp @@ -53,7 +53,7 @@ private: SDL_Window* window = nullptr; SDL_Renderer* renderer = nullptr; - //shared parameters + //global scene parameters int clientIndex = -1; int accountIndex = -1; }; \ No newline at end of file diff --git a/client/client_utilities/makefile b/client/client_utilities/makefile deleted file mode 100644 index 803bbcf..0000000 --- a/client/client_utilities/makefile +++ /dev/null @@ -1,32 +0,0 @@ -#config -INCLUDES+=. -LIBS+= -CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES)) - -#source -CXXSRC=$(wildcard *.cpp) - -#objects -OBJDIR=obj -OBJ+=$(addprefix $(OBJDIR)/,$(CXXSRC:.cpp=.o)) - -#output -OUTDIR=.. -OUT=$(addprefix $(OUTDIR)/,client.a) - -#targets -all: $(OBJ) $(OUT) - ar -crs $(OUT) $(OBJ) - -$(OBJ): | $(OBJDIR) - -$(OUT): | $(OUTDIR) - -$(OBJDIR): - mkdir $(OBJDIR) - -$(OUTDIR): - mkdir $(OUTDIR) - -$(OBJDIR)/%.o: %.cpp - $(CXX) $(CXXFLAGS) -c -o $@ $< diff --git a/client/client_utilities/terminal_error.cpp b/client/fatal_error.cpp similarity index 94% rename from client/client_utilities/terminal_error.cpp rename to client/fatal_error.cpp index b113807..c8dba98 100644 --- a/client/client_utilities/terminal_error.cpp +++ b/client/fatal_error.cpp @@ -21,3 +21,4 @@ */ #include "terminal_error.hpp" +//DOCS: This empty file is used to force an object file \ No newline at end of file diff --git a/client/client_utilities/terminal_error.hpp b/client/fatal_error.hpp similarity index 83% rename from client/client_utilities/terminal_error.hpp rename to client/fatal_error.hpp index 0735247..7d3fe49 100644 --- a/client/client_utilities/terminal_error.hpp +++ b/client/fatal_error.hpp @@ -24,8 +24,8 @@ #include #include -class terminal_error: public std::runtime_error { +class fatal_error: public std::runtime_error { public: - explicit terminal_error(const std::string& str): runtime_error(str) {} - explicit terminal_error(const char* cstr): runtime_error(cstr) {} + explicit fatal_error(const std::string& str): runtime_error(str) {} + explicit fatal_error(const char* cstr): runtime_error(cstr) {} }; diff --git a/client/makefile b/client/makefile index de75884..204eff8 100644 --- a/client/makefile +++ b/client/makefile @@ -1,5 +1,5 @@ #include directories -INCLUDES+=. client_utilities entities scenes ../common/debugging ../common/gameplay ../common/graphics ../common/map ../common/network ../common/network/packet_types ../common/ui ../common/utilities +INCLUDES+=. entities scenes ../common/debugging ../common/gameplay ../common/graphics ../common/map ../common/network ../common/network/packet_types ../common/ui ../common/utilities #libraries #the order of the $(LIBS) is important, at least for MinGW @@ -29,7 +29,6 @@ OUT=$(addprefix $(OUTDIR)/,client) #targets all: $(OBJ) $(OUT) - $(MAKE) -C client_utilities $(MAKE) -C entities $(MAKE) -C scenes $(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS) diff --git a/client/scenes/splash_screen.cpp b/client/scenes/splash_screen.cpp index 8be6a34..6cca2a3 100644 --- a/client/scenes/splash_screen.cpp +++ b/client/scenes/splash_screen.cpp @@ -35,15 +35,11 @@ SplashScreen::SplashScreen(SDL_Window* w) { logo.Load(GetRenderer(), ConfigUtility::GetSingleton()["dir.logos"] + "krstudios.png"); -// SDL_SetWindowSize(window, logo.GetClipW(), logo.GetClipH()); -// SDL_RenderSetLogicalSize(GetRenderer(), logo.GetClipW(), logo.GetClipH()); - startTick = std::chrono::steady_clock::now(); } SplashScreen::~SplashScreen() { -// SDL_SetWindowSize(window, windowWidth, windowHeight); -// SDL_RenderSetLogicalSize(GetRenderer(), windowWidth, windowHeight); + // } //------------------------- @@ -58,6 +54,7 @@ void SplashScreen::FrameStart() { } void SplashScreen::RenderFrame(SDL_Renderer* renderer) { + //TODO: version information int w = 0, h = 0; SDL_RenderGetLogicalSize(renderer, &w, &h); logo.DrawTo(renderer, (w - logo.GetClipW()) / 2, (h - logo.GetClipH()) / 2);