Moved and renamed terminal_error.* to fatal_error.*

This commit is contained in:
2016-03-21 21:10:12 +11:00
parent 5f0cf826d4
commit b89f6f2ece
7 changed files with 9 additions and 44 deletions
+1 -1
View File
@@ -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()));
}
//-------------------------
+1 -1
View File
@@ -53,7 +53,7 @@ private:
SDL_Window* window = nullptr;
SDL_Renderer* renderer = nullptr;
//shared parameters
//global scene parameters
int clientIndex = -1;
int accountIndex = -1;
};
-32
View File
@@ -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 $@ $<
@@ -21,3 +21,4 @@
*/
#include "terminal_error.hpp"
//DOCS: This empty file is used to force an object file
@@ -24,8 +24,8 @@
#include <stdexcept>
#include <string>
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) {}
};
+1 -2
View File
@@ -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)
+2 -5
View File
@@ -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);