From 150221500927d3a641b6a17882689e8fbf59e02b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Nov 2006 16:54:02 +0000 Subject: [PATCH] - Made AActor's xscale and yscale properties full precision fixed point so now larger scales than 4 can be done. SVN r381 (trunk) --- docs/rh-log.txt | 4 ++++ src/actor.h | 2 +- src/am_map.cpp | 8 ++++---- src/d_dehacked.cpp | 4 ++-- src/d_netinfo.cpp | 2 +- src/decorations.cpp | 3 ++- src/g_doom/a_scriptedmarine.cpp | 12 ++++++------ src/g_hexen/a_boostarmor.cpp | 2 +- src/g_hexen/a_healingradius.cpp | 2 +- src/g_hexen/a_summon.cpp | 2 +- src/g_hexen/a_teleportother.cpp | 2 +- src/g_shared/a_decals.cpp | 2 +- src/g_shared/a_mapmarker.cpp | 4 ++-- src/infodefaults.cpp | 4 ++-- src/infomacros.h | 4 ++-- src/m_menu.cpp | 17 +++++++++-------- src/p_buildmap.cpp | 4 ++-- src/p_mobj.cpp | 12 ++++++------ src/p_user.cpp | 10 +++++----- src/r_defs.h | 2 +- src/r_things.cpp | 22 +++++++++++----------- src/thingdef.cpp | 8 ++++---- wadsrc/decorate/hexen/mana.txt | 1 + wadsrc/decorate/hexen/speedboots.txt | 1 + 24 files changed, 71 insertions(+), 63 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 9246c5499..858eddf58 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +November 14, 2006 (Changes by Graf Zahl) +- Made AActor's xscale and yscale properties full precision fixed point + so now larger scales than 4 can be done. + November 10, 2006 (Changes by Graf Zahl) - Added a check to P_CheckMissileSpawn to decrease the monster counter if it was called for spawning a monster with A_CustomMissile. diff --git a/src/actor.h b/src/actor.h index c8aa4128b..a6a43065b 100644 --- a/src/actor.h +++ b/src/actor.h @@ -605,7 +605,7 @@ public: angle_t angle; WORD sprite; // used to find patch_t and flip value BYTE frame; // sprite frame to draw - BYTE xscale, yscale; // Scaling values; 63 is normal size + fixed_t scaleX, scaleY; // Scaling values; FRACUNIT is normal size BYTE RenderStyle; // Style to draw this actor with DWORD renderflags; // Different rendering flags WORD picnum; // Draw this instead of sprite if != 0xffff diff --git a/src/am_map.cpp b/src/am_map.cpp index 8d0804816..e0f9af5cc 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -2101,7 +2101,7 @@ void AM_drawThings (int _color) } static void DrawMarker (FTexture *tex, fixed_t x, fixed_t y, int yadjust, - INTBOOL flip, int xscale, int yscale, int translation, fixed_t alpha, DWORD alphacolor, int renderstyle) + INTBOOL flip, fixed_t xscale, fixed_t yscale, int translation, fixed_t alpha, DWORD alphacolor, int renderstyle) { if (tex == NULL || tex->UseType == FTexture::TEX_Null) { @@ -2112,8 +2112,8 @@ static void DrawMarker (FTexture *tex, fixed_t x, fixed_t y, int yadjust, AM_rotatePoint (&x, &y); } screen->DrawTexture (tex, CXMTOF(x) + f_x, CYMTOF(y) + yadjust + f_y, - DTA_DestWidth, MulScale6 (tex->GetScaledWidth() * CleanXfac, xscale), - DTA_DestHeight, MulScale6 (tex->GetScaledHeight() * CleanYfac, yscale), + DTA_DestWidth, MulScale16 (tex->GetScaledWidth() * CleanXfac, xscale), + DTA_DestHeight, MulScale16 (tex->GetScaledHeight() * CleanYfac, yscale), DTA_ClipTop, f_y, DTA_ClipBottom, f_y + f_h, DTA_ClipLeft, f_x, @@ -2190,7 +2190,7 @@ void AM_drawAuthorMarkers () if (mark->args[1] == 0 || (mark->args[1] == 1 && marked->Sector->MoreFlags & SECF_DRAWN)) { DrawMarker (tex, marked->x >> FRACTOMAPBITS, marked->y >> FRACTOMAPBITS, 0, - flip, mark->xscale+1, mark->yscale+1, mark->Translation, + flip, mark->scaleX, mark->scaleY, mark->Translation, mark->alpha, mark->alphacolor, mark->RenderStyle); } marked = mark->args[0] != 0 ? it.Next() : NULL; diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index c32777ef8..7f3fc76a0 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -64,6 +64,7 @@ #include "v_palette.h" #include "a_sharedglobal.h" #include "thingdef.h" +#include "vectors.h" // [SO] Just the way Randy said to do it :) // [RH] Made this CVAR_SERVERINFO @@ -799,8 +800,7 @@ static int PatchThing (int thingy) } else if (stricmp (Line1, "Scale") == 0) { - info->xscale = clamp ((int)(atof (Line2) * 64), 1, 256) - 1; - info->yscale = clamp ((int)(atof (Line2) * 64), 1, 256) - 1; + info->scaleY = info->scaleX = clamp (FLOAT2FIXED(atof (Line2)), 1, 256*FRACUNIT); } else if (stricmp (Line1, "Decal") == 0) { diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 850ad04a8..caaf1b016 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -663,7 +663,7 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update) GetDefaultByType (players[i].cls)->SpawnState->sprite.index) { // Only change the sprite if the player is using a standard one players[i].mo->sprite = skins[info->skin].sprite; - players[i].mo->xscale = players[i].mo->yscale = skins[info->skin].scale; + players[i].mo->scaleX = players[i].mo->scaleY = skins[info->skin].Scale; } } // Rebuild translation in case the new skin uses a different range diff --git a/src/decorations.cpp b/src/decorations.cpp index 02b66e237..a3ff8ebb3 100644 --- a/src/decorations.cpp +++ b/src/decorations.cpp @@ -51,6 +51,7 @@ #include "decallib.h" #include "i_system.h" #include "thingdef.h" +#include "vectors.h" // MACROS ------------------------------------------------------------------ @@ -668,7 +669,7 @@ static void ParseInsideDecoration (FActorInfo *info, AActor *defaults, else if (SC_Compare ("Scale")) { SC_MustGetFloat (); - defaults->xscale = defaults->yscale = clamp (int(sc_Float * 64.f), 1, 256) - 1; + defaults->scaleX = defaults->scaleY = FLOAT2FIXED(sc_Float); } else if (SC_Compare ("RenderStyle")) { diff --git a/src/g_doom/a_scriptedmarine.cpp b/src/g_doom/a_scriptedmarine.cpp index 8d00d1b90..7e0eec4e1 100644 --- a/src/g_doom/a_scriptedmarine.cpp +++ b/src/g_doom/a_scriptedmarine.cpp @@ -238,8 +238,8 @@ void AScriptedMarine::BeginPlay () AActor * playerdef = GetDefaultByName("DoomPlayer"); if (playerdef != NULL) { - xscale = playerdef->xscale; - yscale = playerdef->yscale; + scaleX = playerdef->scaleX; + scaleY = playerdef->scaleY; } } @@ -976,13 +976,13 @@ void AScriptedMarine::SetSprite (const PClass *source) // Copy the standard player's scaling AActor * playerdef = GetDefaultByName("DoomPlayer"); if (playerdef == NULL) playerdef = GetDefaultByType(RUNTIME_CLASS(AScriptedMarine)); - xscale = playerdef->xscale; - yscale = playerdef->yscale; + scaleX = playerdef->scaleX; + scaleY = playerdef->scaleY; } else { // Use the same sprite the passed class spawns with SpriteOverride = sprite = GetDefaultByType (source)->SpawnState->sprite.index; - xscale = GetDefaultByType(source)->xscale; - yscale = GetDefaultByType(source)->yscale; + scaleX = GetDefaultByType(source)->scaleX; + scaleY = GetDefaultByType(source)->scaleY; } } diff --git a/src/g_hexen/a_boostarmor.cpp b/src/g_hexen/a_boostarmor.cpp index 5b64f132d..4142845ce 100644 --- a/src/g_hexen/a_boostarmor.cpp +++ b/src/g_hexen/a_boostarmor.cpp @@ -29,7 +29,7 @@ FState AArtiBoostArmor::States[] = }; IMPLEMENT_ACTOR (AArtiBoostArmor, Hexen, 8041, 22) - PROP_Flags (MF_SPECIAL) + PROP_Flags (MF_SPECIAL|MF_COUNTITEM) PROP_Flags2 (MF2_FLOATBOB) PROP_SpawnState (0) PROP_Inventory_DefMaxAmount diff --git a/src/g_hexen/a_healingradius.cpp b/src/g_hexen/a_healingradius.cpp index 53c6cff0e..3f777650b 100644 --- a/src/g_hexen/a_healingradius.cpp +++ b/src/g_hexen/a_healingradius.cpp @@ -44,7 +44,7 @@ FState AArtiHealingRadius::States[] = }; IMPLEMENT_ACTOR (AArtiHealingRadius, Hexen, 10120, 0) - PROP_Flags (MF_SPECIAL) + PROP_Flags (MF_SPECIAL|MF_COUNTITEM) PROP_Flags2 (MF2_FLOATBOB) PROP_SpawnState (0) PROP_Inventory_DefMaxAmount diff --git a/src/g_hexen/a_summon.cpp b/src/g_hexen/a_summon.cpp index e579e5733..a51fc4721 100644 --- a/src/g_hexen/a_summon.cpp +++ b/src/g_hexen/a_summon.cpp @@ -25,7 +25,7 @@ FState AArtiDarkServant::States[] = }; IMPLEMENT_ACTOR (AArtiDarkServant, Hexen, 86, 16) - PROP_Flags (MF_SPECIAL) + PROP_Flags (MF_SPECIAL|MF_COUNTITEM) PROP_Flags2 (MF2_FLOATBOB) PROP_SpawnState (S_ARTI_SUMMON) PROP_Inventory_RespawnTics (30+4200) diff --git a/src/g_hexen/a_teleportother.cpp b/src/g_hexen/a_teleportother.cpp index fba93917c..2940c3471 100644 --- a/src/g_hexen/a_teleportother.cpp +++ b/src/g_hexen/a_teleportother.cpp @@ -40,7 +40,7 @@ FState AArtiTeleportOther::States[] = }; IMPLEMENT_ACTOR (AArtiTeleportOther, Hexen, 10040, 17) - PROP_Flags (MF_SPECIAL) + PROP_Flags (MF_SPECIAL|MF_COUNTITEM) PROP_Flags2 (MF2_FLOATBOB) PROP_SpawnState (S_ARTI_TELOTHER1) PROP_Inventory_DefMaxAmount diff --git a/src/g_shared/a_decals.cpp b/src/g_shared/a_decals.cpp index 8179173f6..d3aee07a6 100644 --- a/src/g_shared/a_decals.cpp +++ b/src/g_shared/a_decals.cpp @@ -81,7 +81,7 @@ DBaseDecal::DBaseDecal (int statnum, fixed_t z) DBaseDecal::DBaseDecal (const AActor *basis) : DThinker(STAT_DECAL), - WallNext(0), WallPrev(0), LeftDistance(0), Z(basis->z), ScaleX(basis->xscale<<10), ScaleY(basis->yscale<<10), + WallNext(0), WallPrev(0), LeftDistance(0), Z(basis->z), ScaleX(basis->scaleX), ScaleY(basis->scaleY), Alpha(basis->alpha), AlphaColor(basis->alphacolor), Translation(basis->Translation), PicNum(basis->picnum), RenderFlags(basis->renderflags), RenderStyle(basis->RenderStyle) { diff --git a/src/g_shared/a_mapmarker.cpp b/src/g_shared/a_mapmarker.cpp index fee38520a..b73f9169f 100644 --- a/src/g_shared/a_mapmarker.cpp +++ b/src/g_shared/a_mapmarker.cpp @@ -60,8 +60,8 @@ IMPLEMENT_ACTOR(AMapMarker, Any, 9040, 0) PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY) PROP_RenderFlags (RF_INVISIBLE) PROP_SpawnState (0) - PROP_XScale (31) - PROP_YScale (31) + PROP_XScale (FRACUNIT/2) + PROP_YScale (FRACUNIT/2) END_DEFAULTS void AMapMarker::BeginPlay () diff --git a/src/infodefaults.cpp b/src/infodefaults.cpp index c70116f87..e1321076d 100644 --- a/src/infodefaults.cpp +++ b/src/infodefaults.cpp @@ -193,8 +193,8 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint) } break; - case ADEF_XScale: actor->xscale = dataint; break; - case ADEF_YScale: actor->yscale = dataint; break; + case ADEF_XScale: actor->scaleX = dataint; break; + case ADEF_YScale: actor->scaleY = dataint; break; case ADEF_SpawnHealth: actor->health = dataint; break; case ADEF_ReactionTime: actor->reactiontime = dataint; break; case ADEF_PainChance: actor->PainChance = dataint; break; diff --git a/src/infomacros.h b/src/infomacros.h index 29a52af7b..346c29190 100644 --- a/src/infomacros.h +++ b/src/infomacros.h @@ -219,8 +219,8 @@ public: #define PROP_PlayerPawn_ScoreIcon(x) ADD_STRING_PROP(ADEF_PlayerPawn_ScoreIcon,"\27",x) #define PROP_PlayerPawn_MorphWeapon(x) ADD_STRING_PROP(ADEF_PlayerPawn_MorphWeapon,"\30",x) -#define PROP_XScale(x) ADD_BYTE_PROP(ADEF_XScale,x) -#define PROP_YScale(x) ADD_BYTE_PROP(ADEF_YScale,x) +#define PROP_XScale(x) ADD_LONG_PROP(ADEF_XScale,x) +#define PROP_YScale(x) ADD_LONG_PROP(ADEF_YScale,x) #define PROP_SpawnHealth(x) ADD_WORD_PROP(ADEF_SpawnHealth,x) #define PROP_SpawnHealthLong(x) ADD_LONG_PROP(ADEF_SpawnHealth,x) #define PROP_ReactionTime(x) ADD_BYTE_PROP(ADEF_ReactionTime,x) diff --git a/src/m_menu.cpp b/src/m_menu.cpp index 87a8a81c0..08b78474f 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -1648,7 +1648,8 @@ static void M_DrawClassMenu () M_DrawFrame (x, y, 72*CleanXfac, 80*CleanYfac-1); spriteframe_t *sprframe = &SpriteFrames[sprites[PlayerState->sprite.index].spriteframes + PlayerState->GetFrame()]; - int scale = GetDefaultByType (PlayerClass->Type)->xscale + 1; + fixed_t scaleX = GetDefaultByType (PlayerClass->Type)->scaleX; + fixed_t scaleY = GetDefaultByType (PlayerClass->Type)->scaleY; if (sprframe != NULL) { @@ -1657,8 +1658,8 @@ static void M_DrawClassMenu () { screen->DrawTexture (tex, x + 36*CleanXfac, y + 71*CleanYfac, - DTA_DestWidth, MulScale6 (tex->GetWidth() * CleanXfac, scale), - DTA_DestHeight, MulScale6 (tex->GetHeight() * CleanYfac, scale), + DTA_DestWidth, MulScale16 (tex->GetWidth() * CleanXfac, scaleX), + DTA_DestHeight, MulScale16 (tex->GetHeight() * CleanYfac, scaleY), TAG_DONE); } } @@ -2120,19 +2121,19 @@ static void M_PlayerSetupDrawer () } { spriteframe_t *sprframe; - int scale; + fixed_t Scale; if (GetDefaultByType (PlayerClass->Type)->flags4 & MF4_NOSKIN || players[consoleplayer].userinfo.PlayerClass == -1 || PlayerState->sprite.index != GetDefaultByType (PlayerClass->Type)->SpawnState->sprite.index) { sprframe = &SpriteFrames[sprites[PlayerState->sprite.index].spriteframes + PlayerState->GetFrame()]; - scale = GetDefaultByType (PlayerClass->Type)->xscale + 1; + Scale = GetDefaultByType (PlayerClass->Type)->scaleX; } else { sprframe = &SpriteFrames[sprites[skins[PlayerSkin].sprite].spriteframes + PlayerState->GetFrame()]; - scale = skins[PlayerSkin].scale + 1; + Scale = skins[PlayerSkin].Scale; } if (sprframe != NULL) @@ -2147,8 +2148,8 @@ static void M_PlayerSetupDrawer () screen->DrawTexture (tex, (320 - 52 - 32 + xo - 160)*CleanXfac + (SCREENWIDTH)/2, (PSetupDef.y + LINEHEIGHT*3 + 57 - 104)*CleanYfac + (SCREENHEIGHT/2), - DTA_DestWidth, MulScale6 (tex->GetWidth() * CleanXfac, scale), - DTA_DestHeight, MulScale6 (tex->GetHeight() * CleanYfac, scale), + DTA_DestWidth, MulScale16 (tex->GetWidth() * CleanXfac, Scale), + DTA_DestHeight, MulScale16 (tex->GetHeight() * CleanYfac, Scale), DTA_Translation, translationtables[TRANSLATION_Players] + 256 * MAXPLAYERS, TAG_DONE); } diff --git a/src/p_buildmap.cpp b/src/p_buildmap.cpp index b7b3fc76c..eb9a7652b 100644 --- a/src/p_buildmap.cpp +++ b/src/p_buildmap.cpp @@ -785,8 +785,8 @@ void ACustomSprite::BeginPlay () { Super::BeginPlay (); picnum = args[0] + args[1]*256; - xscale = args[2] - 1; - yscale = args[3] - 1; + scaleX = args[2] * (FRACUNIT/64); + scaleY = args[3] * (FRACUNIT/64); if (args[4] & 2) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 1d2400ff3..8f0c37503 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -194,8 +194,8 @@ void AActor::Serialize (FArchive &arc) << z << angle << frame - << xscale - << yscale + << scaleX + << scaleY << RenderStyle << renderflags; if (arc.IsStoring ()) @@ -388,7 +388,7 @@ void AActor::Serialize (FArchive &arc) GetDefaultByType (player->cls)->SpawnState->sprite.index) { // Give player back the skin sprite = skins[player->userinfo.skin].sprite; - xscale = yscale = skins[player->userinfo.skin].scale; + scaleX = scaleY = skins[player->userinfo.skin].Scale; } if (Speed == 0) { @@ -3039,8 +3039,8 @@ FState AActor::States[] = }; BEGIN_DEFAULTS (AActor, Any, -1, 0) - PROP_XScale (63) - PROP_YScale (63) + PROP_XScale (FRACUNIT) + PROP_YScale (FRACUNIT) PROP_SpawnState (2) PROP_SpawnHealth (1000) PROP_ReactionTime (8) @@ -3470,7 +3470,7 @@ void P_SpawnPlayer (mapthing2_t *mthing, bool tempplayer) // [RH] Set player sprite based on skin mobj->sprite = skins[p->userinfo.skin].sprite; - mobj->xscale = mobj->yscale = skins[p->userinfo.skin].scale; + mobj->scaleX = mobj->scaleY = skins[p->userinfo.skin].Scale; p->DesiredFOV = p->FOV = 90.f; p->camera = p->mo; diff --git a/src/p_user.cpp b/src/p_user.cpp index f271d7935..c6312e3ff 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -1211,11 +1211,11 @@ void P_CheckPlayerSprites() if (playeringame[i] && mo != NULL) { int crouchspriteno; - int defyscale = mo->GetDefault()->yscale; + fixed_t defscaleY = mo->GetDefault()->scaleY; if (player->userinfo.skin != 0) { - defyscale = skins[player->userinfo.skin].scale; + defscaleY = skins[player->userinfo.skin].Scale; } // Set the crouch sprite @@ -1240,11 +1240,11 @@ void P_CheckPlayerSprites() if (crouchspriteno > 0) { mo->sprite = crouchspriteno; - mo->yscale = defyscale; + mo->scaleY = defscaleY; } else if (player->playerstate != PST_DEAD) { - mo->yscale = player->crouchfactor < FRACUNIT*3/4 ? defyscale/2 : defyscale; + mo->scaleY = player->crouchfactor < FRACUNIT*3/4 ? defscaleY/2 : defscaleY; } } else // Set the normal sprite @@ -1257,7 +1257,7 @@ void P_CheckPlayerSprites() { mo->sprite = skins[player->userinfo.skin].sprite; } - mo->yscale = defyscale; + mo->scaleY = defscaleY; } } } diff --git a/src/r_defs.h b/src/r_defs.h index 908475516..3065a033c 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -855,8 +855,8 @@ public: BYTE gender; // This skin's gender (not really used) BYTE range0start; BYTE range0end; - BYTE scale; bool othergame; // [GRB] + fixed_t Scale; int sprite; int crouchsprite; int namespc; // namespace for this skin diff --git a/src/r_things.cpp b/src/r_things.cpp index b655155f2..ac7314ce8 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -502,7 +502,7 @@ void R_InitSkins (void) } else if (0 == stricmp (key, "scale")) { - skins[i].scale = clamp ((int)(atof (sc_String) * 64), 1, 256) - 1; + skins[i].Scale = clamp (FLOAT2FIXED(atof (sc_String)), 1, 256*FRACUNIT); } else if (0 == stricmp (key, "game")) { @@ -871,7 +871,7 @@ void R_InitSprites () const PClass *type = PlayerClasses[0].Type; skins[i].range0start = type->Meta.GetMetaInt (APMETA_ColorRange) & 255; skins[i].range0end = type->Meta.GetMetaInt (APMETA_ColorRange) >> 8; - skins[i].scale = GetDefaultByType (type)->xscale; + skins[i].Scale = GetDefaultByType (type)->scaleX; } R_InitSpriteDefs (); @@ -890,7 +890,7 @@ void R_InitSprites () skins[i].face[2] = 'F'; skins[i].range0start = basetype->Meta.GetMetaInt (APMETA_ColorRange) & 255; skins[i].range0end = basetype->Meta.GetMetaInt (APMETA_ColorRange) >> 8; - skins[i].scale = GetDefaultByType (basetype)->xscale; + skins[i].Scale = GetDefaultByType (basetype)->scaleX; skins[i].sprite = GetDefaultByType (basetype)->SpawnState->sprite.index; skins[i].namespc = ns_global; @@ -1297,8 +1297,8 @@ void R_ProjectSprite (AActor *thing, int fakeside) } // [RH] Added scaling - gzt = fz + (tex->TopOffset << (FRACBITS-6-3)) * (thing->yscale+1) * tex->ScaleX; - gzb = fz + ((tex->TopOffset - tex->GetHeight()) << (FRACBITS-6-3)) * (thing->yscale+1) * tex->ScaleY; + gzt = fz + MulScale3(thing->scaleY, tex->TopOffset * tex->ScaleX); + gzb = fz + MulScale3(thing->scaleY, (tex->TopOffset - tex->GetHeight()) * tex->ScaleY); // [RH] Reject sprites that are off the top or bottom of the screen if (MulScale12 (globaluclip, tz) > viewz - gzb || @@ -1314,7 +1314,7 @@ void R_ProjectSprite (AActor *thing, int fakeside) } // calculate edges of the shape - const fixed_t thingxscalemul = ((thing->xscale+1) * tex->ScaleX) << (16-6-3); + const fixed_t thingxscalemul = MulScale3(thing->scaleX, tex->ScaleX); tx -= (flip ? (tex->GetWidth() - tex->LeftOffset - 1) : tex->LeftOffset) * thingxscalemul; x1 = centerx + MulScale32 (tx, xscale); @@ -1330,7 +1330,7 @@ void R_ProjectSprite (AActor *thing, int fakeside) if (x2 < WindowLeft || x2 <= x1) return; - xscale = MulScale9 (thing->xscale+1, xscale * tex->ScaleX); + xscale = MulScale19 (thing->scaleX, xscale * tex->ScaleX); iscale = (tex->GetWidth() << FRACBITS) / (x2 - x1); x2--; @@ -1377,16 +1377,16 @@ void R_ProjectSprite (AActor *thing, int fakeside) vis->RenderStyle = thing->RenderStyle; vis->AlphaColor = thing->alphacolor; vis->xscale = xscale; - vis->yscale = Scale (InvZtoScale, ((thing->yscale+1) * tex->ScaleY) << (6-3), tz); + vis->yscale = Scale (InvZtoScale, MulScale3(thing->scaleY, tex->ScaleY), tz)>>4; vis->idepth = (DWORD)DivScale32 (1, tz) >> 1; // tz is 20.12, so idepth ought to be 12.20, but vis->cx = tx2; // signed math makes it 13.19 vis->gx = fx; vis->gy = fy; vis->gz = gzb; // [RH] use gzb, not thing->z vis->gzt = gzt; // killough 3/27/98 - vis->floorclip = SafeDivScale9 (thing->floorclip, (thing->yscale+1) * tex->ScaleY); - vis->texturemid = (tex->TopOffset << FRACBITS) - - SafeDivScale9 (viewz-fz+thing->floorclip, (thing->yscale+1) * tex->ScaleY); + vis->floorclip = FixedDiv (thing->floorclip, MulScale3(thing->scaleY, tex->ScaleY)); + vis->texturemid = (tex->TopOffset << FRACBITS) - + FixedDiv (viewz-fz+thing->floorclip, MulScale3(thing->scaleY, tex->ScaleY)); vis->x1 = x1 < WindowLeft ? WindowLeft : x1; vis->x2 = x2 > WindowRight ? WindowRight : x2; vis->Translation = thing->Translation; // [RH] thing translation table diff --git a/src/thingdef.cpp b/src/thingdef.cpp index 3640ba1b9..857965679 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -1352,7 +1352,7 @@ void InstallStates(FActorInfo *info, AActor *defaults) static void MakeStateList(const FStateLabels *list, TArray &dest) { dest.Clear(); - for(int i=0;iNumLabels;i++) + if (list != NULL) for(int i=0;iNumLabels;i++) { FStateDefine def; @@ -2778,7 +2778,7 @@ static void ActorMass (AActor *defaults, Baggage &bag) static void ActorXScale (AActor *defaults, Baggage &bag) { SC_MustGetFloat(); - defaults->xscale=BYTE(sc_Float*64-1); + defaults->scaleY = FLOAT2FIXED(sc_Float); } //========================================================================== @@ -2787,7 +2787,7 @@ static void ActorXScale (AActor *defaults, Baggage &bag) static void ActorYScale (AActor *defaults, Baggage &bag) { SC_MustGetFloat(); - defaults->yscale=BYTE(sc_Float*64-1); + defaults->scaleY = FLOAT2FIXED(sc_Float); } //========================================================================== @@ -2796,7 +2796,7 @@ static void ActorYScale (AActor *defaults, Baggage &bag) static void ActorScale (AActor *defaults, Baggage &bag) { SC_MustGetFloat(); - defaults->xscale=defaults->yscale=BYTE(sc_Float*64-1); + defaults->scaleX= defaults->scaleY = FLOAT2FIXED(sc_Float); } //========================================================================== diff --git a/wadsrc/decorate/hexen/mana.txt b/wadsrc/decorate/hexen/mana.txt index ae39d9444..6130fe962 100644 --- a/wadsrc/decorate/hexen/mana.txt +++ b/wadsrc/decorate/hexen/mana.txt @@ -73,6 +73,7 @@ ACTOR ArtiBoostMana : CustomInventory 8003 Game Hexen SpawnID 26 +FLOATBOB + +COUNTITEM +INVENTORY.INVBAR +INVENTORY.PICKUPFLASH +INVENTORY.FANCYPICKUPSOUND diff --git a/wadsrc/decorate/hexen/speedboots.txt b/wadsrc/decorate/hexen/speedboots.txt index e4b0eefd3..17d193d2a 100644 --- a/wadsrc/decorate/hexen/speedboots.txt +++ b/wadsrc/decorate/hexen/speedboots.txt @@ -5,6 +5,7 @@ ACTOR ArtiSpeedBoots : PowerupGiver 8002 Game Hexen SpawnID 13 +FLOATBOB + +COUNTITEM +INVENTORY.PICKUPFLASH Inventory.Icon ARTISPED Inventory.PickupMessage "$TXT_ARTISPEED"