Wolfenstein 3D:

- Fixed hang when saving game: now save and settings are saved by default in "/tmp0/1/wolf4sdl"
 - Now the --configdir parameter works

git-svn-id: svn://kolibrios.org@8655 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat 2021-03-31 18:43:18 +00:00
parent e7db44fecc
commit 9d6221ab7a
4 changed files with 33 additions and 22 deletions

View File

@ -1,5 +1,5 @@
/// JOYSTICK STUB FOR Wolfenstein 3D port to KolibriOS /// 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++ */ /* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
@ -147,9 +147,6 @@ typedef struct _SDL_Joystick SDL_Joystick;
*/ */
void SDL_JoystickClose(SDL_Joystick *joystick){}; void SDL_JoystickClose(SDL_Joystick *joystick){};
bool mkdir(const char* dir){};
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -1,15 +1,21 @@
#include <SDL.h>
#include <kos32sys.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h>
#include "../../kolibri-libc/source/include/ksys.h"
void kolibri_set_win_center() void kolibri_set_win_center()
{ {
struct proc_info *info = (struct proc_info*)malloc(sizeof(struct proc_info)); ksys_proc_table_t *info = (ksys_proc_table_t*)malloc(sizeof(ksys_proc_table_t));
get_proc_info((char*)info); _ksys_process_info(info, -1);
pos_t screen_size= max_screen_size(); ksys_pos_t screen_size= _ksys_screen_size();
int new_x = screen_size.x/2-info->width/2; int new_x = screen_size.x/2-info->winx_size/2;
int new_y = screen_size.y/2-info->height/2; int new_y = screen_size.y/2-info->winy_size/2;
sys_change_window(new_x,new_y, -1, -1); _ksys_change_window(new_x, new_y, -1, -1);
free(info); free(info);
} }
int mkdir(const char * path, unsigned)
{
return _ksys_mkdir(path);
}

View File

@ -1887,7 +1887,7 @@ void CheckParameters(int argc, char *argv[])
{ {
if(hasError) printf("\n"); if(hasError) printf("\n");
printf( printf(
"Wolf4SDL v1.7 ($Revision$)\n" "Wolf4SDL v1.7\n"
"Ported by Chaos-Software (http://www.chaos-software.de.vu)\n" "Ported by Chaos-Software (http://www.chaos-software.de.vu)\n"
#ifdef _KOLIBRI #ifdef _KOLIBRI
"Ported for KolibriOS by 'turbocat2001' and 'maxcodehack'\n" "Ported for KolibriOS by 'turbocat2001' and 'maxcodehack'\n"
@ -1928,6 +1928,10 @@ void CheckParameters(int argc, char *argv[])
" --configdir <dir> Directory where config file and save games are stored\n" " --configdir <dir> Directory where config file and save games are stored\n"
#if defined(_arch_dreamcast) || defined(_WIN32) #if defined(_arch_dreamcast) || defined(_WIN32)
" (default: current directory)\n" " (default: current directory)\n"
#endif
#ifdef _KOLIBRI
" (default: /tmp0/1/wolf4sdl)\n"
#else #else
" (default: $HOME/.wolf4sdl)\n" " (default: $HOME/.wolf4sdl)\n"
#endif #endif

View File

@ -3989,11 +3989,14 @@ void
CheckForEpisodes (void) CheckForEpisodes (void)
{ {
struct stat statbuf; struct stat statbuf;
/*
// On Linux like systems, the configdir defaults to $HOME/.wolf4sdl // 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) if(configdir[0] == 0)
{ {
#ifdef _KOLIBRI
strcpy(configdir, "/tmp0/1/wolf4sdl");
#else
// Set config location to home directory for multi-user support // Set config location to home directory for multi-user support
char *homedir = getenv("HOME"); char *homedir = getenv("HOME");
if(homedir == NULL) if(homedir == NULL)
@ -4006,8 +4009,9 @@ CheckForEpisodes (void)
Quit("Your $HOME directory path is too long. It cannot be used for saving games."); Quit("Your $HOME directory path is too long. It cannot be used for saving games.");
} }
snprintf(configdir, sizeof(configdir), "%s" WOLFDIR, homedir); snprintf(configdir, sizeof(configdir), "%s" WOLFDIR, homedir);
#endif
} }
#endif*/ #endif
if(configdir[0] != 0) if(configdir[0] != 0)
{ {