From 89a43feb7aa5363d75cb397221c53232ab05379a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 17:55:20 +0100 Subject: [PATCH 01/11] - split the intermission background handling into its own class. This means that 1/3 of wi_stuff can be left as-is when scriptifying the rest. --- src/wi_stuff.cpp | 543 ++++++++++++++++++++++++----------------------- 1 file changed, 281 insertions(+), 262 deletions(-) diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index a7f6b8f17..525d0c577 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -59,6 +59,14 @@ CVAR(Bool, wi_showtotaltime, true, CVAR_ARCHIVE) CVAR(Bool, wi_noautostartmap, false, CVAR_USERINFO | CVAR_ARCHIVE) CVAR(Int, wi_autoadvance, 0, CVAR_SERVERINFO) +// States for the intermission +enum EState +{ + NoState = -1, + StatCount, + ShowNextLoc, + LeavingIntermission +}; static const char *WI_Cmd[] = { "Background", @@ -83,67 +91,8 @@ static const char *WI_Cmd[] = { NULL }; - -struct FPatchInfo +struct FInterBackground { - FFont *mFont; - FTexture *mPatch; - EColorRange mColor; - - void Init(FGIFont &gifont) - { - if (gifont.color == NAME_Null) - { - mPatch = TexMan[gifont.fontname]; // "entering" - mColor = mPatch == NULL ? CR_UNTRANSLATED : CR_UNDEFINED; - mFont = NULL; - } - else - { - mFont = V_GetFont(gifont.fontname); - mColor = V_FindFontColor(gifont.color); - mPatch = NULL; - } - if (mFont == NULL) - { - mFont = BigFont; - } - } -}; - - - -class FIntermissionScreen -{ -public: - // States for the intermission - enum EState - { - NoState = -1, - StatCount, - ShowNextLoc, - LeavingIntermission - }; - - - enum EValues - { - // GLOBAL LOCATIONS - WI_TITLEY = 2, - - // SINGPLE-PLAYER STUFF - SP_STATSX = 50, - SP_STATSY = 50, - - SP_TIMEX = 8, - SP_TIMEY = (200 - 32), - - // NET GAME STUFF - NG_STATSY = 50, - }; - - - // These animation variables, structures, etc. are used for the // DOOM/Ultimate DOOM intermission screen animations. This is // totally different from any sprite or texture/flat animations @@ -167,18 +116,6 @@ public: }; - // States for single-player - enum ESPState - { - SP_KILLS = 0, - SP_ITEMS = 2, - SP_SECRET = 4, - SP_FRAGS = 6, - SP_TIME = 8, - }; - - static const int SHOWNEXTLOCDELAY = 4; // in seconds - struct yahpt_t { int x, y; @@ -188,16 +125,9 @@ public: { int x; // x/y coordinate pair structure int y; - char level[9]; + FString Level; }; - - // - // Animation. - // There is another anim_t used in p_spec. - // (which is why I have renamed this one!) - // - struct in_anim_t { int type; // Made an int so I can use '|' @@ -206,7 +136,7 @@ public: int data; // ALWAYS: n/a, RANDOM: period deviation (<256) TArray frames; // actual graphics for frames of animations - // following must be initialized to zero before use! + // following must be initialized to zero before use! int nexttic; // next value of bcnt (used in conjunction with period) int ctr; // next frame number to animate int state; // used by RANDOM and LEVEL when animating @@ -223,71 +153,21 @@ public: } }; +private: TArray lnodes; TArray anims; - - int acceleratestage; // used to accelerate or skip a stage - bool playerready[MAXPLAYERS]; - int me; // wbs->pnum - EState state; // specifies current state - wbstartstruct_t *wbs; // contains information passed into intermission - wbplayerstruct_t* Plrs[MAXPLAYERS]; // wbs->plyr[] - int cnt; // used for general timing - int bcnt; // used for timing of background animation - int cnt_kills[MAXPLAYERS]; - int cnt_items[MAXPLAYERS]; - int cnt_secret[MAXPLAYERS]; - int cnt_frags[MAXPLAYERS]; - int cnt_deaths[MAXPLAYERS]; - int cnt_time; - int cnt_total_time; - int cnt_par; - int cnt_pause; - int total_frags; - int total_deaths; - bool noautostartmap; - int dofrags; - int ng_state; - - // - // GRAPHICS - // - - FPatchInfo mapname; - FPatchInfo finished; - FPatchInfo entering; - + int bcnt = 0; // used for timing of background animation TArray yah; // You Are Here graphic - FTexture* splat; // splat - FTexture* sp_secret; // "secret" - FTexture* kills; // "Kills", "Scrt", "Items", "Frags" - FTexture* secret; - FTexture* items; - FTexture* frags; - FTexture* timepic; // Time sucks. - FTexture* par; - FTexture* sucks; - FTexture* killers; // "killers", "victims" - FTexture* victims; - FTexture* total; // "Total", your face, your dead face - FTexture* p; // Player graphic - FTexture* lnames[2]; // Name graphics of each level (centered) - - // [RH] Info to dynamically generate the level name graphics - FString lnametexts[2]; - - FTexture *background; - - bool snl_pointeron = false; - - int player_deaths[MAXPLAYERS]; - int sp_state; - - // - // CODE - // + FTexture* splat = nullptr; // splat + FTexture *background = nullptr; + wbstartstruct_t *wbs; +public: + FInterBackground(wbstartstruct_t *wbst) + { + wbs = wbst; + }; //==================================================================== // // Loads the background - either from a single texture @@ -297,22 +177,23 @@ public: // MAPINFO. // //==================================================================== - static bool IsExMy(const char * name) + bool IsExMy(const char * name) { // Only check for the first 3 episodes. They are the only ones with default intermission scripts. // Level names can be upper- and lower case so use tolower to check! - return (tolower(name[0])=='e' && name[1]>='1' && name[1]<='3' && tolower(name[2])=='m'); + return (tolower(name[0]) == 'e' && name[1] >= '1' && name[1] <= '3' && tolower(name[2]) == 'm'); } - void WI_LoadBackground(bool isenterpic) + bool LoadBackground(bool isenterpic) { const char *lumpname = NULL; char buffer[10]; in_anim_t an; lnode_t pt; FTextureID texture; + bool noautostartmap = false; - bcnt=0; + bcnt = 0; texture.SetInvalid(); if (isenterpic) @@ -326,10 +207,10 @@ public: } // Try to get a default if nothing specified - if (lumpname == NULL || lumpname[0]==0) + if (lumpname == NULL || lumpname[0] == 0) { lumpname = NULL; - switch(gameinfo.gametype) + switch (gameinfo.gametype) { case GAME_Chex: case GAME_Doom: @@ -342,24 +223,24 @@ public: lumpname = buffer; } } - if (!lumpname) + if (!lumpname) { - if (isenterpic) + if (isenterpic) { // One special case needs to be handled here! // If going from E1-E3 to E4 the default should be used, not the exit pic. // Not if the exit pic is user defined! - if (level.info->ExitPic.IsNotEmpty()) return; + if (level.info->ExitPic.IsNotEmpty()) return false; // E1-E3 need special treatment when playing Doom 1. if (!(gameinfo.flags & GI_MAPxx)) { // not if the last level is not from the first 3 episodes - if (!IsExMy(wbs->current)) return; + if (!IsExMy(wbs->current)) return false; // not if the next level is one of the first 3 episodes - if (IsExMy(wbs->next)) return; + if (IsExMy(wbs->next)) return false; } } lumpname = "INTERPIC"; @@ -375,22 +256,22 @@ public: lumpname = buffer; } } - if (!lumpname) + if (!lumpname) { - if (isenterpic) return; + if (isenterpic) return false; lumpname = "FLOOR16"; } break; case GAME_Hexen: - if (isenterpic) return; + if (isenterpic) return false; lumpname = "INTERPIC"; break; case GAME_Strife: default: // Strife doesn't have an intermission pic so choose something neutral. - if (isenterpic) return; + if (isenterpic) return false; lumpname = gameinfo.BorderFlat; break; } @@ -399,7 +280,7 @@ public: { // shouldn't happen! background = NULL; - return; + return false; } lnodes.Clear(); @@ -408,21 +289,21 @@ public: splat = NULL; // a name with a starting '$' indicates an intermission script - if (*lumpname!='$') + if (*lumpname != '$') { texture = TexMan.CheckForTexture(lumpname, FTexture::TEX_MiscPatch, FTextureManager::TEXMAN_TryAny); } else { - int lumpnum=Wads.CheckNumForFullName(lumpname+1, true); - if (lumpnum>=0) + int lumpnum = Wads.CheckNumForFullName(lumpname + 1, true); + if (lumpnum >= 0) { FScanner sc(lumpnum); while (sc.GetString()) { an.Reset(); int caseval = sc.MustMatchString(WI_Cmd); - switch(caseval) + switch (caseval) { case 0: // Background sc.MustGetString(); @@ -448,8 +329,7 @@ public: while (!sc.CheckString("}")) { sc.MustGetString(); - strncpy(pt.level, sc.String,8); - pt.level[8] = 0; + pt.Level = sc.String; sc.MustGetNumber(); pt.x = sc.Number; sc.MustGetNumber(); @@ -477,7 +357,7 @@ public: case 8: // IfLeaving an.type = ANIM_IFLEAVING; goto readanimation; - + case 9: // IfNotLeaving an.type = ANIM_IFNOTLEAVING; goto readanimation; @@ -502,7 +382,7 @@ public: sc.MustGetString(); an.LevelName = sc.String; sc.MustGetString(); - caseval=sc.MustMatchString(WI_Cmd); + caseval = sc.MustMatchString(WI_Cmd); default: switch (caseval) @@ -562,13 +442,14 @@ public: } } } - else + else { - Printf("Intermission script %s not found!\n", lumpname+1); + Printf("Intermission script %s not found!\n", lumpname + 1); texture = TexMan.GetTexture("INTERPIC", FTexture::TEX_MiscPatch); } } - background=TexMan[texture]; + background = TexMan[texture]; + return noautostartmap; } //==================================================================== @@ -578,11 +459,12 @@ public: // //==================================================================== - void WI_updateAnimatedBack() + void updateAnimatedBack() { unsigned int i; - for(i=0;itype & ANIM_TYPE) @@ -590,19 +472,19 @@ public: case ANIM_ALWAYS: if (bcnt >= a->nexttic) { - if (++a->ctr >= (int)a->frames.Size()) + if (++a->ctr >= (int)a->frames.Size()) { - if (a->data==0) a->ctr = 0; + if (a->data == 0) a->ctr = 0; else a->ctr--; } a->nexttic = bcnt + a->period; } break; - + case ANIM_PIC: a->ctr = 0; break; - + } } } @@ -613,11 +495,11 @@ public: // //==================================================================== - void WI_drawBackground() + void drawBackground(int state, bool drawsplat, bool snl_pointeron) { unsigned int i; - double animwidth=320; // For a flat fill or clear background scale animations to 320x200 - double animheight=200; + double animwidth = 320; // For a flat fill or clear background scale animations to 320x200 + double animheight = 200; if (background) { @@ -629,20 +511,20 @@ public: // placing the animations precisely where they belong on the base pic animwidth = background->GetScaledWidthDouble(); animheight = background->GetScaledHeightDouble(); - screen->FillBorder (NULL); + screen->FillBorder(NULL); screen->DrawTexture(background, 0, 0, DTA_Fullscreen, true, TAG_DONE); } - else + else { screen->FlatFill(0, 0, SCREENWIDTH, SCREENHEIGHT, background); } } - else + else { - screen->Clear(0,0, SCREENWIDTH, SCREENHEIGHT, 0, 0); + screen->Clear(0, 0, SCREENWIDTH, SCREENHEIGHT, 0, 0); } - for(i=0;ictr >= 0) - screen->DrawTexture(a->frames[a->ctr], a->loc.x, a->loc.y, - DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE); + screen->DrawTexture(a->frames[a->ctr], a->loc.x, a->loc.y, + DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE); + } + + if (drawsplat) + { + for (i = 0; iflags & LEVEL_VISITED) drawOnLnode(i, &splat, 1); // draw a splat on taken cities. + } + } + + // draw flashing ptr + if (snl_pointeron && yah.Size()) + { + unsigned int v = MapToIndex(wbs->next); + // Draw only if it points to a valid level on the current screen! + if (vGetScaledWidth(); + bottom = c[i]->GetScaledHeight(); + left = lnodes[n].x - c[i]->GetScaledLeftOffset(); + top = lnodes[n].y - c[i]->GetScaledTopOffset(); + right += left; + bottom += top; + + if (left >= 0 && right < 320 && top >= 0 && bottom < 200) + { + screen->DrawTexture(c[i], lnodes[n].x, lnodes[n].y, DTA_320x200, true, TAG_DONE); + break; + } } } +}; + +struct FPatchInfo +{ + FFont *mFont; + FTexture *mPatch; + EColorRange mColor; + + void Init(FGIFont &gifont) + { + if (gifont.color == NAME_Null) + { + mPatch = TexMan[gifont.fontname]; // "entering" + mColor = mPatch == NULL ? CR_UNTRANSLATED : CR_UNDEFINED; + mFont = NULL; + } + else + { + mFont = V_GetFont(gifont.fontname); + mColor = V_FindFontColor(gifont.color); + mPatch = NULL; + } + if (mFont == NULL) + { + mFont = BigFont; + } + } +}; + + + +class FIntermissionScreen +{ +public: + + enum EValues + { + // GLOBAL LOCATIONS + WI_TITLEY = 2, + + // SINGPLE-PLAYER STUFF + SP_STATSX = 50, + SP_STATSY = 50, + + SP_TIMEX = 8, + SP_TIMEY = (200 - 32), + + // NET GAME STUFF + NG_STATSY = 50, + }; + + + + // States for single-player + enum ESPState + { + SP_KILLS = 0, + SP_ITEMS = 2, + SP_SECRET = 4, + SP_FRAGS = 6, + SP_TIME = 8, + }; + + static const int SHOWNEXTLOCDELAY = 4; // in seconds + + // + // Animation. + // There is another anim_t used in p_spec. + // (which is why I have renamed this one!) + // + + + FInterBackground *bg; + int acceleratestage; // used to accelerate or skip a stage + bool playerready[MAXPLAYERS]; + int me; // wbs->pnum + int bcnt; + EState state; // specifies current state + wbstartstruct_t *wbs; // contains information passed into intermission + wbplayerstruct_t* Plrs[MAXPLAYERS]; // wbs->plyr[] + int cnt; // used for general timing + int cnt_kills[MAXPLAYERS]; + int cnt_items[MAXPLAYERS]; + int cnt_secret[MAXPLAYERS]; + int cnt_frags[MAXPLAYERS]; + int cnt_deaths[MAXPLAYERS]; + int cnt_time; + int cnt_total_time; + int cnt_par; + int cnt_pause; + int total_frags; + int total_deaths; + bool noautostartmap; + int dofrags; + int ng_state; + + // + // GRAPHICS + // + + FPatchInfo mapname; + FPatchInfo finished; + FPatchInfo entering; + + FTexture* sp_secret; // "secret" + FTexture* kills; // "Kills", "Scrt", "Items", "Frags" + FTexture* secret; + FTexture* items; + FTexture* frags; + FTexture* timepic; // Time sucks. + FTexture* par; + FTexture* sucks; + FTexture* killers; // "killers", "victims" + FTexture* victims; + FTexture* total; // "Total", your face, your dead face + FTexture* p; // Player graphic + FTexture* lnames[2]; // Name graphics of each level (centered) + + // [RH] Info to dynamically generate the level name graphics + FString lnametexts[2]; + + + bool snl_pointeron = false; + + int player_deaths[MAXPLAYERS]; + int sp_state; + + // + // CODE + // + + + + //==================================================================== // // Draws a single character with a shadow @@ -870,57 +956,6 @@ public: } - //==================================================================== - // - // Draws the splats and the 'You are here' arrows - // - //==================================================================== - - int WI_MapToIndex (const char *map) - { - unsigned int i; - - for (i = 0; i < lnodes.Size(); i++) - { - if (!strnicmp (lnodes[i].level, map, 8)) - break; - } - return i; - } - - - //==================================================================== - // - // Draws the splats and the 'You are here' arrows - // - //==================================================================== - - void WI_drawOnLnode( int n, FTexture * c[] ,int numc) - { - int i; - for(i=0;iGetScaledWidth(); - bottom = c[i]->GetScaledHeight(); - left = lnodes[n].x - c[i]->GetScaledLeftOffset(); - top = lnodes[n].y - c[i]->GetScaledTopOffset(); - right += left; - bottom += top; - - if (left >= 0 && right < 320 && top >= 0 && bottom < 200) - { - screen->DrawTexture (c[i], lnodes[n].x, lnodes[n].y, DTA_320x200, true, TAG_DONE); - break; - } - } - } - //==================================================================== // // Draws a number. @@ -1133,7 +1168,7 @@ public: state = ShowNextLoc; acceleratestage = 0; cnt = SHOWNEXTLOCDELAY * TICRATE; - WI_LoadBackground(true); + bg->LoadBackground(true); } void WI_updateShowNextLoc () @@ -1146,26 +1181,7 @@ public: void WI_drawShowNextLoc(void) { - unsigned int i; - - WI_drawBackground(); - - if (splat) - { - for (i=0 ; iflags & LEVEL_VISITED) WI_drawOnLnode(i, &splat,1); // draw a splat on taken cities. - } - } - - // draw flashing ptr - if (snl_pointeron && yah.Size()) - { - unsigned int v = WI_MapToIndex (wbs->next); - // Draw only if it points to a valid level on the current screen! - if (vdrawBackground(state, true, snl_pointeron); // draws which level you are entering.. WI_drawEL (); @@ -1344,7 +1360,7 @@ public: player_t *sortedplayers[MAXPLAYERS]; // draw animated background - WI_drawBackground(); + bg->drawBackground(state, false, false); y = WI_drawLF(); @@ -1648,7 +1664,7 @@ public: FTexture *readyico = TexMan.FindTexture("READYICO"); // draw animated background - WI_drawBackground(); + bg->drawBackground(state, false, false); y = WI_drawLF(); @@ -1898,8 +1914,8 @@ public: lh = IntermissionFont->GetHeight() * 3 / 2; // draw animated background - WI_drawBackground(); - + bg->drawBackground(state, false, false); + WI_drawLF(); if (gameinfo.gametype & GAME_DoomChex) @@ -2089,12 +2105,15 @@ public: if (li) lnametexts[1] = li->LookupLevelName(); else lnametexts[1] = ""; - WI_LoadBackground(false); + bg = new FInterBackground(wbs); + noautostartmap = bg->LoadBackground(false); } void WI_unloadData () { // [RH] The texture data gets unloaded at pre-map time, so there's nothing to do here + if (bg != nullptr) delete bg; + bg = nullptr; return; } @@ -2155,7 +2174,7 @@ static FIntermissionScreen WI_Screen; void WI_Ticker() { - WI_Screen.WI_updateAnimatedBack(); + WI_Screen.bg->updateAnimatedBack(); WI_Screen.WI_Ticker(); } From 8dac6782003f84e1a62b2274ec7d47f09c84bf15 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 19:10:49 +0100 Subject: [PATCH 02/11] - added DAMAGE_NO_ARMOR flag for ACS's SectorDamage function. --- src/p_spec.cpp | 3 ++- src/p_spec.h | 1 + src/v_draw.cpp | 8 ++++---- src/v_video.h | 2 +- src/wi_stuff.cpp | 32 +++++++++++++++----------------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 0eb619723..b3ce7e3e3 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -466,7 +466,8 @@ static void DoSectorDamage(AActor *actor, sector_t *sec, int amount, FName type, return; } - P_DamageMobj (actor, NULL, NULL, amount, type); + int dflags = (flags & DAMAGE_NO_ARMOR) ? DMG_NO_ARMOR : 0; + P_DamageMobj (actor, NULL, NULL, amount, type, dflags); } void P_SectorDamage(int tag, int amount, FName type, PClassActor *protectClass, int flags) diff --git a/src/p_spec.h b/src/p_spec.h index 5cb8861e4..b00e5cacf 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -76,6 +76,7 @@ const double CARRYFACTOR = 3 / 32.; #define DAMAGE_NONPLAYERS 2 #define DAMAGE_IN_AIR 4 #define DAMAGE_SUBCLASSES_PROTECT 8 +#define DAMAGE_NO_ARMOR 16 // [RH] If a deathmatch game, checks to see if noexit is enabled. diff --git a/src/v_draw.cpp b/src/v_draw.cpp index ca5e1fa37..0a9b75b19 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -572,7 +572,7 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, parms->colorOverlay = 0; parms->alphaChannel = false; parms->flipX = false; - parms->shadowAlpha = 0; + //parms->shadowAlpha = 0; parms->shadowColor = 0; parms->virtWidth = this->GetWidth(); parms->virtHeight = this->GetHeight(); @@ -845,7 +845,7 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, break; case DTA_ShadowAlpha: - parms->shadowAlpha = (float)MIN(1., ListGetDouble(tags)); + //parms->shadowAlpha = (float)MIN(1., ListGetDouble(tags)); break; case DTA_ShadowColor: @@ -856,12 +856,12 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, boolval = ListGetInt(tags); if (boolval) { - parms->shadowAlpha = 0.5; + //parms->shadowAlpha = 0.5; parms->shadowColor = 0; } else { - parms->shadowAlpha = 0; + //parms->shadowAlpha = 0; } break; diff --git a/src/v_video.h b/src/v_video.h index 72474ee28..8618f95ba 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -162,7 +162,7 @@ struct DrawParms uint32 colorOverlay; INTBOOL alphaChannel; INTBOOL flipX; - float shadowAlpha; + //float shadowAlpha; int shadowColor; INTBOOL keepratio; INTBOOL masked; diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 525d0c577..d5c5554da 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -738,6 +738,7 @@ public: bool noautostartmap; int dofrags; int ng_state; + float shadowalpha; // // GRAPHICS @@ -777,23 +778,6 @@ public: - //==================================================================== - // - // Draws a single character with a shadow - // - //==================================================================== - - int WI_DrawCharPatch (FFont *font, int charcode, int x, int y, EColorRange translation=CR_UNTRANSLATED, bool nomove=false) - { - int width; - font->GetChar(charcode, &width); - screen->DrawChar(font, translation, x, y, charcode, - nomove ? DTA_CleanNoMove : DTA_Clean, true, - DTA_ShadowAlpha, (gameinfo.gametype & GAME_DoomChex) ? 0 : 0.5, - TAG_DONE); - return x - width; - } - //==================================================================== // // CheckRealHeight @@ -830,6 +814,20 @@ public: return maxy; } + //==================================================================== + // + // Draws a single character with a shadow + // + //==================================================================== + + int WI_DrawCharPatch(FFont *font, int charcode, int x, int y, EColorRange translation = CR_UNTRANSLATED, bool nomove = false) + { + int width; + font->GetChar(charcode, &width); + screen->DrawChar(font, translation, x, y, charcode, nomove ? DTA_CleanNoMove : DTA_Clean, true, TAG_DONE); + return x - width; + } + //==================================================================== // // Draws a level name with the big font From 5ea8ad54a46c67546aefdae17abfbcafc73b5768 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 19:56:22 +0100 Subject: [PATCH 03/11] - added tags to all ammo types. --- wadsrc/static/language.enu | 17 +++++++++++++++++ wadsrc/static/zscript/doom/doomammo.txt | 4 ++++ wadsrc/static/zscript/heretic/hereticammo.txt | 6 ++++++ wadsrc/static/zscript/hexen/mana.txt | 2 ++ 4 files changed, 29 insertions(+) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index b1a8172d7..224aa24f0 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -1566,6 +1566,23 @@ TXT_COMM0 = "Incoming Message"; TXT_COMM1 = "Incoming Message from BlackBird"; +AMMO_CLIP = "Bullets"; +AMMO_SHELLS = "Shotgun Shells"; +AMMO_ROCKETS = "Rockets"; +AMMO_CELLS = "Energy Cells"; +AMMO_GOLDWAND = "Wand Crystals"; +AMMO_CROSSBOW = "Ethereal Arrows"; +AMMO_BLASTER = "Claw Orbs"; +AMMO_MACE = "Mace Spheres"; +AMMO_SKULLROD = "Hellstaff Runes"; +AMMO_PHOENIXROD = "Flame Orbs"; +AMMO_MANA1 = "Blue Mana"; +AMMO_MANA2 = "Green Mana"; +$ifgame(chex) AMMO_CLIP = "Mini Zorch Charge"; +$ifgame(chex) AMMO_SHELLS = "Large Zorcher Charge"; +$ifgame(chex) AMMO_ROCKETS = "Propulsor Charge"; +$ifgame(chex) AMMO_CELLS = "Phasing Zorcher Charge"; + // Menu Strings // Main Menu diff --git a/wadsrc/static/zscript/doom/doomammo.txt b/wadsrc/static/zscript/doom/doomammo.txt index 394f13e94..950fd2122 100644 --- a/wadsrc/static/zscript/doom/doomammo.txt +++ b/wadsrc/static/zscript/doom/doomammo.txt @@ -10,6 +10,7 @@ class Clip : Ammo Ammo.BackpackAmount 10; Ammo.BackpackMaxAmount 400; Inventory.Icon "CLIPA0"; + Tag "$AMMO_CLIP"; } States { @@ -48,6 +49,7 @@ class RocketAmmo : Ammo Ammo.BackpackAmount 1; Ammo.BackpackMaxAmount 100; Inventory.Icon "ROCKA0"; + Tag "$AMMO_ROCKETS"; } States { @@ -86,6 +88,7 @@ class Cell : Ammo Ammo.BackpackAmount 20; Ammo.BackpackMaxAmount 600; Inventory.Icon "CELLA0"; + Tag "$AMMO_CELLS"; } States { @@ -124,6 +127,7 @@ class Shell : Ammo Ammo.BackpackAmount 4; Ammo.BackpackMaxAmount 100; Inventory.Icon "SHELA0"; + Tag "$AMMO_SHELLS"; } States { diff --git a/wadsrc/static/zscript/heretic/hereticammo.txt b/wadsrc/static/zscript/heretic/hereticammo.txt index cf1e50a3d..c5ea831aa 100644 --- a/wadsrc/static/zscript/heretic/hereticammo.txt +++ b/wadsrc/static/zscript/heretic/hereticammo.txt @@ -11,6 +11,7 @@ Class GoldWandAmmo : Ammo Ammo.BackpackAmount 10; Ammo.BackpackMaxAmount 200; Inventory.Icon "INAMGLD"; + Tag "$AMMO_GOLDWAND"; } States { @@ -48,6 +49,7 @@ Class CrossbowAmmo : Ammo Ammo.BackpackAmount 5; Ammo.BackpackMaxAmount 100; Inventory.Icon "INAMBOW"; + Tag "$AMMO_CROSSBOW"; } States { @@ -85,6 +87,7 @@ Class MaceAmmo : Ammo Ammo.BackpackAmount 20; Ammo.BackpackMaxAmount 300; Inventory.Icon "INAMLOB"; + Tag "$AMMO_MACE"; } States { @@ -123,6 +126,7 @@ Class BlasterAmmo : Ammo Ammo.BackpackAmount 10; Ammo.BackpackMaxAmount 400; Inventory.Icon "INAMBST"; + Tag "$AMMO_BLASTER"; } States { @@ -161,6 +165,7 @@ Class SkullRodAmmo : Ammo Ammo.BackpackAmount 20; Ammo.BackpackMaxAmount 400; Inventory.Icon "INAMRAM"; + Tag "$AMMO_SKULLROD"; } States { @@ -199,6 +204,7 @@ Class PhoenixRodAmmo : Ammo Ammo.BackpackAmount 1; Ammo.BackpackMaxAmount 40; Inventory.Icon "INAMPNX"; + Tag "$AMMO_PHOENIXROD"; } States { diff --git a/wadsrc/static/zscript/hexen/mana.txt b/wadsrc/static/zscript/hexen/mana.txt index 0a43a21dd..ad3d6d66b 100644 --- a/wadsrc/static/zscript/hexen/mana.txt +++ b/wadsrc/static/zscript/hexen/mana.txt @@ -13,6 +13,7 @@ class Mana1 : Ammo +FLOATBOB Inventory.Icon "MAN1I0"; Inventory.PickupMessage "$TXT_MANA_1"; + Tag "$AMMO_MANA1"; } States { @@ -37,6 +38,7 @@ class Mana2 : Ammo +FLOATBOB Inventory.Icon "MAN2G0"; Inventory.PickupMessage "$TXT_MANA_2"; + Tag "$AMMO_MANA2"; } States { From 35033891ace78be7dc4623cfbe3e51960830a5fc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 20:12:30 +0100 Subject: [PATCH 04/11] - added MF7_NOINFIGHTSPECIES flag. --- src/actor.h | 1 + src/p_interaction.cpp | 3 +++ src/scripting/thingdef_data.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/src/actor.h b/src/actor.h index d387da2c8..c8c7cbc5f 100644 --- a/src/actor.h +++ b/src/actor.h @@ -388,6 +388,7 @@ enum ActorFlag7 MF7_SMASHABLE = 0x04000000, // dies if hitting the floor. MF7_NOSHIELDREFLECT = 0x08000000, // will not be reflected by shields. MF7_FORCEZERORADIUSDMG = 0x10000000, // passes zero radius damage on to P_DamageMobj, this is necessary in some cases where DoSpecialDamage gets overrideen. + MF7_NOINFIGHTSPECIES = 0x20000000, // don't start infights with one's own species. }; // --- mobj.renderflags --- diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 28df6e761..e940c259f 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1714,6 +1714,9 @@ bool AActor::OkayToSwitchTarget (AActor *other) } } + if ((flags7 & MF7_NOINFIGHTSPECIES) && GetSpecies() == target->GetSpecies()) + return false; // Don't fight own species. + if ((other->flags3 & MF3_NOTARGET) && (other->tid != TIDtoHate || TIDtoHate == 0) && !IsHostile (other)) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 735fddba7..a737ce414 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -317,6 +317,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF7, SMASHABLE, AActor, flags7), DEFINE_FLAG(MF7, NOSHIELDREFLECT, AActor, flags7), DEFINE_FLAG(MF7, FORCEZERORADIUSDMG, AActor, flags7), + DEFINE_FLAG(MF7, NOINFIGHTSPECIES, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From 7f78b42f21964379d7b0948d278d7fee2f5ba409 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 20:20:43 +0100 Subject: [PATCH 05/11] - added an 'inventory change' and 'weapon change' sound, which by default are not defined. --- src/g_game.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/g_game.cpp b/src/g_game.cpp index d93d6743b..b4e497311 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -347,6 +347,10 @@ CCMD (weapnext) StatusBar->AttachMessage(new DHUDMessageFadeOut(SmallFont, SendItemUse->GetTag(), 1.5f, 0.90f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID( 'W', 'E', 'P', 'N' )); } + if (SendItemUse != players[consoleplayer].ReadyWeapon) + { + S_Sound(CHAN_AUTO, "misc/weaponchange", 1.0, ATTN_NONE); + } } CCMD (weapprev) @@ -358,6 +362,10 @@ CCMD (weapprev) StatusBar->AttachMessage(new DHUDMessageFadeOut(SmallFont, SendItemUse->GetTag(), 1.5f, 0.90f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID( 'W', 'E', 'P', 'N' )); } + if (SendItemUse != players[consoleplayer].ReadyWeapon) + { + S_Sound(CHAN_AUTO, "misc/weaponchange", 1.0, ATTN_NONE); + } } CCMD (invnext) @@ -367,6 +375,7 @@ CCMD (invnext) if (who == NULL) return; + auto old = who->InvSel; if (who->InvSel != NULL) { if ((next = who->InvSel->NextInv()) != NULL) @@ -390,6 +399,10 @@ CCMD (invnext) 1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V')); } who->player->inventorytics = 5*TICRATE; + if (old != who->InvSel) + { + S_Sound(CHAN_AUTO, "misc/invchange", 1.0, ATTN_NONE); + } } CCMD (invprev) @@ -399,6 +412,7 @@ CCMD (invprev) if (who == NULL) return; + auto old = who->InvSel; if (who->InvSel != NULL) { if ((item = who->InvSel->PrevInv()) != NULL) @@ -420,6 +434,10 @@ CCMD (invprev) 1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V')); } who->player->inventorytics = 5*TICRATE; + if (old != who->InvSel) + { + S_Sound(CHAN_AUTO, "misc/invchange", 1.0, ATTN_NONE); + } } CCMD (invuseall) From 35552ce0cb82e919cab57331880dfe082260f697 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 20:45:28 +0100 Subject: [PATCH 06/11] - added a Death.Sky state for missiles that gets used when they hit a sky plane. - fixed: The Alt HUD did not draw the crosshair in HUD off mode. --- src/d_main.cpp | 4 ++ src/g_shared/shared_hud.cpp | 4 -- src/namedef.h | 1 + src/p_local.h | 2 +- src/p_mobj.cpp | 70 +++++++++++++++++++++------------ wadsrc/static/zscript/actor.txt | 3 +- 6 files changed, 52 insertions(+), 32 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 02cbca73a..b430c7f04 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -810,6 +810,10 @@ void D_Display () { StatusBar->DrawBottomStuff (HUD_AltHud); if (DrawFSHUD || automapactive) DrawHUD(); + if (players[consoleplayer].camera && players[consoleplayer].camera->player) + { + StatusBar->DrawCrosshair(); + } StatusBar->Draw (HUD_AltHud); StatusBar->DrawTopStuff (HUD_AltHud); } diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index d39c16d88..7fea7b014 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -1136,10 +1136,6 @@ void DrawHUD() i=DrawAmmo(CPlayer, hudwidth-5, i); if (hud_showweapons) DrawWeapons(CPlayer, hudwidth - 5, i); DrawInventory(CPlayer, 144, hudheight-28); - if (CPlayer->camera && CPlayer->camera->player) - { - StatusBar->DrawCrosshair(); - } if (idmypos) DrawCoordinates(CPlayer); DrawTime(); diff --git a/src/namedef.h b/src/namedef.h index 105d29cdd..13e9096bc 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -654,6 +654,7 @@ xx(Goodbye) xx(Require) xx(Exclude) xx(Userstring) +xx(Sky) // Special menus xx(Mainmenu) diff --git a/src/p_local.h b/src/p_local.h index 89346328e..677de09fc 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -111,7 +111,7 @@ void P_BloodSplatter (const DVector3 &pos, AActor *originator, DAngle hitangle); void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle); void P_RipperBlood (AActor *mo, AActor *bleeder); int P_GetThingFloorType (AActor *thing); -void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target); +void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target, bool onsky = false); AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type); AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index fd0df678b..a908e115e 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1804,7 +1804,7 @@ bool AActor::Massacre () // //---------------------------------------------------------------------------- -void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target) +void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target, bool onsky) { if (mo->flags3 & MF3_EXPLOCOUNT) { @@ -1832,11 +1832,15 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target) } if (nextstate == NULL) nextstate = mo->FindState(NAME_Death); - if (line != NULL && line->special == Line_Horizon && !(mo->flags3 & MF3_SKYEXPLODE)) + if (onsky || (line != NULL && line->special == Line_Horizon)) { - // [RH] Don't explode missiles on horizon lines. - mo->Destroy (); - return; + if (!(mo->flags3 & MF3_SKYEXPLODE)) + { + // [RH] Don't explode missiles on horizon lines. + mo->Destroy(); + return; + } + nextstate = mo->FindState(NAME_Death, NAME_Sky); } if (line != NULL && cl_missiledecals) @@ -2557,26 +2561,32 @@ double P_XYMovement (AActor *mo, DVector2 scroll) } explode: // explode a missile - if (!(mo->flags3 & MF3_SKYEXPLODE)) - { + bool onsky = false; if (tm.ceilingline && tm.ceilingline->backsector && tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum && mo->Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline))) { - // Hack to prevent missiles exploding against the sky. - // Does not handle sky floors. - mo->Destroy (); - return Oldfloorz; + if (!(mo->flags3 & MF3_SKYEXPLODE)) + { + // Hack to prevent missiles exploding against the sky. + // Does not handle sky floors. + mo->Destroy(); + return Oldfloorz; + } + else onsky = true; } // [RH] Don't explode on horizon lines. if (mo->BlockingLine != NULL && mo->BlockingLine->special == Line_Horizon) { - mo->Destroy (); - return Oldfloorz; + if (!(mo->flags3 & MF3_SKYEXPLODE)) + { + mo->Destroy(); + return Oldfloorz; + } + else onsky = true; } - } - P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj); + P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj, onsky); return Oldfloorz; } else @@ -2955,15 +2965,20 @@ void P_ZMovement (AActor *mo, double oldfloorz) } else { - if (mo->floorpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE)) + bool onsky = false; + if (mo->floorpic == skyflatnum) { - // [RH] Just remove the missile without exploding it - // if this is a sky floor. - mo->Destroy (); - return; + if (!(mo->flags3 & MF3_SKYEXPLODE)) + { + // [RH] Just remove the missile without exploding it + // if this is a sky floor. + mo->Destroy(); + return; + } + else onsky = true; } P_HitFloor (mo); - P_ExplodeMissile (mo, NULL, NULL); + P_ExplodeMissile (mo, NULL, NULL, onsky); return; } } @@ -3056,12 +3071,17 @@ void P_ZMovement (AActor *mo, double oldfloorz) { return; } - if (mo->ceilingpic == skyflatnum && !(mo->flags3 & MF3_SKYEXPLODE)) + bool onsky = false; + if (mo->ceilingpic == skyflatnum) { - mo->Destroy (); - return; + if (!(mo->flags3 & MF3_SKYEXPLODE)) + { + mo->Destroy(); + return; + } + else onsky = true; } - P_ExplodeMissile (mo, NULL, NULL); + P_ExplodeMissile (mo, NULL, NULL, onsky); return; } } diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 815ffd479..2e9752b97 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -230,7 +230,6 @@ class Actor : Thinker native native deprecated double ScaleX; native deprecated double ScaleY; - //int ConversationRoot; // THe root of the current dialogue; //FStrifeDialogueNode *Conversation; // [RH] The dialogue to show when this actor is used.; @@ -368,7 +367,7 @@ class Actor : Thinker native native Vector3 PosRelative(sector sec); native void HandleSpawnFlags(); - native void ExplodeMissile(line lin = null, Actor target = null); + native void ExplodeMissile(line lin = null, Actor target = null, bool onsky = false); native void RestoreDamage(); native int SpawnHealth(); native void SetDamage(int dmg); From 43e5f035e4cd591b442245d7ffe23f560187459e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 21:48:15 +0100 Subject: [PATCH 07/11] - added a 'brief' mode to linetarget and info. --- src/c_cmds.cpp | 6 +++--- src/c_functions.cpp | 4 ++-- src/c_functions.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index e8f9509e5..ff83d8342 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -880,7 +880,7 @@ CCMD(linetarget) if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; C_AimLine(&t, false); if (t.linetarget) - C_PrintInfo(t.linetarget); + C_PrintInfo(t.linetarget, argv.argc() > 1 && atoi(argv[1]) != 0); else Printf("No target found\n"); } @@ -893,7 +893,7 @@ CCMD(info) if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; C_AimLine(&t, true); if (t.linetarget) - C_PrintInfo(t.linetarget); + C_PrintInfo(t.linetarget, !(argv.argc() > 1 && atoi(argv[1]) == 0)); else Printf("No target found. Info cannot find actors that have " "the NOBLOCKMAP flag or have height/radius of 0.\n"); @@ -902,7 +902,7 @@ CCMD(info) CCMD(myinfo) { if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; - C_PrintInfo(players[consoleplayer].mo); + C_PrintInfo(players[consoleplayer].mo, true); } typedef bool (*ActorTypeChecker) (AActor *); diff --git a/src/c_functions.cpp b/src/c_functions.cpp index 1d1b35a45..ba3eb1175 100644 --- a/src/c_functions.cpp +++ b/src/c_functions.cpp @@ -39,7 +39,7 @@ #include "c_functions.h" -void C_PrintInfo(AActor *target) +void C_PrintInfo(AActor *target, bool verbose) { if (target->player) Printf("Player=%s, ", target->player->userinfo.GetName()); @@ -47,7 +47,7 @@ void C_PrintInfo(AActor *target) target->GetClass()->TypeName.GetChars(), target->health, target->SpawnHealth()); - PrintMiscActorInfo(target); + if (verbose) PrintMiscActorInfo(target); } void C_AimLine(FTranslatedLineTarget *t, bool nonshootable) diff --git a/src/c_functions.h b/src/c_functions.h index 3d8ab6fc8..4989469a6 100644 --- a/src/c_functions.h +++ b/src/c_functions.h @@ -34,6 +34,6 @@ void C_PrintInv(AActor *target); void C_AimLine(FTranslatedLineTarget *t, bool nonshootable); -void C_PrintInfo(AActor *target); +void C_PrintInfo(AActor *target, bool verbose); struct FTranslatedLineTarget; \ No newline at end of file From 6ae91ac9ea1184e9016a3037e3097000bfb99a11 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 26 Feb 2017 10:36:03 +0200 Subject: [PATCH 08/11] Fixed scripting type of demoplayback global variable https://mantis.zdoom.org/view.php?id=334 --- src/scripting/thingdef_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index a737ce414..f68667bbb 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -917,7 +917,7 @@ void InitThingdef() fieldptr = new PField("gametic", TypeSInt32, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&gametic); Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr); - fieldptr = new PField("demoplayback", TypeSInt32, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&demoplayback); + fieldptr = new PField("demoplayback", TypeBool, VARF_Native | VARF_Static | VARF_ReadOnly, (intptr_t)&demoplayback); Namespaces.GlobalNamespace->Symbols.AddSymbol(fieldptr); fieldptr = new PField("BackbuttonTime", TypeSInt32, VARF_Native | VARF_Static, (intptr_t)&BackbuttonTime); From c150f9d737031afd9584a0baba1ab58facc99aac Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 26 Feb 2017 11:37:43 +0200 Subject: [PATCH 09/11] Fixed incorrect pointers for Actor.Used() https://mantis.zdoom.org/view.php?id=340 --- src/p_map.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 789a07076..13f566b1f 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5276,20 +5276,22 @@ bool P_UseTraverse(AActor *usething, const DVector2 &start, const DVector2 &end, // [RH] Check for things to talk with or use a puzzle item on if (!in->isaline) { - if (usething == in->d.thing) + AActor * const mobj = in->d.thing; + + if (mobj == usething) continue; // Check thing // Check for puzzle item use or USESPECIAL flag // Extended to use the same activationtype mechanism as BUMPSPECIAL does - if (in->d.thing->flags5 & MF5_USESPECIAL || in->d.thing->special == UsePuzzleItem) + if (mobj->flags5 & MF5_USESPECIAL || mobj->special == UsePuzzleItem) { - if (P_ActivateThingSpecial(in->d.thing, usething)) + if (P_ActivateThingSpecial(mobj, usething)) return true; } - IFVIRTUALPTR(usething, AActor, Used) + IFVIRTUALPTR(mobj, AActor, Used) { - VMValue params[] = { usething, in->d.thing }; + VMValue params[] = { mobj, usething }; int ret; VMReturn vret(&ret); GlobalVMStack.Call(func, params, 2, &vret, 1); From bfa7a2d737c654da06eba8b7a59bedeaabb8c65a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Feb 2017 10:58:22 +0100 Subject: [PATCH 10/11] - fixed: DStaticEventHandler did not declare its pointers. --- src/events.cpp | 8 +++++++- src/events.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/events.cpp b/src/events.cpp index afa98c99d..d714eefce 100755 --- a/src/events.cpp +++ b/src/events.cpp @@ -449,7 +449,13 @@ DEFINE_EVENT_LOOPER(WorldLightning) DEFINE_EVENT_LOOPER(WorldTick) // declarations -IMPLEMENT_CLASS(DStaticEventHandler, false, false); +IMPLEMENT_CLASS(DStaticEventHandler, false, true); + +IMPLEMENT_POINTERS_START(DStaticEventHandler) +IMPLEMENT_POINTER(next) +IMPLEMENT_POINTER(prev) +IMPLEMENT_POINTERS_END + IMPLEMENT_CLASS(DEventHandler, false, false); IMPLEMENT_CLASS(DBaseEvent, false, false) IMPLEMENT_CLASS(DRenderEvent, false, false) diff --git a/src/events.h b/src/events.h index 46ed88b95..fa63e7325 100755 --- a/src/events.h +++ b/src/events.h @@ -76,7 +76,7 @@ void E_SerializeEvents(FSerializer& arc); class DStaticEventHandler : public DObject // make it a part of normal GC process { - DECLARE_CLASS(DStaticEventHandler, DObject) + DECLARE_CLASS(DStaticEventHandler, DObject); HAS_OBJECT_POINTERS public: DStaticEventHandler() From 76a44ebf9cdef82a3d1dc08bd43e5a960163de54 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 26 Feb 2017 12:04:34 +0200 Subject: [PATCH 11/11] Fixed splitting of long lines in message box menu https://mantis.zdoom.org/view.php?id=338 --- src/menu/messagebox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/menu/messagebox.cpp b/src/menu/messagebox.cpp index a1a0fda76..a68bbc5f1 100644 --- a/src/menu/messagebox.cpp +++ b/src/menu/messagebox.cpp @@ -67,7 +67,8 @@ DMenu *CreateMessageBoxMenu(DMenu *parent, const char *message, int messagemode, { auto c = PClass::FindClass("MessageBoxMenu"); auto p = c->CreateNew(); - VMValue params[] = { p, parent, FString(message), messagemode, playsound, action.GetIndex(), reinterpret_cast(handler) }; + const FString msg = '$' == message[0] ? GStrings(message + 1) : message; + VMValue params[] = { p, parent, msg, messagemode, playsound, action.GetIndex(), reinterpret_cast(handler) }; auto f = dyn_cast(c->Symbols.FindSymbol("Init", false)); GlobalVMStack.Call(f->Variants[0].Implementation, params, countof(params), nullptr, 0);