diff --git a/contrib/games/wolf3d/joystick_stub.cpp b/contrib/games/wolf3d/joystick_stub.cpp index 4c03ee97ff..6c0a3644d0 100755 --- a/contrib/games/wolf3d/joystick_stub.cpp +++ b/contrib/games/wolf3d/joystick_stub.cpp @@ -1,5 +1,5 @@ /// JOYSTICK STUB FOR Wolfenstein 3D port to KolibriOS -/// Ported by maxcodehack +/// Ported by maxcodehack and turbocat2001 /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus @@ -147,9 +147,6 @@ typedef struct _SDL_Joystick SDL_Joystick; */ void SDL_JoystickClose(SDL_Joystick *joystick){}; - -bool mkdir(const char* dir){}; - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/contrib/games/wolf3d/kolibri.cpp b/contrib/games/wolf3d/kolibri.cpp index 9128921b58..ee1abb72bb 100644 --- a/contrib/games/wolf3d/kolibri.cpp +++ b/contrib/games/wolf3d/kolibri.cpp @@ -1,15 +1,21 @@ -#include -#include #include - +#include +#include "../../kolibri-libc/source/include/ksys.h" + void kolibri_set_win_center() { - struct proc_info *info = (struct proc_info*)malloc(sizeof(struct proc_info)); - get_proc_info((char*)info); - - pos_t screen_size= max_screen_size(); - int new_x = screen_size.x/2-info->width/2; - int new_y = screen_size.y/2-info->height/2; - sys_change_window(new_x,new_y, -1, -1); + ksys_proc_table_t *info = (ksys_proc_table_t*)malloc(sizeof(ksys_proc_table_t)); + _ksys_process_info(info, -1); + + ksys_pos_t screen_size= _ksys_screen_size(); + int new_x = screen_size.x/2-info->winx_size/2; + int new_y = screen_size.y/2-info->winy_size/2; + _ksys_change_window(new_x, new_y, -1, -1); free(info); } + +int mkdir(const char * path, unsigned) +{ + return _ksys_mkdir(path); +} + diff --git a/contrib/games/wolf3d/wl_main.cpp b/contrib/games/wolf3d/wl_main.cpp index efff1c0338..f0ac5c561c 100755 --- a/contrib/games/wolf3d/wl_main.cpp +++ b/contrib/games/wolf3d/wl_main.cpp @@ -1887,7 +1887,7 @@ void CheckParameters(int argc, char *argv[]) { if(hasError) printf("\n"); printf( - "Wolf4SDL v1.7 ($Revision$)\n" + "Wolf4SDL v1.7\n" "Ported by Chaos-Software (http://www.chaos-software.de.vu)\n" #ifdef _KOLIBRI "Ported for KolibriOS by 'turbocat2001' and 'maxcodehack'\n" @@ -1902,10 +1902,10 @@ void CheckParameters(int argc, char *argv[]) " --normal Sets the difficulty to normal for tedlevel\n" " --hard Sets the difficulty to hard for tedlevel\n" " --nowait Skips intro screens\n" - #ifndef _KOLIBRI + #ifndef _KOLIBRI " --windowed[-mouse] Starts the game in a window [and grabs mouse]\n" " --res Sets the screen resolution\n" - #endif + #endif " (must be multiple of 320x200 or 320x240)\n" " --resf Sets any screen resolution >= 320x200\n" " (which may result in graphic errors)\n" @@ -1915,11 +1915,11 @@ void CheckParameters(int argc, char *argv[]) " --nodblbuf Don't use SDL's double buffering\n" " --extravbls Sets a delay after each frame, which may help to\n" " reduce flickering (unit is currently 8 ms, default: 0)\n" - #ifndef _KOLIBRI + #ifndef _KOLIBRI " --joystick Use the index-th joystick if available\n" " (-1 to disable joystick, default: 0)\n" " --joystickhat Enables movement with the given coolie hat\n" - #endif + #endif " --samplerate Sets the sound sample rate (given in Hz, default: %i)\n" " --audiobuffer Sets the size of the audio buffer (-> sound latency)\n" " (given in bytes, default: 2048 / (44100 / samplerate))\n" @@ -1928,6 +1928,10 @@ void CheckParameters(int argc, char *argv[]) " --configdir Directory where config file and save games are stored\n" #if defined(_arch_dreamcast) || defined(_WIN32) " (default: current directory)\n" +#endif + +#ifdef _KOLIBRI + " (default: /tmp0/1/wolf4sdl)\n" #else " (default: $HOME/.wolf4sdl)\n" #endif diff --git a/contrib/games/wolf3d/wl_menu.cpp b/contrib/games/wolf3d/wl_menu.cpp index d3c129143e..e2a3b1bfef 100755 --- a/contrib/games/wolf3d/wl_menu.cpp +++ b/contrib/games/wolf3d/wl_menu.cpp @@ -3989,11 +3989,14 @@ void CheckForEpisodes (void) { struct stat statbuf; -/* + // On Linux like systems, the configdir defaults to $HOME/.wolf4sdl -#if !defined(_WIN32) && !defined(_arch_dreamcast) + #if !defined(_WIN32) && !defined(_arch_dreamcast) if(configdir[0] == 0) { + #ifdef _KOLIBRI + strcpy(configdir, "/tmp0/1/wolf4sdl"); + #else // Set config location to home directory for multi-user support char *homedir = getenv("HOME"); if(homedir == NULL) @@ -4006,8 +4009,9 @@ CheckForEpisodes (void) Quit("Your $HOME directory path is too long. It cannot be used for saving games."); } snprintf(configdir, sizeof(configdir), "%s" WOLFDIR, homedir); + #endif } -#endif*/ +#endif if(configdir[0] != 0) {