diff --git a/src/actionspecials.h b/src/actionspecials.h index 6d9d2feb8f..4ab222b2c4 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -176,7 +176,7 @@ DEFINE_SPECIAL(Sector_SetCeilingScale, 188, 5, 5, 5) DEFINE_SPECIAL(Sector_SetFloorScale, 189, 5, 5, 5) DEFINE_SPECIAL(Static_Init, 190, -1, -1, 4) DEFINE_SPECIAL(SetPlayerProperty, 191, 3, 3, 3) -DEFINE_SPECIAL(Ceiling_LowerToHighestFloor, 192, 2, 4, 4) +DEFINE_SPECIAL(Ceiling_LowerToHighestFloor, 192, 2, 4, 5) DEFINE_SPECIAL(Ceiling_LowerInstant, 193, 3, 5, 5) DEFINE_SPECIAL(Ceiling_RaiseInstant, 194, 3, 4, 4) DEFINE_SPECIAL(Ceiling_CrushRaiseAndStayA, 195, 4, 5, 5) @@ -222,7 +222,7 @@ DEFINE_SPECIAL(Light_MaxNeighbor, 234, 1, 1, 1) DEFINE_SPECIAL(Floor_TransferTrigger, 235, 1, 1, 1) DEFINE_SPECIAL(Floor_TransferNumeric, 236, 1, 1, 1) DEFINE_SPECIAL(ChangeCamera, 237, 3, 3, 3) -DEFINE_SPECIAL(Floor_RaiseToLowestCeiling, 238, 2, 4, 4) +DEFINE_SPECIAL(Floor_RaiseToLowestCeiling, 238, 2, 4, 5) DEFINE_SPECIAL(Floor_RaiseByValueTxTy, 239, 3, 3, 3) DEFINE_SPECIAL(Floor_RaiseByTexture, 240, 2, 4, 4) DEFINE_SPECIAL(Floor_LowerToLowestTxTy, 241, 2, 2, 2) @@ -238,21 +238,21 @@ DEFINE_SPECIAL(Floor_Donut, 250, 3, 3, 3) DEFINE_SPECIAL(FloorAndCeiling_LowerRaise, 251, 3, 4, 4) DEFINE_SPECIAL(Ceiling_RaiseToNearest, 252, 2, 3, 3) DEFINE_SPECIAL(Ceiling_LowerToLowest, 253, 2, 4, 4) -DEFINE_SPECIAL(Ceiling_LowerToFloor, 254, 2, 4, 4) +DEFINE_SPECIAL(Ceiling_LowerToFloor, 254, 2, 4, 5) DEFINE_SPECIAL(Ceiling_CrushRaiseAndStaySilA, 255, 4, 5, 5) DEFINE_SPECIAL(Floor_LowerToHighestEE, 256, 2, 3, 3) DEFINE_SPECIAL(Floor_RaiseToLowest, 257, 1, 3, 3) DEFINE_SPECIAL(Floor_LowerToLowestCeiling, 258, 2, 3, 3) -DEFINE_SPECIAL(Floor_RaiseToCeiling, 259, 2, 4, 4) -DEFINE_SPECIAL(Floor_ToCeilingInstant, 260, 1, 3, 3) +DEFINE_SPECIAL(Floor_RaiseToCeiling, 259, 2, 4, 5) +DEFINE_SPECIAL(Floor_ToCeilingInstant, 260, 1, 3, 4) DEFINE_SPECIAL(Floor_LowerByTexture, 261, 2, 3, 3) DEFINE_SPECIAL(Ceiling_RaiseToHighest, 262, 2, 3, 3) DEFINE_SPECIAL(Ceiling_ToHighestInstant, 263, 1, 3, 3) DEFINE_SPECIAL(Ceiling_LowerToNearest, 264, 2, 4, 4) DEFINE_SPECIAL(Ceiling_RaiseToLowest, 265, 2, 3, 3) DEFINE_SPECIAL(Ceiling_RaiseToHighestFloor, 266, 2, 3, 3) -DEFINE_SPECIAL(Ceiling_ToFloorInstant, 267, 1, 3, 3) +DEFINE_SPECIAL(Ceiling_ToFloorInstant, 267, 1, 3, 4) DEFINE_SPECIAL(Ceiling_RaiseByTexture, 268, 2, 3, 3) DEFINE_SPECIAL(Ceiling_LowerByTexture, 269, 2, 4, 4) DEFINE_SPECIAL(Stairs_BuildDownDoom, 270, 5, 5, 5) diff --git a/src/c_console.cpp b/src/c_console.cpp index 2f221e319c..9a9274aa16 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -162,7 +162,7 @@ CVAR (Bool, con_centernotify, false, CVAR_ARCHIVE) CUSTOM_CVAR (Int, con_scaletext, 0, CVAR_ARCHIVE) // Scale notify text at high resolutions? { if (self < 0) self = 0; - if (self > 2) self = 2; + if (self > 3) self = 3; } CUSTOM_CVAR(Float, con_alpha, 0.75f, CVAR_ARCHIVE) @@ -493,7 +493,14 @@ void C_AddNotifyString (int printlevel, const char *source) return; } - width = con_scaletext > 1 ? DisplayWidth/2 : con_scaletext == 1 ? DisplayWidth / CleanXfac : DisplayWidth; + switch (con_scaletext) + { + default: + case 0: width = DisplayWidth; break; + case 1: width = DisplayWidth / CleanXfac; break; + case 2: width = DisplayWidth / 2; break; + case 3: width = DisplayWidth / 4; break; + } if (addtype == APPENDLINE && NotifyStrings[NUMNOTIFIES-1].PrintLevel == printlevel) { @@ -770,6 +777,23 @@ static void C_DrawNotifyText () line, NotifyStrings[i].Text, DTA_AlphaF, alpha, TAG_DONE); } + else if (con_scaletext == 3) + { + if (!center) + screen->DrawText (SmallFont, color, 0, line, NotifyStrings[i].Text, + DTA_VirtualWidth, screen->GetWidth() / 4, + DTA_VirtualHeight, screen->GetHeight() / 4, + DTA_KeepRatio, true, + DTA_AlphaF, alpha, TAG_DONE); + else + screen->DrawText (SmallFont, color, (screen->GetWidth() / 4 - + SmallFont->StringWidth (NotifyStrings[i].Text))/4, + line, NotifyStrings[i].Text, + DTA_VirtualWidth, screen->GetWidth() / 4, + DTA_VirtualHeight, screen->GetHeight() / 4, + DTA_KeepRatio, true, + DTA_AlphaF, alpha, TAG_DONE); + } else { if (!center) diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index d814717c9d..b053d8bd86 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -234,9 +234,27 @@ void CT_Drawer (void) scalex = 1; } - int screen_width = con_scaletext > 1? SCREENWIDTH/2 : SCREENWIDTH; - int screen_height = con_scaletext > 1? SCREENHEIGHT/2 : SCREENHEIGHT; - int st_y = con_scaletext > 1? ST_Y/2 : ST_Y; + int screen_width, screen_height, st_y; + switch (con_scaletext) + { + default: + case 0: + case 1: + screen_width = SCREENWIDTH; + screen_height = SCREENHEIGHT; + st_y = ST_Y; + break; + case 2: + screen_width = SCREENWIDTH / 2; + screen_height = SCREENHEIGHT / 2; + st_y = ST_Y / 2; + break; + case 3: + screen_width = SCREENWIDTH / 4; + screen_height = SCREENHEIGHT / 4; + st_y = ST_Y / 4; + break; + } y += ((SCREENHEIGHT == viewheight && viewactive) || gamestate != GS_LEVEL) ? screen_height : st_y; diff --git a/src/g_shared/hudmessages.cpp b/src/g_shared/hudmessages.cpp index 0ee61f9422..9f13d3d9ef 100644 --- a/src/g_shared/hudmessages.cpp +++ b/src/g_shared/hudmessages.cpp @@ -260,7 +260,14 @@ void DHUDMessage::ResetText (const char *text) } else { - width = con_scaletext >= 2 ? SCREENWIDTH/2 : (con_scaletext ? SCREENWIDTH / CleanXfac : SCREENWIDTH); + switch (con_scaletext) + { + default: + case 0: width = SCREENWIDTH; break; + case 1: width = SCREENWIDTH / CleanXfac; break; + case 2: width = SCREENWIDTH / 2; break; + case 3: width = SCREENWIDTH / 4; break; + } } if (Lines != NULL) @@ -334,12 +341,18 @@ void DHUDMessage::Draw (int bottom, int visibility) else { xscale = yscale = 1; - if (HUDWidth==0 && con_scaletext>1) + if (HUDWidth==0 && con_scaletext==2) { screen_width/=2; screen_height/=2; bottom/=2; } + else if (HUDWidth==0 && con_scaletext==3) + { + screen_width/=4; + screen_height/=4; + bottom/=4; + } } if (HUDWidth == 0) @@ -448,6 +461,16 @@ void DHUDMessage::DoDraw (int linenum, int x, int y, bool clean, int hudheight) DTA_RenderStyle, Style, TAG_DONE); } + else if (con_scaletext == 3) + { + screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, + DTA_VirtualWidth, SCREENWIDTH/4, + DTA_VirtualHeight, SCREENHEIGHT/4, + DTA_AlphaF, Alpha, + DTA_RenderStyle, Style, + DTA_KeepRatio, true, + TAG_DONE); + } else { screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, @@ -551,6 +574,16 @@ void DHUDMessageFadeOut::DoDraw (int linenum, int x, int y, bool clean, int hudh DTA_RenderStyle, Style, TAG_DONE); } + else if (con_scaletext == 3) + { + screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, + DTA_VirtualWidth, SCREENWIDTH/4, + DTA_VirtualHeight, SCREENHEIGHT/4, + DTA_AlphaF, trans, + DTA_RenderStyle, Style, + DTA_KeepRatio, true, + TAG_DONE); + } else { screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, @@ -651,6 +684,16 @@ void DHUDMessageFadeInOut::DoDraw (int linenum, int x, int y, bool clean, int hu DTA_RenderStyle, Style, TAG_DONE); } + else if (con_scaletext == 3) + { + screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, + DTA_VirtualWidth, SCREENWIDTH/4, + DTA_VirtualHeight, SCREENHEIGHT/4, + DTA_AlphaF, trans, + DTA_RenderStyle, Style, + DTA_KeepRatio, true, + TAG_DONE); + } else { screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, @@ -830,6 +873,17 @@ void DHUDMessageTypeOnFadeOut::DoDraw (int linenum, int x, int y, bool clean, in DTA_RenderStyle, Style, TAG_DONE); } + else if (con_scaletext == 3) + { + screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, + DTA_VirtualWidth, SCREENWIDTH/4, + DTA_VirtualHeight, SCREENHEIGHT/4, + DTA_KeepRatio, true, + DTA_TextLen, LineVisible, + DTA_AlphaF, Alpha, + DTA_RenderStyle, Style, + TAG_DONE); + } else { screen->DrawText (Font, TextColor, x, y, Lines[linenum].Text, diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 3a8dc388c8..c9e87d6421 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -885,8 +885,25 @@ static void DrawCoordinates(player_t * CPlayer) pos = DVector3(apos, z); } - int vwidth = con_scaletext==0? SCREENWIDTH : SCREENWIDTH/2; - int vheight = con_scaletext==0? SCREENHEIGHT : SCREENHEIGHT/2; + int vwidth, vheight; + switch (con_scaletext) + { + default: + case 0: + vwidth = SCREENWIDTH; + vheight = SCREENWIDTH; + break; + case 1: + case 2: + vwidth = SCREENWIDTH/2; + vheight = SCREENWIDTH/2; + break; + case 3: + vwidth = SCREENWIDTH/4; + vheight = SCREENWIDTH/4; + break; + } + int xpos = vwidth - SmallFont->StringWidth("X: -00000")-6; int ypos = 18; @@ -1073,7 +1090,12 @@ void DrawHUD() if (hud_althudscale && SCREENWIDTH>640) { hudwidth=SCREENWIDTH/2; - if (hud_althudscale == 2) + if (hud_althudscale == 3) + { + hudwidth = SCREENWIDTH / 4; + hudheight = SCREENHEIGHT / 4; + } + else if (hud_althudscale == 2) { // Optionally just double the pixels to reduce scaling artifacts. hudheight=SCREENHEIGHT/2; diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index b48c048932..c3b1fd262b 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -108,7 +108,7 @@ CVAR (Int, crosshair, 0, CVAR_ARCHIVE) CVAR (Bool, crosshairforce, false, CVAR_ARCHIVE) CVAR (Color, crosshaircolor, 0xff0000, CVAR_ARCHIVE); CVAR (Bool, crosshairhealth, true, CVAR_ARCHIVE); -CVAR (Bool, crosshairscale, false, CVAR_ARCHIVE); +CVAR (Float, crosshairscale, 1.0, CVAR_ARCHIVE); CVAR (Bool, crosshairgrow, false, CVAR_ARCHIVE); CUSTOM_CVAR(Int, am_showmaplabel, 2, CVAR_ARCHIVE) { @@ -1106,9 +1106,9 @@ void DBaseStatusBar::DrawCrosshair () return; } - if (crosshairscale) + if (crosshairscale > 0.0f) { - size = SCREENHEIGHT / 200.; + size = SCREENHEIGHT * crosshairscale / 200.; } else { @@ -1247,6 +1247,13 @@ void DBaseStatusBar::Draw (EHudState state) xpos = vwidth - 80; y = ::ST_Y - height; } + else if (con_scaletext == 3) + { + vwidth = SCREENWIDTH/4; + vheight = SCREENHEIGHT/4; + xpos = vwidth - SmallFont->StringWidth("X: -00000")-6; + y = ::ST_Y/4 - height; + } else { vwidth = SCREENWIDTH/2; @@ -1259,6 +1266,8 @@ void DBaseStatusBar::Draw (EHudState state) { if (con_scaletext == 0) y -= height * 4; + else if (con_scaletext == 3) + y -= height; else y -= height * 2; } @@ -1407,6 +1416,11 @@ void DBaseStatusBar::DrawLog () hudwidth = SCREENWIDTH / 2; hudheight = SCREENHEIGHT / 2; break; + + case 3: + hudwidth = SCREENWIDTH / 4; + hudheight = SCREENHEIGHT / 4; + break; } int linelen = hudwidth<640? Scale(hudwidth,9,10)-40 : 560; diff --git a/src/p_ceiling.cpp b/src/p_ceiling.cpp index 8a0c8f9ef7..c635d9743c 100644 --- a/src/p_ceiling.cpp +++ b/src/p_ceiling.cpp @@ -309,7 +309,7 @@ bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int t break; case DCeiling::ceilLowerToHighestFloor: - targheight = sec->FindHighestFloorSurrounding (&spot); + targheight = sec->FindHighestFloorSurrounding (&spot) + height; ceiling->m_BottomHeight = sec->ceilingplane.PointToDist (spot, targheight); ceiling->m_Direction = -1; break; @@ -359,13 +359,13 @@ bool P_CreateCeiling(sector_t *sec, DCeiling::ECeiling type, line_t *line, int t break; case DCeiling::ceilLowerToFloor: - targheight = sec->FindHighestFloorPoint (&spot); + targheight = sec->FindHighestFloorPoint (&spot) + height; ceiling->m_BottomHeight = sec->ceilingplane.PointToDist (spot, targheight); ceiling->m_Direction = -1; break; case DCeiling::ceilRaiseToFloor: // [RH] What's this for? - targheight = sec->FindHighestFloorPoint (&spot); + targheight = sec->FindHighestFloorPoint (&spot) + height; ceiling->m_TopHeight = sec->ceilingplane.PointToDist (spot, targheight); ceiling->m_Direction = 1; break; diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 3f2b06f951..ccb1c82e97 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -349,16 +349,14 @@ bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, break; case DFloor::floorRaiseAndCrushDoom: + height = 8; case DFloor::floorRaiseToLowestCeiling: floor->m_Direction = 1; - newheight = sec->FindLowestCeilingSurrounding(&spot); - if (floortype == DFloor::floorRaiseAndCrushDoom) - newheight -= 8; + newheight = sec->FindLowestCeilingSurrounding(&spot) - height; ceilingheight = sec->FindLowestCeilingPoint(&spot2); floor->m_FloorDestDist = sec->floorplane.PointToDist(spot, newheight); if (sec->floorplane.ZatPointDist(spot2, floor->m_FloorDestDist) > ceilingheight) - floor->m_FloorDestDist = sec->floorplane.PointToDist(spot2, - floortype == DFloor::floorRaiseAndCrushDoom ? ceilingheight - 8 : ceilingheight); + floor->m_FloorDestDist = sec->floorplane.PointToDist(spot2, floortype == ceilingheight - height); break; case DFloor::floorRaiseToHighest: @@ -387,7 +385,7 @@ bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, case DFloor::floorRaiseToCeiling: floor->m_Direction = 1; - newheight = sec->FindLowestCeilingPoint(&spot); + newheight = sec->FindLowestCeilingPoint(&spot) - height; floor->m_FloorDestDist = sec->floorplane.PointToDist(spot, newheight); break; @@ -406,7 +404,7 @@ bool P_CreateFloor(sector_t *sec, DFloor::EFloor floortype, line_t *line, case DFloor::floorLowerToCeiling: // [RH] Essentially instantly raises the floor to the ceiling floor->m_Direction = -1; - newheight = sec->FindLowestCeilingPoint(&spot); + newheight = sec->FindLowestCeilingPoint(&spot) - height; floor->m_FloorDestDist = sec->floorplane.PointToDist(spot, newheight); break; diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 708380ac43..f1eae4928a 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -263,7 +263,13 @@ FUNC(LS_Door_Raise) FUNC(LS_Door_LockedRaise) // Door_LockedRaise (tag, speed, delay, lock, lighttag) { +#if 0 + // In Hexen this originally created a thinker running for nearly 4 years. + // Let's not do this unless it becomes necessary because this can hang tagwait. + return EV_DoDoor (arg2 || (level.flags2 & LEVEL2_HEXENHACK) ? DDoor::doorRaise : DDoor::doorOpen, ln, it, +#else return EV_DoDoor (arg2 ? DDoor::doorRaise : DDoor::doorOpen, ln, it, +#endif arg0, SPEED(arg1), TICS(arg2), arg3, arg4); } @@ -423,9 +429,9 @@ FUNC(LS_Floor_RaiseInstant) } FUNC(LS_Floor_ToCeilingInstant) -// Floor_ToCeilingInstant (tag, change, crush) +// Floor_ToCeilingInstant (tag, change, crush, gap) { - return EV_DoFloor (DFloor::floorLowerToCeiling, ln, arg0, 0, 0, CRUSH(arg2), CHANGE(arg1), true); + return EV_DoFloor (DFloor::floorLowerToCeiling, ln, arg0, 0, arg3, CRUSH(arg2), CHANGE(arg1), true); } FUNC(LS_Floor_MoveToValueTimes8) @@ -451,7 +457,7 @@ FUNC(LS_Floor_RaiseToLowestCeiling) FUNC(LS_Floor_LowerToLowestCeiling) // Floor_LowerToLowestCeiling (tag, speed, change) { - return EV_DoFloor (DFloor::floorLowerToLowestCeiling, ln, arg0, SPEED(arg1), 0, -1, CHANGE(arg2), true); + return EV_DoFloor (DFloor::floorLowerToLowestCeiling, ln, arg0, SPEED(arg1), arg4, -1, CHANGE(arg2), true); } FUNC(LS_Floor_RaiseByTexture) @@ -467,9 +473,9 @@ FUNC(LS_Floor_LowerByTexture) } FUNC(LS_Floor_RaiseToCeiling) -// Floor_RaiseToCeiling (tag, speed, change, crush) +// Floor_RaiseToCeiling (tag, speed, change, crush, gap) { - return EV_DoFloor (DFloor::floorRaiseToCeiling, ln, arg0, SPEED(arg1), 0, CRUSH(arg3), CHANGE(arg2), true); + return EV_DoFloor (DFloor::floorRaiseToCeiling, ln, arg0, SPEED(arg1), arg4, CRUSH(arg3), CHANGE(arg2), true); } FUNC(LS_Floor_RaiseByValueTxTy) @@ -709,9 +715,9 @@ FUNC(LS_Ceiling_MoveToValue) } FUNC(LS_Ceiling_LowerToHighestFloor) -// Ceiling_LowerToHighestFloor (tag, speed, change, crush) +// Ceiling_LowerToHighestFloor (tag, speed, change, crush, gap) { - return EV_DoCeiling (DCeiling::ceilLowerToHighestFloor, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2)); + return EV_DoCeiling (DCeiling::ceilLowerToHighestFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg2)); } FUNC(LS_Ceiling_LowerInstant) @@ -811,15 +817,15 @@ FUNC(LS_Ceiling_ToHighestInstant) } FUNC(LS_Ceiling_ToFloorInstant) -// Ceiling_ToFloorInstant (tag, change, crush) +// Ceiling_ToFloorInstant (tag, change, crush, gap) { - return EV_DoCeiling (DCeiling::ceilRaiseToFloor, ln, arg0, 2, 0, 0, CRUSH(arg2), 0, CHANGE(arg1)); + return EV_DoCeiling (DCeiling::ceilRaiseToFloor, ln, arg0, 2, 0, arg3, CRUSH(arg2), 0, CHANGE(arg1)); } FUNC(LS_Ceiling_LowerToFloor) -// Ceiling_LowerToFloor (tag, speed, change, crush) +// Ceiling_LowerToFloor (tag, speed, change, crush, gap) { - return EV_DoCeiling (DCeiling::ceilLowerToFloor, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg4)); + return EV_DoCeiling (DCeiling::ceilLowerToFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg4)); } FUNC(LS_Ceiling_LowerByTexture) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 94df4c3bf4..8971efe25a 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -6404,6 +6404,7 @@ void AActor::Revive() flags5 = info->flags5; flags6 = info->flags6; flags7 = info->flags7; + if (SpawnFlags & MTF_FRIENDLY) flags |= MF_FRIENDLY; DamageType = info->DamageType; health = SpawnHealth(); target = NULL; diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index 4bb247f94b..04ac218905 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -361,16 +361,20 @@ static void FinishThingdef() if (sfunc == NULL) { FCompileContext ctx(ti); - dmg->Resolve(ctx); - VMFunctionBuilder buildit; - buildit.Registers[REGT_POINTER].Get(1); // The self pointer - dmg->Emit(&buildit); - sfunc = buildit.MakeFunction(); - sfunc->NumArgs = 1; - sfunc->Proto = NULL; ///FIXME: Need a proper prototype here - // Save this function in case this damage value was reused - // (which happens quite easily with inheritance). - dmg->SetFunction(sfunc); + dmg = static_cast(dmg->Resolve(ctx)); + + if (dmg != nullptr) + { + VMFunctionBuilder buildit; + buildit.Registers[REGT_POINTER].Get(1); // The self pointer + dmg->Emit(&buildit); + sfunc = buildit.MakeFunction(); + sfunc->NumArgs = 1; + sfunc->Proto = NULL; ///FIXME: Need a proper prototype here + // Save this function in case this damage value was reused + // (which happens quite easily with inheritance). + dmg->SetFunction(sfunc); + } } def->Damage = sfunc; diff --git a/src/thingdef/thingdef_exp.cpp b/src/thingdef/thingdef_exp.cpp index 35932e0be1..6a756d9b5d 100644 --- a/src/thingdef/thingdef_exp.cpp +++ b/src/thingdef/thingdef_exp.cpp @@ -392,7 +392,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, PClassActor *cls) return ParseAtan2(sc, identifier, cls); default: args = new FArgumentList; - func = dyn_cast(cls->Symbols.FindSymbol(identifier, true)); + func = (cls == nullptr) ? nullptr : dyn_cast(cls->Symbols.FindSymbol(identifier, true)); try { // There is an action function ACS_NamedExecuteWithResult which must be ignored here for this to work. diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index acb26d05bb..b57618575a 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -414,7 +414,7 @@ ExpEmit FxBoolCast::Emit(VMFunctionBuilder *build) { build->Emit(OP_EQF_K, 1, from.RegNum, build->GetConstantFloat(0.)); } - else if (from.RegNum == REGT_POINTER) + else if (from.RegType == REGT_POINTER) { build->Emit(OP_EQA_K, 1, from.RegNum, build->GetConstantAddress(nullptr, ATAG_GENERIC)); } @@ -4410,6 +4410,8 @@ ExpEmit FxClassTypeCast::Emit(VMFunctionBuilder *build) FxExpression *FxStateByIndex::Resolve(FCompileContext &ctx) { CHECKRESOLVED(); + ABORT(ctx.Class); + if (ctx.Class->NumOwnedStates == 0) { // This can't really happen @@ -4464,6 +4466,8 @@ FxMultiNameState::FxMultiNameState(const char *_statestring, const FScriptPositi FxExpression *FxMultiNameState::Resolve(FCompileContext &ctx) { CHECKRESOLVED(); + ABORT(ctx.Class); + if (names[0] == NAME_None) { scope = NULL; diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index f4bad69bb6..566643b8e3 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -191,7 +191,12 @@ static void ParseConstant (FScanner &sc, PSymbolTable *symt, PClassActor *cls) FxExpression *expr = ParseExpression (sc, cls, true); sc.MustGetToken(';'); - if (!expr->isConstant()) + if (expr == nullptr) + { + sc.ScriptMessage("Error while resolving constant definition"); + FScriptPosition::ErrorCounter++; + } + else if (!expr->isConstant()) { sc.ScriptMessage("Constant definition is not a constant"); FScriptPosition::ErrorCounter++; @@ -247,16 +252,24 @@ static void ParseEnum (FScanner &sc, PSymbolTable *symt, PClassActor *cls) if (sc.CheckToken('=')) { FxExpression *expr = ParseExpression (sc, cls, true); - if (!expr->isConstant()) + if (expr != nullptr) { - sc.ScriptMessage("'%s' must be constant", symname.GetChars()); - FScriptPosition::ErrorCounter++; + if (!expr->isConstant()) + { + sc.ScriptMessage("'%s' must be constant", symname.GetChars()); + FScriptPosition::ErrorCounter++; + } + else + { + currvalue = static_cast(expr)->GetValue().GetInt(); + } + delete expr; } else { - currvalue = static_cast(expr)->GetValue().GetInt(); + sc.ScriptMessage("Error while resolving expression of '%s'", symname.GetChars()); + FScriptPosition::ErrorCounter++; } - delete expr; } PSymbolConstNumeric *sym = new PSymbolConstNumeric(symname, TypeSInt32); sym->Value = currvalue; @@ -568,7 +581,13 @@ static void ParseUserVariable (FScanner &sc, PSymbolTable *symt, PClassActor *cl if (sc.CheckToken('[')) { FxExpression *expr = ParseExpression(sc, cls, true); - if (!expr->isConstant()) + if (expr == nullptr) + { + sc.ScriptMessage("Error while resolving array size"); + FScriptPosition::ErrorCounter++; + maxelems = 1; + } + else if (!expr->isConstant()) { sc.ScriptMessage("Array size must be a constant"); FScriptPosition::ErrorCounter++; diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 8050079e80..ecfdfb1f05 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2197,6 +2197,7 @@ OPTVAL_PLAYER = "Player"; OPTVAL_MAP = "Map"; OPTVAL_SCALETO640X400 = "Scale to 640x400"; OPTVAL_PIXELDOUBLE = "Pixel double"; +OPTVAL_PIXELQUADRUPLE = "Pixel quadruple"; OPTVAL_CURRENTWEAPON = "Current weapon"; OPTVAL_AVAILABLEWEAPONS = "Available weapons"; OPTVAL_ALLWEAPONS = "All weapons"; @@ -2231,6 +2232,7 @@ OPTVAL_ANIMATED = "Animated"; OPTVAL_ROTATED = "Rotated"; OPTVAL_MAPDEFINEDCOLORSONLY = "Map defined colors only"; OPTVAL_DOUBLE = "Double"; +OPTVAL_QUADRUPLE = "Quadruple"; OPTVAL_ITEMPICKUP = "Item Pickup"; OPTVAL_OBITUARIES = "Obituaries"; OPTVAL_CRITICALMESSAGES = "Critical Messages"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 6a584d2927..69313a5d78 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -773,7 +773,7 @@ OptionMenu "HUDOptions" Option "$HUDMNU_GROWCROSSHAIR", "crosshairgrow", "OnOff" ColorPicker "$HUDMNU_CROSSHAIRCOLOR", "crosshaircolor" Option "$HUDMNU_CROSSHAIRHEALTH", "crosshairhealth", "OnOff" - Option "$HUDMNU_CROSSHAIRSCALE", "crosshairscale", "OnOff" + Slider "$HUDMNU_CROSSHAIRSCALE", "crosshairscale", 0.0, 2.0, 0.05, 2 StaticText " " Option "$HUDMNU_NAMETAGS", "displaynametags", "DisplayTagsTypes" Option "$HUDMNU_NAMETAGCOLOR", "nametagcolor", "TextColors", "displaynametags" @@ -804,6 +804,7 @@ OptionValue "AltHUDScale" 0, "$OPTVAL_OFF" 1, "$OPTVAL_SCALETO640X400" 2, "$OPTVAL_PIXELDOUBLE" + 3, "$OPTVAL_PIXELQUADRUPLE" } OptionValue "AltHUDAmmo" @@ -1120,6 +1121,7 @@ OptionValue ScaleValues 0, "$OPTVAL_OFF" 1, "$OPTVAL_ON" 2, "$OPTVAL_DOUBLE" + 3, "$OPTVAL_QUADRUPLE" } OptionValue MessageLevels diff --git a/wadsrc/static/xlat/eternity.txt b/wadsrc/static/xlat/eternity.txt index 4db96f2da5..90a41a4e8a 100644 --- a/wadsrc/static/xlat/eternity.txt +++ b/wadsrc/static/xlat/eternity.txt @@ -251,3 +251,13 @@ enum 466 = 0, Floor_TransferTrigger(0) 467 = 0, Floor_TransferNumeric(0) 468 = 0, FloorAndCeiling_LowerRaise(0) +469 = 0, HealThing(0) +470 = 0, Sector_SetRotation(0) +471 = 0, Sector_SetFloorPanning(0) +472 = 0, Sector_SetCeilingPanning(0) +473 = 0, Light_MinNeighbor(0) +474 = 0, Polyobj_Stop(0) +475 = 0, Plat_RaiseAndStayTx0(0) +476 = 0, Plat_UpByValueStayTx(0) +477 = 0, ACS_ExecuteAlways(0) +478 = 0, Thing_Remove(0)