Commit 61df0986 authored by deuce's avatar deuce
Browse files

Better attempt to fix taskmanager appname...

Add new ciolib_appname and call SDL_RegisterApp(ciolib_appname, 0, NULL)
when the symbols are loaded.
parent 47a443bf
......@@ -15,7 +15,7 @@
#define DIR_SEPERATOR TEXT("/")
#include <direct.h>
#include "SDL_main.h" /* SDL_RegisterApp() which sets program name... */
#include "ciolib.h" /* ciolib_appname */
/* Parse a command line buffer into arguments */
static int ParseCommandLine(char *cmdline, char **argv)
......@@ -95,8 +95,7 @@ static int console_main(int argc, char *argv[], char **env)
}
strncpy(bufp, appname, n);
bufp[n] = '\0';
appname = bufp;
SDL_RegisterApp(appname, 0, NULL);
ciolib_appname = bufp;
/* Run the application main() code */
n=CIOLIB_main(argc, argv);
......
......@@ -81,6 +81,7 @@ CIOLIBEXPORT int hold_update=0;
CIOLIBEXPORT int puttext_can_move=0;
CIOLIBEXPORT int ciolib_xlat=0;
CIOLIBEXPORT int ciolib_reaper=TRUE;
CIOLIBEXPORT char *ciolib_appname=NULL;
static int initialized=0;
CIOLIBEXPORT int CIOLIBCALL ciolib_movetext(int sx, int sy, int ex, int ey, int dx, int dy);
......
......@@ -379,6 +379,7 @@ CIOLIBEXPORTVAR int ciolib_xlat;
#define CIOLIB_XLAT_ALL (CIOLIB_XLAT_CHARS | CIOLIB_XLAT_ATTR)
CIOLIBEXPORTVAR int ciolib_reaper;
CIOLIBEXPORTVAR char *ciolib_appname;
#define _conio_kbhit() kbhit()
......
......@@ -16,6 +16,8 @@ struct sdlfuncs sdl;
#endif
#include <xp_dl.h>
#include "ciolib.h"
static int sdl_funcs_loaded=0;
static int sdl_initialized=0;
static int sdl_audio_initialized=0;
......@@ -228,6 +230,12 @@ int load_sdl_funcs(struct sdlfuncs *sdlf)
xp_dlclose(sdl_dll);
return(-1);
}
{
int (HACK_HACK_HACK *ra)(char *name, Uint32 style, void *hInst);
if ((ra = xp_dlsym(sdl_dll, SDL_RegisterApp)) != NULL) {
ra(ciolib_appname, 0, NULL);
}
}
sdlf->gotfuncs=1;
sdl_funcs_loaded=1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment