diff --git a/src/screen.cpp b/src/screen.cpp index 6c8d959..896d877 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -34,8 +34,7 @@ int screenMain(Config &conf){ win = SDL_CreateWindow("The Journal", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SDL_WINDOW_RESIZABLE | SDL_WINDOW_TRANSPARENT); if (!win){ - snprintf(msg, sizeof msg, "Error creating window: %s", SDL_GetError()); - crash(msg, Exception::MEOW, false); + crash(Exception::MEOW, "Error creating window: %s", SDL_GetError()); return 0; } diff --git a/src/shader.cpp b/src/shader.cpp index 177ef64..22f28ec 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -142,7 +142,6 @@ static void setupShaderSource(GLuint shader, GLenum type, const unsigned char *b void Shader::init(const unsigned char *vert, int vertSize, const unsigned char *frag, int fragSize, const char *vertName, const char *fragName, const char *programName) { GLint success; - char msg[512]; /* Compile vertex shader */ setupShaderSource(vertShader, GL_VERTEX_SHADER, vert, vertSize); @@ -152,8 +151,7 @@ void Shader::init(const unsigned char *vert, int vertSize, const unsigned char * if (!success){ printShaderLog(vertShader); - snprintf(msg, sizeof msg, "GLSL: An error occured while compiling vertex shader '%s' in program '%s'", vertName, programName); - crash(msg, Exception::MKXPError ,true); + crash(Exception::MKXPError, "GLSL: An error occured while compiling vertex shader '%s' in program '%s'", vertName, programName); } /* Compile fragment shader */ @@ -164,8 +162,7 @@ void Shader::init(const unsigned char *vert, int vertSize, const unsigned char * if (!success){ printShaderLog(fragShader); - snprintf(msg, sizeof msg, "GLSL: An error occured while compiling fragment shader '%s' in program '%s'", fragName, programName); - crash(msg, Exception::MKXPError, true); + crash(Exception::MKXPError, "GLSL: An error occured while compiling fragment shader '%s' in program '%s'", fragName, programName); } /* Link shader program */ @@ -182,8 +179,7 @@ void Shader::init(const unsigned char *vert, int vertSize, const unsigned char * if (!success){ printProgramLog(program); - snprintf(msg, sizeof msg, "GLSL: An error occured while linking program '%s' (vertex '%s', fragment '%s')", programName, vertName, fragName); - crash(msg, Exception::MKXPError, true); + crash(Exception::MKXPError, "GLSL: An error occured while linking program '%s' (vertex '%s', fragment '%s')", programName, vertName, fragName); } } diff --git a/src/table.cpp b/src/table.cpp index 9f1e6c9..481b393 100644 --- a/src/table.cpp +++ b/src/table.cpp @@ -114,7 +114,7 @@ void Table::serialize(char *buffer) const{ Table *Table::deserialize(const char *data, int len){ if (len < 20) - crash("Marshal: Table: bad file format", Exception::RGSSError, true); + crash(Exception::RGSSError, "Marshal: Table: bad file format"); readInt32(&data); int x = readInt32(&data); @@ -123,10 +123,10 @@ Table *Table::deserialize(const char *data, int len){ int size = readInt32(&data); if (size != x*y*z) - crash("Marshal: Table: bad file format", Exception::RGSSError, true); + crash(Exception::RGSSError, "Marshal: Table: bad file format"); if (len != 20 + x*y*z*2) - crash("Marshal: Table: bad file format", Exception::RGSSError, true); + crash(Exception::RGSSError, "Marshal: Table: bad file format"); Table *t = new Table(x, y, z); memcpy(dataPtr(t->data), data, sizeof(int16_t)*size);