diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index bada6de3d..a3162dd1c 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -9103,6 +9103,8 @@ enum T_DEFINESOUND, T_INCLUDEDEFAULT, + + T_RENAMEFILE, }; static int32_t parsegroupfiles(scriptfile *script); @@ -9139,7 +9141,8 @@ static int32_t parsegroupfiles(scriptfile *script) { "includedefault", T_INCLUDEDEFAULT }, { "#includedefault", T_INCLUDEDEFAULT }, { "loadgrp", T_LOADGRP }, - { "noautoload", T_NOAUTOLOAD } + { "noautoload", T_NOAUTOLOAD }, + { "renamefile", T_RENAMEFILE }, }; while (1) @@ -9187,6 +9190,16 @@ static int32_t parsegroupfiles(scriptfile *script) case T_NOAUTOLOAD: NoAutoLoad = 1; break; + case T_RENAMEFILE: + { + int32_t crcval = 0, filenum = -1; + char *newname = NULL; + if (scriptfile_getnumber(script,&crcval)) break; + if (scriptfile_getnumber(script,&filenum)) break; + if (scriptfile_getstring(script,&newname)) break; + krename(crcval, filenum, newname); + } + break; case T_EOF: return(0); default: diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index a47fdc41b..1d9a44300 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -231,7 +231,8 @@ enum gametokens T_ANIMSOUNDS, T_NOFLOORPALRANGE, T_ID, - T_DELAY + T_DELAY, + T_RENAMEFILE, }; @@ -9492,6 +9493,7 @@ static int32_t parsedefinitions_game(scriptfile *script, int32_t preload) { "sound", T_SOUND }, { "cutscene", T_CUTSCENE }, { "animsounds", T_ANIMSOUNDS }, + { "renamefile", T_RENAMEFILE }, }; static const tokenlist sound_musictokens[] = @@ -9797,6 +9799,16 @@ static int32_t parsedefinitions_game(scriptfile *script, int32_t preload) } } break; + case T_RENAMEFILE: + { + int32_t crcval = 0, filenum = -1; + char *newname = NULL; + if (scriptfile_getnumber(script,&crcval)) break; + if (scriptfile_getnumber(script,&filenum)) break; + if (scriptfile_getstring(script,&newname)) break; + krename(crcval, filenum, newname); + } + break; case T_EOF: return(0); default: