From: DeaDDooMER Date: Wed, 29 Mar 2023 14:43:48 +0000 (+0300) Subject: system: add option --game-wad and --edtor-wad X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=b25c721e3267a53d72f32b1d33561b3c962bb663;p=d2df-editor.git system: add option --game-wad and --edtor-wad --- diff --git a/src/editor/Editor.lpr b/src/editor/Editor.lpr index 052fbb8..b96ed23 100644 --- a/src/editor/Editor.lpr +++ b/src/editor/Editor.lpr @@ -97,6 +97,22 @@ uses Inc(i); CfgFileName := ParamStr(i); end; + end + else if p = '--game-wad' then + begin + if i + 1 <= ParamCount then + begin + Inc(i); + GameWad := ParamStr(i); + end; + end + else if p = '--editor-wad' then + begin + if i + 1 <= ParamCount then + begin + Inc(i); + EditorWad := ParamStr(i); + end; end; Inc(i); end; @@ -138,6 +154,8 @@ begin EditorDir := ExtractFilePath(Application.ExeName); CfgFileName := EditorDir + DirectorySeparator + 'Editor.cfg'; + GameWad := EditorDir + DirectorySeparator + 'data' + DirectorySeparator + 'game.wad'; + EditorWad := EditorDir + DirectorySeparator + 'data' + DirectorySeparator + 'editor.wad'; CheckParamOptions; InitLogs; diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 34a7287..22d9877 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -2617,10 +2617,10 @@ var config: TConfig; begin ID := 0; - g_ReadResource(EditorDir + 'data/game.wad', 'FONTS', cfgres, cfgdata, cfglen); + g_ReadResource(GameWad, 'FONTS', cfgres, cfgdata, cfglen); if cfgdata <> nil then begin - if not g_CreateTextureWAD('FONT_STD', EditorDir + 'data/game.wad:FONTS\' + texture) then + if not g_CreateTextureWAD('FONT_STD', GameWad + ':FONTS\' + texture) then e_WriteLog('ERROR ERROR ERROR', MSG_WARNING); config := TConfig.CreateMem(cfgdata, cfglen); diff --git a/src/editor/g_map.pas b/src/editor/g_map.pas index 6c6f191..792f258 100644 --- a/src/editor/g_map.pas +++ b/src/editor/g_map.pas @@ -246,7 +246,7 @@ implementation uses BinEditor, g_textures, Dialogs, SysUtils, CONFIG, f_main, - Forms, Math, f_addresource_texture, WADEDITOR, g_language, g_resources; + Forms, Math, f_addresource_texture, WADEDITOR, g_language, g_resources, g_options; const OLD_ITEM_MEDKIT_SMALL = 1; @@ -2823,79 +2823,79 @@ end; procedure LoadData(); begin - g_CreateTextureWAD('PREVIEW', EditorDir+'data/editor.wad:TEXTURES\CHECKERS'); - g_CreateTextureWAD('NOTEXTURE', EditorDir+'data/game.wad:TEXTURES\NOTEXTURE'); - - g_CreateTextureWADSize('AREA_REDFLAG', EditorDir+'data/game.wad:TEXTURES\FLAGRED', 0, 0, 64, 64); - g_CreateTextureWADSize('AREA_BLUEFLAG', EditorDir+'data/game.wad:TEXTURES\FLAGBLUE', 0, 0, 64, 64); - g_CreateTextureWADSize('AREA_DOMFLAG', EditorDir+'data/game.wad:TEXTURES\FLAGDOM', 0, 0, 64, 64); - - g_CreateTextureWADSize('MONSTER_DEMON', EditorDir+'data/game.wad:MTEXTURES\DEMON_SLEEP', 0, 0, 64, 64); - g_CreateTextureWADSize('MONSTER_IMP', EditorDir+'data/game.wad:MTEXTURES\IMP_SLEEP', 0, 0, 64, 64); - g_CreateTextureWADSize('MONSTER_ZOMBY', EditorDir+'data/game.wad:MTEXTURES\ZOMBY_SLEEP', 0, 0, 64, 64); - g_CreateTextureWADSize('MONSTER_SERG', EditorDir+'data/game.wad:MTEXTURES\SERG_SLEEP', 0, 0, 64, 64); - g_CreateTextureWADSize('MONSTER_CYBER', EditorDir+'data/game.wad:MTEXTURES\CYBER_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_CGUN', EditorDir+'data/game.wad:MTEXTURES\CGUN_SLEEP', 0, 0, 64, 64); - g_CreateTextureWADSize('MONSTER_BARON', EditorDir+'data/game.wad:MTEXTURES\BARON_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_KNIGHT', EditorDir+'data/game.wad:MTEXTURES\KNIGHT_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_CACO', EditorDir+'data/game.wad:MTEXTURES\CACO_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_SOUL', EditorDir+'data/game.wad:MTEXTURES\SOUL_SLEEP', 0, 0, 64, 64); - g_CreateTextureWADSize('MONSTER_PAIN', EditorDir+'data/game.wad:MTEXTURES\PAIN_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_SPIDER', EditorDir+'data/game.wad:MTEXTURES\SPIDER_SLEEP', 0, 0, 256, 128); - g_CreateTextureWADSize('MONSTER_BSP', EditorDir+'data/game.wad:MTEXTURES\BSP_SLEEP', 0, 0, 128, 64); - g_CreateTextureWADSize('MONSTER_MANCUB', EditorDir+'data/game.wad:MTEXTURES\MANCUB_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_SKEL', EditorDir+'data/game.wad:MTEXTURES\SKEL_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_VILE', EditorDir+'data/game.wad:MTEXTURES\VILE_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_FISH', EditorDir+'data/game.wad:MTEXTURES\FISH_SLEEP', 0, 0, 32, 32); - g_CreateTextureWADSize('MONSTER_BARREL', EditorDir+'data/game.wad:MTEXTURES\BARREL_SLEEP', 0, 0, 64, 64); - g_CreateTextureWADSize('MONSTER_ROBO', EditorDir+'data/game.wad:MTEXTURES\ROBO_SLEEP', 0, 0, 128, 128); - g_CreateTextureWADSize('MONSTER_MAN', EditorDir+'data/game.wad:MTEXTURES\MAN_SLEEP', 0, 0, 64, 64); - - g_CreateTextureWADSize('ITEM_BLUESPHERE', EditorDir+'data/game.wad:TEXTURES\SBLUE', 0, 0, 32, 32); - g_CreateTextureWADSize('ITEM_WHITESPHERE', EditorDir+'data/game.wad:TEXTURES\SWHITE', 0, 0, 32, 32); - g_CreateTextureWADSize('ITEM_ARMORGREEN', EditorDir+'data/game.wad:TEXTURES\ARMORGREEN', 0, 0, 32, 16); - g_CreateTextureWADSize('ITEM_ARMORBLUE', EditorDir+'data/game.wad:TEXTURES\ARMORBLUE', 0, 0, 32, 16); - g_CreateTextureWADSize('ITEM_INVUL', EditorDir+'data/game.wad:TEXTURES\INVUL', 0, 0, 32, 32); - g_CreateTextureWADSize('ITEM_BOTTLE', EditorDir+'data/game.wad:TEXTURES\BOTTLE', 0, 0, 16, 32); - g_CreateTextureWADSize('ITEM_HELMET', EditorDir+'data/game.wad:TEXTURES\HELMET', 0, 0, 16, 16); - g_CreateTextureWADSize('ITEM_JETPACK', EditorDir+'data/game.wad:TEXTURES\JETPACK', 0, 0, 32, 32); - g_CreateTextureWADSize('ITEM_INVIS', EditorDir+'data/game.wad:TEXTURES\INVIS', 0, 0, 32, 32); - g_CreateTextureWADSize('ITEM_WEAPON_FLAMETHROWER', EditorDir+'data/game.wad:TEXTURES\FLAMETHROWER', 0, 0, 64, 32); - g_CreateTextureWADSize('ITEM_AMMO_FUELCAN', EditorDir+'data/game.wad:TEXTURES\FUELCAN', 0, 0, 16, 32); - - g_CreateTextureWAD('ITEM_MEDKIT_SMALL', EditorDir+'data/game.wad:TEXTURES\MED1'); - g_CreateTextureWAD('ITEM_MEDKIT_LARGE', EditorDir+'data/game.wad:TEXTURES\MED2'); - g_CreateTextureWAD('ITEM_WEAPON_SAW', EditorDir+'data/game.wad:TEXTURES\SAW'); - g_CreateTextureWAD('ITEM_WEAPON_PISTOL', EditorDir+'data/game.wad:TEXTURES\PISTOL'); - g_CreateTextureWAD('ITEM_WEAPON_KASTET', EditorDir+'data/game.wad:TEXTURES\KASTET'); - g_CreateTextureWAD('ITEM_WEAPON_SHOTGUN1', EditorDir+'data/game.wad:TEXTURES\SHOTGUN1'); - g_CreateTextureWAD('ITEM_WEAPON_SHOTGUN2', EditorDir+'data/game.wad:TEXTURES\SHOTGUN2'); - g_CreateTextureWAD('ITEM_WEAPON_CHAINGUN', EditorDir+'data/game.wad:TEXTURES\MGUN'); - g_CreateTextureWAD('ITEM_WEAPON_ROCKETLAUNCHER', EditorDir+'data/game.wad:TEXTURES\RLAUNCHER'); - g_CreateTextureWAD('ITEM_WEAPON_PLASMA', EditorDir+'data/game.wad:TEXTURES\PGUN'); - g_CreateTextureWAD('ITEM_WEAPON_BFG', EditorDir+'data/game.wad:TEXTURES\BFG'); - g_CreateTextureWAD('ITEM_WEAPON_SUPERPULEMET', EditorDir+'data/game.wad:TEXTURES\SPULEMET'); - g_CreateTextureWAD('ITEM_AMMO_BULLETS', EditorDir+'data/game.wad:TEXTURES\CLIP'); - g_CreateTextureWAD('ITEM_AMMO_BULLETS_BOX', EditorDir+'data/game.wad:TEXTURES\AMMO'); - g_CreateTextureWAD('ITEM_AMMO_SHELLS', EditorDir+'data/game.wad:TEXTURES\SHELL1'); - g_CreateTextureWAD('ITEM_AMMO_SHELLS_BOX', EditorDir+'data/game.wad:TEXTURES\SHELL2'); - g_CreateTextureWAD('ITEM_AMMO_ROCKET', EditorDir+'data/game.wad:TEXTURES\ROCKET'); - g_CreateTextureWAD('ITEM_AMMO_ROCKET_BOX', EditorDir+'data/game.wad:TEXTURES\ROCKETS'); - g_CreateTextureWAD('ITEM_AMMO_CELL', EditorDir+'data/game.wad:TEXTURES\CELL'); - g_CreateTextureWAD('ITEM_AMMO_CELL_BIG', EditorDir+'data/game.wad:TEXTURES\CELL2'); - g_CreateTextureWAD('ITEM_AMMO_BACKPACK', EditorDir+'data/game.wad:TEXTURES\BPACK'); - g_CreateTextureWAD('ITEM_KEY_RED', EditorDir+'data/game.wad:TEXTURES\KEYR'); - g_CreateTextureWAD('ITEM_KEY_GREEN', EditorDir+'data/game.wad:TEXTURES\KEYG'); - g_CreateTextureWAD('ITEM_KEY_BLUE', EditorDir+'data/game.wad:TEXTURES\KEYB'); - g_CreateTextureWAD('ITEM_OXYGEN', EditorDir+'data/game.wad:TEXTURES\OXYGEN'); - g_CreateTextureWAD('ITEM_SUIT', EditorDir+'data/game.wad:TEXTURES\SUIT'); - g_CreateTextureWAD('ITEM_MEDKIT_BLACK', EditorDir+'data/game.wad:TEXTURES\BMED'); - - g_CreateTextureWAD('AREA_PLAYERPOINT1', EditorDir+'data/editor.wad:TEXTURES\P1POINT'); - g_CreateTextureWAD('AREA_PLAYERPOINT2', EditorDir+'data/editor.wad:TEXTURES\P2POINT'); - g_CreateTextureWAD('AREA_DMPOINT', EditorDir+'data/editor.wad:TEXTURES\DMPOINT'); - g_CreateTextureWAD('AREA_REDPOINT', EditorDir+'data/editor.wad:TEXTURES\REDPOINT'); - g_CreateTextureWAD('AREA_BLUEPOINT', EditorDir+'data/editor.wad:TEXTURES\BLUEPOINT'); + g_CreateTextureWAD('PREVIEW', EditorWad + ':TEXTURES\CHECKERS'); + g_CreateTextureWAD('NOTEXTURE', GameWad + ':TEXTURES\NOTEXTURE'); + + g_CreateTextureWADSize('AREA_REDFLAG', GameWad + ':TEXTURES\FLAGRED', 0, 0, 64, 64); + g_CreateTextureWADSize('AREA_BLUEFLAG', GameWad + ':TEXTURES\FLAGBLUE', 0, 0, 64, 64); + g_CreateTextureWADSize('AREA_DOMFLAG', GameWad + ':TEXTURES\FLAGDOM', 0, 0, 64, 64); + + g_CreateTextureWADSize('MONSTER_DEMON', GameWad + ':MTEXTURES\DEMON_SLEEP', 0, 0, 64, 64); + g_CreateTextureWADSize('MONSTER_IMP', GameWad + ':MTEXTURES\IMP_SLEEP', 0, 0, 64, 64); + g_CreateTextureWADSize('MONSTER_ZOMBY', GameWad + ':MTEXTURES\ZOMBY_SLEEP', 0, 0, 64, 64); + g_CreateTextureWADSize('MONSTER_SERG', GameWad + ':MTEXTURES\SERG_SLEEP', 0, 0, 64, 64); + g_CreateTextureWADSize('MONSTER_CYBER', GameWad + ':MTEXTURES\CYBER_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_CGUN', GameWad + ':MTEXTURES\CGUN_SLEEP', 0, 0, 64, 64); + g_CreateTextureWADSize('MONSTER_BARON', GameWad + ':MTEXTURES\BARON_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_KNIGHT', GameWad + ':MTEXTURES\KNIGHT_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_CACO', GameWad + ':MTEXTURES\CACO_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_SOUL', GameWad + ':MTEXTURES\SOUL_SLEEP', 0, 0, 64, 64); + g_CreateTextureWADSize('MONSTER_PAIN', GameWad + ':MTEXTURES\PAIN_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_SPIDER', GameWad + ':MTEXTURES\SPIDER_SLEEP', 0, 0, 256, 128); + g_CreateTextureWADSize('MONSTER_BSP', GameWad + ':MTEXTURES\BSP_SLEEP', 0, 0, 128, 64); + g_CreateTextureWADSize('MONSTER_MANCUB', GameWad + ':MTEXTURES\MANCUB_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_SKEL', GameWad + ':MTEXTURES\SKEL_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_VILE', GameWad + ':MTEXTURES\VILE_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_FISH', GameWad + ':MTEXTURES\FISH_SLEEP', 0, 0, 32, 32); + g_CreateTextureWADSize('MONSTER_BARREL', GameWad + ':MTEXTURES\BARREL_SLEEP', 0, 0, 64, 64); + g_CreateTextureWADSize('MONSTER_ROBO', GameWad + ':MTEXTURES\ROBO_SLEEP', 0, 0, 128, 128); + g_CreateTextureWADSize('MONSTER_MAN', GameWad + ':MTEXTURES\MAN_SLEEP', 0, 0, 64, 64); + + g_CreateTextureWADSize('ITEM_BLUESPHERE', GameWad + ':TEXTURES\SBLUE', 0, 0, 32, 32); + g_CreateTextureWADSize('ITEM_WHITESPHERE', GameWad + ':TEXTURES\SWHITE', 0, 0, 32, 32); + g_CreateTextureWADSize('ITEM_ARMORGREEN', GameWad + ':TEXTURES\ARMORGREEN', 0, 0, 32, 16); + g_CreateTextureWADSize('ITEM_ARMORBLUE', GameWad + ':TEXTURES\ARMORBLUE', 0, 0, 32, 16); + g_CreateTextureWADSize('ITEM_INVUL', GameWad + ':TEXTURES\INVUL', 0, 0, 32, 32); + g_CreateTextureWADSize('ITEM_BOTTLE', GameWad + ':TEXTURES\BOTTLE', 0, 0, 16, 32); + g_CreateTextureWADSize('ITEM_HELMET', GameWad + ':TEXTURES\HELMET', 0, 0, 16, 16); + g_CreateTextureWADSize('ITEM_JETPACK', GameWad + ':TEXTURES\JETPACK', 0, 0, 32, 32); + g_CreateTextureWADSize('ITEM_INVIS', GameWad + ':TEXTURES\INVIS', 0, 0, 32, 32); + g_CreateTextureWADSize('ITEM_WEAPON_FLAMETHROWER', GameWad + ':TEXTURES\FLAMETHROWER', 0, 0, 64, 32); + g_CreateTextureWADSize('ITEM_AMMO_FUELCAN', GameWad + ':TEXTURES\FUELCAN', 0, 0, 16, 32); + + g_CreateTextureWAD('ITEM_MEDKIT_SMALL', GameWad + ':TEXTURES\MED1'); + g_CreateTextureWAD('ITEM_MEDKIT_LARGE', GameWad + ':TEXTURES\MED2'); + g_CreateTextureWAD('ITEM_WEAPON_SAW', GameWad + ':TEXTURES\SAW'); + g_CreateTextureWAD('ITEM_WEAPON_PISTOL', GameWad + ':TEXTURES\PISTOL'); + g_CreateTextureWAD('ITEM_WEAPON_KASTET', GameWad + ':TEXTURES\KASTET'); + g_CreateTextureWAD('ITEM_WEAPON_SHOTGUN1', GameWad + ':TEXTURES\SHOTGUN1'); + g_CreateTextureWAD('ITEM_WEAPON_SHOTGUN2', GameWad + ':TEXTURES\SHOTGUN2'); + g_CreateTextureWAD('ITEM_WEAPON_CHAINGUN', GameWad + ':TEXTURES\MGUN'); + g_CreateTextureWAD('ITEM_WEAPON_ROCKETLAUNCHER', GameWad + ':TEXTURES\RLAUNCHER'); + g_CreateTextureWAD('ITEM_WEAPON_PLASMA', GameWad + ':TEXTURES\PGUN'); + g_CreateTextureWAD('ITEM_WEAPON_BFG', GameWad + ':TEXTURES\BFG'); + g_CreateTextureWAD('ITEM_WEAPON_SUPERPULEMET', GameWad + ':TEXTURES\SPULEMET'); + g_CreateTextureWAD('ITEM_AMMO_BULLETS', GameWad + ':TEXTURES\CLIP'); + g_CreateTextureWAD('ITEM_AMMO_BULLETS_BOX', GameWad + ':TEXTURES\AMMO'); + g_CreateTextureWAD('ITEM_AMMO_SHELLS', GameWad + ':TEXTURES\SHELL1'); + g_CreateTextureWAD('ITEM_AMMO_SHELLS_BOX', GameWad + ':TEXTURES\SHELL2'); + g_CreateTextureWAD('ITEM_AMMO_ROCKET', GameWad + ':TEXTURES\ROCKET'); + g_CreateTextureWAD('ITEM_AMMO_ROCKET_BOX', GameWad + ':TEXTURES\ROCKETS'); + g_CreateTextureWAD('ITEM_AMMO_CELL', GameWad + ':TEXTURES\CELL'); + g_CreateTextureWAD('ITEM_AMMO_CELL_BIG', GameWad + ':TEXTURES\CELL2'); + g_CreateTextureWAD('ITEM_AMMO_BACKPACK', GameWad + ':TEXTURES\BPACK'); + g_CreateTextureWAD('ITEM_KEY_RED', GameWad + ':TEXTURES\KEYR'); + g_CreateTextureWAD('ITEM_KEY_GREEN', GameWad + ':TEXTURES\KEYG'); + g_CreateTextureWAD('ITEM_KEY_BLUE', GameWad + ':TEXTURES\KEYB'); + g_CreateTextureWAD('ITEM_OXYGEN', GameWad + ':TEXTURES\OXYGEN'); + g_CreateTextureWAD('ITEM_SUIT', GameWad + ':TEXTURES\SUIT'); + g_CreateTextureWAD('ITEM_MEDKIT_BLACK', GameWad + ':TEXTURES\BMED'); + + g_CreateTextureWAD('AREA_PLAYERPOINT1', EditorWad + ':TEXTURES\P1POINT'); + g_CreateTextureWAD('AREA_PLAYERPOINT2', EditorWad + ':TEXTURES\P2POINT'); + g_CreateTextureWAD('AREA_DMPOINT', EditorWad + ':TEXTURES\DMPOINT'); + g_CreateTextureWAD('AREA_REDPOINT', EditorWad + ':TEXTURES\REDPOINT'); + g_CreateTextureWAD('AREA_BLUEPOINT', EditorWad + ':TEXTURES\BLUEPOINT'); end; procedure FreeData();