New S_SKIN attribute - "camerascale", another float. Acts as a scale modifier to t_cam_dist and t_cam_height.

This commit is contained in:
toasterbabe 2016-08-06 23:18:37 +01:00
parent 029fd156a8
commit c678220857
4 changed files with 12 additions and 4 deletions

View file

@ -48,6 +48,7 @@ enum skin {
skin_height,
skin_spinheight,
skin_shieldscale,
skin_camerascale,
skin_starttranscolor,
skin_prefcolor,
skin_prefoppositecolor,
@ -84,6 +85,7 @@ static const char *const skin_opt[] = {
"height",
"spinheight",
"shieldscale",
"camerascale",
"starttranscolor",
"prefcolor",
"prefoppositecolor",
@ -197,6 +199,9 @@ static int skin_get(lua_State *L)
case skin_shieldscale:
lua_pushfixed(L, skin->shieldscale);
break;
case skin_camerascale:
lua_pushfixed(L, skin->camerascale);
break;
case skin_starttranscolor:
lua_pushinteger(L, skin->starttranscolor);
break;

View file

@ -8002,16 +8002,16 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
camspeed = cv_cam_speed.value;
camstill = cv_cam_still.value;
camrotate = cv_cam_rotate.value;
camdist = FixedMul(cv_cam_dist.value, mo->scale);
camheight = FixedMul(cv_cam_height.value, mo->scale);
camdist = FixedMul(cv_cam_dist.value, FixedMul(skins[player->skin].camerascale, mo->scale));
camheight = FixedMul(cv_cam_height.value, FixedMul(skins[player->skin].camerascale, mo->scale));
}
else // Camera 2
{
camspeed = cv_cam2_speed.value;
camstill = cv_cam2_still.value;
camrotate = cv_cam2_rotate.value;
camdist = FixedMul(cv_cam2_dist.value, mo->scale);
camheight = FixedMul(cv_cam2_height.value, mo->scale);
camdist = FixedMul(cv_cam2_dist.value, FixedMul(skins[player->skin].camerascale, mo->scale));
camheight = FixedMul(cv_cam2_height.value, FixedMul(skins[player->skin].camerascale, mo->scale));
}
#ifdef REDSANALOG

View file

@ -2308,6 +2308,7 @@ static void Sk_SetDefaultValue(skin_t *skin)
skin->spinheight = FixedMul(skin->height, 2*FRACUNIT/3);
skin->shieldscale = FRACUNIT;
skin->camerascale = FRACUNIT;
skin->thokitem = -1;
skin->spinitem = -1;
@ -2662,6 +2663,7 @@ void R_AddSkins(UINT16 wadnum)
GETFLOAT(jumpfactor)
GETFLOAT(highresscale)
GETFLOAT(shieldscale)
GETFLOAT(camerascale)
#undef GETFLOAT
else // let's check if it's a sound, otherwise error out

View file

@ -98,6 +98,7 @@ typedef struct
fixed_t spinheight;
fixed_t shieldscale; // no change to bounding box, but helps set the shield's sprite size
fixed_t camerascale;
// Definable color translation table
UINT8 starttranscolor;