Fix linux warnings

This commit is contained in:
Filip Gawin 2020-05-12 01:24:57 +02:00
parent c40fcdf39a
commit c2ac6b3759
52 changed files with 165 additions and 70 deletions

View File

@ -62,7 +62,10 @@ public:
CAnimBlendAssociation(void); CAnimBlendAssociation(void);
CAnimBlendAssociation(CAnimBlendAssociation &other); CAnimBlendAssociation(CAnimBlendAssociation &other);
virtual ~CAnimBlendAssociation(void); #ifndef FIX_BUGS
virtual
#endif
~CAnimBlendAssociation(void);
void AllocateAnimBlendNodeArray(int n); void AllocateAnimBlendNodeArray(int n);
void FreeAnimBlendNodeArray(void); void FreeAnimBlendNodeArray(void);
void Init(RpClump *clump, CAnimBlendHierarchy *hier); void Init(RpClump *clump, CAnimBlendHierarchy *hier);

View File

@ -147,11 +147,12 @@ FrameUpdateCallBackWithVelocityExtractionNonSkinned(AnimBlendFrameData *frame, v
mat->pos.x = pos.x - transx; mat->pos.x = pos.x - transx;
mat->pos.y = pos.y - transy; mat->pos.y = pos.y - transy;
mat->pos.z = pos.z; mat->pos.z = pos.z;
if(mat->pos.z >= -0.8f) if(mat->pos.z >= -0.8f) {
if(mat->pos.z < -0.4f) if(mat->pos.z < -0.4f)
mat->pos.z += (2.5f * mat->pos.z + 2.0f) * frame->resetPos.z; mat->pos.z += (2.5f * mat->pos.z + 2.0f) * frame->resetPos.z;
else else
mat->pos.z += frame->resetPos.z; mat->pos.z += frame->resetPos.z;
}
mat->pos.x += frame->resetPos.x; mat->pos.x += frame->resetPos.x;
mat->pos.y += frame->resetPos.y; mat->pos.y += frame->resetPos.y;
} }
@ -361,11 +362,12 @@ FrameUpdateCallBackWithVelocityExtractionSkinned(AnimBlendFrameData *frame, void
xform->t.x = pos.x - transx; xform->t.x = pos.x - transx;
xform->t.y = pos.y - transy; xform->t.y = pos.y - transy;
xform->t.z = pos.z; xform->t.z = pos.z;
if(xform->t.z >= -0.8f) if(xform->t.z >= -0.8f) {
if(xform->t.z < -0.4f) if(xform->t.z < -0.4f)
xform->t.z += (2.5f * xform->t.z + 2.0f) * frame->resetPos.z; xform->t.z += (2.5f * xform->t.z + 2.0f) * frame->resetPos.z;
else else
xform->t.z += frame->resetPos.z; xform->t.z += frame->resetPos.z;
}
xform->t.x += frame->resetPos.x; xform->t.x += frame->resetPos.x;
xform->t.y += frame->resetPos.y; xform->t.y += frame->resetPos.y;
} }

View File

@ -53,7 +53,7 @@ ALDeviceList::ALDeviceList()
index = 0; index = 0;
// go through device list (each device terminated with a single NULL, list terminated with double NULL) // go through device list (each device terminated with a single NULL, list terminated with double NULL)
while (*devices != NULL) { while (*devices != '\0') {
if (strcmp(defaultDeviceName, devices) == 0) { if (strcmp(defaultDeviceName, devices) == 0) {
defaultDeviceIndex = index; defaultDeviceIndex = index;
} }
@ -186,7 +186,7 @@ unsigned int ALDeviceList::GetMaxNumSources(int index)
/* /*
* Checks if the extension is supported on the given device * Checks if the extension is supported on the given device
*/ */
bool ALDeviceList::IsExtensionSupported(int index, char *szExtName) bool ALDeviceList::IsExtensionSupported(int index, const char *szExtName)
{ {
bool bReturn = false; bool bReturn = false;

View File

@ -32,7 +32,7 @@ public:
char *GetDeviceName(int index); char *GetDeviceName(int index);
void GetDeviceVersion(int index, int *major, int *minor); void GetDeviceVersion(int index, int *major, int *minor);
unsigned int GetMaxNumSources(int index); unsigned int GetMaxNumSources(int index);
bool IsExtensionSupported(int index, char *szExtName); bool IsExtensionSupported(int index, const char *szExtName);
int GetDefaultDevice(); int GetDefaultDevice();
void FilterDevicesMinVer(int major, int minor); void FilterDevicesMinVer(int major, int minor);
void FilterDevicesMaxVer(int major, int minor); void FilterDevicesMaxVer(int major, int minor);
@ -46,4 +46,4 @@ private:
}; };
#endif #endif
#endif // ALDEVICELIST_H #endif // ALDEVICELIST_H

View File

@ -431,6 +431,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
} }
} }
break; break;
default: break;
} }
} }
if (pVehicle->pDriver && pVehicle->pDriver->m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS){ if (pVehicle->pDriver && pVehicle->pDriver->m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS){

View File

@ -2307,6 +2307,7 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
*pBrake = 0.0f; *pBrake = 0.0f;
*pHandbrake = false; *pHandbrake = false;
return; return;
default: break;
} }
} }
pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo]; pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo];

View File

@ -517,6 +517,7 @@ void CGarage::Update()
case GARAGE_BOMBSHOP1: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB1_SET, 1); break; case GARAGE_BOMBSHOP1: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB1_SET, 1); break;
case GARAGE_BOMBSHOP2: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB2_SET, 1); break; case GARAGE_BOMBSHOP2: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB2_SET, 1); break;
case GARAGE_BOMBSHOP3: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB3_SET, 1); break; case GARAGE_BOMBSHOP3: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB3_SET, 1); break;
default: break;
} }
m_eGarageState = GS_OPENING; m_eGarageState = GS_OPENING;
if (!CGarages::BombsAreFree) if (!CGarages::BombsAreFree)
@ -561,6 +562,7 @@ void CGarage::Update()
case GARAGE_BOMBSHOP3: case GARAGE_BOMBSHOP3:
CHud::SetHelpMessage(TheText.Get("GA_8"), false); // Use the detonator to activate the bomb. CHud::SetHelpMessage(TheText.Get("GA_8"), false); // Use the detonator to activate the bomb.
break; break;
default: break;
} }
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE); CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE);
FindPlayerPed()->m_pWanted->m_bIgnoredByCops = false; FindPlayerPed()->m_pWanted->m_bIgnoredByCops = false;
@ -1065,6 +1067,7 @@ void CGarage::Update()
case GARAGE_HIDEOUT_ONE: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse1, MAX_STORED_CARS_IN_INDUSTRIAL); break; case GARAGE_HIDEOUT_ONE: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse1, MAX_STORED_CARS_IN_INDUSTRIAL); break;
case GARAGE_HIDEOUT_TWO: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse2, MAX_STORED_CARS_IN_COMMERCIAL); break; case GARAGE_HIDEOUT_TWO: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse2, MAX_STORED_CARS_IN_COMMERCIAL); break;
case GARAGE_HIDEOUT_THREE: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse3, MAX_STORED_CARS_IN_SUBURBAN); break; case GARAGE_HIDEOUT_THREE: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse3, MAX_STORED_CARS_IN_SUBURBAN); break;
default: break;
} }
} }
UpdateDoorsHeight(); UpdateDoorsHeight();
@ -1093,6 +1096,7 @@ void CGarage::Update()
case GARAGE_HIDEOUT_ONE: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse1); break; case GARAGE_HIDEOUT_ONE: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse1); break;
case GARAGE_HIDEOUT_TWO: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse2); break; case GARAGE_HIDEOUT_TWO: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse2); break;
case GARAGE_HIDEOUT_THREE: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse3); break; case GARAGE_HIDEOUT_THREE: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse3); break;
default: break;
} }
if (bCreatedAllCars) if (bCreatedAllCars)
m_eGarageState = GS_OPENING; m_eGarageState = GS_OPENING;
@ -2151,6 +2155,7 @@ int32 CGarages::CountCarsInHideoutGarage(eGarageType type)
case GARAGE_HIDEOUT_THREE: case GARAGE_HIDEOUT_THREE:
total += (aCarsInSafeHouse3[i].HasCar()); total += (aCarsInSafeHouse3[i].HasCar());
break; break;
default: break;
} }
} }
return total; return total;
@ -2165,6 +2170,7 @@ int32 CGarages::FindMaxNumStoredCarsForGarage(eGarageType type)
return LIMIT_CARS_IN_COMMERCIAL; return LIMIT_CARS_IN_COMMERCIAL;
case GARAGE_HIDEOUT_THREE: case GARAGE_HIDEOUT_THREE:
return LIMIT_CARS_IN_SUBURBAN; return LIMIT_CARS_IN_SUBURBAN;
default: break;
} }
return 0; return 0;
} }
@ -2180,6 +2186,7 @@ bool CGarages::IsPointWithinHideOutGarage(Const CVector& point)
point.y > aGarages[i].m_fY1 && point.y < aGarages[i].m_fY2 && point.y > aGarages[i].m_fY1 && point.y < aGarages[i].m_fY2 &&
point.z > aGarages[i].m_fZ1 && point.z < aGarages[i].m_fZ2) point.z > aGarages[i].m_fZ1 && point.z < aGarages[i].m_fZ2)
return true; return true;
default: break;
} }
} }
return false; return false;

View File

@ -356,6 +356,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
return true; return true;
} }
break; break;
default: break;
} }
} }
if (!m_bRemoved && (m_eType == PICKUP_ONCE_TIMEOUT || m_eType == PICKUP_MONEY) && CTimer::GetTimeInMilliseconds() > m_nTimer) if (!m_bRemoved && (m_eType == PICKUP_ONCE_TIMEOUT || m_eType == PICKUP_MONEY) && CTimer::GetTimeInMilliseconds() > m_nTimer)
@ -576,6 +577,7 @@ CPickups::ModelForWeapon(eWeaponType weaponType)
case WEAPONTYPE_FLAMETHROWER: return MI_FLAMETHROWER; case WEAPONTYPE_FLAMETHROWER: return MI_FLAMETHROWER;
case WEAPONTYPE_MOLOTOV: return MI_MOLOTOV; case WEAPONTYPE_MOLOTOV: return MI_MOLOTOV;
case WEAPONTYPE_GRENADE: return MI_GRENADE; case WEAPONTYPE_GRENADE: return MI_GRENADE;
default: break;
} }
return 0; return 0;
} }

View File

@ -303,7 +303,7 @@ void CSceneEdit::Draw(void)
nCommandDrawn -= (MOVIE_TOTAL_COMMANDS - 1); nCommandDrawn -= (MOVIE_TOTAL_COMMANDS - 1);
if (nCommandDrawn <= MOVIE_DO_NOTHING) if (nCommandDrawn <= MOVIE_DO_NOTHING)
nCommandDrawn += (MOVIE_TOTAL_COMMANDS - 1); nCommandDrawn += (MOVIE_TOTAL_COMMANDS - 1);
sprintf(str, pCommandStrings[nCommandDrawn]); sprintf(str, "%s", pCommandStrings[nCommandDrawn]);
AsciiToUnicode(str, wstr); AsciiToUnicode(str, wstr);
CFont::SetColor(CRGBA(0, 0, 0, 0)); CFont::SetColor(CRGBA(0, 0, 0, 0));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(COMMAND_NAME_X_RIGHT - SHADOW_OFFSET), SCREEN_SCALE_Y(COMMAND_NAME_Y + SHADOW_OFFSET + i * COMMAND_NAME_HEIGHT), wstr); CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(COMMAND_NAME_X_RIGHT - SHADOW_OFFSET), SCREEN_SCALE_Y(COMMAND_NAME_Y + SHADOW_OFFSET + i * COMMAND_NAME_HEIGHT), wstr);
@ -1095,4 +1095,4 @@ bool CSceneEdit::SelectWeapon(void)
return false; return false;
} }
return false; return false;
} }

View File

@ -11305,6 +11305,7 @@ INITSAVEBUF
case ENTITY_TYPE_DUMMY: case ENTITY_TYPE_DUMMY:
type = 4; type = 4;
handle = CPools::GetDummyPool()->GetJustIndex((CDummy*)pEntity) + 1; handle = CPools::GetDummyPool()->GetJustIndex((CDummy*)pEntity) + 1;
default: break;
} }
} }
WriteSaveBuf(buf, type); WriteSaveBuf(buf, type);
@ -11462,6 +11463,7 @@ void CTheScripts::ClearSpaceForMissionEntity(const CVector& pos, CEntity* pEntit
printf("Deleted a ped where a mission entity should be\n"); printf("Deleted a ped where a mission entity should be\n");
break; break;
} }
default: break;
} }
} }
} }

View File

@ -120,7 +120,7 @@ CAnimViewer::Initialise(void) {
if (!CFileMgr::ReadLine(fd, gString, 255)) if (!CFileMgr::ReadLine(fd, gString, 255))
break; break;
sscanf(gString, "%s %s", &modelName, &animGroup); sscanf(gString, "%s %s", modelName, animGroup);
int groupId; int groupId;
for (groupId = 0; groupId < NUM_ANIM_ASSOC_GROUPS; groupId++) { for (groupId = 0; groupId < NUM_ANIM_ASSOC_GROUPS; groupId++) {
if (!strcmp(animGroup, CAnimManager::GetAnimGroupName((AssocGroupId)groupId))) if (!strcmp(animGroup, CAnimManager::GetAnimGroupName((AssocGroupId)groupId)))
@ -429,4 +429,4 @@ CAnimViewer::Shutdown(void)
CTimer::Shutdown(); CTimer::Shutdown();
CStreaming::Shutdown(); CStreaming::Shutdown();
CTxdStore::RemoveTxdSlot(animTxdSlot); CTxdStore::RemoveTxdSlot(animTxdSlot);
} }

View File

@ -885,7 +885,7 @@ CCam::PrintMode(void)
sprintf(buf, " "); sprintf(buf, " ");
sprintf(buf, " "); sprintf(buf, " ");
static char *modes[] = { "None", static Const char *modes[] = { "None",
"Top Down", "GTA Classic", "Behind Car", "Follow Ped", "Top Down", "GTA Classic", "Behind Car", "Follow Ped",
"Aiming", "Debug", "Sniper", "Rocket", "Model Viewer", "Bill", "Aiming", "Debug", "Sniper", "Rocket", "Model Viewer", "Bill",
"Syphon", "Circle", "Cheesy Zoom", "Wheel", "Fixed", "Syphon", "Circle", "Cheesy Zoom", "Wheel", "Fixed",

View File

@ -80,6 +80,10 @@ CCamera::CCamera(void)
Init(); Init();
} }
CCamera::CCamera(float)
{
}
void void
CCamera::Init(void) CCamera::Init(void)
{ {
@ -87,7 +91,12 @@ CCamera::Init(void)
float fMouseAccelHorzntl = m_fMouseAccelHorzntl; float fMouseAccelHorzntl = m_fMouseAccelHorzntl;
float fMouseAccelVertical = m_fMouseAccelVertical; float fMouseAccelVertical = m_fMouseAccelVertical;
#endif #endif
#ifdef FIX_BUGS
static const CCamera DummyCamera = CCamera(0.f);
*this = DummyCamera;
#else
memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh? memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh?
#endif
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
m_fMouseAccelHorzntl = fMouseAccelHorzntl; m_fMouseAccelHorzntl = fMouseAccelHorzntl;
m_fMouseAccelVertical = fMouseAccelVertical; m_fMouseAccelVertical = fMouseAccelVertical;
@ -740,6 +749,7 @@ CCamera::CamControl(void)
case VEHICLE_TYPE_BOAT: case VEHICLE_TYPE_BOAT:
ReqMode = CCam::MODE_BEHINDBOAT; ReqMode = CCam::MODE_BEHINDBOAT;
break; break;
default: break;
} }
// Car zoom value // Car zoom value
@ -2992,7 +3002,7 @@ CCamera::SetZoomValueFollowPedScript(int16 dist)
case 0: m_fPedZoomValueScript = 0.25f; break; case 0: m_fPedZoomValueScript = 0.25f; break;
case 1: m_fPedZoomValueScript = 1.5f; break; case 1: m_fPedZoomValueScript = 1.5f; break;
case 2: m_fPedZoomValueScript = 2.9f; break; case 2: m_fPedZoomValueScript = 2.9f; break;
default: m_fPedZoomValueScript = m_fPedZoomValueScript; break; default: break;
} }
m_bUseScriptZoomValuePed = true; m_bUseScriptZoomValuePed = true;
@ -3007,7 +3017,7 @@ CCamera::SetZoomValueCamStringScript(int16 dist)
case 0: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_1 : FREE_CAR_ZOOM_VALUE_1; break; case 0: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_1 : FREE_CAR_ZOOM_VALUE_1; break;
case 1: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_2 : FREE_CAR_ZOOM_VALUE_2; break; case 1: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_2 : FREE_CAR_ZOOM_VALUE_2; break;
case 2: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_3 : FREE_CAR_ZOOM_VALUE_3; break; case 2: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_3 : FREE_CAR_ZOOM_VALUE_3; break;
default: m_fCarZoomValueScript = m_fCarZoomValueScript; break; default: break;
} }
} else } else
#endif #endif
@ -3016,7 +3026,7 @@ CCamera::SetZoomValueCamStringScript(int16 dist)
case 0: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_1; break; case 0: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_1; break;
case 1: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_2; break; case 1: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_2; break;
case 2: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_3; break; case 2: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_3; break;
default: m_fCarZoomValueScript = m_fCarZoomValueScript; break; default: break;
} }
} }

View File

@ -403,7 +403,7 @@ public:
int m_BlurRed; int m_BlurRed;
int m_BlurType; int m_BlurType;
uint32 unknown; // some counter having to do with music uint32 unknown; // some counter having to do with music
int m_iWorkOutSpeedThisNumFrames; int m_iWorkOutSpeedThisNumFrames;
int m_iNumFramesSoFar; int m_iNumFramesSoFar;
@ -549,6 +549,7 @@ uint32 unknown; // some counter having to do with music
// High level and misc // High level and misc
CCamera(void); CCamera(void);
CCamera(float);
void Init(void); void Init(void);
void Process(void); void Process(void);
void CamControl(void); void CamControl(void);

View File

@ -231,7 +231,7 @@ CCollision::SortOutCollisionAfterLoad(void)
void void
CCollision::LoadCollisionScreen(eLevelName level) CCollision::LoadCollisionScreen(eLevelName level)
{ {
static char *levelNames[4] = { static Const char *levelNames[4] = {
"", "",
"IND_ZON", "IND_ZON",
"COM_ZON", "COM_ZON",

View File

@ -610,6 +610,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int32 button,
case MOUSE: case MOUSE:
state = &CPad::GetPad(PAD1)->PCTempMouseState; state = &CPad::GetPad(PAD1)->PCTempMouseState;
break; break;
default: break;
} }
if (pad != NULL) if (pad != NULL)
@ -1024,7 +1025,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int32 button, eC
case JOYSTICK: case JOYSTICK:
state = &CPad::GetPad(PAD1)->PCTempJoyState; state = &CPad::GetPad(PAD1)->PCTempJoyState;
break; break;
default: break;
} }
if (process) if (process)
@ -1293,6 +1294,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetApps()) if (CPad::GetPad(PAD1)->GetApps())
return true; return true;
break; break;
default: break;
} }
return false; return false;
@ -1493,6 +1495,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyJustDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetAppsJustDown()) if (CPad::GetPad(PAD1)->GetAppsJustDown())
return true; return true;
break; break;
default: break;
} }
return false; return false;
@ -1530,6 +1533,7 @@ bool CControllerConfigManager::GetIsMouseButtonDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2()) if (CPad::GetPad(PAD1)->GetMouseX2())
return true; return true;
break; break;
default: break;
} }
return false; return false;
@ -1567,6 +1571,7 @@ bool CControllerConfigManager::GetIsMouseButtonUp(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2Up()) if (CPad::GetPad(PAD1)->GetMouseX2Up())
return true; return true;
break; break;
default: break;
} }
return false; return false;
@ -1747,6 +1752,7 @@ void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction
DeleteMatchingCommonControls (action, key, type); DeleteMatchingCommonControls (action, key, type);
DeleteMatching1rst3rdPersonControls (action, key, type); DeleteMatching1rst3rdPersonControls (action, key, type);
break; break;
default: break;
} }
} }
} }
@ -1770,6 +1776,7 @@ bool CControllerConfigManager::GetIsKeyBlank(int32 key, eControllerType type)
if (key != 0) if (key != 0)
return false; return false;
break; break;
default: break;
} }
return true; return true;
@ -1836,6 +1843,7 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
case PED_SNIPER_ZOOM_OUT: case PED_SNIPER_ZOOM_OUT:
return ACTIONTYPE_1RSTPERSON; return ACTIONTYPE_1RSTPERSON;
break; break;
default: break;
} }
return ACTIONTYPE_NONE; return ACTIONTYPE_NONE;
@ -1861,6 +1869,7 @@ void CControllerConfigManager::ClearSettingsAssociatedWithAction(e_ControllerAct
m_aSettings[action][type].m_Key = 0; m_aSettings[action][type].m_Key = 0;
m_aSettings[action][type].m_ContSetOrder = SETORDER_NONE; m_aSettings[action][type].m_ContSetOrder = SETORDER_NONE;
break; break;
default: break;
} }
ResetSettingOrder(action); ResetSettingOrder(action);
@ -1881,6 +1890,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
return GetControllerSettingTextMouse (action); return GetControllerSettingTextMouse (action);
case JOYSTICK: case JOYSTICK:
return GetControllerSettingTextJoystick(action); return GetControllerSettingTextJoystick(action);
default: break;
} }
} }
} }
@ -2224,6 +2234,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextKeyBoard(e_ControllerAc
return TheText.Get("FEC_SFT"); // "SHIFT" return TheText.Get("FEC_SFT"); // "SHIFT"
break; break;
} }
default: break;
} }
} }
} }
@ -2256,6 +2267,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextMouse(e_ControllerActio
case 7: case 7:
return TheText.Get("FEC_MXT"); // MXB2 return TheText.Get("FEC_MXT"); // MXB2
break; break;
default: break;
} }
return NULL; return NULL;
@ -2375,6 +2387,7 @@ bool CControllerConfigManager::GetIsActionAButtonCombo(e_ControllerAction action
case PED_CYCLE_TARGET_RIGHT: case PED_CYCLE_TARGET_RIGHT:
return true; return true;
break; break;
default: break;
} }
return false; return false;
@ -2395,6 +2408,7 @@ wchar *CControllerConfigManager::GetButtonComboText(e_ControllerAction action)
case VEHICLE_LOOKBEHIND: case VEHICLE_LOOKBEHIND:
return TheText.Get("FEC_LBC"); // Use Look Left With Look Right. return TheText.Get("FEC_LBC"); // Use Look Left With Look Right.
break; break;
default: break;
} }
return NULL; return NULL;

View File

@ -753,7 +753,7 @@ CFileLoader::LoadClumpObject(const char *line)
char model[24], txd[24]; char model[24], txd[24];
CClumpModelInfo *mi; CClumpModelInfo *mi;
if(sscanf(line, "%d %s %s", &id, &model, &txd) == 3){ if(sscanf(line, "%d %s %s", &id, model, txd) == 3){
mi = CModelInfo::AddClumpModel(id); mi = CModelInfo::AddClumpModel(id);
mi->SetName(model); mi->SetName(model);
mi->SetTexDictionary(txd); mi->SetTexDictionary(txd);
@ -1184,7 +1184,7 @@ CFileLoader::LoadMapZones(const char *filename)
float minx, miny, minz; float minx, miny, minz;
float maxx, maxy, maxz; float maxx, maxy, maxz;
if(sscanf(line, "%s %d %f %f %f %f %f %f %d", if(sscanf(line, "%s %d %f %f %f %f %f %f %d",
&name, &type, name, &type,
&minx, &miny, &minz, &minx, &miny, &minz,
&maxx, &maxy, &maxz, &maxx, &maxy, &maxz,
&level) == 9) &level) == 9)

View File

@ -412,7 +412,7 @@ CMenuManager::ThingsToDoBeforeLeavingPage()
// ------ Functions not in the game/inlined ends // ------ Functions not in the game/inlined ends
void void
CMenuManager::BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2) CMenuManager::BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2)
{ {
if (!text) if (!text)
return; return;
@ -5020,6 +5020,7 @@ CMenuManager::SaveLoadFileError_SetUpErrorScreen()
case SAVESTATUS_DELETEFAILED10: case SAVESTATUS_DELETEFAILED10:
ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false); ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false);
break; break;
default: break;
} }
} }

View File

@ -598,7 +598,7 @@ public:
#endif #endif
public: public:
static void BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2); static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2);
static void CentreMousePointer(); static void CentreMousePointer();
void CheckCodesForControls(int); void CheckCodesForControls(int);
bool CheckHover(int x1, int x2, int y1, int y2); bool CheckHover(int x1, int x2, int y1, int y2);

View File

@ -509,7 +509,7 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
double xpos = 1.0f, ypos; double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos); glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
if (xpos != NULL) { if (xpos != 0.f) {
state.MMB = true; state.MMB = true;
state.RMB = true; state.RMB = true;
state.LMB = true; state.LMB = true;
@ -565,7 +565,7 @@ void CPad::UpdateMouse()
#else #else
double xpos = 1.0f, ypos; double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos); glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
if (xpos == NULL) if (xpos == 0.f)
return; return;
int32 signX = 1; int32 signX = 1;

View File

@ -90,7 +90,11 @@ CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot)
// relocate to another slot?? // relocate to another slot??
CObject *newObject = new CObject(object->GetModelIndex(), false); CObject *newObject = new CObject(object->GetModelIndex(), false);
CWorld::Remove(object); CWorld::Remove(object);
#ifdef FIX_BUGS
*newObject = *object;
#else
memcpy(newObject, object, ms_pObjectPool->GetMaxEntrySize()); memcpy(newObject, object, ms_pObjectPool->GetMaxEntrySize());
#endif
CWorld::Add(newObject); CWorld::Add(newObject);
object->m_rwObject = nil; object->m_rwObject = nil;
delete object; delete object;

View File

@ -7,7 +7,7 @@ float CProfile::ms_afCumulativeTime[NUM_PROFILES];
float CProfile::ms_afEndTime[NUM_PROFILES]; float CProfile::ms_afEndTime[NUM_PROFILES];
float CProfile::ms_afMaxEndTime[NUM_PROFILES]; float CProfile::ms_afMaxEndTime[NUM_PROFILES];
float CProfile::ms_afMaxCumulativeTime[NUM_PROFILES]; float CProfile::ms_afMaxCumulativeTime[NUM_PROFILES];
char *CProfile::ms_pProfileString[NUM_PROFILES]; Const char *CProfile::ms_pProfileString[NUM_PROFILES];
RwRGBA CProfile::ms_aBarColours[NUM_PROFILES]; RwRGBA CProfile::ms_aBarColours[NUM_PROFILES];
void CProfile::Initialise() void CProfile::Initialise()
@ -68,4 +68,4 @@ void CProfile::ShowResults()
ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME] = Max(ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME], ms_afCumulativeTime[PROFILE_RENDERING_TIME]); ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME] = Max(ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME], ms_afCumulativeTime[PROFILE_RENDERING_TIME]);
ms_afMaxCumulativeTime[PROFILE_TOTAL] = Max(ms_afMaxCumulativeTime[PROFILE_TOTAL], ms_afCumulativeTime[PROFILE_TOTAL]); ms_afMaxCumulativeTime[PROFILE_TOTAL] = Max(ms_afMaxCumulativeTime[PROFILE_TOTAL], ms_afCumulativeTime[PROFILE_TOTAL]);
} }
#endif #endif

View File

@ -19,10 +19,10 @@ class CProfile
static float ms_afEndTime[NUM_PROFILES]; static float ms_afEndTime[NUM_PROFILES];
static float ms_afMaxEndTime[NUM_PROFILES]; static float ms_afMaxEndTime[NUM_PROFILES];
static float ms_afMaxCumulativeTime[NUM_PROFILES]; static float ms_afMaxCumulativeTime[NUM_PROFILES];
static char *ms_pProfileString[NUM_PROFILES]; static Const char *ms_pProfileString[NUM_PROFILES];
static RwRGBA ms_aBarColours[NUM_PROFILES]; static RwRGBA ms_aBarColours[NUM_PROFILES];
public: public:
static void Initialise(); static void Initialise();
static void SuspendProfile(eProfile profile); static void SuspendProfile(eProfile profile);
static void ShowResults(); static void ShowResults();
}; };

View File

@ -710,6 +710,7 @@ CStreaming::RequestSubway(void)
RequestModel(MI_SUBPLATFORM_SUB, STREAMFLAGS_NOFADE); RequestModel(MI_SUBPLATFORM_SUB, STREAMFLAGS_NOFADE);
RequestModel(MI_SUBPLATFORM_SUB2, STREAMFLAGS_NOFADE); RequestModel(MI_SUBPLATFORM_SUB2, STREAMFLAGS_NOFADE);
break; break;
default: break;
} }
} }
@ -747,6 +748,7 @@ CStreaming::RequestIslands(eLevelName level)
RequestModel(islandLODindust, BIGBUILDINGFLAGS); RequestModel(islandLODindust, BIGBUILDINGFLAGS);
RequestModel(islandLODcomSub, BIGBUILDINGFLAGS); RequestModel(islandLODcomSub, BIGBUILDINGFLAGS);
break; break;
default: break;
} }
} }
@ -1750,7 +1752,7 @@ CStreaming::ProcessLoadingChannel(int32 ch)
void void
CStreaming::RetryLoadFile(int32 ch) CStreaming::RetryLoadFile(int32 ch)
{ {
char *key; Const char *key;
CPad::StopPadsShaking(); CPad::StopPadsShaking();

View File

@ -9,7 +9,7 @@
float CSurfaceTable::ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS]; float CSurfaceTable::ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
void void
CSurfaceTable::Initialise(char *filename) CSurfaceTable::Initialise(Const char *filename)
{ {
int lineno, fieldno; int lineno, fieldno;
char *line; char *line;

View File

@ -100,7 +100,7 @@ class CSurfaceTable
{ {
static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS]; static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
public: public:
static void Initialise(char *filename); static void Initialise(Const char *filename);
static int GetAdhesionGroup(uint8 surfaceType); static int GetAdhesionGroup(uint8 surfaceType);
static float GetWetMultiplier(uint8 surfaceType); static float GetWetMultiplier(uint8 surfaceType);
static float GetAdhesiveLimit(CColPoint &colpoint); static float GetAdhesiveLimit(CColPoint &colpoint);

View File

@ -2205,6 +2205,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
case ENTITY_TYPE_OBJECT: case ENTITY_TYPE_OBJECT:
pObject->ObjectDamage(300.0f * fDamageMultiplier); pObject->ObjectDamage(300.0f * fDamageMultiplier);
break; break;
default: break;
} }
} }
} }

View File

@ -357,7 +357,7 @@ CTheZones::FindSmallestZonePositionILN(const CVector *v)
} }
int16 int16
CTheZones::FindZoneByLabelAndReturnIndex(char *name) CTheZones::FindZoneByLabelAndReturnIndex(Const char *name)
{ {
char str[8]; char str[8];
memset(str, 0, 8); memset(str, 0, 8);

View File

@ -86,7 +86,7 @@ public:
static CZone *FindSmallestZonePosition(const CVector *v); static CZone *FindSmallestZonePosition(const CVector *v);
static CZone *FindSmallestZonePositionType(const CVector *v, eZoneType type); static CZone *FindSmallestZonePositionType(const CVector *v, eZoneType type);
static CZone *FindSmallestZonePositionILN(const CVector *v); static CZone *FindSmallestZonePositionILN(const CVector *v);
static int16 FindZoneByLabelAndReturnIndex(char *name); static int16 FindZoneByLabelAndReturnIndex(Const char *name);
static CZoneInfo *GetZoneInfo(const CVector *v, uint8 day); static CZoneInfo *GetZoneInfo(const CVector *v, uint8 day);
static void GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info); static void GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info);
static void SetZoneCarInfo(uint16 zoneid, uint8 day, int16 carDensity, static void SetZoneCarInfo(uint16 zoneid, uint8 day, int16 carDensity,

View File

@ -401,7 +401,7 @@ DestroySplashScreen(void)
splashTxdId = -1; splashTxdId = -1;
} }
char* Const char*
GetRandomSplashScreen(void) GetRandomSplashScreen(void)
{ {
int index; int index;
@ -424,10 +424,10 @@ GetRandomSplashScreen(void)
return splashName; return splashName;
} }
char* Const char*
GetLevelSplashScreen(int level) GetLevelSplashScreen(int level)
{ {
static char *splashScreens[4] = { static Const char *splashScreens[4] = {
nil, nil,
"splash1", "splash1",
"splash2", "splash2",
@ -1278,7 +1278,7 @@ void TheGame(void)
CGame::Initialise("DATA\\GTA3.DAT"); CGame::Initialise("DATA\\GTA3.DAT");
#endif #endif
char *splash = GetRandomSplashScreen(); // inlined here Const char *splash = GetRandomSplashScreen(); // inlined here
LoadingScreen("Starting Game", NULL, splash); LoadingScreen("Starting Game", NULL, splash);
@ -1312,7 +1312,7 @@ void TheGame(void)
if (FrontEndMenuManager.m_bWantToLoad) if (FrontEndMenuManager.m_bWantToLoad)
#endif #endif
{ {
char *splash1 = GetLevelSplashScreen(CGame::currLevel); Const char *splash1 = GetLevelSplashScreen(CGame::currLevel);
LoadSplash(splash1); LoadSplash(splash1);
} }

View File

@ -22,8 +22,8 @@ void LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
void LoadingIslandScreen(const char *levelName); void LoadingIslandScreen(const char *levelName);
CSprite2d *LoadSplash(const char *name); CSprite2d *LoadSplash(const char *name);
void DestroySplashScreen(void); void DestroySplashScreen(void);
char *GetLevelSplashScreen(int level); Const char *GetLevelSplashScreen(int level);
char *GetRandomSplashScreen(void); Const char *GetRandomSplashScreen(void);
void LittleTest(void); void LittleTest(void);
void ValidateVersion(); void ValidateVersion();
void ResetLoadingScreenBar(void); void ResetLoadingScreenBar(void);

View File

@ -180,7 +180,7 @@ CPedModelInfo::SetLowDetailClump(RpClump *lodclump)
struct ColNodeInfo struct ColNodeInfo
{ {
char *name; Const char *name;
int pedNode; int pedNode;
int pieceType; int pieceType;
float x, z; float x, z;

View File

@ -61,7 +61,7 @@ CParticleObject::CParticleObject() :
m_nState(POBJECTSTATE_INITIALISED), m_nState(POBJECTSTATE_INITIALISED),
m_pNext(NULL), m_pNext(NULL),
m_pPrev(NULL), m_pPrev(NULL),
m_nRemoveTimer(NULL) m_nRemoveTimer(0)
{ {
; ;
@ -1127,13 +1127,21 @@ CParticleObject::SaveParticle(uint8 *buffer, uint32 *length)
for ( CParticleObject *p = pCloseListHead; p != NULL; p = p->m_pNext ) for ( CParticleObject *p = pCloseListHead; p != NULL; p = p->m_pNext )
{ {
#ifdef FIX_BUGS
*(CParticleObject*)buffer = *p;
#else
memcpy(buffer, p, sizeof(CParticleObject)); memcpy(buffer, p, sizeof(CParticleObject));
#endif
buffer += sizeof(CParticleObject); buffer += sizeof(CParticleObject);
} }
for ( CParticleObject *p = pFarListHead; p != NULL; p = p->m_pNext ) for ( CParticleObject *p = pFarListHead; p != NULL; p = p->m_pNext )
{ {
#ifdef FIX_BUGS
*(CParticleObject*)buffer = *p;
#else
memcpy(buffer, p, sizeof(CParticleObject)); memcpy(buffer, p, sizeof(CParticleObject));
#endif
buffer += sizeof(CParticleObject); buffer += sizeof(CParticleObject);
} }

View File

@ -166,6 +166,7 @@ CEmergencyPed::FiremanAI(void)
m_nEmergencyPedState = EMERGENCY_PED_READY; m_nEmergencyPedState = EMERGENCY_PED_READY;
SetMoveState(PEDMOVE_WALK); SetMoveState(PEDMOVE_WALK);
break; break;
default: break;
} }
} }
@ -410,6 +411,7 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_READY; m_nEmergencyPedState = EMERGENCY_PED_READY;
SetMoveState(PEDMOVE_WALK); SetMoveState(PEDMOVE_WALK);
break; break;
default: break;
} }
} }
} }

View File

@ -5048,13 +5048,13 @@ CPed::LoadFightData(void)
sscanf( sscanf(
&line[lp], &line[lp],
"%s %f %f %f %f %c %s %d %d", "%s %f %f %f %f %c %s %d %d",
&moveName, moveName,
&startFireTime, &startFireTime,
&endFireTime, &endFireTime,
&comboFollowOnTime, &comboFollowOnTime,
&strikeRadius, &strikeRadius,
&hitLevel, &hitLevel,
&animName, animName,
&damage, &damage,
&flags); &flags);
@ -10686,6 +10686,7 @@ CPed::ProcessControl(void)
Say(SOUND_PED_HANDS_UP); Say(SOUND_PED_HANDS_UP);
} }
break; break;
default: break;
} }
SetMoveAnim(); SetMoveAnim();
if (bPedIsBleeding) { if (bPedIsBleeding) {
@ -11810,8 +11811,10 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
} }
} else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) { } else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) {
switch (ped->m_vehEnterType) { if (veh->bIsBus) {
if (!veh->bIsBus) { veh->AddPassenger(ped);
} else {
switch (ped->m_vehEnterType) {
case CAR_DOOR_RF: case CAR_DOOR_RF:
veh->AddPassenger(ped, 0); veh->AddPassenger(ped, 0);
break; break;
@ -11821,10 +11824,10 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
case CAR_DOOR_LR: case CAR_DOOR_LR:
veh->AddPassenger(ped, 1); veh->AddPassenger(ped, 1);
break; break;
} default:
default: veh->AddPassenger(ped);
veh->AddPassenger(ped);
break; break;
}
} }
ped->m_nPedState = PED_DRIVING; ped->m_nPedState = PED_DRIVING;
if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT) if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT)
@ -17119,6 +17122,7 @@ CPed::SetObjective(eObjective newObj, CVector dest)
if (sq(m_distanceToCountSeekDone) > (m_nextRoutePointPos - GetPosition()).MagnitudeSqr2D()) if (sq(m_distanceToCountSeekDone) > (m_nextRoutePointPos - GetPosition()).MagnitudeSqr2D())
return; return;
break; break;
default: break;
} }
if (IsTemporaryObjective(m_objective)) { if (IsTemporaryObjective(m_objective)) {

View File

@ -984,6 +984,7 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
case PARTICLE_WATER_HYDRANT: case PARTICLE_WATER_HYDRANT:
pParticle->m_vecPosition.z += 20.0f * psystem->m_fPositionRandomError * ms_afRandTable[CGeneral::GetRandomNumber() % RAND_TABLE_SIZE]; pParticle->m_vecPosition.z += 20.0f * psystem->m_fPositionRandomError * ms_afRandTable[CGeneral::GetRandomNumber() % RAND_TABLE_SIZE];
break; break;
default: break;
} }
if ( fSize != 0.0f ) if ( fSize != 0.0f )
@ -1214,6 +1215,7 @@ void CParticle::Update()
continue; continue;
} }
break; break;
default: break;
} }
} }
} }
@ -1295,6 +1297,7 @@ void CParticle::Update()
continue; continue;
} }
break; break;
default: break;
} }
} }
} }

View File

@ -1174,6 +1174,7 @@ CRenderer::IsEntityCullZoneVisible(CEntity *ent)
if(!obj->IsStatic()) if(!obj->IsStatic())
return true; return true;
return !(obj->m_pCurSurface && obj->m_pCurSurface->bZoneCulled2); return !(obj->m_pCurSurface && obj->m_pCurSurface->bZoneCulled2);
default: break;
} }
return true; return true;
} }
@ -1182,12 +1183,14 @@ bool
CRenderer::IsVehicleCullZoneVisible(CEntity *ent) CRenderer::IsVehicleCullZoneVisible(CEntity *ent)
{ {
CVehicle *v = (CVehicle*)ent; CVehicle *v = (CVehicle*)ent;
switch(v->GetStatus()) switch(v->GetStatus()) {
case STATUS_SIMPLE: case STATUS_SIMPLE:
case STATUS_PHYSICS: case STATUS_PHYSICS:
case STATUS_ABANDONED: case STATUS_ABANDONED:
case STATUS_WRECKED: case STATUS_WRECKED:
return !(v->m_pCurGroundEntity && v->m_pCurGroundEntity->bZoneCulled2); return !(v->m_pCurGroundEntity && v->m_pCurGroundEntity->bZoneCulled2);
default: break;
}
return true; return true;
} }

View File

@ -52,7 +52,7 @@ const float fBlueMult = 1.4f;
void void
CWaterLevel::Initialise(char *pWaterDat) CWaterLevel::Initialise(Const char *pWaterDat)
{ {
ms_nNoOfWaterLevels = 0; ms_nNoOfWaterLevels = 0;

View File

@ -79,7 +79,7 @@ class CWaterLevel
static int16 nGeomUsed; static int16 nGeomUsed;
public: public:
static void Initialise(char *pWaterDat); static void Initialise(Const char *pWaterDat);
static void Shutdown(); static void Shutdown();
static void CreateWavyAtomic(); static void CreateWavyAtomic();
static void DestroyWavyAtomic(); static void DestroyWavyAtomic();

View File

@ -231,7 +231,7 @@ CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
{ {
RpAtomic *lodatm; RpAtomic *lodatm;
float fadefactor; float fadefactor;
uint8 alpha; uint32 alpha;
CSimpleModelInfo *mi; CSimpleModelInfo *mi;
mi = GetAtomicModelInfo(atomic); mi = GetAtomicModelInfo(atomic);
@ -730,11 +730,13 @@ CVisibilityPlugins::SetAtomicModelInfo(RpAtomic *atomic,
{ {
AtomicExt *ext = ATOMICEXT(atomic); AtomicExt *ext = ATOMICEXT(atomic);
ext->modelInfo = modelInfo; ext->modelInfo = modelInfo;
switch (modelInfo->GetModelType()) switch (modelInfo->GetModelType()) {
case MITYPE_SIMPLE: case MITYPE_SIMPLE:
case MITYPE_TIME: case MITYPE_TIME:
if(modelInfo->m_normalCull) if(modelInfo->m_normalCull)
SetAtomicRenderCallback(atomic, RenderObjNormalAtomic); SetAtomicRenderCallback(atomic, RenderObjNormalAtomic);
default: break;
}
} }
CSimpleModelInfo* CSimpleModelInfo*
@ -851,6 +853,7 @@ CVisibilityPlugins::SetClumpModelInfo(RpClump *clump, CClumpModelInfo *modelInfo
else else
CLUMPEXT(clump)->visibilityCB = VehicleVisibilityCB; CLUMPEXT(clump)->visibilityCB = VehicleVisibilityCB;
break; break;
default: break;
} }
} }

View File

@ -246,7 +246,7 @@ GenericLoad()
// Load SimpleVars and Scripts // Load SimpleVars and Scripts
CheckSum = 0; CheckSum = 0;
CDate(CompileDateAndTime); CDate dummy; // unused
CPad::ResetCheats(); CPad::ResetCheats();
if (!ReadInSizeofSaveFileBuffer(file, size)) if (!ReadInSizeofSaveFileBuffer(file, size))
return false; return false;

View File

@ -429,7 +429,7 @@ RwChar **_psGetVideoModeList()
if ( vm.flags & rwVIDEOMODEEXCLUSIVE ) if ( vm.flags & rwVIDEOMODEEXCLUSIVE )
{ {
_VMList[i] = (RwChar*)RwCalloc(100, sizeof(RwChar)); _VMList[i] = (RwChar*)RwCalloc(100, sizeof(RwChar));
rwsprintf(_VMList[i],"%lu X %lu X %lu", vm.width, vm.height, vm.depth); rwsprintf(_VMList[i],"%d X %d X %d", vm.width, vm.height, vm.depth);
} }
else else
_VMList[i] = nil; _VMList[i] = nil;

View File

@ -252,6 +252,7 @@ CAutomobile::ProcessControl(void)
strongGrip2 = true; strongGrip2 = true;
} }
} }
default: break;
} }
} }
@ -423,6 +424,7 @@ CAutomobile::ProcessControl(void)
m_fGasPedal = 0.0f; m_fGasPedal = 0.0f;
m_nCarHornTimer = 0; m_nCarHornTimer = 0;
break; break;
default: break;
} }
// what's going on here? // what's going on here?
@ -1259,6 +1261,7 @@ CAutomobile::PreRender(void)
m_aWheelColPoints[i].point + CVector(0.0f, 0.0f, 0.05f), m_aWheelColPoints[i].point + CVector(0.0f, 0.0f, 0.05f),
CVector(0.0f, 0.0f, 0.0f), nil, 0.1f); CVector(0.0f, 0.0f, 0.0f), nil, 0.1f);
break; break;
default: break;
} }
} }
}else{ }else{
@ -1383,6 +1386,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y, GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_LEFT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_LEFT]); &m_aWheelSkidmarkMuddy[CARWHEEL_REAR_LEFT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_LEFT]);
break; break;
default: break;
} }
switch(m_aWheelState[CARWHEEL_REAR_RIGHT]){ switch(m_aWheelState[CARWHEEL_REAR_RIGHT]){
@ -1400,6 +1404,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y, GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_RIGHT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_RIGHT]); &m_aWheelSkidmarkMuddy[CARWHEEL_REAR_RIGHT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_RIGHT]);
break; break;
default: break;
} }
} }
@ -1851,7 +1856,7 @@ CAutomobile::PreRender(void)
false); false);
CVector pos = GetPosition() - 4.0f*GetForward(); CVector pos = GetPosition() - 4.0f*GetForward();
if(Damage.GetLightStatus(VEHLIGHT_REAR_LEFT) == LIGHT_STATUS_OK || if(Damage.GetLightStatus(VEHLIGHT_REAR_LEFT) == LIGHT_STATUS_OK ||
Damage.GetLightStatus(VEHLIGHT_REAR_RIGHT) == LIGHT_STATUS_OK) Damage.GetLightStatus(VEHLIGHT_REAR_RIGHT) == LIGHT_STATUS_OK) {
if(m_fBrakePedal > 0.0f) if(m_fBrakePedal > 0.0f)
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f), CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f),
10.0f, 1.0f, 0.0f, 0.0f, 10.0f, 1.0f, 0.0f, 0.0f,
@ -1860,6 +1865,7 @@ CAutomobile::PreRender(void)
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f), CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f),
7.0f, 0.6f, 0.0f, 0.0f, 7.0f, 0.6f, 0.0f, 0.0f,
CPointLights::FOG_NONE, false); CPointLights::FOG_NONE, false);
}
} }
}else{ }else{
// Lights off // Lights off
@ -3781,6 +3787,7 @@ CAutomobile::IsDoorReady(eDoors door)
case DOOR_FRONT_RIGHT: doorflag = CAR_DOOR_FLAG_RF; break; case DOOR_FRONT_RIGHT: doorflag = CAR_DOOR_FLAG_RF; break;
case DOOR_REAR_LEFT: doorflag = CAR_DOOR_FLAG_LR; break; case DOOR_REAR_LEFT: doorflag = CAR_DOOR_FLAG_LR; break;
case DOOR_REAR_RIGHT: doorflag = CAR_DOOR_FLAG_RR; break; case DOOR_REAR_RIGHT: doorflag = CAR_DOOR_FLAG_RR; break;
default: break;
} }
return (doorflag & m_nGettingInFlags) == 0; return (doorflag & m_nGettingInFlags) == 0;
} }

View File

@ -180,6 +180,7 @@ CBoat::ProcessControl(void)
return; return;
} }
break; break;
default: break;
} }
float collisionDamage = pHandling->fCollisionDamageMultiplier * m_fDamageImpulse; float collisionDamage = pHandling->fCollisionDamageMultiplier * m_fDamageImpulse;

View File

@ -85,6 +85,7 @@ CDamageManager::ApplyDamage(tComponent component, float damage, float unused)
ProgressEngineDamage(); ProgressEngineDamage();
ProgressPanelDamage(subComp); ProgressPanelDamage(subComp);
break; break;
default: break;
} }
return true; return true;
} }

View File

@ -996,7 +996,7 @@ CHeli::TestRocketCollision(CVector *rocketPos)
for(i = 0; i < NUM_HELIS; i++){ for(i = 0; i < NUM_HELIS; i++){
if(pHelis[i] && !pHelis[i]->bExplosionProof && (*rocketPos - pHelis[i]->GetPosition()).MagnitudeSqr() < sq(8.0f)){ if(pHelis[i] && !pHelis[i]->bExplosionProof && (*rocketPos - pHelis[i]->GetPosition()).MagnitudeSqr() < sq(8.0f)){
pHelis[i]->m_fAngularSpeed = (CGeneral::GetRandomNumber() < RAND_MAX/2) ? 0.05f : -0.05f; pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f;
pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN; pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN;
pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000; pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
hit = true; hit = true;
@ -1023,7 +1023,7 @@ CHeli::TestBulletCollision(CVector *line0, CVector *line1, CVector *bulletPos, i
if(pHelis[i]->m_heliType == HELI_CATALINA && pHelis[i]->m_nBulletDamage > 400 || if(pHelis[i]->m_heliType == HELI_CATALINA && pHelis[i]->m_nBulletDamage > 400 ||
pHelis[i]->m_heliType != HELI_CATALINA && pHelis[i]->m_nBulletDamage > 700){ pHelis[i]->m_heliType != HELI_CATALINA && pHelis[i]->m_nBulletDamage > 700){
pHelis[i]->m_fAngularSpeed = (CGeneral::GetRandomNumber() < RAND_MAX/2) ? 0.05f : -0.05f; pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f;
pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN; pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN;
pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000; pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
} }

View File

@ -492,7 +492,7 @@ CTrain::Shutdown(void)
} }
void void
CTrain::ReadAndInterpretTrackFile(char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists, CTrain::ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail) float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail)
{ {
bool readingFile = false; bool readingFile = false;

View File

@ -87,7 +87,7 @@ public:
static void InitTrains(void); static void InitTrains(void);
static void Shutdown(void); static void Shutdown(void);
static void ReadAndInterpretTrackFile(char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists, static void ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail); float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail);
static void UpdateTrains(void); static void UpdateTrains(void);
}; };

View File

@ -200,6 +200,7 @@ void CBulletInfo::Update(void)
case ENTITY_TYPE_VEHICLE: case ENTITY_TYPE_VEHICLE:
DMAudio.PlayOneShot(((CVehicle*)pHitEntity)->m_audioEntityId, SOUND_WEAPON_HIT_VEHICLE, 1.0f); DMAudio.PlayOneShot(((CVehicle*)pHitEntity)->m_audioEntityId, SOUND_WEAPON_HIT_VEHICLE, 1.0f);
break; break;
default: break;
} }
} }
CGlass::WasGlassHitByBullet(pHitEntity, point.point); CGlass::WasGlassHitByBullet(pHitEntity, point.point);

View File

@ -116,6 +116,7 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
elasticity = 0.5f; elasticity = 0.5f;
break; break;
} }
default: break;
} }
int i = 0; int i = 0;
@ -137,6 +138,7 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
case WEAPONTYPE_GRENADE: case WEAPONTYPE_GRENADE:
ms_apProjectile[i] = new CProjectile(MI_GRENADE); ms_apProjectile[i] = new CProjectile(MI_GRENADE);
break; break;
default: break;
} }
if (ms_apProjectile[i] == nil) if (ms_apProjectile[i] == nil)
@ -183,6 +185,7 @@ CProjectileInfo::RemoveNotAdd(CEntity *entity, eWeaponType weaponType, CVector p
case WEAPONTYPE_ROCKETLAUNCHER: case WEAPONTYPE_ROCKETLAUNCHER:
CExplosion::AddExplosion(nil, entity, EXPLOSION_ROCKET, pos, 0); CExplosion::AddExplosion(nil, entity, EXPLOSION_ROCKET, pos, 0);
break; break;
default: break;
} }
} }

View File

@ -806,6 +806,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
break; break;
} }
default: break;
} }
DoBulletImpact(shooter, victim, fireSource, &target, &point, ahead); DoBulletImpact(shooter, victim, fireSource, &target, &point, ahead);
@ -1070,6 +1071,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
break; break;
} }
default: break;
} }
} }
@ -1101,6 +1103,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point->point); PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point->point);
break; break;
} }
default: break;
} }
} }
else else
@ -1328,6 +1331,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
break; break;
} }
default: break;
} }
} }
@ -1359,6 +1363,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point); PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break; break;
} }
default: break;
} }
} }
else else
@ -1768,6 +1773,7 @@ CWeapon::FireInstantHitFromCar(CAutomobile *shooter, bool left)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point); PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break; break;
} }
default: break;
} }
} }
else else
@ -2037,6 +2043,7 @@ CWeapon::Update(int32 audioEntity)
break; break;
} }
default: break;
} }
} }
@ -2131,6 +2138,7 @@ FireOneInstantHitRound(CVector *source, CVector *target, int32 damage)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point); PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break; break;
} }
default: break;
} }
} }
else else

View File

@ -105,8 +105,8 @@ CWeaponInfo::LoadWeaponData(void)
sscanf( sscanf(
&line[lp], &line[lp],
"%s %s %f %d %d %d %d %f %f %f %f %f %f %f %s %s %f %f %f %f %d %d", "%s %s %f %d %d %d %d %f %f %f %f %f %f %f %s %s %f %f %f %f %d %d",
&weaponName, weaponName,
&fireType, fireType,
&range, &range,
&firingRate, &firingRate,
&reload, &reload,
@ -119,8 +119,8 @@ CWeaponInfo::LoadWeaponData(void)
&fireOffsetX, &fireOffsetX,
&fireOffsetY, &fireOffsetY,
&fireOffsetZ, &fireOffsetZ,
&animToPlay, animToPlay,
&anim2ToPlay, anim2ToPlay,
&animLoopStart, &animLoopStart,
&animLoopEnd, &animLoopEnd,
&delayBetweenAnimAndFire, &delayBetweenAnimAndFire,
@ -201,4 +201,4 @@ CWeaponInfo::Shutdown(void)
{ {
debug("Shutting down CWeaponInfo...\n"); debug("Shutting down CWeaponInfo...\n");
debug("CWeaponInfo shut down\n"); debug("CWeaponInfo shut down\n");
} }