Skip to content
Permalink
Browse files
Code cleanups
Unworking ColAccel
Lotta other stuff I forgot about by now

git-svn-id: svn://localhost/vcspc/trunk@31 9f344024-d43e-4b27-bde7-3d027e20192d
  • Loading branch information
silent committed Feb 17, 2014
1 parent 41be0d5 commit d7a256d056f0e12598f2390075c321419001a660
Showing with 2,226 additions and 1,840 deletions.
  1. +44 −1 VCS PC/Audio.cpp
  2. +33 −1 VCS PC/Audio.h
  3. +0 −13 VCS PC/CClock.cpp
  4. +0 −38 VCS PC/CClock.h
  5. +6 −6 VCS PC/CGridref.cpp
  6. +5 −5 VCS PC/CPed.cpp
  7. +6 −7 VCS PC/CPed.h
  8. +0 −115 VCS PC/CText.cpp
  9. +0 −70 VCS PC/CText.h
  10. +16 −6 VCS PC/CVehicle.h
  11. +0 −1 VCS PC/CWanted.h
  12. +21 −0 VCS PC/Clock.cpp
  13. +21 −0 VCS PC/Clock.h
  14. +66 −0 VCS PC/ColAccel.cpp
  15. +25 −0 VCS PC/ColAccel.h
  16. +0 −31 VCS PC/Coronas.cpp
  17. +19 −11 VCS PC/DLCManager.cpp
  18. +12 −6 VCS PC/DLCManager.h
  19. +12 −12 VCS PC/Darkel.cpp
  20. +46 −17 VCS PC/EmpireMgr.cpp
  21. +16 −5 VCS PC/EmpireMgr.h
  22. +109 −0 VCS PC/FileMgr.cpp
  23. +7 −5 VCS PC/FileMgr.h
  24. +20 −156 VCS PC/{CFont.cpp → Font.cpp}
  25. +14 −27 VCS PC/{CFont.h → Font.h}
  26. +76 −49 VCS PC/Frontend.cpp
  27. +10 −5 VCS PC/Frontend.h
  28. +8 −8 VCS PC/Garages.cpp
  29. +19 −0 VCS PC/General.cpp
  30. +38 −18 VCS PC/General.h
  31. BIN VCS PC/Hud.cpp
  32. +31 −67 VCS PC/Hud.h
  33. +1 −0 VCS PC/MemoryMgr.h
  34. +123 −25 VCS PC/ModelInfo.cpp
  35. +138 −64 VCS PC/ModelInfo.h
  36. +1 −1 VCS PC/PlayerInfo.cpp
  37. +3 −3 VCS PC/PlayerInfo.h
  38. +2 −1 VCS PC/Pools.cpp
  39. +12 −0 VCS PC/Pools.h
  40. +14 −17 VCS PC/Project2dfx.cpp
  41. +13 −0 VCS PC/RW.cpp
  42. +87 −0 VCS PC/Radar.cpp
  43. +5 −0 VCS PC/Radar.h
  44. +1 −1 VCS PC/Script.cpp
  45. +1 −2 VCS PC/Script.h
  46. +3 −0 VCS PC/Sprite.cpp
  47. +1 −0 VCS PC/Sprite.h
  48. +34 −34 VCS PC/Stats.cpp
  49. +19 −23 VCS PC/StdAfx.h
  50. +68 −0 VCS PC/Text.cpp
  51. +76 −0 VCS PC/Text.h
  52. +25 −12 VCS PC/UpdateManager.cpp
  53. +5 −1 VCS PC/UpdateManager.h
  54. +2 −3 VCS PC/UserDisplay.cpp
  55. +12 −7 VCS PC/VCS PC.vcxproj
  56. +27 −21 VCS PC/VCS PC.vcxproj.filters
  57. +736 −879 VCS PC/VCSPC.cpp
  58. +71 −0 VCS PC/Vehicle.cpp
  59. +6 −3 VCS PC/VideoPlayer.cpp
  60. +1 −1 VCS PC/VideoPlayer.h
  61. +59 −62 VCS PC/WidescreenSupport.cpp
@@ -2,6 +2,10 @@


signed char CAERadioTrackManager::bTracksPlayedRecently[NUM_RADIOSTATIONS]; signed char CAERadioTrackManager::bTracksPlayedRecently[NUM_RADIOSTATIONS];


static std::map<short,tVehicleAudioSettings> AudioSettingsMap;

WRAPPER void CAudioEngine::ReportFrontendAudioEvent(long nSoundID, float fUnk, float fVolume) { WRAPARG(nSoundID); WRAPARG(fUnk); WRAPARG(fVolume); EAXJMP(0x506EA0); }

signed char CAERadioTrackManager::GetNextTrackByStation(BYTE stationID) signed char CAERadioTrackManager::GetNextTrackByStation(BYTE stationID)
{ {
static const BYTE numberOfRadioTracks[NUM_RADIOSTATIONS] = static const BYTE numberOfRadioTracks[NUM_RADIOSTATIONS] =
@@ -30,4 +34,43 @@ bool CAERadioTrackManager::Load()
return true; return true;
} }


WRAPPER void CMusicManager::ReportFrontendAudioEvent(long nSoundID, float fUnk, float fVolume) { WRAPARG(nSoundID); WRAPARG(fUnk); WRAPARG(fVolume); EAXJMP(0x506EA0); } void CAEVehicleAudioEntity::GetVehicleAudioSettings(short nModelID)
{
AudioSettings = AudioSettingsMap[nModelID];
}

void CAEVehicleAudioEntity::LoadVehicleAudioSettings()
{
if ( FILE* hFile = CFileMgr::OpenFile("DATA\\VEHAUDIOSETS.DAT", "r") )
{
while ( const char* pLine = CFileLoader::LoadLine(hFile) )
{
if ( pLine[0] && pLine[0] != '#' )
{
signed int nModelID, nVehType, nEngineOn, nEngineOff, nRadioSound, nHornTon, nDoorSound, nUnk, nRadioNum, nRadioType, nScannerName;
tVehicleAudioSettings NewEntry;
char ModelName[40];

sscanf(pLine, "%s %d %d %d %d %f %f %d %f %d %d %d %d %d %f", ModelName, &nVehType, &nEngineOn, &nEngineOff, &nRadioSound,
&NewEntry.BassDepth, &NewEntry.unk1, &nHornTon, &NewEntry.HornFreq, &nDoorSound, &nUnk, &nRadioNum, &nRadioType, &nScannerName,
&NewEntry.EngineVolumeBoost);

CModelInfo::GetModelInfo(ModelName, &nModelID);

NewEntry.VehicleType = static_cast<signed char>(nVehType);
NewEntry.EngineOnSound = static_cast<short>(nEngineOn);
NewEntry.EngineOffSound = static_cast<short>(nEngineOff);
NewEntry.RadioSoundType = static_cast<signed char>(nRadioSound);
NewEntry.HornTon = static_cast<signed char>(nHornTon);
NewEntry.DoorSound = static_cast<signed char>(nDoorSound);
NewEntry.unk2 = static_cast<signed char>(nUnk);
NewEntry.RadioNum = static_cast<signed char>(nRadioNum);
NewEntry.RadioType = static_cast<signed char>(nRadioType);
NewEntry.PoliceScannerName = static_cast<signed char>(nScannerName);

AudioSettingsMap[static_cast<short>(nModelID)] = NewEntry;
}
}
CFileMgr::CloseFile(hFile);
}
}
@@ -33,6 +33,23 @@
#define NJ_OFFSET (MR_OFFSET+MR_STREAMS) #define NJ_OFFSET (MR_OFFSET+MR_STREAMS)
#define RE_OFFSET (NJ_OFFSET+NJ_STREAMS) #define RE_OFFSET (NJ_OFFSET+NJ_STREAMS)


struct tVehicleAudioSettings
{
signed char VehicleType;
short EngineOnSound;
short EngineOffSound;
signed char RadioSoundType; // 0 - standard, 1 - HQ, 2 - bikes
float BassDepth;
float unk1;
signed char HornTon;
float HornFreq;
signed char DoorSound;
signed char unk2;
signed char RadioNum;
signed char RadioType;
signed char PoliceScannerName;
float EngineVolumeBoost;
};


class CAERadioTrackManager class CAERadioTrackManager
{ {
@@ -46,10 +63,25 @@ class CAERadioTrackManager
static bool Load(); static bool Load();
}; };


class CMusicManager class CAEVehicleAudioEntity
{
private:
BYTE pad[128];
tVehicleAudioSettings AudioSettings;

public:
void GetVehicleAudioSettings(short nModelID);

// VCS PC class extension
static void LoadVehicleAudioSettings();
};

class CAudioEngine
{ {
public: public:
void ReportFrontendAudioEvent(long nSoundID, float fUnk, float fVolume); void ReportFrontendAudioEvent(long nSoundID, float fUnk, float fVolume);
}; };


static_assert(sizeof(tVehicleAudioSettings) == 0x24, "tVehicleAudioSettings has wrong size!");

#endif #endif

This file was deleted.

This file was deleted.

@@ -9,18 +9,18 @@ void CGridref::Draw()
BYTE zoneY; BYTE zoneY;


GetIDByPlayerPosition(&zoneX, &zoneY); GetIDByPlayerPosition(&zoneX, &zoneY);
CFont::SetTextBackground(0, 0); CFont::SetBackground(0, 0);
CFont::SetTextUseProportionalValues(false); CFont::SetProportional(false);
CFont::SetFontStyle(FONT_Pricedown); CFont::SetFontStyle(FONT_Pricedown);
CFont::SetTextAlignment(ALIGN_Center); CFont::SetOrientation(ALIGN_Center);
CFont::SetTextOutline(1); CFont::SetEdge(1);
CFont::SetTextBorderRGBA(CRGBA(0, 0, 0, 255)); CFont::SetDropColor(CRGBA(0, 0, 0, 255));
CFont::SetScale(_width(0.35), _height(0.65)); CFont::SetScale(_width(0.35), _height(0.65));
CFont::SetColor(CRGBA(BaseColors[2])); CFont::SetColor(CRGBA(BaseColors[2]));
_snprintf(ZoneID, sizeof(ZoneID), "%c%d", zoneX + 100, zoneY); _snprintf(ZoneID, sizeof(ZoneID), "%c%d", zoneX + 100, zoneY);
CFont::PrintString(_x(150.0), _y(7.5), ZoneID); CFont::PrintString(_x(150.0), _y(7.5), ZoneID);
CFont::PrintString(_x(115.0), _y(7.5), GetNameByID(zoneX, zoneY)); CFont::PrintString(_x(115.0), _y(7.5), GetNameByID(zoneX, zoneY));
CFont::SetTextOutline(0); CFont::SetEdge(0);
} }
} }


@@ -34,9 +34,9 @@ void CPed::GetBonePosition(CVector* result, int boneID, bool bUnk)
} }
} }


BYTE CPed::func_5E6580() BYTE CPed::GetWeaponSkill()
{ {
DWORD dwFunc = (DWORD)FUNC_CPed_func_5E6580; DWORD dwFunc = (DWORD)FUNC_CPed_GetWeaponSkill;
BYTE bResult; BYTE bResult;
_asm _asm
{ {
@@ -55,7 +55,7 @@ long double CPed::GetCrosshairSize()
long double crosshairSize; long double crosshairSize;


weaponID = weaponSlots[m_bActiveWeapon].dwType; weaponID = weaponSlots[m_bActiveWeapon].dwType;
unkData = func_5E6580(); unkData = GetWeaponSkill();
weapPtr = CWeaponInfo::GetWeaponInfo(weaponID, unkData); weapPtr = CWeaponInfo::GetWeaponInfo(weaponID, unkData);
crosshairSize = 0.5 / weapPtr->GetAccuracy(); crosshairSize = 0.5 / weapPtr->GetAccuracy();


@@ -68,8 +68,8 @@ long double CPed::GetCrosshairSize()
void CPed::Remap() void CPed::Remap()
{ {
CPedData* pTempPedData = &CPedData::pPedData[CPools::GetPedPool()->GetIndexOnly(this)]; CPedData* pTempPedData = &CPedData::pPedData[CPools::GetPedPool()->GetIndexOnly(this)];
CPedModelInfoVCS::AssignColoursToModel(pTempPedData->m_color1, pTempPedData->m_color2, pTempPedData->m_color3, pTempPedData->m_color4); CPedModelInfoVCS::SetPedColour(pTempPedData->m_color1, pTempPedData->m_color2, pTempPedData->m_color3, pTempPedData->m_color4);
CPedModelInfoVCS::SetEnvironmentMap(m_pRwObject); CPedModelInfoVCS::SetEditableMaterials(m_pRwObject);
} }


CPed* CPedData::Constructor(CPed* pPed, WORD model) CPed* CPedData::Constructor(CPed* pPed, WORD model)
@@ -4,7 +4,7 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN


#define FUNC_CPed__GiveWeapon 0x5E6080 #define FUNC_CPed__GiveWeapon 0x5E6080
#define FUNC_CPed_func_5E6580 0x5E6580 #define FUNC_CPed_GetWeaponSkill 0x5E6580
#define FUNC_CPed__GetBonePosition 0x5E4280 #define FUNC_CPed__GetBonePosition 0x5E4280


class CPedFlags class CPedFlags
@@ -146,7 +146,7 @@ class CPedFlags
class CVehicle; class CVehicle;
class CPed; class CPed;


class CPlayerData class CPlayerPedData
{ {
public: public:
CWanted* m_Wanted; // 0x0 CWanted* m_Wanted; // 0x0
@@ -230,7 +230,7 @@ class NOVMT CPed : public CPhysical
BYTE __pad1[820]; BYTE __pad1[820];
CPedFlags pedFlags; CPedFlags pedFlags;
CPedIntelligence* pPedIntelligence; CPedIntelligence* pPedIntelligence;
CPlayerData* pPlayerData; CPlayerPedData* pPlayerData;
BYTE __pad7[80]; BYTE __pad7[80];
int iMoveAnimGroup; int iMoveAnimGroup;
BYTE __pad2[104]; BYTE __pad2[104];
@@ -269,7 +269,7 @@ class NOVMT CPed : public CPhysical
{ return fHealth; }; { return fHealth; };
inline float GetArmour() inline float GetArmour()
{ return fArmour; }; { return fArmour; };
inline CPlayerData* GetPlayerData() inline CPlayerPedData* GetPlayerData()
{ return pPlayerData; }; { return pPlayerData; };
inline BYTE GetActiveWeapon() inline BYTE GetActiveWeapon()
{ return m_bActiveWeapon; }; { return m_bActiveWeapon; };
@@ -281,7 +281,7 @@ class NOVMT CPed : public CPhysical


void GiveWeapon(int WeaponType, int WeaponAmmo); void GiveWeapon(int WeaponType, int WeaponAmmo);
void GetBonePosition(CVector* result, int boneID, bool bUnk); void GetBonePosition(CVector* result, int boneID, bool bUnk);
BYTE func_5E6580(); BYTE GetWeaponSkill();


long double GetCrosshairSize(); long double GetCrosshairSize();
void Remap(); void Remap();
@@ -301,8 +301,7 @@ friend class CPed;


CPedData() CPedData()
: m_color1(0), m_color2(0), m_color3(0), m_color4(0) : m_color1(0), m_color2(0), m_color3(0), m_color4(0)
{ {}
}


void SetColours(BYTE a, BYTE b, BYTE c, BYTE d) void SetColours(BYTE a, BYTE b, BYTE c, BYTE d)
{ m_color1 = a; m_color2 = b; m_color3 = c; m_color4 = d; }; { m_color1 = a; m_color2 = b; m_color3 = c; m_color4 = d; };

This file was deleted.

0 comments on commit d7a256d

Please sign in to comment.