summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/animation/AnimBlendAssociation.h5
-rw-r--r--src/animation/FrameUpdate.cpp6
-rw-r--r--src/audio/oal/aldlist.cpp4
-rw-r--r--src/audio/oal/aldlist.h4
-rw-r--r--src/control/CarAI.cpp1
-rw-r--r--src/control/CarCtrl.cpp1
-rw-r--r--src/control/Garages.cpp7
-rw-r--r--src/control/Pickups.cpp2
-rw-r--r--src/control/SceneEdit.cpp4
-rw-r--r--src/control/Script.cpp2
-rw-r--r--src/core/AnimViewer.cpp4
-rw-r--r--src/core/Cam.cpp2
-rw-r--r--src/core/Camera.cpp16
-rw-r--r--src/core/Camera.h3
-rw-r--r--src/core/Collision.cpp2
-rw-r--r--src/core/ControllerConfig.cpp16
-rw-r--r--src/core/FileLoader.cpp4
-rw-r--r--src/core/Frontend.cpp3
-rw-r--r--src/core/Frontend.h2
-rw-r--r--src/core/Pad.cpp4
-rw-r--r--src/core/Pools.cpp4
-rw-r--r--src/core/Profile.cpp4
-rw-r--r--src/core/Profile.h4
-rw-r--r--src/core/Streaming.cpp4
-rw-r--r--src/core/SurfaceTable.cpp2
-rw-r--r--src/core/SurfaceTable.h2
-rw-r--r--src/core/World.cpp1
-rw-r--r--src/core/Zones.cpp2
-rw-r--r--src/core/Zones.h2
-rw-r--r--src/core/main.cpp10
-rw-r--r--src/core/main.h4
-rw-r--r--src/modelinfo/PedModelInfo.cpp2
-rw-r--r--src/objects/ParticleObject.cpp10
-rw-r--r--src/peds/EmergencyPed.cpp2
-rw-r--r--src/peds/Ped.cpp18
-rw-r--r--src/render/Particle.cpp3
-rw-r--r--src/render/Renderer.cpp5
-rw-r--r--src/render/WaterLevel.cpp2
-rw-r--r--src/render/WaterLevel.h2
-rw-r--r--src/rw/VisibilityPlugins.cpp15
-rw-r--r--src/save/GenericGameStorage.cpp2
-rw-r--r--src/skel/glfw/glfw.cpp2
-rw-r--r--src/vehicles/Automobile.cpp9
-rw-r--r--src/vehicles/Boat.cpp1
-rw-r--r--src/vehicles/DamageManager.cpp1
-rw-r--r--src/vehicles/Heli.cpp4
-rw-r--r--src/vehicles/Train.cpp2
-rw-r--r--src/vehicles/Train.h2
-rw-r--r--src/weapons/BulletInfo.cpp1
-rw-r--r--src/weapons/ProjectileInfo.cpp3
-rw-r--r--src/weapons/Weapon.cpp8
-rw-r--r--src/weapons/WeaponInfo.cpp10
52 files changed, 165 insertions, 70 deletions
diff --git a/src/animation/AnimBlendAssociation.h b/src/animation/AnimBlendAssociation.h
index d0c60a88..2dff4391 100644
--- a/src/animation/AnimBlendAssociation.h
+++ b/src/animation/AnimBlendAssociation.h
@@ -62,7 +62,10 @@ public:
CAnimBlendAssociation(void);
CAnimBlendAssociation(CAnimBlendAssociation &other);
- virtual ~CAnimBlendAssociation(void);
+#ifndef FIX_BUGS
+ virtual
+#endif
+ ~CAnimBlendAssociation(void);
void AllocateAnimBlendNodeArray(int n);
void FreeAnimBlendNodeArray(void);
void Init(RpClump *clump, CAnimBlendHierarchy *hier);
diff --git a/src/animation/FrameUpdate.cpp b/src/animation/FrameUpdate.cpp
index 8697e7c6..a3a2013a 100644
--- a/src/animation/FrameUpdate.cpp
+++ b/src/animation/FrameUpdate.cpp
@@ -147,11 +147,12 @@ FrameUpdateCallBackWithVelocityExtractionNonSkinned(AnimBlendFrameData *frame, v
mat->pos.x = pos.x - transx;
mat->pos.y = pos.y - transy;
mat->pos.z = pos.z;
- if(mat->pos.z >= -0.8f)
+ if(mat->pos.z >= -0.8f) {
if(mat->pos.z < -0.4f)
mat->pos.z += (2.5f * mat->pos.z + 2.0f) * frame->resetPos.z;
else
mat->pos.z += frame->resetPos.z;
+ }
mat->pos.x += frame->resetPos.x;
mat->pos.y += frame->resetPos.y;
}
@@ -361,11 +362,12 @@ FrameUpdateCallBackWithVelocityExtractionSkinned(AnimBlendFrameData *frame, void
xform->t.x = pos.x - transx;
xform->t.y = pos.y - transy;
xform->t.z = pos.z;
- if(xform->t.z >= -0.8f)
+ if(xform->t.z >= -0.8f) {
if(xform->t.z < -0.4f)
xform->t.z += (2.5f * xform->t.z + 2.0f) * frame->resetPos.z;
else
xform->t.z += frame->resetPos.z;
+ }
xform->t.x += frame->resetPos.x;
xform->t.y += frame->resetPos.y;
}
diff --git a/src/audio/oal/aldlist.cpp b/src/audio/oal/aldlist.cpp
index 768ace30..458b7c80 100644
--- a/src/audio/oal/aldlist.cpp
+++ b/src/audio/oal/aldlist.cpp
@@ -53,7 +53,7 @@ ALDeviceList::ALDeviceList()
index = 0;
// 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) {
defaultDeviceIndex = index;
}
@@ -186,7 +186,7 @@ unsigned int ALDeviceList::GetMaxNumSources(int index)
/*
* 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;
diff --git a/src/audio/oal/aldlist.h b/src/audio/oal/aldlist.h
index b8f1b31a..694c9d01 100644
--- a/src/audio/oal/aldlist.h
+++ b/src/audio/oal/aldlist.h
@@ -32,7 +32,7 @@ public:
char *GetDeviceName(int index);
void GetDeviceVersion(int index, int *major, int *minor);
unsigned int GetMaxNumSources(int index);
- bool IsExtensionSupported(int index, char *szExtName);
+ bool IsExtensionSupported(int index, const char *szExtName);
int GetDefaultDevice();
void FilterDevicesMinVer(int major, int minor);
void FilterDevicesMaxVer(int major, int minor);
@@ -46,4 +46,4 @@ private:
};
#endif
-#endif // ALDEVICELIST_H \ No newline at end of file
+#endif // ALDEVICELIST_H
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index 3e22ee77..b3fc85ae 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -431,6 +431,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
}
}
break;
+ default: break;
}
}
if (pVehicle->pDriver && pVehicle->pDriver->m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS){
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index fcd1e83f..d6ccc8bb 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2307,6 +2307,7 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
*pBrake = 0.0f;
*pHandbrake = false;
return;
+ default: break;
}
}
pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo];
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index d8fd3ec0..5fc44974 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -517,6 +517,7 @@ void CGarage::Update()
case GARAGE_BOMBSHOP1: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB1_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;
+ default: break;
}
m_eGarageState = GS_OPENING;
if (!CGarages::BombsAreFree)
@@ -561,6 +562,7 @@ void CGarage::Update()
case GARAGE_BOMBSHOP3:
CHud::SetHelpMessage(TheText.Get("GA_8"), false); // Use the detonator to activate the bomb.
break;
+ default: break;
}
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE);
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_TWO: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse2, MAX_STORED_CARS_IN_COMMERCIAL); break;
case GARAGE_HIDEOUT_THREE: StoreAndRemoveCarsForThisHideout(CGarages::aCarsInSafeHouse3, MAX_STORED_CARS_IN_SUBURBAN); break;
+ default: break;
}
}
UpdateDoorsHeight();
@@ -1093,6 +1096,7 @@ void CGarage::Update()
case GARAGE_HIDEOUT_ONE: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse1); break;
case GARAGE_HIDEOUT_TWO: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse2); break;
case GARAGE_HIDEOUT_THREE: bCreatedAllCars = RestoreCarsForThisHideout(CGarages::aCarsInSafeHouse3); break;
+ default: break;
}
if (bCreatedAllCars)
m_eGarageState = GS_OPENING;
@@ -2151,6 +2155,7 @@ int32 CGarages::CountCarsInHideoutGarage(eGarageType type)
case GARAGE_HIDEOUT_THREE:
total += (aCarsInSafeHouse3[i].HasCar());
break;
+ default: break;
}
}
return total;
@@ -2165,6 +2170,7 @@ int32 CGarages::FindMaxNumStoredCarsForGarage(eGarageType type)
return LIMIT_CARS_IN_COMMERCIAL;
case GARAGE_HIDEOUT_THREE:
return LIMIT_CARS_IN_SUBURBAN;
+ default: break;
}
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.z > aGarages[i].m_fZ1 && point.z < aGarages[i].m_fZ2)
return true;
+ default: break;
}
}
return false;
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 569af776..32bffa17 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -356,6 +356,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
return true;
}
break;
+ default: break;
}
}
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_MOLOTOV: return MI_MOLOTOV;
case WEAPONTYPE_GRENADE: return MI_GRENADE;
+ default: break;
}
return 0;
}
diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp
index 6aa64a3c..be8c5519 100644
--- a/src/control/SceneEdit.cpp
+++ b/src/control/SceneEdit.cpp
@@ -303,7 +303,7 @@ void CSceneEdit::Draw(void)
nCommandDrawn -= (MOVIE_TOTAL_COMMANDS - 1);
if (nCommandDrawn <= MOVIE_DO_NOTHING)
nCommandDrawn += (MOVIE_TOTAL_COMMANDS - 1);
- sprintf(str, pCommandStrings[nCommandDrawn]);
+ sprintf(str, "%s", pCommandStrings[nCommandDrawn]);
AsciiToUnicode(str, wstr);
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);
@@ -1095,4 +1095,4 @@ bool CSceneEdit::SelectWeapon(void)
return false;
}
return false;
-} \ No newline at end of file
+}
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 30793f55..13000847 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -11305,6 +11305,7 @@ INITSAVEBUF
case ENTITY_TYPE_DUMMY:
type = 4;
handle = CPools::GetDummyPool()->GetJustIndex((CDummy*)pEntity) + 1;
+ default: break;
}
}
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");
break;
}
+ default: break;
}
}
}
diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp
index 40a8b09e..f49f811f 100644
--- a/src/core/AnimViewer.cpp
+++ b/src/core/AnimViewer.cpp
@@ -120,7 +120,7 @@ CAnimViewer::Initialise(void) {
if (!CFileMgr::ReadLine(fd, gString, 255))
break;
- sscanf(gString, "%s %s", &modelName, &animGroup);
+ sscanf(gString, "%s %s", modelName, animGroup);
int groupId;
for (groupId = 0; groupId < NUM_ANIM_ASSOC_GROUPS; groupId++) {
if (!strcmp(animGroup, CAnimManager::GetAnimGroupName((AssocGroupId)groupId)))
@@ -429,4 +429,4 @@ CAnimViewer::Shutdown(void)
CTimer::Shutdown();
CStreaming::Shutdown();
CTxdStore::RemoveTxdSlot(animTxdSlot);
-} \ No newline at end of file
+}
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 8cd44f6f..6c79604c 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -885,7 +885,7 @@ CCam::PrintMode(void)
sprintf(buf, " ");
sprintf(buf, " ");
- static char *modes[] = { "None",
+ static Const char *modes[] = { "None",
"Top Down", "GTA Classic", "Behind Car", "Follow Ped",
"Aiming", "Debug", "Sniper", "Rocket", "Model Viewer", "Bill",
"Syphon", "Circle", "Cheesy Zoom", "Wheel", "Fixed",
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 9b178f35..35d230dc 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -80,6 +80,10 @@ CCamera::CCamera(void)
Init();
}
+CCamera::CCamera(float)
+{
+}
+
void
CCamera::Init(void)
{
@@ -87,7 +91,12 @@ CCamera::Init(void)
float fMouseAccelHorzntl = m_fMouseAccelHorzntl;
float fMouseAccelVertical = m_fMouseAccelVertical;
#endif
+#ifdef FIX_BUGS
+ static const CCamera DummyCamera = CCamera(0.f);
+ *this = DummyCamera;
+#else
memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh?
+#endif
#ifdef GTA3_1_1_PATCH
m_fMouseAccelHorzntl = fMouseAccelHorzntl;
m_fMouseAccelVertical = fMouseAccelVertical;
@@ -740,6 +749,7 @@ CCamera::CamControl(void)
case VEHICLE_TYPE_BOAT:
ReqMode = CCam::MODE_BEHINDBOAT;
break;
+ default: break;
}
// Car zoom value
@@ -2992,7 +3002,7 @@ CCamera::SetZoomValueFollowPedScript(int16 dist)
case 0: m_fPedZoomValueScript = 0.25f; break;
case 1: m_fPedZoomValueScript = 1.5f; break;
case 2: m_fPedZoomValueScript = 2.9f; break;
- default: m_fPedZoomValueScript = m_fPedZoomValueScript; break;
+ default: break;
}
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 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;
- default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
+ default: break;
}
} else
#endif
@@ -3016,7 +3026,7 @@ CCamera::SetZoomValueCamStringScript(int16 dist)
case 0: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_1; break;
case 1: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_2; break;
case 2: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_3; break;
- default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
+ default: break;
}
}
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 94bcbd23..80fc878e 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -403,7 +403,7 @@ public:
int m_BlurRed;
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_iNumFramesSoFar;
@@ -549,6 +549,7 @@ uint32 unknown; // some counter having to do with music
// High level and misc
CCamera(void);
+ CCamera(float);
void Init(void);
void Process(void);
void CamControl(void);
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 0cdacfdb..01cc323a 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -231,7 +231,7 @@ CCollision::SortOutCollisionAfterLoad(void)
void
CCollision::LoadCollisionScreen(eLevelName level)
{
- static char *levelNames[4] = {
+ static Const char *levelNames[4] = {
"",
"IND_ZON",
"COM_ZON",
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index dcd9f125..6a5080e5 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -610,6 +610,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int32 button,
case MOUSE:
state = &CPad::GetPad(PAD1)->PCTempMouseState;
break;
+ default: break;
}
if (pad != NULL)
@@ -1024,7 +1025,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int32 button, eC
case JOYSTICK:
state = &CPad::GetPad(PAD1)->PCTempJoyState;
break;
-
+ default: break;
}
if (process)
@@ -1293,6 +1294,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetApps())
return true;
break;
+ default: break;
}
return false;
@@ -1493,6 +1495,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyJustDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetAppsJustDown())
return true;
break;
+ default: break;
}
return false;
@@ -1530,6 +1533,7 @@ bool CControllerConfigManager::GetIsMouseButtonDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2())
return true;
break;
+ default: break;
}
return false;
@@ -1567,6 +1571,7 @@ bool CControllerConfigManager::GetIsMouseButtonUp(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2Up())
return true;
break;
+ default: break;
}
return false;
@@ -1747,6 +1752,7 @@ void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction
DeleteMatchingCommonControls (action, key, type);
DeleteMatching1rst3rdPersonControls (action, key, type);
break;
+ default: break;
}
}
}
@@ -1770,6 +1776,7 @@ bool CControllerConfigManager::GetIsKeyBlank(int32 key, eControllerType type)
if (key != 0)
return false;
break;
+ default: break;
}
return true;
@@ -1836,6 +1843,7 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
case PED_SNIPER_ZOOM_OUT:
return ACTIONTYPE_1RSTPERSON;
break;
+ default: break;
}
return ACTIONTYPE_NONE;
@@ -1861,6 +1869,7 @@ void CControllerConfigManager::ClearSettingsAssociatedWithAction(e_ControllerAct
m_aSettings[action][type].m_Key = 0;
m_aSettings[action][type].m_ContSetOrder = SETORDER_NONE;
break;
+ default: break;
}
ResetSettingOrder(action);
@@ -1881,6 +1890,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
return GetControllerSettingTextMouse (action);
case JOYSTICK:
return GetControllerSettingTextJoystick(action);
+ default: break;
}
}
}
@@ -2224,6 +2234,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextKeyBoard(e_ControllerAc
return TheText.Get("FEC_SFT"); // "SHIFT"
break;
}
+ default: break;
}
}
}
@@ -2256,6 +2267,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextMouse(e_ControllerActio
case 7:
return TheText.Get("FEC_MXT"); // MXB2
break;
+ default: break;
}
return NULL;
@@ -2375,6 +2387,7 @@ bool CControllerConfigManager::GetIsActionAButtonCombo(e_ControllerAction action
case PED_CYCLE_TARGET_RIGHT:
return true;
break;
+ default: break;
}
return false;
@@ -2395,6 +2408,7 @@ wchar *CControllerConfigManager::GetButtonComboText(e_ControllerAction action)
case VEHICLE_LOOKBEHIND:
return TheText.Get("FEC_LBC"); // Use Look Left With Look Right.
break;
+ default: break;
}
return NULL;
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index 88afb40c..6e7188c5 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -753,7 +753,7 @@ CFileLoader::LoadClumpObject(const char *line)
char model[24], txd[24];
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->SetName(model);
mi->SetTexDictionary(txd);
@@ -1184,7 +1184,7 @@ CFileLoader::LoadMapZones(const char *filename)
float minx, miny, minz;
float maxx, maxy, maxz;
if(sscanf(line, "%s %d %f %f %f %f %f %f %d",
- &name, &type,
+ name, &type,
&minx, &miny, &minz,
&maxx, &maxy, &maxz,
&level) == 9)
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index f0d75d12..d58d0576 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -412,7 +412,7 @@ CMenuManager::ThingsToDoBeforeLeavingPage()
// ------ Functions not in the game/inlined ends
void
-CMenuManager::BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2)
+CMenuManager::BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2)
{
if (!text)
return;
@@ -5020,6 +5020,7 @@ CMenuManager::SaveLoadFileError_SetUpErrorScreen()
case SAVESTATUS_DELETEFAILED10:
ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false);
break;
+ default: break;
}
}
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 65c4e178..89517528 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -598,7 +598,7 @@ public:
#endif
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();
void CheckCodesForControls(int);
bool CheckHover(int x1, int x2, int y1, int y2);
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index da86d15e..924d4724 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -509,7 +509,7 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
- if (xpos != NULL) {
+ if (xpos != 0.f) {
state.MMB = true;
state.RMB = true;
state.LMB = true;
@@ -565,7 +565,7 @@ void CPad::UpdateMouse()
#else
double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
- if (xpos == NULL)
+ if (xpos == 0.f)
return;
int32 signX = 1;
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index bc65f6b6..b361c36f 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -90,7 +90,11 @@ CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot)
// relocate to another slot??
CObject *newObject = new CObject(object->GetModelIndex(), false);
CWorld::Remove(object);
+#ifdef FIX_BUGS
+ *newObject = *object;
+#else
memcpy(newObject, object, ms_pObjectPool->GetMaxEntrySize());
+#endif
CWorld::Add(newObject);
object->m_rwObject = nil;
delete object;
diff --git a/src/core/Profile.cpp b/src/core/Profile.cpp
index 05d54133..0aa18ab8 100644
--- a/src/core/Profile.cpp
+++ b/src/core/Profile.cpp
@@ -7,7 +7,7 @@ float CProfile::ms_afCumulativeTime[NUM_PROFILES];
float CProfile::ms_afEndTime[NUM_PROFILES];
float CProfile::ms_afMaxEndTime[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];
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_TOTAL] = Max(ms_afMaxCumulativeTime[PROFILE_TOTAL], ms_afCumulativeTime[PROFILE_TOTAL]);
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/core/Profile.h b/src/core/Profile.h
index d2e8054b..4fe693ae 100644
--- a/src/core/Profile.h
+++ b/src/core/Profile.h
@@ -19,10 +19,10 @@ class CProfile
static float ms_afEndTime[NUM_PROFILES];
static float ms_afMaxEndTime[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];
public:
static void Initialise();
static void SuspendProfile(eProfile profile);
static void ShowResults();
-}; \ No newline at end of file
+};
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index a2e6048b..c961f53d 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -710,6 +710,7 @@ CStreaming::RequestSubway(void)
RequestModel(MI_SUBPLATFORM_SUB, STREAMFLAGS_NOFADE);
RequestModel(MI_SUBPLATFORM_SUB2, STREAMFLAGS_NOFADE);
break;
+ default: break;
}
}
@@ -747,6 +748,7 @@ CStreaming::RequestIslands(eLevelName level)
RequestModel(islandLODindust, BIGBUILDINGFLAGS);
RequestModel(islandLODcomSub, BIGBUILDINGFLAGS);
break;
+ default: break;
}
}
@@ -1750,7 +1752,7 @@ CStreaming::ProcessLoadingChannel(int32 ch)
void
CStreaming::RetryLoadFile(int32 ch)
{
- char *key;
+ Const char *key;
CPad::StopPadsShaking();
diff --git a/src/core/SurfaceTable.cpp b/src/core/SurfaceTable.cpp
index 7212fc65..08a84cfd 100644
--- a/src/core/SurfaceTable.cpp
+++ b/src/core/SurfaceTable.cpp
@@ -9,7 +9,7 @@
float CSurfaceTable::ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
void
-CSurfaceTable::Initialise(char *filename)
+CSurfaceTable::Initialise(Const char *filename)
{
int lineno, fieldno;
char *line;
diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h
index 4af6a265..12246dce 100644
--- a/src/core/SurfaceTable.h
+++ b/src/core/SurfaceTable.h
@@ -100,7 +100,7 @@ class CSurfaceTable
{
static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
public:
- static void Initialise(char *filename);
+ static void Initialise(Const char *filename);
static int GetAdhesionGroup(uint8 surfaceType);
static float GetWetMultiplier(uint8 surfaceType);
static float GetAdhesiveLimit(CColPoint &colpoint);
diff --git a/src/core/World.cpp b/src/core/World.cpp
index c884f1ed..c15c134d 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -2205,6 +2205,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
case ENTITY_TYPE_OBJECT:
pObject->ObjectDamage(300.0f * fDamageMultiplier);
break;
+ default: break;
}
}
}
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index 5b7519dc..4f491a49 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -357,7 +357,7 @@ CTheZones::FindSmallestZonePositionILN(const CVector *v)
}
int16
-CTheZones::FindZoneByLabelAndReturnIndex(char *name)
+CTheZones::FindZoneByLabelAndReturnIndex(Const char *name)
{
char str[8];
memset(str, 0, 8);
diff --git a/src/core/Zones.h b/src/core/Zones.h
index 67800569..6549dad5 100644
--- a/src/core/Zones.h
+++ b/src/core/Zones.h
@@ -86,7 +86,7 @@ public:
static CZone *FindSmallestZonePosition(const CVector *v);
static CZone *FindSmallestZonePositionType(const CVector *v, eZoneType type);
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 void GetZoneInfoForTimeOfDay(const CVector *pos, CZoneInfo *info);
static void SetZoneCarInfo(uint16 zoneid, uint8 day, int16 carDensity,
diff --git a/src/core/main.cpp b/src/core/main.cpp
index d6af0b2a..1ea8dc7f 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -401,7 +401,7 @@ DestroySplashScreen(void)
splashTxdId = -1;
}
-char*
+Const char*
GetRandomSplashScreen(void)
{
int index;
@@ -424,10 +424,10 @@ GetRandomSplashScreen(void)
return splashName;
}
-char*
+Const char*
GetLevelSplashScreen(int level)
{
- static char *splashScreens[4] = {
+ static Const char *splashScreens[4] = {
nil,
"splash1",
"splash2",
@@ -1278,7 +1278,7 @@ void TheGame(void)
CGame::Initialise("DATA\\GTA3.DAT");
#endif
- char *splash = GetRandomSplashScreen(); // inlined here
+ Const char *splash = GetRandomSplashScreen(); // inlined here
LoadingScreen("Starting Game", NULL, splash);
@@ -1312,7 +1312,7 @@ void TheGame(void)
if (FrontEndMenuManager.m_bWantToLoad)
#endif
{
- char *splash1 = GetLevelSplashScreen(CGame::currLevel);
+ Const char *splash1 = GetLevelSplashScreen(CGame::currLevel);
LoadSplash(splash1);
}
diff --git a/src/core/main.h b/src/core/main.h
index 90b13fbb..32a880d6 100644
--- a/src/core/main.h
+++ b/src/core/main.h
@@ -22,8 +22,8 @@ void LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
void LoadingIslandScreen(const char *levelName);
CSprite2d *LoadSplash(const char *name);
void DestroySplashScreen(void);
-char *GetLevelSplashScreen(int level);
-char *GetRandomSplashScreen(void);
+Const char *GetLevelSplashScreen(int level);
+Const char *GetRandomSplashScreen(void);
void LittleTest(void);
void ValidateVersion();
void ResetLoadingScreenBar(void);
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index 47080e23..0cb0fc36 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -180,7 +180,7 @@ CPedModelInfo::SetLowDetailClump(RpClump *lodclump)
struct ColNodeInfo
{
- char *name;
+ Const char *name;
int pedNode;
int pieceType;
float x, z;
diff --git a/src/objects/ParticleObject.cpp b/src/objects/ParticleObject.cpp
index 3dd80546..2fbe6195 100644
--- a/src/objects/ParticleObject.cpp
+++ b/src/objects/ParticleObject.cpp
@@ -61,7 +61,7 @@ CParticleObject::CParticleObject() :
m_nState(POBJECTSTATE_INITIALISED),
m_pNext(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 )
{
+#ifdef FIX_BUGS
+ *(CParticleObject*)buffer = *p;
+#else
memcpy(buffer, p, sizeof(CParticleObject));
+#endif
buffer += sizeof(CParticleObject);
}
for ( CParticleObject *p = pFarListHead; p != NULL; p = p->m_pNext )
{
+#ifdef FIX_BUGS
+ *(CParticleObject*)buffer = *p;
+#else
memcpy(buffer, p, sizeof(CParticleObject));
+#endif
buffer += sizeof(CParticleObject);
}
diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp
index 7229ed3f..cdaee657 100644
--- a/src/peds/EmergencyPed.cpp
+++ b/src/peds/EmergencyPed.cpp
@@ -166,6 +166,7 @@ CEmergencyPed::FiremanAI(void)
m_nEmergencyPedState = EMERGENCY_PED_READY;
SetMoveState(PEDMOVE_WALK);
break;
+ default: break;
}
}
@@ -410,6 +411,7 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_READY;
SetMoveState(PEDMOVE_WALK);
break;
+ default: break;
}
}
}
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 2bd5c152..f4e99d4d 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -5048,13 +5048,13 @@ CPed::LoadFightData(void)
sscanf(
&line[lp],
"%s %f %f %f %f %c %s %d %d",
- &moveName,
+ moveName,
&startFireTime,
&endFireTime,
&comboFollowOnTime,
&strikeRadius,
&hitLevel,
- &animName,
+ animName,
&damage,
&flags);
@@ -10686,6 +10686,7 @@ CPed::ProcessControl(void)
Say(SOUND_PED_HANDS_UP);
}
break;
+ default: break;
}
SetMoveAnim();
if (bPedIsBleeding) {
@@ -11810,8 +11811,10 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
}
} 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:
veh->AddPassenger(ped, 0);
break;
@@ -11821,10 +11824,10 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
case CAR_DOOR_LR:
veh->AddPassenger(ped, 1);
break;
- }
- default:
- veh->AddPassenger(ped);
+ default:
+ veh->AddPassenger(ped);
break;
+ }
}
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)
@@ -17119,6 +17122,7 @@ CPed::SetObjective(eObjective newObj, CVector dest)
if (sq(m_distanceToCountSeekDone) > (m_nextRoutePointPos - GetPosition()).MagnitudeSqr2D())
return;
break;
+ default: break;
}
if (IsTemporaryObjective(m_objective)) {
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 5995432b..4223ac10 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -984,6 +984,7 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
case PARTICLE_WATER_HYDRANT:
pParticle->m_vecPosition.z += 20.0f * psystem->m_fPositionRandomError * ms_afRandTable[CGeneral::GetRandomNumber() % RAND_TABLE_SIZE];
break;
+ default: break;
}
if ( fSize != 0.0f )
@@ -1214,6 +1215,7 @@ void CParticle::Update()
continue;
}
break;
+ default: break;
}
}
}
@@ -1295,6 +1297,7 @@ void CParticle::Update()
continue;
}
break;
+ default: break;
}
}
}
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 1f1e3b50..8a48eb11 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1174,6 +1174,7 @@ CRenderer::IsEntityCullZoneVisible(CEntity *ent)
if(!obj->IsStatic())
return true;
return !(obj->m_pCurSurface && obj->m_pCurSurface->bZoneCulled2);
+ default: break;
}
return true;
}
@@ -1182,12 +1183,14 @@ bool
CRenderer::IsVehicleCullZoneVisible(CEntity *ent)
{
CVehicle *v = (CVehicle*)ent;
- switch(v->GetStatus())
+ switch(v->GetStatus()) {
case STATUS_SIMPLE:
case STATUS_PHYSICS:
case STATUS_ABANDONED:
case STATUS_WRECKED:
return !(v->m_pCurGroundEntity && v->m_pCurGroundEntity->bZoneCulled2);
+ default: break;
+ }
return true;
}
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index e8e79f96..1a28ce83 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -52,7 +52,7 @@ const float fBlueMult = 1.4f;
void
-CWaterLevel::Initialise(char *pWaterDat)
+CWaterLevel::Initialise(Const char *pWaterDat)
{
ms_nNoOfWaterLevels = 0;
diff --git a/src/render/WaterLevel.h b/src/render/WaterLevel.h
index a471bc52..985c9744 100644
--- a/src/render/WaterLevel.h
+++ b/src/render/WaterLevel.h
@@ -79,7 +79,7 @@ class CWaterLevel
static int16 nGeomUsed;
public:
- static void Initialise(char *pWaterDat);
+ static void Initialise(Const char *pWaterDat);
static void Shutdown();
static void CreateWavyAtomic();
static void DestroyWavyAtomic();
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index d034391c..22edcb68 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -231,7 +231,7 @@ CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
{
RpAtomic *lodatm;
float fadefactor;
- uint8 alpha;
+ uint32 alpha;
CSimpleModelInfo *mi;
mi = GetAtomicModelInfo(atomic);
@@ -730,11 +730,13 @@ CVisibilityPlugins::SetAtomicModelInfo(RpAtomic *atomic,
{
AtomicExt *ext = ATOMICEXT(atomic);
ext->modelInfo = modelInfo;
- switch (modelInfo->GetModelType())
- case MITYPE_SIMPLE:
- case MITYPE_TIME:
- if(modelInfo->m_normalCull)
- SetAtomicRenderCallback(atomic, RenderObjNormalAtomic);
+ switch (modelInfo->GetModelType()) {
+ case MITYPE_SIMPLE:
+ case MITYPE_TIME:
+ if(modelInfo->m_normalCull)
+ SetAtomicRenderCallback(atomic, RenderObjNormalAtomic);
+ default: break;
+ }
}
CSimpleModelInfo*
@@ -851,6 +853,7 @@ CVisibilityPlugins::SetClumpModelInfo(RpClump *clump, CClumpModelInfo *modelInfo
else
CLUMPEXT(clump)->visibilityCB = VehicleVisibilityCB;
break;
+ default: break;
}
}
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index ba7bd216..8aae4011 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -246,7 +246,7 @@ GenericLoad()
// Load SimpleVars and Scripts
CheckSum = 0;
- CDate(CompileDateAndTime);
+ CDate dummy; // unused
CPad::ResetCheats();
if (!ReadInSizeofSaveFileBuffer(file, size))
return false;
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index 4a35adcf..f0a704a8 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -429,7 +429,7 @@ RwChar **_psGetVideoModeList()
if ( vm.flags & rwVIDEOMODEEXCLUSIVE )
{
_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
_VMList[i] = nil;
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 60f17204..a880f26d 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -252,6 +252,7 @@ CAutomobile::ProcessControl(void)
strongGrip2 = true;
}
}
+ default: break;
}
}
@@ -423,6 +424,7 @@ CAutomobile::ProcessControl(void)
m_fGasPedal = 0.0f;
m_nCarHornTimer = 0;
break;
+ default: break;
}
// what's going on here?
@@ -1259,6 +1261,7 @@ CAutomobile::PreRender(void)
m_aWheelColPoints[i].point + CVector(0.0f, 0.0f, 0.05f),
CVector(0.0f, 0.0f, 0.0f), nil, 0.1f);
break;
+ default: break;
}
}
}else{
@@ -1383,6 +1386,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_LEFT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_LEFT]);
break;
+ default: break;
}
switch(m_aWheelState[CARWHEEL_REAR_RIGHT]){
@@ -1400,6 +1404,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_RIGHT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_RIGHT]);
break;
+ default: break;
}
}
@@ -1851,7 +1856,7 @@ CAutomobile::PreRender(void)
false);
CVector pos = GetPosition() - 4.0f*GetForward();
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)
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.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),
7.0f, 0.6f, 0.0f, 0.0f,
CPointLights::FOG_NONE, false);
+ }
}
}else{
// Lights off
@@ -3781,6 +3787,7 @@ CAutomobile::IsDoorReady(eDoors door)
case DOOR_FRONT_RIGHT: doorflag = CAR_DOOR_FLAG_RF; break;
case DOOR_REAR_LEFT: doorflag = CAR_DOOR_FLAG_LR; break;
case DOOR_REAR_RIGHT: doorflag = CAR_DOOR_FLAG_RR; break;
+ default: break;
}
return (doorflag & m_nGettingInFlags) == 0;
}
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 348f2732..d992d190 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -180,6 +180,7 @@ CBoat::ProcessControl(void)
return;
}
break;
+ default: break;
}
float collisionDamage = pHandling->fCollisionDamageMultiplier * m_fDamageImpulse;
diff --git a/src/vehicles/DamageManager.cpp b/src/vehicles/DamageManager.cpp
index 03ccfe77..6b59ccda 100644
--- a/src/vehicles/DamageManager.cpp
+++ b/src/vehicles/DamageManager.cpp
@@ -85,6 +85,7 @@ CDamageManager::ApplyDamage(tComponent component, float damage, float unused)
ProgressEngineDamage();
ProgressPanelDamage(subComp);
break;
+ default: break;
}
return true;
}
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp
index e4cd5883..7b62b461 100644
--- a/src/vehicles/Heli.cpp
+++ b/src/vehicles/Heli.cpp
@@ -996,7 +996,7 @@ CHeli::TestRocketCollision(CVector *rocketPos)
for(i = 0; i < NUM_HELIS; i++){
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_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
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 ||
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_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
}
diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp
index 7831a0c8..1d47ca3a 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -492,7 +492,7 @@ CTrain::Shutdown(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)
{
bool readingFile = false;
diff --git a/src/vehicles/Train.h b/src/vehicles/Train.h
index 6aa76fa8..c645ecaf 100644
--- a/src/vehicles/Train.h
+++ b/src/vehicles/Train.h
@@ -87,7 +87,7 @@ public:
static void InitTrains(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);
static void UpdateTrains(void);
};
diff --git a/src/weapons/BulletInfo.cpp b/src/weapons/BulletInfo.cpp
index 92d98a50..389e7486 100644
--- a/src/weapons/BulletInfo.cpp
+++ b/src/weapons/BulletInfo.cpp
@@ -200,6 +200,7 @@ void CBulletInfo::Update(void)
case ENTITY_TYPE_VEHICLE:
DMAudio.PlayOneShot(((CVehicle*)pHitEntity)->m_audioEntityId, SOUND_WEAPON_HIT_VEHICLE, 1.0f);
break;
+ default: break;
}
}
CGlass::WasGlassHitByBullet(pHitEntity, point.point);
diff --git a/src/weapons/ProjectileInfo.cpp b/src/weapons/ProjectileInfo.cpp
index 8297d953..47bc65ac 100644
--- a/src/weapons/ProjectileInfo.cpp
+++ b/src/weapons/ProjectileInfo.cpp
@@ -116,6 +116,7 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
elasticity = 0.5f;
break;
}
+ default: break;
}
int i = 0;
@@ -137,6 +138,7 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
case WEAPONTYPE_GRENADE:
ms_apProjectile[i] = new CProjectile(MI_GRENADE);
break;
+ default: break;
}
if (ms_apProjectile[i] == nil)
@@ -183,6 +185,7 @@ CProjectileInfo::RemoveNotAdd(CEntity *entity, eWeaponType weaponType, CVector p
case WEAPONTYPE_ROCKETLAUNCHER:
CExplosion::AddExplosion(nil, entity, EXPLOSION_ROCKET, pos, 0);
break;
+ default: break;
}
}
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 3ac769d7..67e01a2e 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -806,6 +806,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
break;
}
+ default: break;
}
DoBulletImpact(shooter, victim, fireSource, &target, &point, ahead);
@@ -1070,6 +1071,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
break;
}
+ default: break;
}
}
@@ -1101,6 +1103,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point->point);
break;
}
+ default: break;
}
}
else
@@ -1328,6 +1331,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
break;
}
+ default: break;
}
}
@@ -1359,6 +1363,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break;
}
+ default: break;
}
}
else
@@ -1768,6 +1773,7 @@ CWeapon::FireInstantHitFromCar(CAutomobile *shooter, bool left)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break;
}
+ default: break;
}
}
else
@@ -2037,6 +2043,7 @@ CWeapon::Update(int32 audioEntity)
break;
}
+ default: break;
}
}
@@ -2131,6 +2138,7 @@ FireOneInstantHitRound(CVector *source, CVector *target, int32 damage)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break;
}
+ default: break;
}
}
else
diff --git a/src/weapons/WeaponInfo.cpp b/src/weapons/WeaponInfo.cpp
index aec9c69a..c4ab75d2 100644
--- a/src/weapons/WeaponInfo.cpp
+++ b/src/weapons/WeaponInfo.cpp
@@ -105,8 +105,8 @@ CWeaponInfo::LoadWeaponData(void)
sscanf(
&line[lp],
"%s %s %f %d %d %d %d %f %f %f %f %f %f %f %s %s %f %f %f %f %d %d",
- &weaponName,
- &fireType,
+ weaponName,
+ fireType,
&range,
&firingRate,
&reload,
@@ -119,8 +119,8 @@ CWeaponInfo::LoadWeaponData(void)
&fireOffsetX,
&fireOffsetY,
&fireOffsetZ,
- &animToPlay,
- &anim2ToPlay,
+ animToPlay,
+ anim2ToPlay,
&animLoopStart,
&animLoopEnd,
&delayBetweenAnimAndFire,
@@ -201,4 +201,4 @@ CWeaponInfo::Shutdown(void)
{
debug("Shutting down CWeaponInfo...\n");
debug("CWeaponInfo shut down\n");
-} \ No newline at end of file
+}