Turned on warnings and fixed
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
#include "log.h"
|
||||
|
||||
#include "render.h"
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <GL/glew.h>
|
||||
|
||||
#define logLevel 4
|
||||
|
||||
void mYughLog(int category, int priority, const char *message,
|
||||
int line, const char *file, ...)
|
||||
void mYughLog(int category, int priority, int line, const char *file, const char *message, ...)
|
||||
{
|
||||
if (priority >= logLevel) {
|
||||
time_t now = time(0);
|
||||
@@ -27,8 +26,7 @@ void mYughLog(int category, int priority, const char *message,
|
||||
snprintf(buffer, ERROR_BUFFER, "LEVEL %d :: %s [ %s:%d ] %s\n",
|
||||
priority, msgbuffer, file, line, dt);
|
||||
|
||||
//SDL_LogMessage(category, priority, buffer);
|
||||
printf(buffer);
|
||||
printf("%s", buffer);
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
@@ -38,19 +36,8 @@ void FlushGLErrors()
|
||||
GLenum glErr = GL_NO_ERROR;
|
||||
glErr = glGetError();
|
||||
while (glErr != GL_NO_ERROR) {
|
||||
YughLog(SDL_LOG_CATEGORY_RENDER, SDL_LOG_PRIORITY_ERROR,
|
||||
YughLog(0, 3,
|
||||
"GL Error: %d", glErr);
|
||||
glErr = glGetError();
|
||||
}
|
||||
}
|
||||
|
||||
int TestSDLError(int sdlErr)
|
||||
{
|
||||
if (sdlErr != 0) {
|
||||
YughLog(0, SDL_LOG_PRIORITY_ERROR, "SDL Error :: %s",
|
||||
SDL_GetError());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user