From dcded0e183e3426c8e4dcf6590f8d975b16805f7 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 1 May 2017 16:20:25 +0300 Subject: [PATCH 1/4] Handle unloading of canvas textures properly https://forum.zdoom.org/viewtopic.php?t=56207 --- src/textures/canvastexture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/textures/canvastexture.cpp b/src/textures/canvastexture.cpp index eba5d2feac..d2530017bf 100644 --- a/src/textures/canvastexture.cpp +++ b/src/textures/canvastexture.cpp @@ -171,11 +171,13 @@ void FCanvasTexture::Unload () if (Canvas != NULL) { delete Canvas; + Canvas = nullptr; } if (CanvasBgra != NULL) { delete CanvasBgra; + CanvasBgra = nullptr; } FTexture::Unload(); From 050acc92713a9d1d462eae12c982d1e3e2034bd3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 May 2017 20:44:41 +0200 Subject: [PATCH 2/4] - added rudimentary support for SVE.wad from the Strife Veteran edition so that the extended single player campaign is usable: * all new things got either an sctor definition or are explicitly deleted through the 'doomednums' section in MAPINFO. CTC related actors are non-functional! * added a 'noskillflags' option to 'doomednums' so that the lightmap definition things in the maps can be repurposed as dynamic lights. * added the new dagger powerup. * added MAPINFO entries for the added maps. --- src/g_doomedmap.cpp | 9 + src/info.h | 1 + src/p_mobj.cpp | 2 +- wadsrc/static/iwadinfo.txt | 15 +- wadsrc/static/language.enu | 9 + wadsrc/static/mapinfo/conversationids.txt | 8 + wadsrc/static/mapinfo/strife.txt | 56 +++++ wadsrc/static/zscript.txt | 2 + wadsrc/static/zscript/strife/svelights.txt | 129 ++++++++++++ wadsrc/static/zscript/strife/svestuff.txt | 191 ++++++++++++++++++ wadsrc/static/zscript/strife/weapondagger.txt | 20 +- 11 files changed, 434 insertions(+), 8 deletions(-) create mode 100644 wadsrc/static/zscript/strife/svelights.txt create mode 100644 wadsrc/static/zscript/strife/svestuff.txt diff --git a/src/g_doomedmap.cpp b/src/g_doomedmap.cpp index b795436508..38feaaf76b 100644 --- a/src/g_doomedmap.cpp +++ b/src/g_doomedmap.cpp @@ -88,6 +88,7 @@ struct MapinfoEdMapItem // These are for error reporting. We must store the file information because it's no longer available when these items get resolved. FString filename; int linenum; + bool noskillflags; }; typedef TMap IdMap; @@ -184,12 +185,18 @@ void FMapInfoParser::ParseDoomEdNums() } memset(editem.args, 0, sizeof(editem.args)); editem.argsdefined = 0; + editem.noskillflags = false; int minargs = 0; int maxargs = 5; FString specialname; if (sc.CheckString(",")) { + if (sc.CheckString("noskillflags")) + { + editem.noskillflags = true; + if (!sc.CheckString(",")) goto noargs; + } editem.argsdefined = 5; // mark args as used - if this is done we need to prevent assignment of map args in P_SpawnMapThing. if (editem.special < 0) editem.special = 0; if (!sc.CheckNumber()) @@ -238,6 +245,7 @@ void FMapInfoParser::ParseDoomEdNums() error++; } } + noargs: DoomEdFromMapinfo.Insert(ednum, editem); } else @@ -275,6 +283,7 @@ void InitActorNumsFromMapinfo() ent.Type = cls; ent.Special = pair->Value.special; ent.ArgsDefined = pair->Value.argsdefined; + ent.NoSkillFlags = pair->Value.noskillflags; memcpy(ent.Args, pair->Value.args, sizeof(ent.Args)); DoomEdMap.Insert(pair->Key, ent); } diff --git a/src/info.h b/src/info.h index d167631cf5..3e497d0f63 100644 --- a/src/info.h +++ b/src/info.h @@ -358,6 +358,7 @@ struct FDoomEdEntry PClassActor *Type; short Special; signed char ArgsDefined; + bool NoSkillFlags; int Args[5]; }; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 3c423bbf2e..f770d037af 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5817,7 +5817,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) } mask = G_SkillProperty(SKILLP_SpawnFilter); - if (!(mthing->SkillFilter & mask)) + if (!(mthing->SkillFilter & mask) && !mentry->NoSkillFlags) { return NULL; } diff --git a/wadsrc/static/iwadinfo.txt b/wadsrc/static/iwadinfo.txt index 6746c62485..777a94f852 100644 --- a/wadsrc/static/iwadinfo.txt +++ b/wadsrc/static/iwadinfo.txt @@ -100,10 +100,22 @@ IWad BannerColors = "ff ff 00", "00 c0 00" } +IWad +{ + Name = "Strife: Veteran Edition" + Autoname = "strife.veteran" + Game = "Strife" + Config = "Strife" + Mapinfo = "mapinfo/strife.txt" + MustContain = "MAP35", "I_RELB", "FXAA_F" + BannerColors = "f0 f0 f0", "6b 3c 18" + Required = "Strife: Quest for the Sigil" +} + IWad { Name = "Strife: Quest for the Sigil" - Autoname = "strife" + Autoname = "strife.strife" Game = "Strife" Config = "Strife" Mapinfo = "mapinfo/strife.txt" @@ -418,4 +430,5 @@ Names "hacx2.wad" "square1.pk3" "delaweare.wad" + "sve.wad" } diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 31a66feb35..989ebd0952 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2807,3 +2807,12 @@ TCMNU_MAGFILTER = "Linear filter when upscaling"; TCMNU_MIPMAP = "Use mipmapped textures"; TCMNU_DYNLIGHTS = "Dynamic lights"; +// SVE strings: + +TAG_TALISMANRED = "Red Talisman"; +TAG_TALISMANGREEN = "Green Talisman"; +TAG_TALISMANBLUE = "Blue Talisman"; +MSG_TALISMANRED = "You have a feeling that it wasn't to be touched..."; +MSG_TALISMANGREEN = "Whatever it is, it doesn't belong in this world..."; +MSG_TALISMANBLUE = "It must do something..."; +MSG_TALISMANPOWER = "You have super strength!"; diff --git a/wadsrc/static/mapinfo/conversationids.txt b/wadsrc/static/mapinfo/conversationids.txt index 477907a84a..8ef26be50a 100644 --- a/wadsrc/static/mapinfo/conversationids.txt +++ b/wadsrc/static/mapinfo/conversationids.txt @@ -323,4 +323,12 @@ conversationids 341 = QuestItem30 342 = QuestItem31 343 = SlideshowStarter + 345 = SVEBlueChalice + 346 = SVEFlagSpotRed + 347 = SVEFlagSpotBlue + 348 = SVETalismanRed + 349 = SVETalismanGreen + 350 = SVETalismanBlue + 351 = SVEOpenDoor225 + } \ No newline at end of file diff --git a/wadsrc/static/mapinfo/strife.txt b/wadsrc/static/mapinfo/strife.txt index 0b52b213e4..3a763d4cb1 100644 --- a/wadsrc/static/mapinfo/strife.txt +++ b/wadsrc/static/mapinfo/strife.txt @@ -323,6 +323,30 @@ DoomEdNums 3004 = Peasant1 3005 = Crusader 3006 = Sentinel + + 5080 = none // CTC stuff + 5081 = none + 5130 = SVEFlagSpotBlue + 5131 = SVEFlagSpotRed + 7957 = none // AltLight for lightmapped geometry. + 7958 = SVELight7958, noskillflags + 7959 = SVELight7959, noskillflags + 7960 = SVELight7960, noskillflags + 7961 = SVELight7961, noskillflags + 7962 = SVELight7962, noskillflags + 7963 = none + 7964 = SVELight7964, noskillflags + 7965 = SVELight7965, noskillflags + 7966 = SVETalismanRed + 7967 = SVETalismanGreen + 7968 = SVETalismanBlue + 7969 = none // Bloom threshold. + 7970 = SVEBlueChalice + 7971 = SVELight7971, noskillflags + 7972 = SVELight7972, noskillflags + 7973 = SVELight7973, noskillflags + 7974 = SVELight7974, noskillflags + 7975 = SVEOreSpawner } SpawnNums @@ -860,6 +884,38 @@ map MAP34 "AREA 3: Movement Base" noallies } +map MAP35 "AREA 35: Factory: Production" +{ + next = "MAP01" + sky1 = "SKYMNT01" + music = "D_TRIBAL" + cluster = 1 +} + +map MAP36 "AREA 36: Castle Clash" +{ + next = "MAP37" + sky1 = "SKYMNT01" + music = "D_MARCH" + cluster = 3 +} + +map MAP37 "AREA 37: Killing Grounds" +{ + next = "MAP38" + sky1 = "SKYMNT01" + music = "D_STRIKE" + cluster = 3 +} + +map MAP38 "AREA 38: Ordered Chaos" +{ + next = "MAP36" + sky1 = "SKYMNT01" + music = "D_TRIBAL" + cluster = 3 +} + cluster 1 { hub diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index 99627676d6..d26794f6e7 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -247,6 +247,8 @@ version "2.5" #include "zscript/strife/weapongrenade.txt" #include "zscript/strife/weaponmauler.txt" #include "zscript/strife/sigil.txt" +#include "zscript/strife/svestuff.txt" +#include "zscript/strife/svelights.txt" #include "zscript/chex/chexmonsters.txt" #include "zscript/chex/chexkeys.txt" diff --git a/wadsrc/static/zscript/strife/svelights.txt b/wadsrc/static/zscript/strife/svelights.txt new file mode 100644 index 0000000000..28af3a8070 --- /dev/null +++ b/wadsrc/static/zscript/strife/svelights.txt @@ -0,0 +1,129 @@ +// This turns the helper things for creating lightmaps in SVE into actual light sources + +class SVELight : PointLight +{ + override void BeginPlay() + { + Super.BeginPlay(); + if (!bSpawnCeiling) AddZ(height); + } +} + +class SVELight7958 : SVELight +{ + Default + { + +SPAWNCEILING + +DYNAMICLIGHT.ATTENUATE + Height 6; + Args 255,255,224,128; + } +} + +class SVELight7959 : SVELight +{ + Default + { + +DYNAMICLIGHT.ATTENUATE + Height 6; + Args 255,255,224,128; + } +} + +class SVELight7960 : SVELight +{ + Default + { + +SPAWNCEILING + +DYNAMICLIGHT.ATTENUATE + Height 6; + Args 255,255,64,100; + } +} + +class SVELight7961 : SVELight +{ + Default + { + +DYNAMICLIGHT.ATTENUATE + Height 6; + Args 255,255,64,100; + } +} + +class SVELight7962 : SVELight +{ + Default + { + +DYNAMICLIGHT.ATTENUATE + Height 8; + Args 255,64,16,128; + } +} + +// 7963 has intentionally been omitted + +class SVELight7964 : SVELight +{ + Default + { + +SPAWNCEILING + +DYNAMICLIGHT.ATTENUATE + Height 64; + Args 200,200,170,160; + } +} + +class SVELight7965 : SVELight +{ + Default + { + +DYNAMICLIGHT.ATTENUATE + Height 64; + Args 200,200,170,160; + } +} + +class SVELight7971 : SVELight +{ + Default + { + +DYNAMICLIGHT.ATTENUATE + Height 80; + Args 248,248,224,144; + } +} + +class SVELight7972 : SVELight +{ + Default + { + +SPAWNCEILING + +DYNAMICLIGHT.ATTENUATE + Height 24; + Args 168,175,255,128; + } +} + +class SVELight7973 : SVELight +{ + Default + { + +DYNAMICLIGHT.ATTENUATE + Height 80; + Args 112,112,112,100; + } +} + +class SVELight7974 : SVELight +{ + Default + { + +DYNAMICLIGHT.ATTENUATE + Height 80; + Args 100,100,90,100; + } +} + + + diff --git a/wadsrc/static/zscript/strife/svestuff.txt b/wadsrc/static/zscript/strife/svestuff.txt new file mode 100644 index 0000000000..0e17a7eca9 --- /dev/null +++ b/wadsrc/static/zscript/strife/svestuff.txt @@ -0,0 +1,191 @@ + +// CTC flag spots. They are not functional and only here so that something gets spawned for them. + +class SVEFlagSpotRed : Inventory +{ + States + { + Spawn: + FLGR A 1 BRIGHT; + FLGR A 0 BRIGHT; // A_FlagStandSpawn + FLGR A 1 BRIGHT; // A_FlagStandCheck + Wait; + } +} + +class SVEFlagSpotBlue : Inventory +{ + States + { + Spawn: + FLGB A 1 BRIGHT; + FLGB A 0 BRIGHT; // A_FlagStandSpawn + FLGB A 1 BRIGHT; // A_FlagStandCheck + Wait; + } +} + +class SVEBlueChalice : Inventory +{ + Default + { + +DROPPED + +FLOORCLIP + +INVENTORY.INVBAR + Radius 10; + Height 16; + Tag "$TAG_OFFERINGCHALICE"; + Inventory.Icon "I_RELB"; + Inventory.PickupMessage "$TXT_OFFERINGCHALICE"; + } + States + { + Spawn: + RELB A -1 BRIGHT; + Stop; + } +} + +class SVETalismanPowerup : Inventory +{ +} + +class SVETalismanRed : Inventory +{ + Default + { + +DROPPED + +FLOORCLIP + +INVENTORY.INVBAR + Radius 10; + Height 16; + Inventory.MaxAmount 1; + Inventory.Icon "I_FLGR"; + Tag "$TAG_TALISMANRED"; + Inventory.PickupMessage "$MSG_TALISMANRED"; + } + States + { + Spawn: + FLGR A -1 BRIGHT; + Stop; + } + + override bool TryPickup (in out Actor toucher) + { + let useok = Super.TryPickup (toucher); + if (useok) + { + if (toucher.FindInventory("SVETalismanRed") && + toucher.FindInventory("SVETalismanGreen") && + toucher.FindInventory("SVETalismanBlue")) + { + toucher.A_Print("$MSG_TALISMANPOWER"); + GiveInventoryType("SVETalismanPowerup"); + } + } + return useok; + } + +} + +class SVETalismanBlue : SVETalismanRed +{ + Default + { + +INVENTORY.INVBAR + Inventory.Icon "I_FLGB"; + Tag "$TAG_TALISMANBLUE"; + Inventory.PickupMessage "$MSG_TALISMANBLUE"; + } + States + { + Spawn: + FLGB A -1 BRIGHT; + Stop; + } +} + +class SVETalismanGreen : SVETalismanRed +{ + Default + { + +INVENTORY.INVBAR + Inventory.Icon "I_FLGG"; + Tag "$TAG_TALISMANGREEN"; + Inventory.PickupMessage "$MSG_TALISMANGREEN"; + } + States + { + Spawn: + FLGG A -1 BRIGHT; + Stop; + } +} + +class SVEOreSpawner : Actor +{ + Default + { + +NOSECTOR + } + States + { + Spawn: + TNT1 A 175 A_OreSpawner; + loop; + } + + // + // A_OreSpawner + // + // [SVE] svillarreal + // + + void A_OreSpawner() + { + if(deathmatch) return; + + bool inrange = false; + for(int i = 0; i < MAXPLAYERS; i++) + { + if(!playeringame[i]) + continue; + + if(Distance2D(players[i].mo) < 2048) + { + inrange = true; + break; + } + } + if(!inrange) return; + + let it = ThinkerIterator.Create("DegninOre"); + Thinker ac; + + int numores = 0; + while (ac = it.Next()) + { + if (++numores == 3) return; + } + Spawn("DegninOre", Pos); + } +} + +class SVEOpenDoor225 : DummyStrifeItem +{ + override bool TryPickup (in out Actor toucher) + { + Door_Open(225, 16); + GoAwayAndDie (); + return true; + } + + override bool SpecialDropAction (Actor dropper) + { + Door_Open(225, 16); + Destroy (); + return true; + } + +} diff --git a/wadsrc/static/zscript/strife/weapondagger.txt b/wadsrc/static/zscript/strife/weapondagger.txt index 7c74933474..2d3ba74f8b 100644 --- a/wadsrc/static/zscript/strife/weapondagger.txt +++ b/wadsrc/static/zscript/strife/weapondagger.txt @@ -40,13 +40,21 @@ class PunchDagger : StrifeWeapon action void A_JabDagger () { FTranslatedLineTarget t; - - int power = MIN(10, stamina / 10); - int damage = (random[JabDagger]() % (power + 8)) * (power + 2); - - if (FindInventory("PowerStrength")) + int damage; + + if (FindInventory("SVETalismanPowerup")) { - damage *= 10; + damage = 1000; + } + else + { + int power = MIN(10, stamina / 10); + damage = (random[JabDagger]() % (power + 8)) * (power + 2); + + if (FindInventory("PowerStrength")) + { + damage *= 10; + } } double angle = angle + random2[JabDagger]() * (5.625 / 256); From 79ef7989fc81c6800be30004eb0c81bdab949ec6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 May 2017 22:04:54 +0200 Subject: [PATCH 3/4] - moved the software renderer's dynamic light option into the dynamic light menu to avoid confusion. Todo: Review the other options and make sure they apply to both renderers. --- wadsrc/static/language.enu | 4 ++-- wadsrc/static/menudef.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 989ebd0952..08b2f650ed 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2671,7 +2671,7 @@ GLTEXMNU_SORTDRAWLIST = "Sort draw lists by texture"; // Dynamic Light Options GLLIGHTMNU_TITLE = "DYNAMIC LIGHTS"; -GLLIGHTMNU_LIGHTSENABLED = "Dynamic Lights enabled"; +GLLIGHTMNU_LIGHTSENABLED = "Dynamic Lights (OpenGL)"; GLLIGHTMNU_LIGHTDEFS = "Enable light definitions"; GLLIGHTMNU_CLIPLIGHTS = "Clip lights"; GLLIGHTMNU_LIGHTSPRITES = "Lights affect sprites"; @@ -2805,7 +2805,7 @@ TCMNU_TRUECOLOR = "True color output"; TCMNU_MINFILTER = "Linear filter when downscaling"; TCMNU_MAGFILTER = "Linear filter when upscaling"; TCMNU_MIPMAP = "Use mipmapped textures"; -TCMNU_DYNLIGHTS = "Dynamic lights"; +TCMNU_DYNLIGHTS = "Dynamic lights (Software)"; // SVE strings: diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 5bc698684e..2f324f6421 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -706,7 +706,6 @@ OptionMenu "TrueColorOptions" Option "$TCMNU_MINFILTER", "r_minfilter", "OnOff" Option "$TCMNU_MAGFILTER", "r_magfilter", "OnOff" Option "$TCMNU_MIPMAP", "r_mipmap", "OnOff" - Option "$TCMNU_DYNLIGHTS", "r_dynlights", "OnOff" } OptionMenu "SWROptions" @@ -2094,7 +2093,8 @@ OptionMenu "GLTextureGLOptions" OptionMenu "GLLightOptions" { Title "$GLLIGHTMNU_TITLE" - Option "$GLLIGHTMNU_LIGHTSENABLED", gl_lights, "YesNo" + Option "$TCMNU_DYNLIGHTS", "r_dynlights", "OnOff" + Option "$GLLIGHTMNU_LIGHTSENABLED", gl_lights, "OnOff" Option "$GLLIGHTMNU_LIGHTDEFS", gl_attachedlights, "YesNo" Option "$GLLIGHTMNU_CLIPLIGHTS", gl_lights_checkside, "YesNo" Option "$GLLIGHTMNU_LIGHTSPRITES", gl_light_sprites, "YesNo" From aac6e6584222e3296e3599901970500f2bd6e037 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 May 2017 22:44:58 +0200 Subject: [PATCH 4/4] - fixed: FxActionSpecialCall did not resolve float to int casts. --- src/scripting/backend/codegen.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 35582aa429..f088bc2430 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -8481,6 +8481,12 @@ FxExpression *FxActionSpecialCall::Resolve(FCompileContext& ctx) if (ArgList[i]->ValueType->GetRegType() == REGT_FLOAT /* lax */) { ArgList[i] = new FxIntCast(ArgList[i], ctx.FromDecorate); + ArgList[i] = ArgList[i]->Resolve(ctx); + if (ArgList[i] == nullptr) + { + delete this; + return nullptr; + } } else {