Merge branch 'some_scaling_stuff' into 'master'

Two scale things I noticed.

See merge request KartKrew/Kart!51
This commit is contained in:
Sal 2018-10-24 16:01:39 -04:00
commit d93a4106b6
6 changed files with 18 additions and 17 deletions

View file

@ -2223,7 +2223,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
dust->angle = (ANGLE_180/16) * i; dust->angle = (ANGLE_180/16) * i;
P_SetScale(dust, source->scale); P_SetScale(dust, source->scale);
dust->destscale = source->scale*10; dust->destscale = source->scale*10;
dust->scalespeed = FixedMul(dust->scalespeed, source->scale); dust->scalespeed = source->scale/12;
P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, source->scale)); P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, source->scale));
truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT, truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT,
@ -2231,7 +2231,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE); source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE);
P_SetScale(truc, source->scale); P_SetScale(truc, source->scale);
truc->destscale = source->scale*6; truc->destscale = source->scale*6;
truc->scalespeed = FixedMul(truc->scalespeed, source->scale); truc->scalespeed = source->scale/12;
speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS; speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
@ -2247,7 +2247,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE); source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE);
P_SetScale(dust, source->scale); P_SetScale(dust, source->scale);
dust->destscale = source->scale*10; dust->destscale = source->scale*10;
dust->scalespeed = FixedMul(dust->scalespeed, source->scale); dust->scalespeed = source->scale/12;
dust->tics = 30; dust->tics = 30;
dust->momz = P_RandomRange(FixedMul(3*FRACUNIT, source->scale)>>FRACBITS, FixedMul(7*FRACUNIT, source->scale)>>FRACBITS)*FRACUNIT; dust->momz = P_RandomRange(FixedMul(3*FRACUNIT, source->scale)>>FRACBITS, FixedMul(7*FRACUNIT, source->scale)>>FRACBITS)*FRACUNIT;
@ -2256,7 +2256,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMPARTICLE); source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMPARTICLE);
P_SetScale(truc, source->scale); P_SetScale(truc, source->scale);
truc->destscale = source->scale*5; truc->destscale = source->scale*5;
truc->scalespeed = FixedMul(truc->scalespeed, source->scale); truc->scalespeed = source->scale/12;
speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS;
truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT;
truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT;
@ -2655,7 +2655,7 @@ void K_DriftDustHandling(mobj_t *spawner)
dust->momz = P_MobjFlip(spawner) * (P_RandomRange(1, 4) * (spawner->scale)); dust->momz = P_MobjFlip(spawner) * (P_RandomRange(1, 4) * (spawner->scale));
P_SetScale(dust, spawner->scale/2); P_SetScale(dust, spawner->scale/2);
dust->destscale = spawner->scale * 3; dust->destscale = spawner->scale * 3;
dust->scalespeed = FixedMul(dust->scalespeed, spawner->scale); dust->scalespeed = spawner->scale/12;
if (leveltime % 6 == 0) if (leveltime % 6 == 0)
S_StartSound(spawner, sfx_screec); S_StartSound(spawner, sfx_screec);
@ -5013,7 +5013,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
&& player->kartstuff[k_growshrinktimer] <= 0) // Grow holds the item box hostage && player->kartstuff[k_growshrinktimer] <= 0) // Grow holds the item box hostage
{ {
K_PlayPowerGloatSound(player->mo); K_PlayPowerGloatSound(player->mo);
player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->scalespeed = mapheaderinfo[gamemap-1]->mobj_scale/TICRATE;
player->mo->destscale = 3*(mapheaderinfo[gamemap-1]->mobj_scale)/2; player->mo->destscale = 3*(mapheaderinfo[gamemap-1]->mobj_scale)/2;
if (cv_kartdebugshrink.value && !player->bot) if (cv_kartdebugshrink.value && !player->bot)
player->mo->destscale = 6*player->mo->destscale/8; player->mo->destscale = 6*player->mo->destscale/8;

View file

@ -3406,7 +3406,7 @@ void A_ParticleSpawn(mobj_t *actor)
P_SetScale(spawn, actor->scale); P_SetScale(spawn, actor->scale);
spawn->momz = speed; spawn->momz = speed;
spawn->destscale = FixedDiv(spawn->scale<<FRACBITS, 100<<FRACBITS); spawn->destscale = FixedDiv(spawn->scale<<FRACBITS, 100<<FRACBITS);
spawn->scalespeed = FixedDiv(((actor->spawnpoint->angle >> 8) & 63) << FRACBITS, 100<<FRACBITS); spawn->scalespeed = FixedDiv(((actor->spawnpoint->angle >> 8) & 63) * actor->scale, 100<<FRACBITS);
actor->tics = actor->spawnpoint->extrainfo + 1; actor->tics = actor->spawnpoint->extrainfo + 1;
} }

View file

@ -3003,6 +3003,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
fixed_t topz; fixed_t topz;
fixed_t a, b, c; fixed_t a, b, c;
mobjtype_t type = MT_ROCKCRUMBLE1; mobjtype_t type = MT_ROCKCRUMBLE1;
const fixed_t spacing = 48*mapheaderinfo[gamemap-1]->mobj_scale;
// If the control sector has a special // If the control sector has a special
// of Section3:7-15, use the custom debris. // of Section3:7-15, use the custom debris.
@ -3034,16 +3035,16 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
rightx = sec->lines[rightmostvertex]->v1->x; rightx = sec->lines[rightmostvertex]->v1->x;
topy = sec->lines[topmostvertex]->v1->y-(16<<FRACBITS); topy = sec->lines[topmostvertex]->v1->y-(16<<FRACBITS);
bottomy = sec->lines[bottommostvertex]->v1->y; bottomy = sec->lines[bottommostvertex]->v1->y;
topz = *rover->topheight-(16<<FRACBITS); topz = *rover->topheight-(spacing/2);
for (a = leftx; a < rightx; a += (32<<FRACBITS)) for (a = leftx; a < rightx; a += spacing)
{ {
for (b = topy; b > bottomy; b -= (32<<FRACBITS)) for (b = topy; b > bottomy; b -= spacing)
{ {
if (R_PointInSubsector(a, b)->sector == sec) if (R_PointInSubsector(a, b)->sector == sec)
{ {
mobj_t *spawned = NULL; mobj_t *spawned = NULL;
for (c = topz; c > *rover->bottomheight; c -= (32<<FRACBITS)) for (c = topz; c > *rover->bottomheight; c -= spacing)
{ {
spawned = P_SpawnMobj(a, b, c, type); spawned = P_SpawnMobj(a, b, c, type);
spawned->fuse = 3*TICRATE; spawned->fuse = 3*TICRATE;

View file

@ -3129,7 +3129,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (!player->kartstuff[k_invincibilitytimer] && player->kartstuff[k_growshrinktimer] <= 0) if (!player->kartstuff[k_invincibilitytimer] && player->kartstuff[k_growshrinktimer] <= 0)
{ {
// Start shrinking! // Start shrinking!
player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->scalespeed = mapheaderinfo[gamemap-1]->mobj_scale/TICRATE;
player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8; player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8;
if (cv_kartdebugshrink.value && !player->bot) if (cv_kartdebugshrink.value && !player->bot)
player->mo->destscale = 6*player->mo->destscale/8; player->mo->destscale = 6*player->mo->destscale/8;

View file

@ -8263,7 +8263,7 @@ void P_MobjThinker(mobj_t *mobj)
P_SetScale(smoke, mobj->target->scale/2); P_SetScale(smoke, mobj->target->scale/2);
smoke->destscale = 3*mobj->target->scale/2; smoke->destscale = 3*mobj->target->scale/2;
smoke->scalespeed = FixedMul(smoke->scalespeed, mobj->target->scale); smoke->scalespeed = mobj->target->scale/12;
smoke->momx = mobj->target->momx/2; smoke->momx = mobj->target->momx/2;
smoke->momy = mobj->target->momy/2; smoke->momy = mobj->target->momy/2;
@ -9116,7 +9116,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
// All mobjs are created at 100% scale. // All mobjs are created at 100% scale.
mobj->scale = FRACUNIT; mobj->scale = FRACUNIT;
mobj->destscale = mobj->scale; mobj->destscale = mobj->scale;
mobj->scalespeed = FRACUNIT/12; mobj->scalespeed = mapheaderinfo[gamemap-1]->mobj_scale/12;
if (mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->mobj_scale != FRACUNIT) //&& !(mobj->type == MT_BLACKEGGMAN) if (mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->mobj_scale != FRACUNIT) //&& !(mobj->type == MT_BLACKEGGMAN)
mobj->destscale = mapheaderinfo[gamemap-1]->mobj_scale; mobj->destscale = mapheaderinfo[gamemap-1]->mobj_scale;
@ -9456,7 +9456,7 @@ mobj_t *P_SpawnShadowMobj(mobj_t * caster)
// All mobjs are created at 100% scale. // All mobjs are created at 100% scale.
mobj->scale = FRACUNIT; mobj->scale = FRACUNIT;
mobj->destscale = mobj->scale; mobj->destscale = mobj->scale;
mobj->scalespeed = FRACUNIT/12; mobj->scalespeed = mapheaderinfo[gamemap-1]->mobj_scale/12;
if (mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->mobj_scale != FRACUNIT) //&& !(mobj->type == MT_BLACKEGGMAN) if (mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->mobj_scale != FRACUNIT) //&& !(mobj->type == MT_BLACKEGGMAN)
mobj->destscale = mapheaderinfo[gamemap-1]->mobj_scale; mobj->destscale = mapheaderinfo[gamemap-1]->mobj_scale;

View file

@ -1116,7 +1116,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
diff |= MD_SCALE; diff |= MD_SCALE;
if (mobj->destscale != mobj->scale) if (mobj->destscale != mobj->scale)
diff |= MD_DSCALE; diff |= MD_DSCALE;
if (mobj->scalespeed != FRACUNIT/12) if (mobj->scalespeed != mapheaderinfo[gamemap-1]->mobj_scale/12)
diff2 |= MD2_SCALESPEED; diff2 |= MD2_SCALESPEED;
if (mobj == redflag) if (mobj == redflag)
@ -2123,7 +2123,7 @@ static void LoadMobjThinker(actionf_p1 thinker)
if (diff2 & MD2_SCALESPEED) if (diff2 & MD2_SCALESPEED)
mobj->scalespeed = READFIXED(save_p); mobj->scalespeed = READFIXED(save_p);
else else
mobj->scalespeed = FRACUNIT/12; mobj->scalespeed = mapheaderinfo[gamemap-1]->mobj_scale/12;
if (diff2 & MD2_CUSVAL) if (diff2 & MD2_CUSVAL)
mobj->cusval = READINT32(save_p); mobj->cusval = READINT32(save_p);
if (diff2 & MD2_CVMEM) if (diff2 & MD2_CVMEM)