mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-01 20:35:41 +00:00
replace ugly else if with switch
This commit is contained in:
parent
320624edc8
commit
4b747e567a
1 changed files with 48 additions and 53 deletions
|
@ -536,61 +536,56 @@ CShadows::StoreShadowForVehicle(CVehicle *pCar, VEH_SHD_TYPE type)
|
||||||
|
|
||||||
float size = 1.0f;
|
float size = 1.0f;
|
||||||
|
|
||||||
if ( pCar->GetModelIndex() == MI_HUNTER )
|
switch ( pCar->GetModelIndex() )
|
||||||
{
|
{
|
||||||
fVehicleWidth *= 3.0f;
|
case MI_PIZZABOY:
|
||||||
fVehicleHeight *= 1.4f;
|
case MI_PCJ600:
|
||||||
size *= 0.5f;
|
case MI_FAGGIO:
|
||||||
}
|
|
||||||
else if ( pCar->GetModelIndex() == MI_ANGEL )
|
|
||||||
{
|
|
||||||
fVehicleHeight = fVehicleHeight * 1.5f;
|
|
||||||
size = 0.03f;
|
|
||||||
}
|
|
||||||
else if ( pCar->GetModelIndex() == MI_SEASPAR )
|
|
||||||
{
|
|
||||||
fVehicleWidth *= 3.0f;
|
|
||||||
fVehicleHeight *= 1.4f;
|
|
||||||
size *= 0.5f;
|
|
||||||
}
|
|
||||||
else if ( pCar->GetModelIndex() == MI_PIZZABOY || pCar->GetModelIndex() == MI_PCJ600 || pCar->GetModelIndex() == MI_FAGGIO )
|
|
||||||
{
|
{
|
||||||
fVehicleHeight *= 1.2f;
|
fVehicleHeight *= 1.2f;
|
||||||
size = 0.05f;
|
size = 0.05f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if ( pCar->GetModelIndex() == MI_FREEWAY )
|
|
||||||
|
case MI_ANGEL:
|
||||||
|
case MI_FREEWAY:
|
||||||
|
case MI_SANCHEZ:
|
||||||
{
|
{
|
||||||
fVehicleHeight *= 1.5f;
|
fVehicleHeight *= 1.5f;
|
||||||
size = 0.03f;
|
size *= 0.03f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if ( pCar->GetModelIndex() == MI_RCRAIDER )
|
|
||||||
{
|
case MI_HUNTER:
|
||||||
fVehicleHeight *= 1.5f;
|
case MI_SEASPAR:
|
||||||
fVehicleWidth *= 2.0f;
|
case MI_SPARROW:
|
||||||
size = 0.2f;
|
case MI_MAVERICK:
|
||||||
}
|
case MI_VCNMAV:
|
||||||
else if ( pCar->GetModelIndex() == MI_SANCHEZ )
|
case MI_POLMAV:
|
||||||
{
|
|
||||||
fVehicleHeight *= 1.5f;
|
|
||||||
size = 0.03f;
|
|
||||||
}
|
|
||||||
else if ( pCar->GetModelIndex() == MI_SPARROW || pCar->GetModelIndex() == MI_MAVERICK || pCar->GetModelIndex() == MI_VCNMAV || pCar->GetModelIndex() == MI_POLMAV )
|
|
||||||
{
|
{
|
||||||
fVehicleWidth *= 3.0f;
|
fVehicleWidth *= 3.0f;
|
||||||
fVehicleHeight *= 1.4f;
|
fVehicleHeight *= 1.4f;
|
||||||
size *= 0.5f;
|
size *= 0.5f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if ( pCar->GetModelIndex() == MI_RCGOBLIN )
|
|
||||||
|
case MI_RCGOBLIN:
|
||||||
|
case MI_RCRAIDER:
|
||||||
{
|
{
|
||||||
fVehicleHeight *= 1.5f;
|
fVehicleHeight *= 1.5f;
|
||||||
fVehicleWidth *= 2.0f;
|
fVehicleWidth *= 2.0f;
|
||||||
size = 0.2f;
|
size *= 0.2f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if ( pCar->GetModelIndex() == MI_DODO )
|
|
||||||
|
case MI_DODO:
|
||||||
{
|
{
|
||||||
fVehicleHeight *= 0.9f;
|
fVehicleHeight *= 0.9f;
|
||||||
fVehicleWidth *= 0.4f;
|
fVehicleWidth *= 0.4f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CarPos.x -= pCar->GetForward().x * (((fVehicleHeight/2) - pCar->GetColModel()->boundingBox.max.y)*size);
|
CarPos.x -= pCar->GetForward().x * (((fVehicleHeight/2) - pCar->GetColModel()->boundingBox.max.y)*size);
|
||||||
CarPos.y -= pCar->GetForward().y * (((fVehicleHeight/2) - pCar->GetColModel()->boundingBox.max.y)*size);
|
CarPos.y -= pCar->GetForward().y * (((fVehicleHeight/2) - pCar->GetColModel()->boundingBox.max.y)*size);
|
||||||
|
|
Loading…
Reference in a new issue