mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-19 15:01:13 +00:00
minor tweaks.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4455 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
dcc3d4c5d9
commit
cf893a1921
5 changed files with 35 additions and 12 deletions
|
@ -215,6 +215,8 @@ static ftemanifest_t *FS_Manifest_Clone(ftemanifest_t *oldm)
|
||||||
newm->formalname = Z_StrDup(oldm->formalname);
|
newm->formalname = Z_StrDup(oldm->formalname);
|
||||||
if (oldm->protocolname)
|
if (oldm->protocolname)
|
||||||
newm->protocolname = Z_StrDup(oldm->protocolname);
|
newm->protocolname = Z_StrDup(oldm->protocolname);
|
||||||
|
if (oldm->defaultexec)
|
||||||
|
newm->defaultexec = Z_StrDup(oldm->defaultexec);
|
||||||
|
|
||||||
for (i = 0; i < sizeof(newm->gamepath) / sizeof(newm->gamepath[0]); i++)
|
for (i = 0; i < sizeof(newm->gamepath) / sizeof(newm->gamepath[0]); i++)
|
||||||
{
|
{
|
||||||
|
@ -236,15 +238,18 @@ static ftemanifest_t *FS_Manifest_Clone(ftemanifest_t *oldm)
|
||||||
|
|
||||||
void FS_Manifest_Print(ftemanifest_t *man)
|
void FS_Manifest_Print(ftemanifest_t *man)
|
||||||
{
|
{
|
||||||
|
char buffer[1024];
|
||||||
int i, j;
|
int i, j;
|
||||||
if (man->updateurl)
|
if (man->updateurl)
|
||||||
Con_Printf("updateurl \"%s\"\n", man->updateurl);
|
Con_Printf("updateurl \"%s\"\n", COM_QuotedString(man->updateurl, buffer, sizeof(buffer)));
|
||||||
if (man->installation)
|
if (man->installation)
|
||||||
Con_Printf("game \"%s\"\n", man->installation);
|
Con_Printf("game \"%s\"\n", COM_QuotedString(man->installation, buffer, sizeof(buffer)));
|
||||||
if (man->formalname)
|
if (man->formalname)
|
||||||
Con_Printf("name \"%s\"\n", man->formalname);
|
Con_Printf("name \"%s\"\n", COM_QuotedString(man->formalname, buffer, sizeof(buffer)));
|
||||||
if (man->protocolname)
|
if (man->protocolname)
|
||||||
Con_Printf("protocolname \"%s\"\n", man->protocolname);
|
Con_Printf("protocolname \"%s\"\n", COM_QuotedString(man->protocolname, buffer, sizeof(buffer)));
|
||||||
|
if (man->defaultexec)
|
||||||
|
Con_Printf("defaultexec %s\n", COM_QuotedString(man->defaultexec, buffer, sizeof(buffer)));
|
||||||
|
|
||||||
for (i = 0; i < sizeof(man->gamepath) / sizeof(man->gamepath[0]); i++)
|
for (i = 0; i < sizeof(man->gamepath) / sizeof(man->gamepath[0]); i++)
|
||||||
{
|
{
|
||||||
|
@ -322,6 +327,11 @@ static void FS_Manifest_ParseTokens(ftemanifest_t *man)
|
||||||
Z_Free(man->protocolname);
|
Z_Free(man->protocolname);
|
||||||
man->protocolname = Z_StrDup(Cmd_Argv(1));
|
man->protocolname = Z_StrDup(Cmd_Argv(1));
|
||||||
}
|
}
|
||||||
|
else if (!stricmp(fname, "defaultexec"))
|
||||||
|
{
|
||||||
|
Z_Free(man->defaultexec);
|
||||||
|
man->defaultexec = Z_StrDup(Cmd_Argv(1));
|
||||||
|
}
|
||||||
else if (!stricmp(fname, "basegame") || !stricmp(fname, "gamedir"))
|
else if (!stricmp(fname, "basegame") || !stricmp(fname, "gamedir"))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -1613,6 +1613,16 @@ void Plug_Close(plugin_t *plug)
|
||||||
}
|
}
|
||||||
|
|
||||||
Con_Printf("Closing plugin %s\n", plug->name);
|
Con_Printf("Closing plugin %s\n", plug->name);
|
||||||
|
|
||||||
|
//ensure any active contexts provided by the plugin are closed (stuff with destroy callbacks)
|
||||||
|
#if defined(PLUGINS) && !defined(NOMEDIA) && !defined(SERVERONLY)
|
||||||
|
Media_UnregisterDecoder(plug, NULL);
|
||||||
|
Media_UnregisterEncoder(plug, NULL);
|
||||||
|
#endif
|
||||||
|
FS_UnRegisterFileSystemModule(plug);
|
||||||
|
|
||||||
|
//tell the plugin that everything is closed and that it should free up any lingering memory/stuff
|
||||||
|
//it is still allowed to create/have open files.
|
||||||
if (plug->shutdown)
|
if (plug->shutdown)
|
||||||
{
|
{
|
||||||
plugin_t *cp = currentplug;
|
plugin_t *cp = currentplug;
|
||||||
|
@ -1620,13 +1630,10 @@ void Plug_Close(plugin_t *plug)
|
||||||
VM_Call(plug->vm, plug->shutdown);
|
VM_Call(plug->vm, plug->shutdown);
|
||||||
currentplug = cp;
|
currentplug = cp;
|
||||||
}
|
}
|
||||||
#if defined(PLUGINS) && !defined(NOMEDIA) && !defined(SERVERONLY)
|
|
||||||
Media_UnregisterDecoder(plug, NULL);
|
|
||||||
Media_UnregisterEncoder(plug, NULL);
|
|
||||||
#endif
|
|
||||||
FS_UnRegisterFileSystemModule(plug);
|
|
||||||
VM_Destroy(plug->vm);
|
VM_Destroy(plug->vm);
|
||||||
|
|
||||||
|
//make sure anything else that was left is unlinked (stuff without destroy callbacks).
|
||||||
for (i = 0; i < pluginstreamarraylen; i++)
|
for (i = 0; i < pluginstreamarraylen; i++)
|
||||||
{
|
{
|
||||||
if (pluginstreamarray[i].plugin == plug)
|
if (pluginstreamarray[i].plugin == plug)
|
||||||
|
|
|
@ -65,7 +65,9 @@ uniform sampler2D s_t1; //lightmap0
|
||||||
#if defined(BUMP) && (defined(OFFSETMAPPING) || defined(DELUXE) || defined(SPECULAR))
|
#if defined(BUMP) && (defined(OFFSETMAPPING) || defined(DELUXE) || defined(SPECULAR))
|
||||||
uniform sampler2D s_t2; //normal.rgb+height.a
|
uniform sampler2D s_t2; //normal.rgb+height.a
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef DELUXE
|
||||||
uniform sampler2D s_t3; //deluxe0
|
uniform sampler2D s_t3; //deluxe0
|
||||||
|
#endif
|
||||||
#ifdef FULLBRIGHT
|
#ifdef FULLBRIGHT
|
||||||
uniform sampler2D s_t4; //fullbright
|
uniform sampler2D s_t4; //fullbright
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -237,7 +237,8 @@ static void *Dec_DisplayFrame(void *vctx, qboolean nosound, enum uploadfmt_e *fm
|
||||||
static void Dec_Destroy(void *vctx)
|
static void Dec_Destroy(void *vctx)
|
||||||
{
|
{
|
||||||
decctx *ctx = (decctx*)vctx;
|
decctx *ctx = (decctx*)vctx;
|
||||||
ctx->wnd->destroy();
|
if (inited) //make sure things don't happen in the wrong order. we can still leak though
|
||||||
|
ctx->wnd->destroy();
|
||||||
delete ctx;
|
delete ctx;
|
||||||
}
|
}
|
||||||
static void Dec_GetSize (void *vctx, int *width, int *height)
|
static void Dec_GetSize (void *vctx, int *width, int *height)
|
||||||
|
@ -412,6 +413,7 @@ static qintptr_t Dec_Shutdown(qintptr_t *args)
|
||||||
|
|
||||||
static media_decoder_funcs_t decoderfuncs =
|
static media_decoder_funcs_t decoderfuncs =
|
||||||
{
|
{
|
||||||
|
"berkelium",
|
||||||
Dec_Create,
|
Dec_Create,
|
||||||
Dec_DisplayFrame,
|
Dec_DisplayFrame,
|
||||||
NULL,//doneframe
|
NULL,//doneframe
|
||||||
|
@ -434,8 +436,8 @@ extern "C" qintptr_t Plug_Init(qintptr_t *args)
|
||||||
}
|
}
|
||||||
if (!Plug_Export("Shutdown", Dec_Shutdown))
|
if (!Plug_Export("Shutdown", Dec_Shutdown))
|
||||||
{
|
{
|
||||||
Con_Printf("Berkelium plugin warning: Engine doesn't support Shutdown feature\n");
|
Con_Printf("Berkelium plugin failed: Engine doesn't support Shutdown feature\n");
|
||||||
// return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Plug_ExportNative("Media_VideoDecoder", &decoderfuncs))
|
if (!Plug_ExportNative("Media_VideoDecoder", &decoderfuncs))
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@ typedef enum uploadfmt_e
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
char *drivername;
|
||||||
void *(QDECL *createdecoder)(char *name); //needed
|
void *(QDECL *createdecoder)(char *name); //needed
|
||||||
void *(QDECL *decodeframe)(void *ctx, qboolean nosound, uploadfmt_t *fmt, int *width, int *height); //needed
|
void *(QDECL *decodeframe)(void *ctx, qboolean nosound, uploadfmt_t *fmt, int *width, int *height); //needed
|
||||||
void (QDECL *doneframe)(void *ctx, void *img); //basically a free()
|
void (QDECL *doneframe)(void *ctx, void *img); //basically a free()
|
||||||
|
@ -26,6 +27,7 @@ typedef struct
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
char *drivername;
|
||||||
void *(QDECL *capture_begin) (char *streamname, int videorate, int width, int height, int *sndkhz, int *sndchannels, int *sndbits);
|
void *(QDECL *capture_begin) (char *streamname, int videorate, int width, int height, int *sndkhz, int *sndchannels, int *sndbits);
|
||||||
void (QDECL *capture_video) (void *ctx, void *data, int frame, int width, int height);
|
void (QDECL *capture_video) (void *ctx, void *data, int frame, int width, int height);
|
||||||
void (QDECL *capture_audio) (void *ctx, void *data, int bytes);
|
void (QDECL *capture_audio) (void *ctx, void *data, int bytes);
|
||||||
|
|
Loading…
Reference in a new issue