diff --git a/console.c b/console.c index d41c75c..961797f 100644 --- a/console.c +++ b/console.c @@ -75,13 +75,13 @@ char **consoleGetCommand(const char *string) { i++; current_char = string[i]; } - command_array[0] = (void*)(intptr_t)(j-1); + command_array[0] = (void*)(size_t)(j-1); return command_array; } void consoleFreeCommand(char **command_array) { int j; - for (j = 1; j < (intptr_t)command_array[0]+1; j++) { + for (j = 1; j < (size_t)command_array[0]+1; j++) { free(command_array[j]); } free(command_array); @@ -94,13 +94,13 @@ void consoleProcessCommand(const char *command_string) { if (console_commands_table[command_hash]) { // BUG: command count has to be +10 ??? FIXME char test[12]; -itoa((intptr_t)command[0], test, 10); +itoa((size_t)command[0], test, 10); consoleLog(test); - if ((intptr_t)command[0] == 1) { // no arguments + if ((size_t)command[0] == 1) { // no arguments (*console_commands_table[command_hash])(NULL); - } else if ((intptr_t)command[0] == 2) { // 1 arg + } else if ((size_t)command[0] == 2) { // 1 arg (*console_commands_table[command_hash])(command[2]); - } else if ((intptr_t)command[0] == 3) { // 2 args + } else if ((size_t)command[0] == 3) { // 2 args (*console_commands_table[command_hash])(command[2], command[3]); } } else { diff --git a/interface/sdl.c b/interface/sdl.c index 550ecb9..3572a6b 100644 --- a/interface/sdl.c +++ b/interface/sdl.c @@ -142,6 +142,11 @@ void interfaceLoop() { break; } break; + case SDL_VIDEORESIZE: + video_width = event.resize.w; + video_height = event.resize.h; + interfaceVideoSet(); + break; } if (stop_while) break; @@ -290,7 +295,7 @@ if(!Surface || !Width || !Height) } int interfaceVideoSet() { - if ((screen = SDL_SetVideoMode(video_width, video_height, 32, SDL_SWSURFACE|video_mode)) == NULL) { + if ((screen = SDL_SetVideoMode(video_width, video_height, 32, SDL_SWSURFACE|SDL_RESIZABLE|video_mode)) == NULL) { return ERROR; } camera_surface = SDL_CreateRGBSurface(screen->flags, screen->w, screen->h, screen->format->BitsPerPixel, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask);