table.cpp fix

This commit is contained in:
DepressedTWM 2026-06-01 14:12:17 -04:00
parent 6e7cd26e28
commit 55bbf876f8
3 changed files with 7 additions and 12 deletions

View file

@ -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;
}

View file

@ -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);
}
}

View file

@ -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);