Init
This commit is contained in:
commit
a4f85d47ac
BIN
ARCHIVEFIX/ArchiveFix.exe
Normal file
BIN
ARCHIVEFIX/ArchiveFix.exe
Normal file
Binary file not shown.
1
ARCHIVEFIX/gtav_aes_key.dat
Normal file
1
ARCHIVEFIX/gtav_aes_key.dat
Normal file
@ -0,0 +1 @@
|
||||
³‰s―‹<EFBFBD>&:<3A>ρp2B³“‹Σς¤ΠM<CEA0><4D>.fω<>ύ
|
BIN
ARCHIVEFIX/gtav_hash_lut.dat
Normal file
BIN
ARCHIVEFIX/gtav_hash_lut.dat
Normal file
Binary file not shown.
BIN
ARCHIVEFIX/gtav_ng_decrypt_tables.dat
Normal file
BIN
ARCHIVEFIX/gtav_ng_decrypt_tables.dat
Normal file
Binary file not shown.
BIN
ARCHIVEFIX/gtav_ng_encrypt_luts.dat
Normal file
BIN
ARCHIVEFIX/gtav_ng_encrypt_luts.dat
Normal file
Binary file not shown.
BIN
ARCHIVEFIX/gtav_ng_encrypt_tables.dat
Normal file
BIN
ARCHIVEFIX/gtav_ng_encrypt_tables.dat
Normal file
Binary file not shown.
BIN
ARCHIVEFIX/gtav_ng_key.dat
Normal file
BIN
ARCHIVEFIX/gtav_ng_key.dat
Normal file
Binary file not shown.
BIN
OPTIONAL_DLL/socialclub.dll
Normal file
BIN
OPTIONAL_DLL/socialclub.dll
Normal file
Binary file not shown.
2100
OPTIONAL_FIXES/game/Core/app.cpp
Normal file
2100
OPTIONAL_FIXES/game/Core/app.cpp
Normal file
File diff suppressed because it is too large
Load Diff
72
OPTIONAL_FIXES/game/Core/app.h
Normal file
72
OPTIONAL_FIXES/game/Core/app.h
Normal file
@ -0,0 +1,72 @@
|
||||
//
|
||||
// filename: app.h
|
||||
// description: wrapper class for the basic application code
|
||||
//
|
||||
|
||||
#ifndef INC_APP_H_
|
||||
#define INC_APP_H_
|
||||
|
||||
#include "file/file_config.h"
|
||||
#include "fwsys/app.h"
|
||||
#include "profile/stalldetection.h"
|
||||
#include "system/exception.h"
|
||||
|
||||
#if RSG_ORBIS
|
||||
#include <coredump.h>
|
||||
#pragma comment(lib,"SceCoredump_stub_weak")
|
||||
#endif
|
||||
|
||||
|
||||
class CApp : public fwApp
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
State_InitSystem = 0,
|
||||
State_InitGame,
|
||||
State_RunGame,
|
||||
State_ShutdownGame,
|
||||
State_ShutdownSystem
|
||||
};
|
||||
|
||||
virtual fwFsm::Return UpdateState(const s32 state, const s32 iMessage, const fwFsm::Event event);
|
||||
|
||||
fwFsm::Return InitSystem();
|
||||
fwFsm::Return InitGame();
|
||||
fwFsm::Return RunGame_OnEnter();
|
||||
fwFsm::Return RunGame();
|
||||
fwFsm::Return RunGame_OnExit();
|
||||
fwFsm::Return ShutdownGame();
|
||||
fwFsm::Return ShutdownSystem();
|
||||
|
||||
bool WantToExit();
|
||||
void CheckDongle();
|
||||
|
||||
#if RSG_PC
|
||||
static bool IsShutdownConfirmed();
|
||||
static bool IsScuiDisabledForShutdown();
|
||||
static void CheckExit();
|
||||
static void Restart();
|
||||
static void WriteExitFile(const char* errorInfo);
|
||||
static bool IsGameRunning();
|
||||
#endif
|
||||
static CApp* GetInstance() { return sm_Self; }
|
||||
static void SetInstance(CApp* self) { sm_Self = self; }
|
||||
|
||||
//#if RSG_LAUNCHER_CHECK
|
||||
// bool CheckParentProcess();
|
||||
//#endif
|
||||
|
||||
#if BACKTRACE_ENABLED && (RSG_PC || RSG_DURANGO)
|
||||
static void WriteCrashContextLog(const wchar_t* path);
|
||||
static void CollectAdditionalAttributes();
|
||||
#endif
|
||||
|
||||
private:
|
||||
pfStallDetection m_StallDetection;
|
||||
|
||||
static CApp* sm_Self;
|
||||
};
|
||||
|
||||
|
||||
#endif // INC_APP_H_
|
1239
OPTIONAL_FIXES/game/frontend/ProfileSettings.cpp
Normal file
1239
OPTIONAL_FIXES/game/frontend/ProfileSettings.cpp
Normal file
File diff suppressed because it is too large
Load Diff
731
OPTIONAL_FIXES/game/system/EntitlementManager.cpp
Normal file
731
OPTIONAL_FIXES/game/system/EntitlementManager.cpp
Normal file
@ -0,0 +1,731 @@
|
||||
#include "EntitlementManager.h"
|
||||
|
||||
#if RSG_ENTITLEMENT_ENABLED
|
||||
|
||||
#include <comdef.h>
|
||||
#include <WbemIdl.h>
|
||||
#include "MachineHash.h"
|
||||
|
||||
#include "core/app.h"
|
||||
#include "wolfssl/wolfcrypt/sha.h"
|
||||
#include "diag/seh.h"
|
||||
#include "frontend/WarningScreen.h"
|
||||
#include "fwnet/netchannel.h"
|
||||
#include "network/Network.h"
|
||||
#include "network/Sessions/NetworkSession.h"
|
||||
#include "rline/entitlement/rlrosentitlement.h"
|
||||
#include "system/param.h"
|
||||
#include "system/timer.h"
|
||||
//#include "system/epic.h"
|
||||
|
||||
using namespace rage;
|
||||
|
||||
// chosen by fair random.org.
|
||||
// guaranteed to be random.
|
||||
static volatile u32 g_EntitlementManager_magic_idle = 0x94e90e07;
|
||||
static volatile u32 g_EntitlementManager_magic_waiting_online = 0x5de4e7e0;
|
||||
static volatile u32 g_EntitlementManager_magic_check_pending = 0x4d6c7730;
|
||||
static volatile u32 g_EntitlementManager_magic_ask_for_code_on_main_thread = 0x6b11e8d5;
|
||||
static volatile u32 g_EntitlementManager_magic_waiting_for_code = 0x327c0a7a;
|
||||
static volatile u32 g_EntitlementManager_magic_waiting_for_creds = 0x52af4cb3;
|
||||
static volatile u32 g_EntitlementManager_magic_error = 0xd2cd7276;
|
||||
static volatile u32 MAGIC_PREORDER_BONUS = 0xc9b4aa31;
|
||||
|
||||
#if !__NO_OUTPUT
|
||||
bool CEntitlementManager::sm_bPassedLegals = false;
|
||||
bool CEntitlementManager::sm_bPassedInitialization = false;
|
||||
bool CEntitlementManager::sm_bPassedUIAcceptingCommands = false;
|
||||
#define ENT_STATE_CHECK(x) if (!x) { x = true; gnetDebug1("Setting "#x" to true"); }
|
||||
#else
|
||||
#define ENT_STATE_CHECK(x)
|
||||
#endif
|
||||
|
||||
// This cannot be a member
|
||||
void CEntitlementManager_StartCheck(int)
|
||||
{
|
||||
CEntitlementManager::StartCheck();
|
||||
}
|
||||
|
||||
// Neither can this
|
||||
static volatile u32 g_EntitlementManager_state = g_EntitlementManager_magic_idle;
|
||||
|
||||
sysCriticalSectionToken CEntitlementManager::sm_Cs;
|
||||
|
||||
bool CEntitlementManager::sm_initialized = false;
|
||||
bool CEntitlementManager::sm_IsActivationUiShowing = false;
|
||||
bool CEntitlementManager::sm_bEntitlementWorkComplete = false;
|
||||
bool CEntitlementManager::sm_bFirstTimeShowSignIn = true;
|
||||
char CEntitlementManager::sm_PrePopulateKey[MAX_PATH] = {0};
|
||||
u32 CEntitlementManager::sm_EntitlementCheckStartTime = 0;
|
||||
bool CEntitlementManager::sm_EntitlementError = false;
|
||||
u32 CEntitlementManager::sm_EntitlementMsgStartTime = 0;
|
||||
u32 CEntitlementManager::sm_CheckStartTime = 0;
|
||||
u32 CEntitlementManager::sm_PreorderBonus = 0;
|
||||
u32 CEntitlementManager::sm_codeAskStartTime = 0;
|
||||
|
||||
#if defined(MASTER_NO_SCUI)
|
||||
namespace rage
|
||||
{
|
||||
NOSTRIP_PARAM(noentitlements, "Disable entitlements for Master builds");
|
||||
NOSTRIP_XPARAM(noSocialClub);
|
||||
}
|
||||
#elif !__FINAL
|
||||
namespace rage
|
||||
{
|
||||
PARAM(noentitlements, "Disable entitlents for non-Final builds");
|
||||
XPARAM(noSocialClub);
|
||||
}
|
||||
#endif //!__FINAL
|
||||
|
||||
RAGE_DEFINE_SUBCHANNEL(net, entitlement, DIAG_SEVERITY_DEBUG3)
|
||||
#undef __net_channel
|
||||
#define __net_channel net_entitlement
|
||||
|
||||
|
||||
static const char * sm_SkuSteam = "96C261A9C3EF0DA32CBC68A83FB7699CA1D5973D6B4D4EA1F9EF8B4E5C7D85B8";
|
||||
static const char * sm_SkuMain = "D962AD7FF354A224C6599EB313EFA50E2E04B3E82274480A2143697681FC5DC6";
|
||||
static const char * sm_SkuEpic = "04541FB36991EF2C43B38659B204EC3B941649666404498FB2CAD04B29E64A33";
|
||||
|
||||
static const char * sm_PreorderSinglePlayerMoney = "92694D1B738D91C40DA97F68D6946D658C64A420AE2CF5BFF92A819CF8DBAB6E";
|
||||
|
||||
// Called once to set up
|
||||
void CEntitlementManager::Init(unsigned)
|
||||
{
|
||||
gnetDebug1("Init");
|
||||
|
||||
rtry
|
||||
{
|
||||
#if !__FINAL || defined(MASTER_NO_SCUI)
|
||||
if (PARAM_noSocialClub.Get() || PARAM_noentitlements.Get())
|
||||
{
|
||||
gnetDebug1("Entitlements are disabled due to running with -noentitlements");
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_idle;
|
||||
sm_initialized = true;
|
||||
return;
|
||||
}
|
||||
#endif // !__FINAL || defined(MASTER_NO_SCUI)
|
||||
|
||||
rverify(!sm_initialized, catchall, gnetError("CEntitlementManager already initialized!"));
|
||||
sm_initialized = true;
|
||||
//@@: location ENTITLEMENTMANAGER_INIT_THREAD_ENTRY
|
||||
sysIpcCreateThread(ThreadEntry, NULL, 1024 * 16, PRIO_BELOW_NORMAL, "CEM Thread");
|
||||
|
||||
// Prepopulate the redemption key
|
||||
PrePopulateKey();
|
||||
}
|
||||
rcatchall
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CEntitlementManager::Reset()
|
||||
{
|
||||
SYS_CS_SYNC(sm_Cs);
|
||||
gnetDebug1("Reset");
|
||||
|
||||
sm_IsActivationUiShowing = false;
|
||||
sm_bEntitlementWorkComplete = false;
|
||||
sm_EntitlementError = false;
|
||||
sm_EntitlementCheckStartTime = 0;
|
||||
sm_EntitlementMsgStartTime = 0;
|
||||
sm_PreorderBonus = 0;
|
||||
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_idle;
|
||||
}
|
||||
|
||||
bool CEntitlementManager::IsPending()
|
||||
{
|
||||
#if !__FINAL || defined(MASTER_NO_SCUI)
|
||||
if (PARAM_noSocialClub.Get())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif //!__FINAL || defined(MASTER_NO_SCUI)
|
||||
|
||||
// If we're not signed in, we're always pending regardless of manager state
|
||||
if (!g_rlPc.GetProfileManager()->IsSignedIn())
|
||||
return true;
|
||||
|
||||
// for UI purposes, if we lagged enough to display this message, keep it on screen to avoid a flicker.
|
||||
if (sm_EntitlementMsgStartTime > 0)
|
||||
return true;
|
||||
|
||||
return g_EntitlementManager_state != g_EntitlementManager_magic_idle || !sm_initialized;
|
||||
}
|
||||
|
||||
void CEntitlementManager::StartCheck()
|
||||
{
|
||||
SYS_CS_SYNC(sm_Cs);
|
||||
gnetDebug1("StartCheck");
|
||||
//@@: location CENTITLEMENTMANAGER_STARTCHECK_GET_SYSTEM_TIME
|
||||
sm_CheckStartTime = sysTimer::GetSystemMsTime();
|
||||
|
||||
if (g_EntitlementManager_state == g_EntitlementManager_magic_idle)
|
||||
{
|
||||
gnetDebug1("Update :: StartCheck, setting to Waiting Online");
|
||||
//@@: location CENTITLEMENTMANAGER_STARTCHECK_SET_STATE
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_waiting_online;
|
||||
}
|
||||
}
|
||||
|
||||
void CEntitlementManager::Shutdown(unsigned)
|
||||
{
|
||||
gnetDebug1("Shutdown");
|
||||
sm_initialized = false;
|
||||
}
|
||||
|
||||
// Called to determine ownership of preorder bonus
|
||||
bool CEntitlementManager::IsEntitledToSpPreorderBonus()
|
||||
{
|
||||
return sm_PreorderBonus == MAGIC_PREORDER_BONUS;
|
||||
}
|
||||
|
||||
bool CEntitlementManager::IsReadyToShutdown()
|
||||
{
|
||||
return g_EntitlementManager_state != g_EntitlementManager_magic_check_pending;
|
||||
}
|
||||
|
||||
void CEntitlementManager::ActivationCallback(const int /*contentId*/, const char* /*activationCode*/, const rgsc::IActivationV1::ActivationAction action)
|
||||
{
|
||||
SYS_CS_SYNC(sm_Cs);
|
||||
gnetDebug1("ActivationCallback :: action: %d", (int)action);
|
||||
|
||||
sm_IsActivationUiShowing = false;
|
||||
sm_EntitlementError = false;
|
||||
sm_EntitlementCheckStartTime = 0;
|
||||
sm_EntitlementMsgStartTime = 0;
|
||||
|
||||
if (action == rgsc::IActivationV1::ACTIVATION_ACTIVATED_CONTENT)
|
||||
{
|
||||
// We need to wait for a credentials changed event
|
||||
if (g_EntitlementManager_state == g_EntitlementManager_magic_waiting_for_code)
|
||||
{
|
||||
gnetDebug1("ACTIVATION_ACTIVATED_CONTENT - We haven't received new creds yet");
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_waiting_for_creds;
|
||||
}
|
||||
}
|
||||
else if (action == rgsc::IActivationV1::ACTIVATION_USER_QUIT)
|
||||
{
|
||||
g_rlPc.GetUiInterface()->CloseUi();
|
||||
g_rlPc.SetUserRequestedShutdownViaScui(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
sm_codeAskStartTime = sysTimer::GetSystemMsTime();
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_ask_for_code_on_main_thread;
|
||||
}
|
||||
}
|
||||
|
||||
void CEntitlementManager::OnRosEvent(const rlRosEvent& rEvent)
|
||||
{
|
||||
switch(rEvent.GetId())
|
||||
{
|
||||
case RLROS_EVENT_GET_CREDENTIALS_RESULT:
|
||||
{
|
||||
if (g_EntitlementManager_state == g_EntitlementManager_magic_waiting_for_code ||
|
||||
g_EntitlementManager_state == g_EntitlementManager_magic_waiting_for_creds)
|
||||
{
|
||||
gnetDebug1("OnRosEvent - RLROS_EVENT_GET_CREDENTIALS_RESULT : Requesting new entitlement data");
|
||||
sm_bEntitlementWorkComplete = false;
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_check_pending;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Show activation UI
|
||||
void CEntitlementManager::ShowActivationUi()
|
||||
{
|
||||
gnetDebug1("Showing Activation Interface");
|
||||
sm_IsActivationUiShowing = true;
|
||||
g_rlPc.GetActivationInterface()->ShowActivationCodeUi(0, sm_PrePopulateKey, false, &ActivationCallback);
|
||||
}
|
||||
|
||||
void CEntitlementManager::UpdateOnlineState()
|
||||
{
|
||||
rtry
|
||||
{
|
||||
rcheck(!CLoadingScreens::IsDisplayingLegalScreen(), catchall, );
|
||||
rcheck(g_rlPc.IsInitialized(), catchall, );
|
||||
rcheck(g_rlPc.IsUiAcceptingCommands(), catchall, );
|
||||
rcheck(!CApp::IsScuiDisabledForShutdown(), catchall, );
|
||||
|
||||
if (g_rlPc.IsUiShowing())
|
||||
{
|
||||
// If the entitlement work is complete, show the activation ui
|
||||
if (sm_bEntitlementWorkComplete)
|
||||
{
|
||||
rcheck(!sm_IsActivationUiShowing, catchall, );
|
||||
// more consistant timing and animation of SCUI here. We'll see the online prompt and the
|
||||
// homepage return for 1.5 second, and then show the activation UI. Otherwise can appear janky.
|
||||
rcheck(sysTimer::HasElapsedIntervalMs(sm_codeAskStartTime, 1500), catchall, );
|
||||
ShowActivationUi();
|
||||
}
|
||||
// Otherwise, request the entitlement work to begin
|
||||
else
|
||||
{
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_check_pending;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rlGamertag name;
|
||||
rlPresence::GetName(0, name);
|
||||
CWarningScreen::SetMessageWithHeader(WARNING_MESSAGE_STANDARD, "WARNING_ACTIVATION", "ACTIVATION_ONLINE", FE_WARNING_OK, false, -1, name);
|
||||
eWarningButtonFlags result = CWarningScreen::CheckAllInput();
|
||||
if (result == FE_WARNING_OK)
|
||||
{
|
||||
ShowActivationUi();
|
||||
}
|
||||
}
|
||||
}
|
||||
rcatchall
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CEntitlementManager::UpdateWaitingForOnlineState()
|
||||
{
|
||||
//@@: range CENTITLEMENTMANAGER_UPDATEWAITINGFORONLINESTATE {
|
||||
rtry
|
||||
{
|
||||
rcheck(!CLoadingScreens::IsDisplayingLegalScreen(), catchall, );
|
||||
ENT_STATE_CHECK(sm_bPassedLegals);
|
||||
rcheck(g_rlPc.IsInitialized(), catchall, );
|
||||
ENT_STATE_CHECK(sm_bPassedInitialization);
|
||||
rcheck(g_rlPc.IsUiAcceptingCommands(), catchall, );
|
||||
ENT_STATE_CHECK(sm_bPassedUIAcceptingCommands);
|
||||
|
||||
// User is now online, update the state
|
||||
if (g_rlPc.GetProfileManager()->IsOnline())
|
||||
{
|
||||
gnetDebug1("Update :: Online, setting to Magic Check Pending");
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_check_pending;
|
||||
CWarningScreen::Remove();
|
||||
sm_bFirstTimeShowSignIn = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// User is signed in but not online, and is thus OFFLINE
|
||||
rcheck(!g_rlPc.GetProfileManager()->IsSigningIn(), catchall, sm_bFirstTimeShowSignIn = false);
|
||||
rcheck(!g_rlPc.GetProfileManager()->IsSignedIn(), offlineflow, sm_bFirstTimeShowSignIn = false);
|
||||
rcheck(!g_rlPc.GetUiInterface()->IsVisible(), catchall, sm_bFirstTimeShowSignIn = false);
|
||||
rcheck(!CApp::IsScuiDisabledForShutdown(), catchall, );
|
||||
|
||||
if (sm_bFirstTimeShowSignIn)
|
||||
{
|
||||
rcheck(!g_rlPc.IsUiShowing(), catchall, );
|
||||
sm_bFirstTimeShowSignIn = false;
|
||||
gnetDebug1("UpdateWaitingForOnlineState :: Showing Signin UI");
|
||||
//@@: location CENTITLEMENTMANAGER_UPDATEWAITINGFORONLINESTATE_SHOWSIGNINUI
|
||||
g_rlPc.ShowSigninUi();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
rcatch(offlineflow)
|
||||
{
|
||||
if (sm_bEntitlementWorkComplete)
|
||||
{
|
||||
if (!CApp::IsScuiDisabledForShutdown())
|
||||
{
|
||||
#if __STEAM_BUILD
|
||||
if (SteamUser() && !SteamUser()->BLoggedOn())
|
||||
{
|
||||
CWarningScreen::SetMessageWithHeader(WARNING_MESSAGE_STANDARD, "WARNING_ACTIVATION", "ACTIVATION_OFFLINE_STEAM", FE_WARNING_OK);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
printf("screaming in public restrooms part 3");
|
||||
}
|
||||
|
||||
eWarningButtonFlags result = CWarningScreen::CheckAllInput();
|
||||
if (result == FE_WARNING_OK)
|
||||
{
|
||||
gnetDebug1("Update :: Offline, Shutdown requested");
|
||||
CPauseMenu::SetGameWantsToExitToWindows(true);
|
||||
NetworkInterface::GetNetworkExitFlow().StartShutdownTasks();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (g_EntitlementManager_state != g_EntitlementManager_magic_check_pending)
|
||||
{
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_check_pending;
|
||||
}
|
||||
}
|
||||
rcatchall
|
||||
{
|
||||
static bool bShowingSocialClubInit = false;
|
||||
const int SCUI_INIT_SPINNER_MS = 1000;
|
||||
|
||||
bool bIsShowingLegals = CLoadingScreens::IsDisplayingLegalScreen();
|
||||
bool bIsAcceptingCommands = g_rlPc.IsUiAcceptingCommands();
|
||||
bool bIsValidTime = sm_CheckStartTime != 0 && sysTimer::HasElapsedIntervalMs(sm_CheckStartTime, SCUI_INIT_SPINNER_MS);
|
||||
|
||||
if (bIsValidTime && !bIsShowingLegals && !bIsAcceptingCommands)
|
||||
{
|
||||
CLoadingScreens::SetSocialClubLoadingSpinner();
|
||||
bShowingSocialClubInit = true;
|
||||
}
|
||||
else if (bShowingSocialClubInit && g_rlPc.IsUiAcceptingCommands())
|
||||
{
|
||||
CLoadingScreens::ShutdownSocialClubLoadingSpinner();
|
||||
bShowingSocialClubInit = false;
|
||||
}
|
||||
}
|
||||
//@@: } CENTITLEMENTMANAGER_UPDATEWAITINGFORONLINESTATE
|
||||
|
||||
}
|
||||
|
||||
void CEntitlementManager::Update()
|
||||
{
|
||||
SYS_CS_SYNC(sm_Cs);
|
||||
|
||||
// Check for noSocialClub
|
||||
#if !__FINAL || defined(MASTER_NO_SCUI)
|
||||
if (PARAM_noSocialClub.Get())
|
||||
{
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_idle;
|
||||
return;
|
||||
}
|
||||
|
||||
if (PARAM_noentitlements.Get())
|
||||
{
|
||||
// Even without -entitlements, a signin is still required
|
||||
if (!g_rlPc.GetProfileManager()->IsSignedIn())
|
||||
{
|
||||
UpdateWaitingForOnlineState();
|
||||
}
|
||||
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_idle;
|
||||
return;
|
||||
}
|
||||
#endif // !__FINAL || defined(MASTER_NO_SCUI)
|
||||
|
||||
if (g_EntitlementManager_state == g_EntitlementManager_magic_ask_for_code_on_main_thread)
|
||||
{
|
||||
gnetDebug1("Update :: Setting state to g_EntitlementManager_magic_waiting_for_code");
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_waiting_for_code;
|
||||
}
|
||||
else if (g_EntitlementManager_state == g_EntitlementManager_magic_waiting_for_code)
|
||||
{
|
||||
if (g_rlPc.GetProfileManager()->IsOnline())
|
||||
{
|
||||
UpdateOnlineState();
|
||||
}
|
||||
else
|
||||
{
|
||||
gnetDebug1("Update :: Not Online, setting to Waiting Online");
|
||||
//@@: location CENTITLEMENTMANAGER_UPDATE_SET_ONLINE
|
||||
g_EntitlementManager_state = g_EntitlementManager_magic_waiting_online;
|
||||
}
|
||||
}
|
||||
else if (g_EntitlementManager_state == g_EntitlementManager_magic_waiting_online)
|
||||
{
|
||||
UpdateWaitingForOnlineState();
|
||||
}
|
||||
else if (g_EntitlementManager_state == g_EntitlementManager_magic_check_pending ||
|
||||
g_EntitlementManager_state == g_EntitlementManager_magic_waiting_for_creds)
|
||||
{
|
||||
const int MIN_TIME_WARNING = 8000;
|
||||
//@@: location CENTITLEMENTMANAGER_UPDATE_SET_PENDING
|
||||
if (sm_EntitlementCheckStartTime != 0 && !g_rlPc.IsUiShowing() && sysTimer::HasElapsedIntervalMs(sm_EntitlementCheckStartTime, MIN_TIME_WARNING))
|
||||
{
|
||||
CWarningScreen::SetMessageWithHeader(WARNING_MESSAGE_STANDARD, "ACTIVATION_HEADER", "ACTIVATION_PENDING", FE_WARNING_SPINNER);
|
||||
if (sm_EntitlementMsgStartTime == 0)
|
||||
{
|
||||
sm_EntitlementMsgStartTime = sysTimer::GetSystemMsTime();
|
||||
gnetDebug1("Displaying \"activation taking too long\" message at %u", sm_EntitlementMsgStartTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (g_EntitlementManager_state == g_EntitlementManager_magic_error)
|
||||
{
|
||||
CWarningScreen::SetMessageWithHeader(WARNING_MESSAGE_STANDARD, "ACTIVATION_ERROR", "ACTIVATION_ERROR_NO_OFFLINE", FE_WARNING_OK);
|
||||
eWarningButtonFlags result = CWarningScreen::CheckAllInput();
|
||||
if (result == FE_WARNING_OK)
|
||||
{
|
||||
gnetDebug1("Update :: Error, Shutdown requested");
|
||||
CPauseMenu::SetGameWantsToExitToWindows(true);
|
||||
NetworkInterface::GetNetworkExitFlow().StartShutdownTasks();
|
||||
}
|
||||
}
|
||||
// Make sure warning is on screen for at least 1500ms
|
||||
else if (sm_EntitlementMsgStartTime != 0)
|
||||
{
|
||||
const int MIN_DISPLAY_TIME = 1500;
|
||||
if (sysTimer::HasElapsedIntervalMs(sm_EntitlementMsgStartTime, MIN_DISPLAY_TIME))
|
||||
{
|
||||
sm_EntitlementMsgStartTime = 0;
|
||||
gnetDebug1("Clearing \"activation taking too long\" message at %u", sm_EntitlementMsgStartTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
CWarningScreen::SetMessageWithHeader(WARNING_MESSAGE_STANDARD, "ACTIVATION_HEADER", "ACTIVATION_PENDING", FE_WARNING_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define CHECKDINPUT_THRESHOLD 1000*30
|
||||
void CEntitlementManager::ThreadEntry(void*)
|
||||
{
|
||||
while (sm_initialized)
|
||||
{
|
||||
// dormant until rlPC is initialized
|
||||
while(!g_rlPc.IsInitialized())
|
||||
{
|
||||
sysIpcSleep(100);
|
||||
|
||||
if (CApp::IsShutdownConfirmed())
|
||||
return;
|
||||
}
|
||||
|
||||
// dormant until the main thread requests some work
|
||||
while (g_EntitlementManager_state != g_EntitlementManager_magic_check_pending)
|
||||
{
|
||||
//@@: range CENTITLEMENTMANAGER_THREADENTRY_LOOP {
|
||||
sysIpcSleep(100);
|
||||
|
||||
if (CApp::IsShutdownConfirmed())
|
||||
return;
|
||||
//@@: } CENTITLEMENTMANAGER_THREADENTRY_LOOP
|
||||
}
|
||||
|
||||
sysIpcSleep(30);
|
||||
|
||||
sm_EntitlementCheckStartTime = sysTimer::GetSystemMsTime();
|
||||
|
||||
rage::netStatus asyncStatus;
|
||||
|
||||
// Set up buffer for entitlement block
|
||||
const size_t ENTITLEMENT_BLOCK_SIZE = 1024 * 64;
|
||||
char* entitlementBlock = rage_new char[ENTITLEMENT_BLOCK_SIZE];
|
||||
unsigned int entitlementBlockSize = 0;
|
||||
//@@: range CENTITLEMENTMANAGER_THREADENTRY {
|
||||
|
||||
gnetDebug1("ThreadEntry :: Calculating machine hash");
|
||||
|
||||
// Get the machine hash
|
||||
char machineHash[HASH_DIGEST_STRING_LENGTH];
|
||||
// Get the profile information
|
||||
rgsc::Profile profile;
|
||||
rgsc::RockstarId profileId = InvalidRockstarId;
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_GET_SIGN_IN_INFO
|
||||
if (g_rlPc.GetProfileManager())
|
||||
{
|
||||
HRESULT hr = g_rlPc.GetProfileManager()->GetSignInInfo(&profile);
|
||||
if(hr == ERROR_SUCCESS)
|
||||
{
|
||||
profileId = profile.GetProfileId();
|
||||
}
|
||||
}
|
||||
|
||||
//@@: range CENTITLEMENTMANAGER_THREADENTRY_ACTUAL_WORK {
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_CALL_MACHINE_HASH
|
||||
CMachineHash::GetMachineHash(machineHash, profileId);
|
||||
|
||||
gnetDebug1("Machine Hash for profile id: %"I64FMT"d: %s", profileId, machineHash);
|
||||
|
||||
if(g_rlPc.GetProfileManager() && g_rlPc.GetProfileManager()->IsOnline())
|
||||
{
|
||||
// Start an async request for the entitlement block, coerced into being synchronous
|
||||
int version = 0;
|
||||
gnetDebug1("ThreadEntry :: Getting entitlement block");
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_GET_ENTITLEMENT_BLOCK
|
||||
if (rlRosEntitlement::GetEntitlementBlock(0, machineHash, "en-US", entitlementBlock, ENTITLEMENT_BLOCK_SIZE, &version, &entitlementBlockSize, &asyncStatus))
|
||||
{
|
||||
// Wait for the async operation
|
||||
while (asyncStatus.Pending())
|
||||
{
|
||||
sysIpcSleep(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the block to signify failure
|
||||
delete[] entitlementBlock;
|
||||
entitlementBlock = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#if !__FINAL
|
||||
// Offline Entitlement is tied to the launcher in final builds. In !Final builds, there is no launcher...
|
||||
if (entitlementBlock && asyncStatus.Succeeded())
|
||||
{
|
||||
gnetDebug1("ThreadEntry :: Got block :: SaveOfflineEntitlement");
|
||||
rlRosEntitlement::SaveOfflineEntitlement((u8*)entitlementBlock, entitlementBlockSize, (rgsc::u8*)machineHash);
|
||||
while(rlRosEntitlement::IsEntitlementIOInProgress())
|
||||
sysIpcSleep(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
sm_EntitlementError = asyncStatus.Failed();
|
||||
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_ISINITIALIZED
|
||||
if(entitlementBlockSize == 0 && rlRosEntitlement::IsInitialized())
|
||||
{
|
||||
#if SUPPORT_OFFLINE_ENTITLEMENT
|
||||
bool retBool = rlRosEntitlement::LoadOfflineEntitlement((rgsc::u8*)machineHash);
|
||||
if(retBool)
|
||||
{
|
||||
|
||||
//@@: range CENTITLEMENTMANAGER_THREADENTRY_FETCH_OFFLINE_VALUES {
|
||||
while(rlRosEntitlement::IsEntitlementIOInProgress())
|
||||
sysIpcSleep(1);
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_GET_OFFLINE_VALUES
|
||||
entitlementBlock = (char *)rlRosEntitlement::GetOfflineEntitlement();
|
||||
entitlementBlockSize = rlRosEntitlement::GetOfflineEntitlementLength();
|
||||
//@@: } CENTITLEMENTMANAGER_THREADENTRY_FETCH_OFFLINE_VALUES
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Reset the wait, or go round again if another request has come in
|
||||
SYS_CS_SYNC(sm_Cs);
|
||||
|
||||
u32 nextState;
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_DOESDATABLOCKGRANTENTITLEMENT
|
||||
|
||||
/////////////////////////////////////// START PREORDER BONUS /////////////////////////////////////////////////
|
||||
if (entitlementBlock)
|
||||
{
|
||||
char* entBlockPreorder = rage_new char[ENTITLEMENT_BLOCK_SIZE];
|
||||
if (entBlockPreorder)
|
||||
{
|
||||
sysMemCpy(entBlockPreorder, entitlementBlock, entitlementBlockSize);
|
||||
|
||||
if (rlRosEntitlement::DoesDataBlockGrantEntitlement(profileId, machineHash, entBlockPreorder, entitlementBlockSize, sm_PreorderSinglePlayerMoney))
|
||||
{
|
||||
sm_PreorderBonus = MAGIC_PREORDER_BONUS;
|
||||
}
|
||||
|
||||
delete[] entBlockPreorder;
|
||||
entBlockPreorder = NULL;
|
||||
}
|
||||
|
||||
gnetDebug1("Has entitlement for Preorder cash - %s", IsEntitledToSpPreorderBonus() ? "TRUE" : "FALSE");
|
||||
}
|
||||
/////////////////////////////////////// END PREORDER BONUS /////////////////////////////////////////////////
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_DOESDATABLOCKGRANTENTITLEMENT_GAME
|
||||
|
||||
const char* sku = NULL;
|
||||
|
||||
#if __STEAM_BUILD
|
||||
sku = sm_SkuSteam;
|
||||
#else
|
||||
//if(g_SysEpic.IsInitialized())
|
||||
//{
|
||||
// sku = sm_SkuEpic;
|
||||
//}
|
||||
/* TODO JRM
|
||||
else if(g_sysSteam.IsInitialized())
|
||||
{
|
||||
sku = sm_SkuSteam;
|
||||
}
|
||||
*/
|
||||
//else
|
||||
//{
|
||||
sku = sm_SkuMain;
|
||||
//}
|
||||
#endif // __STEAM_BUILD
|
||||
|
||||
if (entitlementBlock && rlRosEntitlement::DoesDataBlockGrantEntitlement(profileId, machineHash, entitlementBlock, entitlementBlockSize, sku))
|
||||
{
|
||||
gnetDebug1("ThreadEntry :: Updating state to g_EntitlementManager_magic_idle");
|
||||
nextState = g_EntitlementManager_magic_idle;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sm_EntitlementError)
|
||||
{
|
||||
gnetDebug1("ThreadEntry :: Updating state to g_EntitlementManager_magic_error");
|
||||
nextState = g_EntitlementManager_magic_error;
|
||||
}
|
||||
else
|
||||
{
|
||||
gnetDebug1("ThreadEntry :: Updating state to g_EntitlementManager_magic_ask_for_code_on_main_thread");
|
||||
sm_codeAskStartTime = sysTimer::GetSystemMsTime();
|
||||
nextState = g_EntitlementManager_magic_ask_for_code_on_main_thread;
|
||||
}
|
||||
}
|
||||
//@@: } CENTITLEMENTMANAGER_THREADENTRY_ACTUAL_WORK
|
||||
|
||||
|
||||
// If we loaded offline entitlement, clear it. At this point entitlementBlock simply points
|
||||
// at the same memory owned by rlRosEntitlement
|
||||
|
||||
//@@: location CENTITLEMENTMANAGER_THREADENTRY_GET_OFFLINE_ENTITLEMENT
|
||||
if (rlRosEntitlement::GetOfflineEntitlement())
|
||||
{
|
||||
rlRosEntitlement::ClearOfflineEntitlement();
|
||||
}
|
||||
else if (entitlementBlock)
|
||||
{
|
||||
delete[] entitlementBlock;
|
||||
entitlementBlock = NULL;
|
||||
}
|
||||
|
||||
// Zero-out the machine hash, as this function is the last to use it
|
||||
sysMemSet(machineHash, 0, sizeof(machineHash));
|
||||
|
||||
sm_bEntitlementWorkComplete = true;
|
||||
g_EntitlementManager_state = nextState;
|
||||
//@@: } CENTITLEMENTMANAGER_THREADENTRY
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool CEntitlementManager::PrePopulateKey()
|
||||
{
|
||||
#if __STEAM_BUILD
|
||||
HKEY hKey = NULL;
|
||||
DWORD dwType = 0;
|
||||
DWORD dwSize = MAX_PATH;
|
||||
LRESULT lResult;
|
||||
|
||||
// Location of the registry key where Steam will be putting the serial number.
|
||||
char *wSteamKey = "Software\\Rockstar Games";
|
||||
|
||||
// Open the registry key.
|
||||
lResult = RegOpenKeyEx(HKEY_CURRENT_USER, wSteamKey, 0, KEY_READ, &hKey);
|
||||
|
||||
// Make sure the key exists.
|
||||
if (lResult == ERROR_SUCCESS)
|
||||
{
|
||||
// Make sure the "CDKey" key value exists, otherwise return an empty serial number.
|
||||
lResult = RegQueryValueEx(hKey, "Grand Theft Auto V", 0, &dwType, (BYTE*)sm_PrePopulateKey, &dwSize);
|
||||
if (lResult == ERROR_SUCCESS && dwSize < MAX_PATH)
|
||||
{
|
||||
sm_PrePopulateKey[dwSize] = '\0';
|
||||
RegCloseKey(hKey);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// If the key doesn't even exist then return an empty serial.
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#elif !__FINAL
|
||||
safecpy(sm_PrePopulateKey, "TEST-GTAV-MAIN");
|
||||
return true;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // RSG_ENTITLEMENT_ENABLED
|
2201
OPTIONAL_FIXES/rage/base/src/rline/rlpc.cpp
Normal file
2201
OPTIONAL_FIXES/rage/base/src/rline/rlpc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
424
OPTIONAL_FIXES/rage/base/src/rline/rlpc.h
Normal file
424
OPTIONAL_FIXES/rage/base/src/rline/rlpc.h
Normal file
@ -0,0 +1,424 @@
|
||||
//
|
||||
// rline/rlpc.h
|
||||
//
|
||||
// Copyright (C) 1999-2013 Rockstar Games. All Rights Reserved.
|
||||
//
|
||||
|
||||
#ifndef RLINE_RLPC_H
|
||||
#define RLINE_RLPC_H
|
||||
|
||||
#include "file/file_config.h"
|
||||
|
||||
#if RSG_PC
|
||||
|
||||
#include "system/new.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/rgsc_common.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/rgsc_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/achievements_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/players_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/presence_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/profiles_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/commerce_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/delegate_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/cloudsave_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/configuration_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/gamerpics_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/pad_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/titleid_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/file_system_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/tasks_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/rgsc_ui_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/activation_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/patching_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/telemetry_interface.h"
|
||||
#include "../../../suite/src/rgsc/rgsc/rgsc/public_interface/network_interface.h"
|
||||
|
||||
#include "atl/delegate.h"
|
||||
#include "data/autoid.h"
|
||||
#include "input/pad.h"
|
||||
#include "net/relay.h"
|
||||
#include "data/certificateverify.h"
|
||||
|
||||
#include "rline/scpresence/rlscpresencemessage.h"
|
||||
#include "rline/rlpcpipe.h"
|
||||
//#include "system/epic.h"
|
||||
|
||||
#if !__RGSC_DLL
|
||||
#include "input/virtualkeyboard.h"
|
||||
#endif
|
||||
|
||||
namespace rage
|
||||
{
|
||||
|
||||
bool RockstarCertificateVerification(CertificateDetails & detail);
|
||||
|
||||
class rlGamerHandle;
|
||||
class rlScPresenceMessageSender;
|
||||
|
||||
enum ePcEventType
|
||||
{
|
||||
RLPC_EVENT_SIGN_IN_STATE_CHANGED,
|
||||
RLPC_EVENT_ROS_TICKET_CHANGED,
|
||||
RLPC_EVENT_FRIEND_STATUS_CHANGED,
|
||||
RLPC_EVENT_SOCIAL_CLUB_MESSAGE,
|
||||
RLPC_EVENT_GAME_INVITE_ACCEPTED,
|
||||
RLPC_EVENT_JOINED_VIA_PRESENCE,
|
||||
RLPC_EVENT_CLOUD_SAVES_ENABLED_UPDATED
|
||||
};
|
||||
|
||||
#define RLPC_EVENT_COMMON_DECL( name )\
|
||||
static unsigned EVENT_ID() { return name::GetAutoId(); }\
|
||||
virtual unsigned GetId() const { return name::GetAutoId(); }
|
||||
|
||||
#define RLPC_EVENT_DECL( name, id )\
|
||||
AUTOID_DECL_ID( name, rage::rlPcEvent, id )\
|
||||
RLPC_EVENT_COMMON_DECL( name )
|
||||
|
||||
class rlPcEvent
|
||||
{
|
||||
public:
|
||||
AUTOID_DECL_ROOT(rlPcEvent);
|
||||
|
||||
RLPC_EVENT_COMMON_DECL(rlPcEvent);
|
||||
|
||||
rlPcEvent() {}
|
||||
virtual ~rlPcEvent() {}
|
||||
};
|
||||
|
||||
class rlPcEventSignInStateChanged : public rlPcEvent
|
||||
{
|
||||
public:
|
||||
RLPC_EVENT_DECL(rlPcEventSignInStateChanged, RLPC_EVENT_SIGN_IN_STATE_CHANGED);
|
||||
|
||||
explicit rlPcEventSignInStateChanged(const rgsc::SignInStateFlags state)
|
||||
: m_State(state)
|
||||
{
|
||||
}
|
||||
|
||||
rgsc::SignInStateFlags m_State;
|
||||
};
|
||||
|
||||
class rlPcEventRosTicketChanged : public rlPcEvent
|
||||
{
|
||||
public:
|
||||
RLPC_EVENT_DECL(rlPcEventRosTicketChanged, RLPC_EVENT_ROS_TICKET_CHANGED);
|
||||
|
||||
explicit rlPcEventRosTicketChanged(const char* xml)
|
||||
: m_Xml(xml)
|
||||
{
|
||||
}
|
||||
|
||||
const char* m_Xml;
|
||||
};
|
||||
|
||||
class rlPcEventFriendStatusChanged : public rlPcEvent
|
||||
{
|
||||
public:
|
||||
RLPC_EVENT_DECL(rlPcEventFriendStatusChanged, RLPC_EVENT_FRIEND_STATUS_CHANGED);
|
||||
|
||||
rlPcEventFriendStatusChanged()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class rlPcEventSocialClubMessage : public rlPcEvent
|
||||
{
|
||||
public:
|
||||
RLPC_EVENT_DECL(rlPcEventSocialClubMessage, RLPC_EVENT_SOCIAL_CLUB_MESSAGE);
|
||||
|
||||
explicit rlPcEventSocialClubMessage(const rlScPresenceMessage* scMsg, const rlScPresenceMessageSender* sender)
|
||||
: m_ScMsg(scMsg)
|
||||
, m_Sender(sender)
|
||||
{
|
||||
}
|
||||
|
||||
const rlScPresenceMessage* m_ScMsg;
|
||||
const rlScPresenceMessageSender* m_Sender;
|
||||
};
|
||||
|
||||
class rlPcEventGameInviteAccepted : public rlPcEvent
|
||||
{
|
||||
public:
|
||||
RLPC_EVENT_DECL(rlPcEventGameInviteAccepted, RLPC_EVENT_GAME_INVITE_ACCEPTED);
|
||||
|
||||
explicit rlPcEventGameInviteAccepted(const rlScPresenceMessage* scMsg, const rlScPresenceMessageSender* sender)
|
||||
{
|
||||
m_ScMsg = scMsg;
|
||||
m_Sender = sender;
|
||||
}
|
||||
|
||||
const rlScPresenceMessage* m_ScMsg;
|
||||
const rlScPresenceMessageSender* m_Sender;
|
||||
};
|
||||
|
||||
class rlPcEventJoinedViaPresence : public rlPcEvent
|
||||
{
|
||||
public:
|
||||
RLPC_EVENT_DECL(rlPcEventJoinedViaPresence, RLPC_EVENT_JOINED_VIA_PRESENCE);
|
||||
|
||||
explicit rlPcEventJoinedViaPresence(const rlScPresenceMessage* scMsg, const rlScPresenceMessageSender* sender)
|
||||
{
|
||||
m_ScMsg = scMsg;
|
||||
m_Sender = sender;
|
||||
}
|
||||
|
||||
const rlScPresenceMessage* m_ScMsg;
|
||||
const rlScPresenceMessageSender* m_Sender;
|
||||
};
|
||||
|
||||
class rlPcEventCloudSavesEnabledUpdate : public rlPcEvent
|
||||
{
|
||||
public:
|
||||
RLPC_EVENT_DECL(rlPcEventCloudSavesEnabledUpdate, RLPC_EVENT_CLOUD_SAVES_ENABLED_UPDATED);
|
||||
|
||||
explicit rlPcEventCloudSavesEnabledUpdate(const char* rosTitleName)
|
||||
: m_RosTitleName(rosTitleName)
|
||||
{
|
||||
}
|
||||
|
||||
const char* m_RosTitleName;
|
||||
};
|
||||
|
||||
typedef atDelegator<void (class rlPc*, const class rlPcEvent*)> rlPcEventDelegator;
|
||||
typedef rlPcEventDelegator::Delegate rlPcEventDelegate;
|
||||
|
||||
/* This class presents the interface to the external PC Platform DLL.
|
||||
It acts as the glue that binds Rage to the DLL and vice versa.
|
||||
*/
|
||||
class rlPc
|
||||
{
|
||||
friend class RgscDelegate;
|
||||
public:
|
||||
|
||||
enum InitErrorCodes
|
||||
{
|
||||
SC_INIT_ERR_NONE = 0,
|
||||
SC_INIT_ERR_NO_DLL = 1,
|
||||
SC_INIT_ERR_NO_SC_COMMAND_LINE = 2,
|
||||
SC_INIT_ERR_PROGRAM_FILES_NOT_FOUND = 3,
|
||||
SC_INIT_ERR_LOAD_LIBRARY_FAILED = 4,
|
||||
SC_INIT_ERR_GET_PROC_ADDRESS_FAILED = 5,
|
||||
SC_INIT_ERR_CALL_EXPORTED_FUNC_FAILED = 6,
|
||||
SC_INIT_ERR_QUERY_INTERFACE_FAILED = 7,
|
||||
SC_INIT_ERR_UNKNOWN_ENV = 8,
|
||||
SC_INIT_ERR_INIT_CALL_FAILED = 9,
|
||||
SC_INIT_ERR_GET_SUBSYSTEM_FAILED = 10,
|
||||
SC_INIT_ERR_RGSC_NULL_AFTER_LOAD = 11,
|
||||
SC_INIT_ERR_CREATE_DEVICE_DX11 = 12,
|
||||
SC_INIT_ERR_CREATE_DEVICE_DX9 = 13,
|
||||
SC_INIT_ERR_NULL_PIPE = 14,
|
||||
SC_INIT_ERR_PIPE_CONNECT_FAILED = 15,
|
||||
SC_INIT_ERR_SIGNATURE_VERIFICATION_FAILED = 16,
|
||||
SC_INIT_ERR_WEBSITE_FAILED_LOAD = 17,
|
||||
};
|
||||
|
||||
rlPc();
|
||||
~rlPc();
|
||||
|
||||
bool Init();
|
||||
void Shutdown();
|
||||
void Update();
|
||||
|
||||
//PURPOSE
|
||||
// Add/remove a delegate that will be called with event notifications.
|
||||
void AddDelegate(rlPcEventDelegate* dlgt);
|
||||
void RemoveDelegate(rlPcEventDelegate* dlgt);
|
||||
void DispatchEvent(const rlPcEvent* e);
|
||||
|
||||
bool IsInitialized();
|
||||
|
||||
rgsc::IRgscV10* GetRgscInterface();
|
||||
rgsc::IAchievementManagerV3* GetAchievementManager();
|
||||
rgsc::IPlayerManagerV2* GetPlayerManager();
|
||||
rgsc::IPresenceManagerV4* GetPresenceManager();
|
||||
rgsc::ICommerceManagerV4* GetCommerceManager();
|
||||
rgsc::IProfileManagerV2* GetProfileManager();
|
||||
rgsc::IGamepadManagerV3* GetGamepadManager();
|
||||
rgsc::IFileSystemV3* GetFileSystem();
|
||||
rgsc::IRgscUiV7* GetUiInterface();
|
||||
rgsc::IActivationV2* GetActivationInterface();
|
||||
rgsc::IPatchingV1* GetPatchingInterface();
|
||||
rgsc::ITaskManagerV1* GetTaskManager();
|
||||
rgsc::ITelemetryV3* GetTelemetry();
|
||||
rgsc::INetworkV1* GetNetworkInterface();
|
||||
rgsc::ICloudSaveManagerV3* GetCloudSaveManager();
|
||||
rgsc::IGamerPicManagerV1* GetGamerPicManager();
|
||||
|
||||
//PURPOSE
|
||||
// Show the main UI / landing page.
|
||||
bool ShowUi();
|
||||
|
||||
//PURPOSE
|
||||
// Show the sign-in UI.
|
||||
bool ShowSigninUi();
|
||||
|
||||
//PURPOSE
|
||||
// Shows the gamer profile UI (gamer card).
|
||||
//PARAMS
|
||||
// target - Gamer handle of gamer who's profile will be shown.
|
||||
bool ShowGamerProfileUi(const rlGamerHandle& target);
|
||||
|
||||
//PURPOSE
|
||||
// Shows the commerce UI.
|
||||
//PARAMS
|
||||
// url - url to the store's page to navigate to
|
||||
bool ShowCommerceUi(const char* url);
|
||||
|
||||
//PURPOSE
|
||||
// Returns true if a system UI is showing.
|
||||
bool IsUiShowing() const;
|
||||
|
||||
//PURPOSE
|
||||
// Returns true if the UI is loaded and ready to accept commands.
|
||||
bool IsUiAcceptingCommands();
|
||||
|
||||
// PURPOSE
|
||||
// Returns true if the SCUI quit game button has been pressed
|
||||
bool HasUserRequestedShutdownViaScui();
|
||||
void SetUserRequestedShutdownViaScui(bool bShutdownRequested);
|
||||
|
||||
bool ConnectDownloaderPipe(const char * pipeName);
|
||||
rlPCPipe* GetDownloaderPipe() { return m_PCPipe; }
|
||||
|
||||
//PURPOSE
|
||||
// Error codes to help debug startup issues.
|
||||
void SetInitErrorCode(int errorCode);
|
||||
int GetInitErrorCode() {return m_InitializationErrorCode;}
|
||||
|
||||
const char* GetSocialClubVersion();
|
||||
|
||||
//PURPOSE
|
||||
// Retrieves the presence message sender information if available.
|
||||
void GetPresenceMessageSender(rgsc::IPresenceMessage* msg, rlScPresenceMessageSender* sender);
|
||||
|
||||
// PURPOSE
|
||||
// Returns TRUE if the specified revision is the Social Club version.
|
||||
bool IsSocialClubVersion(int major, int minor, int build, int revision);
|
||||
|
||||
// PURPOSE
|
||||
// Returns TRUE if the specified revision is at least the Social Club version.
|
||||
bool IsAtLeastSocialClubVersion(int major, int minor, int build, int revision);
|
||||
|
||||
// PURPOSE
|
||||
// Called when a SCUI text box gains focus
|
||||
void SetTextBoxHasFocus(const bool hasFocus, const char* prompt, const char* text, const bool isPassword, const unsigned int maxNumChars);
|
||||
|
||||
// PURPOSE
|
||||
// Called when we need to refresh the Steam Auth Token
|
||||
void RefreshSteamAuthTicket(bool bNotifyRgsc);
|
||||
u32 GetSteamAuthTicketLength();
|
||||
const char* GetSteamAuthTicket();
|
||||
|
||||
// PURPOSE
|
||||
// Returns the additional session info attribute in use by the title for secondary game sessions (i.e. trinfo in GTAV)
|
||||
// Takes in a char ptr so we can potentially expand to a delimited list in future titles that may use more than 2 sessions
|
||||
const char* GetAdditionalSessionAttr() { return m_AdditionalSessionAttr; }
|
||||
void SetAdditionalSessionAttr(const char* attr) { safecpy(m_AdditionalSessionAttr, attr); }
|
||||
|
||||
// PURPOSE
|
||||
// Returns the additional session join attribute in use by the title for secondary game sessions (i.e. trjoin in GTAV)
|
||||
// Takes in a char ptr so we can potentially expand to a delimited list in future titles that may use more than 2 sessions
|
||||
const char* GetAdditionalJoinAttr() { return m_AdditionalJoinAttr; }
|
||||
void SetAdditionalJoinAttr(const char* attr) { safecpy(m_AdditionalJoinAttr, attr); }
|
||||
|
||||
// PURPOSE
|
||||
// Get/Set the Metadata file path
|
||||
const char* GetMetaDataPath() { return m_MetaDataPath; }
|
||||
void SetMetaDataPath(const char* path) { safecpy(m_MetaDataPath, path); }
|
||||
|
||||
// PURPOSE
|
||||
// Handler for entitlement events
|
||||
void HandleEntitlementEvent(const char* json);
|
||||
|
||||
// PURPOSE
|
||||
// Returns the number of virtual SCUI gamepads.
|
||||
unsigned GetNumScuiPads() const;
|
||||
|
||||
// PURPOSE
|
||||
// Returns a pointer to a virtual SCUI gamepad at the requested index.
|
||||
// Returns nullptr if invalid or out of range.
|
||||
rgsc::RgscGamepad* GetScuiPad(const unsigned index) const;
|
||||
|
||||
#if !__FINAL
|
||||
void SimluateDeviceLost();
|
||||
void SimluateDeviceReset();
|
||||
#endif
|
||||
|
||||
private:
|
||||
rlPcEventDelegator m_Delegator;
|
||||
|
||||
int m_SocialClubVersionNum[4];
|
||||
char m_SocialClubVersion[32];
|
||||
bool m_bHasScuiRequestedQuit;
|
||||
|
||||
rgsc::IRgscV10* m_Rgsc;
|
||||
rgsc::IProfileManagerV2* m_ProfileManager;
|
||||
rgsc::IGamepadManagerV3* m_GamepadManager;
|
||||
rgsc::IAchievementManagerV3* m_AchievementManager;
|
||||
rgsc::IPlayerManagerV2* m_PlayerManager;
|
||||
rgsc::IPresenceManagerV4* m_PresenceManager;
|
||||
rgsc::ICommerceManagerV4* m_CommerceManager;
|
||||
rgsc::IActivationV2* m_ActivationSystem;
|
||||
rgsc::IPatchingV1* m_PatchingSystem;
|
||||
rgsc::IFileSystemV3* m_FileSystem;
|
||||
rgsc::IRgscUiV7* m_RgscUi;
|
||||
rgsc::ITaskManagerV1* m_TaskManager;
|
||||
rgsc::ITelemetryV3* m_Telemetry;
|
||||
rgsc::INetworkV1* m_NetworkInterface;
|
||||
rgsc::ICloudSaveManagerV3* m_CloudSaveManager;
|
||||
rgsc::IGamerPicManagerV1* m_GamerPicManager;
|
||||
|
||||
HMODULE m_hRgscDll;
|
||||
|
||||
// IPC communication with the game's launcher
|
||||
rlPCPipe* m_PCPipe;
|
||||
|
||||
// Virtual Gamepads
|
||||
rgsc::RgscGamepad* m_ScuiPads[ioPad::MAX_PADS];
|
||||
unsigned m_NumScuiPads;
|
||||
|
||||
// listens for events from the relay server
|
||||
void OnRelayEvent(const netRelayEvent& event);
|
||||
|
||||
// registered with netRelay to listen for events.
|
||||
netRelay::Delegate m_RelayDelegate;
|
||||
|
||||
//#if EPIC_API_SUPPORTED
|
||||
// sysEpicEventDelegator::Delegate m_EpicDelegate;
|
||||
// void OnEpicEvent(sysEpic*, const sysEpicEvent*);
|
||||
//#endif
|
||||
|
||||
int m_InitializationErrorCode;
|
||||
bool m_WaitingForKeyboardResult;
|
||||
unsigned m_KeyboardCompleteTime;
|
||||
|
||||
#if !__RGSC_DLL
|
||||
ioVirtualKeyboard m_ScuiVirtualKeyboard;
|
||||
#endif
|
||||
|
||||
#if __STEAM_BUILD
|
||||
static char sm_SteamAuthTicket[rgsc::RGSC_STEAM_TICKET_ENCODED_BUF_SIZE];
|
||||
static u32 sm_uSteamAuthTicketLen;
|
||||
#endif
|
||||
|
||||
char m_AdditionalSessionAttr[rgsc::RGSC_ADDITIONAL_SESSION_ATTR_BUF_SIZE];
|
||||
char m_AdditionalJoinAttr[rgsc::RGSC_ADDITIONAL_SESSION_ATTR_BUF_SIZE];
|
||||
char m_MetaDataPath[rgsc::RGSC_MAX_PATH];
|
||||
|
||||
#if !__FINAL && !__RGSC_DLL
|
||||
u32 GetDllVersion(const char* fileName);
|
||||
bool InstallDlls(char (&loadPath)[MAX_PATH]);
|
||||
u32 GetDllFileCount(const char* path);
|
||||
#endif
|
||||
void SetSocialClubVersion(const wchar_t* fileName);
|
||||
bool LoadDll();
|
||||
};
|
||||
|
||||
// global instance
|
||||
extern rlPc g_rlPc;
|
||||
|
||||
} // namespace rage
|
||||
|
||||
#endif //RSG_PC
|
||||
|
||||
#endif // RLINE_RLPC_H
|
55
README.md
Normal file
55
README.md
Normal file
@ -0,0 +1,55 @@
|
||||
# GTA5 源码编译所需要的补丁
|
||||
|
||||
> ### 如果你之前已经应用过这些补丁,请重新解压整个源代码,以确保错误可以重现并报告。
|
||||
|
||||
- 解压 {rage,game} 到 X:\gta5\src\ 并覆盖
|
||||
- 解压 "ROOT_DLL" 内的所有文件到 titleupdate
|
||||
- 记得禁用 Visual Studio 项目的 “将所有警告视为错误” 选项
|
||||
- 可选:将 "OPTIONAL_DLL" 内的 socialclub.dll 复制到 `C:\Program Files\Rockstar Games\Social Club Debug` 目录下
|
||||
|
||||
## 以类似零售版的方式启动游戏并使任务流程正常工作:
|
||||
- 在 gameconfig.xml (`update.rpf/common/data/`) 中将 MISSION 的 SizeOfStack 设置为 53000
|
||||
- 将 _编译好的_ scripts.rpf 复制到 `update2.rpf/levels/gta5/scripts` (!! 需要重新加密编辑过的 RPF !!)
|
||||
- 使用 `-DoReleaseStartup` 参数运行可执行文件
|
||||
|
||||
## 如果你编辑了任何 RPF 文件:
|
||||
|
||||
- 请使用 [Archivefix.exe](https://staticfile-cn.zerodream.net/files/gta5-source/ArchiveFix.zip) 重新加密任何编辑过的 RPF 文件。
|
||||
|
||||
### 通用注释:
|
||||
以下是推荐使用的启动参数,将以下内容复制,然后在 `X:\gta5\build\dev_ng` 目录下创建一个文本文件,重命名为 `run.bat`,然后将内容粘贴到 `run.bat` 文件中,然后双击运行 `run.bat` 文件即可。
|
||||
|
||||
```
|
||||
@echo off
|
||||
game_win64_debug.exe -rootdir "X:\gta5\build\dev_ng/" -audiopack "X:\gta5\build\dev_ng/x64/audio/audio.rpf" -commonpack "X:\gta5\build\dev_ng/common.rpf" -assetsdir "X:\gta5\build\dev_ng" -noSocialClub -nonetlogs -audio -output -nodebugpack -usepackfiles -platformpack "x64.rpf" -kbgame -update "." -override_script script -sc_DisableForbiddenVehicleRemoval -nokeyboardhook -width 1280 -height 720 -windowed
|
||||
```
|
||||
|
||||
以下是启动参数的详细说明:
|
||||
|
||||
- 启动参数:`-noSocialClub -nokeyboardhook -nonetlogs`
|
||||
- `-noSocialClub` - 修复激活问题
|
||||
- `-nokeyboardhook` - 防止游戏卡住按键
|
||||
- `-nonetlogs` - 修复 message.log 引起的崩溃
|
||||
|
||||
### 附加启动参数:
|
||||
- `-output` - 添加调试控制台输出
|
||||
- `-kbgame` - 默认使用游戏键盘而不是调试键盘
|
||||
- `-rag` - 使用 Rockstar 的游戏调试工具
|
||||
- `-ragUseOwnWindow` - 游戏将会在自己的窗口中运行,而不是附加到调试器
|
||||
|
||||
### 其他非必须的启动参数:
|
||||
- -useFinalShaders - 不需要,调试着色器已经提供,而最终着色器不适用于调试版本
|
||||
- -audiopack - 不需要,游戏已经默认使用 audio_rel.rpf
|
||||
- -langfilesuffix - 不需要,游戏已经默认使用 american_rel
|
||||
- -commonpack, -nodebugpack, -usepackfiles, -platformpack, -assetsdir - 不需要,代码更改已经使游戏默认加载打包文件
|
||||
- -nonetwork - 不推荐,因为它会在你退出暂停菜单时崩溃游戏
|
||||
- -disablecacheloader - 不需要,代码更改已经使游戏加载正确的缓存文件
|
||||
|
||||
### 注意:
|
||||
- 你需要 v2699 游戏版本更新和 update2.rpf,编译好的调试着色器,以及编译好的 script.rpf
|
||||
- 着色器从游戏文件夹中的 common/shaders 目录中加载,不需要重新打包 common.rpf
|
||||
- 着色器质量必须高于 normal,否则它会从 win32_40_lq 加载,而我们还没有编译好它
|
||||
- 按 LCtrl+Tab 切换键盘模式,从调试切换到游戏,否则需要使用控制器
|
||||
|
||||
## 可选修复
|
||||
- "OPTIONAL_FIXES" 文件夹包含了一个临时的代码,用于修复 RGSC 和移除 Epic API,如果你需要它们,请从中复制到 `X:\gta5\src` 目录下
|
BIN
ROOT_DLL/GFSDK_ShadowLib.win64.dll
Normal file
BIN
ROOT_DLL/GFSDK_ShadowLib.win64.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/GFSDK_TXAA.win64.dll
Normal file
BIN
ROOT_DLL/GFSDK_TXAA.win64.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/GFSDK_TXAA_AlphaResolve.win64.dll
Normal file
BIN
ROOT_DLL/GFSDK_TXAA_AlphaResolve.win64.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/GPUPerfAPIDX11-x64.dll
Normal file
BIN
ROOT_DLL/GPUPerfAPIDX11-x64.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/NvPmApi.Core.win64.dll
Normal file
BIN
ROOT_DLL/NvPmApi.Core.win64.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/bink2w64.dll
Normal file
BIN
ROOT_DLL/bink2w64.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/libcurl.dll
Normal file
BIN
ROOT_DLL/libcurl.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/opusenc.dll
Normal file
BIN
ROOT_DLL/opusenc.dll
Normal file
Binary file not shown.
BIN
ROOT_DLL/toxmod.dll
Normal file
BIN
ROOT_DLL/toxmod.dll
Normal file
Binary file not shown.
9087
game/audio/ambience/ambientaudioentity.cpp
Normal file
9087
game/audio/ambience/ambientaudioentity.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1550
game/audio/ambience/water/audshorelineOcean.cpp
Normal file
1550
game/audio/ambience/water/audshorelineOcean.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1684
game/audio/ambience/water/audshorelineRiver.cpp
Normal file
1684
game/audio/ambience/water/audshorelineRiver.cpp
Normal file
File diff suppressed because it is too large
Load Diff
6146
game/audio/environment/environment.cpp
Normal file
6146
game/audio/environment/environment.cpp
Normal file
File diff suppressed because it is too large
Load Diff
5722
game/audio/northaudioengine.cpp
Normal file
5722
game/audio/northaudioengine.cpp
Normal file
File diff suppressed because it is too large
Load Diff
9766
game/audio/scriptaudioentity.cpp
Normal file
9766
game/audio/scriptaudioentity.cpp
Normal file
File diff suppressed because it is too large
Load Diff
3146
game/network/Shop/NetworkShopping.cpp
Normal file
3146
game/network/Shop/NetworkShopping.cpp
Normal file
File diff suppressed because it is too large
Load Diff
4703
game/scene/ExtraContent.cpp
Normal file
4703
game/scene/ExtraContent.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1804
game/shaders/ShaderLib.cpp
Normal file
1804
game/shaders/ShaderLib.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1603
game/system/FileMgr.cpp
Normal file
1603
game/system/FileMgr.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1151
game/text/TextFile.cpp
Normal file
1151
game/text/TextFile.cpp
Normal file
File diff suppressed because it is too large
Load Diff
85
rage/base/src/audioengine/enginedefs.h
Normal file
85
rage/base/src/audioengine/enginedefs.h
Normal file
@ -0,0 +1,85 @@
|
||||
//
|
||||
// audioengine/enginedefs.h
|
||||
//
|
||||
// Copyright (C) 1999-2006 Rockstar Games. All Rights Reserved.
|
||||
//
|
||||
|
||||
#ifndef AUD_ENGINE_DEFS_H
|
||||
#define AUD_ENGINE_DEFS_H
|
||||
|
||||
#define AUD_SUPPORT_RAVE_EDITING (__USEDEBUGAUDIO)
|
||||
|
||||
#if AUD_SUPPORT_RAVE_EDITING
|
||||
#define SUPPORT_RAVE_EDITING_ONLY(x) x
|
||||
#else
|
||||
#define SUPPORT_RAVE_EDITING_ONLY(x)
|
||||
#endif
|
||||
|
||||
#define AUD_DEBUG_SOUNDS (AUD_SUPPORT_RAVE_EDITING && !__SPU) // use the variance cache to store the extra debug info
|
||||
|
||||
namespace rage {
|
||||
|
||||
|
||||
// PURPOSE
|
||||
// Defines the maximum number of sound manager (global) variables
|
||||
static const u32 g_MaxSoundManagerVariables = 64;
|
||||
|
||||
static const u32 g_MaxAudEntityVariableBlocks = 256;
|
||||
|
||||
// PURPOSE
|
||||
// Defines the maximum number of effects that can be active at any one time
|
||||
static const u32 g_MaxManagedEffects = 24;
|
||||
|
||||
// 0xff denotes null so limit to 255 slots per bucket
|
||||
const u32 g_audMaxSoundSlotsPerBucket = 255;
|
||||
const u32 g_audMaxRequestedSettingsSlotsPerBucket = 96;
|
||||
// this is the maximum number of dynamic children that can be instantiated per frame per bucket
|
||||
const u32 g_audMaxChildSoundRequestsPerBucket = 64;
|
||||
// this is the maximum number of voices that can be used by any one sound bucket
|
||||
const u32 g_audMaxVoicesPerBucket = 96;
|
||||
|
||||
// The number of shadow sound pairings per bucket
|
||||
const u32 g_audMaxShadowSoundPairs = 64;
|
||||
|
||||
#if RSG_PC || RSG_ORBIS || RSG_DURANGO
|
||||
#define NUM_REQUEST_BUFFERS 4
|
||||
const u32 g_audRequestedSettingsBuffers = NUM_REQUEST_BUFFERS;
|
||||
#else
|
||||
const u32 g_audRequestedSettingsBuffers = 3;
|
||||
#endif
|
||||
|
||||
|
||||
const u32 g_NumAudioTimers = 7;
|
||||
|
||||
|
||||
|
||||
// PURPOSE
|
||||
// Variables are stored as name-value pairs
|
||||
struct variableNameValuePair
|
||||
{
|
||||
u32 hash;
|
||||
f32 value;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct audTimerState
|
||||
{
|
||||
audTimerState() : timeInMs(0), timeScale(1.f), isPaused(false), wasPausedLastFrame(false){}
|
||||
|
||||
u32 timeInMs;
|
||||
f32 timeScale;
|
||||
bool isPaused;
|
||||
bool wasPausedLastFrame;
|
||||
};
|
||||
|
||||
struct audEngineContext
|
||||
{
|
||||
u32 systemTimeMs;
|
||||
audTimerState timers[g_NumAudioTimers];
|
||||
};
|
||||
|
||||
|
||||
} // namespace rage
|
||||
|
||||
#endif // AUD_ENGINE_DEFS_H
|
667
rage/base/src/audioengine/entity.cpp
Normal file
667
rage/base/src/audioengine/entity.cpp
Normal file
@ -0,0 +1,667 @@
|
||||
//
|
||||
// audioengine/entity.cpp
|
||||
//
|
||||
// Copyright (C) 1999-2006 Rockstar Games. All Rights Reserved.
|
||||
//
|
||||
|
||||
#include "entity.h"
|
||||
|
||||
#include "controller.h"
|
||||
#include "widgets.h"
|
||||
#include "engine.h"
|
||||
|
||||
#include "audiohardware/channel.h"
|
||||
#include "audiohardware/driver.h"
|
||||
#include "audiohardware/debug.h"
|
||||
#include "profile/group.h"
|
||||
#include "profile/page.h"
|
||||
#include "system/param.h"
|
||||
|
||||
namespace rage {
|
||||
|
||||
CompileTimeAssert(AUD_INVALID_CONTROLLER_ENTITY_ID == 0xFFFF);
|
||||
#define AUDCONTROLLER_USER_PROFILER 0
|
||||
#if AUDCONTROLLER_USER_PROFILER
|
||||
PF_PAGE(AudioEntitiesTimingsPage, "RAGE audEntity Timings");
|
||||
PF_GROUP(AudioEntitiesTimings);
|
||||
PF_LINK(AudioEntitiesTimingsPage, AudioEntitiesTimings);
|
||||
PF_TIMER(SetInitialSoundParams, AudioEntitiesTimings);
|
||||
#endif
|
||||
|
||||
BANK_ONLY(bool g_WarnOnMissingSounds = false);
|
||||
|
||||
audMetadataRef g_NullSoundRef;
|
||||
|
||||
atRangeArray<audVariableBlock, g_MaxAudEntityVariableBlocks> audEntity::sm_EntityVariableBlocks;
|
||||
ALIGNAS(16) atRangeArray<float, g_MaxAudEntityVariableBlocks*audVariableBlock::kNumVariablesPerBlock> audEntity::sm_EntityVariableBlockValues ;
|
||||
u32 * audEntity::sm_EntityVariableBlockRefs = NULL;
|
||||
|
||||
audEntity::audBatchedSoundRequestList audEntity::sm_BatchedSoundRequests;
|
||||
audEntity::audDeletedEntityList audEntity::sm_DeletedEntities;
|
||||
audEntity::audDeletedTrackerList audEntity::sm_DeletedTrackers;
|
||||
|
||||
BANK_ONLY(bool audEntity::sm_PrintedFullBatchList = false);
|
||||
|
||||
void audEntity::InitClass()
|
||||
{
|
||||
sm_BatchedSoundRequests.Reset();
|
||||
sm_DeletedEntities.Reset();
|
||||
sm_EntityVariableBlockRefs = rage_new u32[g_MaxAudEntityVariableBlocks];
|
||||
InitializeVariableBlocks();
|
||||
}
|
||||
|
||||
void audEntity::ShutdownClass()
|
||||
{
|
||||
if(sm_EntityVariableBlockRefs)
|
||||
{
|
||||
delete[] sm_EntityVariableBlockRefs;
|
||||
sm_EntityVariableBlockRefs = NULL;
|
||||
}
|
||||
}
|
||||
#define AUD_ENABLE_BATCHING 1
|
||||
audEntity::audEntity() : m_ControllerEntityId(AUD_INVALID_CONTROLLER_ENTITY_ID)
|
||||
{
|
||||
m_EntityVariableBlock = -1;
|
||||
#if __DEV
|
||||
m_Name = NULL;
|
||||
m_IsADebugEntity = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
audEntity::~audEntity()
|
||||
{
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
void audEntity::Init()
|
||||
{
|
||||
if (!audDriver::GetConfig().IsAudioProcessingEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Assert(m_ControllerEntityId == AUD_INVALID_CONTROLLER_ENTITY_ID);
|
||||
|
||||
if (AssertVerify(audController::GetController()))
|
||||
{
|
||||
Assign(m_ControllerEntityId, audController::GetController()->RegisterEntity(this));
|
||||
|
||||
#if __BANK
|
||||
if(g_AudioEngine.GetRemoteDebug().IsDebugTypeActive(ENTITY_DEBUG))
|
||||
{
|
||||
g_AudioEngine.GetRemoteDebug().AddEntity(this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void audEntity::InitializeVariableBlocks()
|
||||
{
|
||||
sysMemZeroBytes<sizeof(sm_EntityVariableBlocks)>(&sm_EntityVariableBlocks);
|
||||
sysMemZeroBytes<sizeof(sm_EntityVariableBlockValues)>(&sm_EntityVariableBlockValues);
|
||||
sysMemZeroBytes<sizeof(u32)*g_MaxAudEntityVariableBlocks>(sm_EntityVariableBlockRefs);
|
||||
}
|
||||
|
||||
void audEntity::Shutdown()
|
||||
{
|
||||
#if __BANK
|
||||
if(g_AudioEngine.GetRemoteDebug().IsDebugTypeActive(ENTITY_DEBUG))
|
||||
{
|
||||
g_AudioEngine.GetRemoteDebug().RemoveEntity(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(m_ControllerEntityId != AUD_INVALID_CONTROLLER_ENTITY_ID)
|
||||
{
|
||||
AddToDeletedList();
|
||||
audController::GetController()->UnregisterEntity(this);
|
||||
m_ControllerEntityId = AUD_INVALID_CONTROLLER_ENTITY_ID;
|
||||
}
|
||||
|
||||
ReleaseVariableBlock();
|
||||
}
|
||||
|
||||
void audEntity::AddToDeletedList()
|
||||
{
|
||||
if(!sm_DeletedEntities.IsFull())
|
||||
{
|
||||
sm_DeletedEntities.Append() = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No space in the list, so process synchronously to ensure we dont leave any dangling batch requests
|
||||
for(audBatchedSoundRequestList::iterator iter = sm_BatchedSoundRequests.begin(); iter != sm_BatchedSoundRequests.end(); iter++)
|
||||
{
|
||||
if((*iter).entity == this)
|
||||
{
|
||||
(*iter).entity = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void audEntity::ReportTrackerDeletion(const audTracker *tracker)
|
||||
{
|
||||
if(!sm_DeletedTrackers.IsFull())
|
||||
{
|
||||
sm_DeletedTrackers.Append() = tracker;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No space in the list, so process synchronously to ensure we dont leave any dangling batch requests
|
||||
for(audBatchedSoundRequestList::iterator iter = sm_BatchedSoundRequests.begin(); iter != sm_BatchedSoundRequests.end(); iter++)
|
||||
{
|
||||
if((*iter).entity && (*iter).initParams.Tracker == tracker)
|
||||
{
|
||||
(*iter).entity = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool audEntity::AllocateEntityVariableBlock(const char * mapName)
|
||||
{
|
||||
return AllocateEntityVariableBlock(atStringHash(mapName));
|
||||
}
|
||||
|
||||
bool audEntity::AllocateEntityVariableBlock(u32 mapNameHash)
|
||||
{
|
||||
for(s16 i=0; i< g_MaxAudEntityVariableBlocks; i++)
|
||||
{
|
||||
if(!sm_EntityVariableBlockRefs[i])
|
||||
{
|
||||
//Found a free variable block
|
||||
sm_EntityVariableBlockRefs[i]++;
|
||||
m_EntityVariableBlock = i;
|
||||
GetVariableBlock()->Init(mapNameHash);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Assertf(false,"Run out of entity variable blocks, this will most likely be the cause of bugs like B* 2041782");
|
||||
m_EntityVariableBlock = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
void audEntity::SetEntityVariable(u32 nameHash, f32 value)
|
||||
{
|
||||
audVariableBlock* varBlock = GetVariableBlock();
|
||||
if(varBlock)
|
||||
{
|
||||
varBlock->SetVariable(nameHash, value);
|
||||
}
|
||||
}
|
||||
|
||||
f32 audEntity::GetEntityVariableValue(u32 nameHash)
|
||||
{
|
||||
audVariableBlock* varBlock = GetVariableBlock();
|
||||
if(varBlock)
|
||||
{
|
||||
const f32* var = varBlock->FindVariableAddress(nameHash);
|
||||
if(var)
|
||||
{
|
||||
return *var;
|
||||
}
|
||||
}
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
|
||||
void audEntity::StopAllSounds(bool allowRelease /* = true */)
|
||||
{
|
||||
if(m_ControllerEntityId != AUD_INVALID_CONTROLLER_ENTITY_ID)
|
||||
{
|
||||
audController::GetController()->StopAllSounds(this, allowRelease);
|
||||
}
|
||||
}
|
||||
|
||||
void audEntity::PreUpdateService(u32 UNUSED_PARAM(timeInMs))
|
||||
{
|
||||
}
|
||||
|
||||
void audEntity::PostUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
void audEntity::UpdateSound(audSound* UNUSED_PARAM(sound), audRequestedSettings *UNUSED_PARAM(reqSets), u32 UNUSED_PARAM(timeInMs))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void audEntity::CreateSound_LocalReference(const char *soundName, audSound **soundRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
CreateSound_LocalReference(atStringHash(soundName), soundRef, initParams);
|
||||
#if __BANK
|
||||
if(g_WarnOnMissingSounds && !*soundRef)
|
||||
{
|
||||
audWarningf("Missing sound %s", soundName);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void audEntity::CreateSound_LocalReference(const u32 soundHash, audSound **soundRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
// ignore requests for NULL_SOUND
|
||||
if (soundHash == g_NullSoundHash || m_ControllerEntityId==AUD_INVALID_CONTROLLER_ENTITY_ID || !soundRef)
|
||||
{
|
||||
if(soundRef)
|
||||
{
|
||||
*soundRef = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
audSoundInitParams tmpParams;
|
||||
const audSoundInitParams *actualParams = (initParams) ? initParams : &tmpParams;
|
||||
*soundRef = audController::GetController()->GetSoundInstance(soundHash, this, NULL, actualParams);
|
||||
|
||||
SetInitialSoundParams(soundRef, actualParams);
|
||||
}
|
||||
|
||||
void audEntity::CreateSound_LocalReference(const audMetadataRef soundMetadataRef, audSound **soundRef, const audSoundInitParams *initParams)
|
||||
{
|
||||
if (m_ControllerEntityId==AUD_INVALID_CONTROLLER_ENTITY_ID || !soundRef || !soundMetadataRef.IsValid())
|
||||
{
|
||||
if(soundRef)
|
||||
{
|
||||
*soundRef = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
audSoundInitParams tmpParams;
|
||||
const audSoundInitParams *actualParams = (initParams) ? initParams : &tmpParams;
|
||||
*soundRef = audController::GetController()->GetSoundInstance(soundMetadataRef, this, NULL, actualParams);
|
||||
|
||||
SetInitialSoundParams(soundRef, actualParams);
|
||||
}
|
||||
|
||||
void audEntity::CreateSound_PersistentReference(const audMetadataRef soundMetadataRef, audSound **soundRef, const audSoundInitParams *initParams)
|
||||
{
|
||||
audAssertf(m_ControllerEntityId!=AUD_INVALID_CONTROLLER_ENTITY_ID, "Trying to play a sound from an audio entity with no controller - need to call audEntity::Init()");
|
||||
audAssertf(!*soundRef, "Non-NULL ptr passed to CreateSound_PersistentReference. This is an ignorable assert (though it's likely that it will fire a few times in a row) and simply means that a pointer should have been set to NULL before calling this function, to ensure a valid reference isn't lost.");
|
||||
if (m_ControllerEntityId==AUD_INVALID_CONTROLLER_ENTITY_ID || !soundRef)
|
||||
{
|
||||
*soundRef = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
audSoundInitParams tmpParams;
|
||||
const audSoundInitParams *actualParams = (initParams) ? initParams : &tmpParams;
|
||||
audController::GetController()->GetPersistentSoundInstance(soundMetadataRef, this, soundRef, actualParams);
|
||||
|
||||
SetInitialSoundParams(soundRef, actualParams);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void audEntity::CreateSound_PersistentReference(const char *soundName, audSound **soundRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
CreateSound_PersistentReference(atStringHash(soundName), soundRef, initParams);
|
||||
#if __BANK
|
||||
if(g_WarnOnMissingSounds && !*soundRef)
|
||||
{
|
||||
audWarningf("Missing sound %s", soundName);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void audEntity::CreateSound_PersistentReference(const u32 soundHash, audSound **soundRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
audAssertf(m_ControllerEntityId!=AUD_INVALID_CONTROLLER_ENTITY_ID, "Trying to play a sound from an audio entity with no controller - need to call audEntity::Init()");
|
||||
audAssertf(!*soundRef, "Non-NULL ptr passed to CreateSound_PersistentReference. This is an ignorable assert (though it's likely that it will fire a few times in a row) and simply means that a pointer should have been set to NULL before calling this function, to ensure a valid reference isn't lost.");
|
||||
// ignore requests for null sound
|
||||
if (soundHash == g_NullSoundHash || m_ControllerEntityId==AUD_INVALID_CONTROLLER_ENTITY_ID || !soundRef)
|
||||
{
|
||||
*soundRef = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
audSoundInitParams tmpParams;
|
||||
const audSoundInitParams *actualParams = (initParams) ? initParams : &tmpParams;
|
||||
audController::GetController()->GetPersistentSoundInstance(soundHash, this, soundRef, actualParams);
|
||||
|
||||
SetInitialSoundParams(soundRef, actualParams);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool audEntity::CreateAndPlaySound(const char *soundName, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
const bool success = CreateAndPlaySound(atStringHash(soundName), initParams);
|
||||
#if __BANK
|
||||
if(g_WarnOnMissingSounds && !success)
|
||||
{
|
||||
audWarningf("Missing sound %s", soundName);
|
||||
}
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
bool audEntity::CreateAndPlaySound(const u32 soundHash, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
return CreateAndPlaySound(SOUNDFACTORY.GetMetadataManager().GetObjectMetadataRefFromHash(soundHash), initParams);
|
||||
}
|
||||
|
||||
bool audEntity::CreateAndPlaySound(const audMetadataRef metadataRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
#if __ASSERT
|
||||
if(initParams)
|
||||
{
|
||||
Assert(initParams->VolumeCurveScale != 0.f);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if AUD_ENABLE_BATCHING
|
||||
return AddBatchedSoundRequest(metadataRef, initParams);
|
||||
#else
|
||||
audSoundInitParams tmpParams;
|
||||
const audSoundInitParams *actualParams = (initParams) ? initParams : &tmpParams;
|
||||
|
||||
audSound *sound;
|
||||
CreateSound_LocalReference(metadataRef, &sound, actualParams);
|
||||
if (!sound)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
audSoundInitParams *nonConstParams = const_cast<audSoundInitParams*>(actualParams);
|
||||
sound->PrepareAndPlay(const_cast<audWaveSlot*>(actualParams->WaveSlot), nonConstParams->AllowLoad, nonConstParams->PrepareTimeLimit);
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool audEntity::AddBatchedSoundRequest(audMetadataRef soundMetadataRef, const audSoundInitParams *initParams)
|
||||
{
|
||||
#if __USEDEBUGAUDIO
|
||||
if(initParams)
|
||||
{
|
||||
if(initParams->EnvironmentGroup || initParams->Tracker)
|
||||
{
|
||||
g_Controller->GetThreadVerifier()->OnCreateSound(soundMetadataRef);
|
||||
}
|
||||
Assertf(initParams->Volume >= g_SilenceVolume*3.f, "Invalid requested volume: %f", initParams->Volume);
|
||||
Assertf(initParams->Volume <= 24.f,"Invalid requested volume: %f", initParams->Volume);
|
||||
}
|
||||
#endif // RSG_ASSERT
|
||||
|
||||
#if RSG_BANK
|
||||
if(audSoundManager::ShouldBreakOnCreate(soundMetadataRef, this))
|
||||
{
|
||||
audWarningf("Debug breaking on batched sound %s creation", this->GetName());
|
||||
__debugbreak();
|
||||
}
|
||||
|
||||
if(sm_BatchedSoundRequests.IsFull() && !sm_PrintedFullBatchList)
|
||||
{
|
||||
sm_PrintedFullBatchList = true;
|
||||
for(s32 i = 0; i < sm_BatchedSoundRequests.GetCount(); i++)
|
||||
{
|
||||
const char *soundName;
|
||||
audMetadataObjectInfo objInfo;
|
||||
if(g_AudioEngine.GetSoundManager().GetFactory().GetMetadataManager().GetObjectInfo(sm_BatchedSoundRequests[i].soundMetadataRef, objInfo))
|
||||
{
|
||||
soundName = objInfo.GetName_Debug();
|
||||
}
|
||||
else
|
||||
{
|
||||
soundName = "InvalidSoundRef";
|
||||
}
|
||||
|
||||
const char *entityName = "(no entity)";
|
||||
|
||||
const bool trackerHasBeenDeleted = (initParams->Tracker != NULL) && (sm_DeletedTrackers.Find(initParams->Tracker) != -1);
|
||||
const bool entityHasBeenDeleted = sm_BatchedSoundRequests[i].entity == NULL ||
|
||||
(sm_DeletedEntities.Find(sm_BatchedSoundRequests[i].entity) != -1) ||
|
||||
trackerHasBeenDeleted;
|
||||
|
||||
if(!entityHasBeenDeleted && sm_BatchedSoundRequests[i].entity)
|
||||
{
|
||||
entityName = sm_BatchedSoundRequests[i].entity->GetEntityName();
|
||||
}
|
||||
audWarningf("%d: %s (predelay: %d) / %s %p", i, soundName, sm_BatchedSoundRequests[i].initParams.Predelay, entityName, sm_BatchedSoundRequests[i].entity);
|
||||
}
|
||||
|
||||
audAssertf(!sm_BatchedSoundRequests.IsFull(), "BatchedSoundList is full");
|
||||
}
|
||||
#endif // RSG_BANK
|
||||
|
||||
if(soundMetadataRef != g_NullSoundRef && soundMetadataRef.IsValid() && !sm_BatchedSoundRequests.IsFull())
|
||||
{
|
||||
audBatchedSoundRequest &req = sm_BatchedSoundRequests.Append();
|
||||
req.entity = this;
|
||||
req.soundMetadataRef = soundMetadataRef;
|
||||
if(initParams)
|
||||
{
|
||||
audAssertf(initParams->Predelay < 10000, "Large predelay requested in AddBatchedSoundRequest: %u", initParams->Predelay);
|
||||
|
||||
req.initParams = *initParams;
|
||||
if(initParams->Tracker)
|
||||
{
|
||||
// Ensure we get a ReportTrackerDeletion call if the entity that owns this tracker is deleted
|
||||
initParams->Tracker->IncrementReferenceCount();
|
||||
}
|
||||
|
||||
// For environmentgroups that track the life of the sound (initialized with NULL audEntity)
|
||||
// we need to make sure that group isn't deleted between the batched sound request and when it's processed
|
||||
// so add a reference to the group here and then decrement it when it's processed
|
||||
if(initParams->EnvironmentGroup)
|
||||
{
|
||||
const_cast<audEnvironmentGroupInterface*>(initParams->EnvironmentGroup)->AddSoundReference();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
audSoundInitParams tempInitParams;
|
||||
req.initParams = tempInitParams;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void audEntity::ProcessBatchedSoundRequests(const s32 timeStepMs)
|
||||
{
|
||||
for(s32 i = sm_BatchedSoundRequests.GetCount() - 1; i >= 0; i--)
|
||||
{
|
||||
audBatchedSoundRequest &req = sm_BatchedSoundRequests[i];
|
||||
audSoundInitParams *initParams = &sm_BatchedSoundRequests[i].initParams;
|
||||
|
||||
const bool trackerHasBeenDeleted = (initParams->Tracker != NULL) && (sm_DeletedTrackers.Find(initParams->Tracker) != -1);
|
||||
const bool entityHasBeenDeleted = req.entity == NULL ||
|
||||
(sm_DeletedEntities.Find(req.entity) != -1) ||
|
||||
trackerHasBeenDeleted;
|
||||
if(!entityHasBeenDeleted)
|
||||
{
|
||||
if(initParams->Predelay > 100)
|
||||
{
|
||||
// Decrement the predelay but leave the request in the list
|
||||
initParams->Predelay -= Min(initParams->Predelay, timeStepMs);
|
||||
continue;
|
||||
}
|
||||
audSound *sound;
|
||||
req.entity->CreateSound_LocalReference(req.soundMetadataRef, &sound, initParams);
|
||||
if(sound)
|
||||
{
|
||||
// TODO: set a flag to assert if looping (have to wait until prepared)
|
||||
sound->PrepareAndPlay(const_cast<audWaveSlot*>(initParams->WaveSlot), initParams->AllowLoad, initParams->PrepareTimeLimit);
|
||||
}
|
||||
}
|
||||
|
||||
if(initParams->EnvironmentGroup)
|
||||
{
|
||||
// Decrement the envgroup reference we added when creating the batched sound request
|
||||
const_cast<audEnvironmentGroupInterface*>(initParams->EnvironmentGroup)->RemoveSoundReference();
|
||||
}
|
||||
|
||||
if(initParams->Tracker && !trackerHasBeenDeleted)
|
||||
{
|
||||
// Remove the extra reference we added to this tracker while it was sitting in the batched list
|
||||
initParams->Tracker->DecrementReferenceCount();
|
||||
}
|
||||
// remove this request from the list since we've either played it or it's entity has been deleted
|
||||
sm_BatchedSoundRequests.DeleteFast(i);
|
||||
}
|
||||
}
|
||||
|
||||
void audEntity::ResetDeletedObjectLists()
|
||||
{
|
||||
sm_DeletedEntities.Reset();
|
||||
sm_DeletedTrackers.Reset();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void audEntity::CreateAndPlaySound_Persistent(const char *soundName, audSound **soundRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
CreateAndPlaySound_Persistent(atStringHash(soundName), soundRef, initParams);
|
||||
#if __BANK
|
||||
if(g_WarnOnMissingSounds && !*soundRef)
|
||||
{
|
||||
audWarningf("Missing sound %s", soundName);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void audEntity::CreateAndPlaySound_Persistent(const u32 soundHash, audSound **soundRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
audSoundInitParams tmpParams;
|
||||
const audSoundInitParams *actualParams = (initParams) ? initParams : &tmpParams;
|
||||
|
||||
CreateSound_PersistentReference(soundHash, soundRef, actualParams);
|
||||
audSound* RESTRICT soundPtr = *soundRef;
|
||||
if (!soundPtr)
|
||||
{
|
||||
*soundRef = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
audSoundInitParams *NonConstParams = const_cast<audSoundInitParams*>(actualParams);
|
||||
soundPtr->PrepareAndPlay(const_cast<audWaveSlot*>(actualParams->WaveSlot), NonConstParams->AllowLoad, NonConstParams->PrepareTimeLimit);
|
||||
}
|
||||
|
||||
void audEntity::CreateAndPlaySound_Persistent(const audMetadataRef metadataRef, audSound **soundRef, const audSoundInitParams *initParams /* = NULL */)
|
||||
{
|
||||
audSoundInitParams tmpParams;
|
||||
const audSoundInitParams *actualParams = (initParams) ? initParams : &tmpParams;
|
||||
|
||||
CreateSound_PersistentReference(metadataRef, soundRef, actualParams);
|
||||
audSound* RESTRICT soundPtr = *soundRef;
|
||||
if (!soundPtr)
|
||||
{
|
||||
*soundRef = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
audSoundInitParams *NonConstParams = const_cast<audSoundInitParams*>(actualParams);
|
||||
soundPtr->PrepareAndPlay(const_cast<audWaveSlot*>(actualParams->WaveSlot), NonConstParams->AllowLoad, NonConstParams->PrepareTimeLimit);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void audEntity::SetInitialSoundParams(audSound **soundRef, const audSoundInitParams *initParams)
|
||||
{
|
||||
audSound* RESTRICT soundPtr = *soundRef;
|
||||
if (!soundPtr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
audRequestedSettings* RESTRICT pReqSets = soundPtr->GetRequestedSettings();
|
||||
TrapZ((size_t)pReqSets);
|
||||
|
||||
audAssertf(initParams->StartOffset >= 0, "Invalid start offset: %d", initParams->StartOffset);
|
||||
if(initParams->IsStartOffsetPercentage)
|
||||
{
|
||||
audAssertf(initParams->StartOffset >= 0 && initParams->StartOffset <= 100, "Invalid percentage start offset: %d", initParams->StartOffset);
|
||||
}
|
||||
pReqSets->SetUpdateEntity(initParams->UpdateEntity);
|
||||
pReqSets->SetVolume(initParams->Volume);
|
||||
pReqSets->SetVolumeCurveScale(initParams->VolumeCurveScale);
|
||||
pReqSets->SetPitch(initParams->Pitch);
|
||||
pReqSets->SetLowPassFilterCutoff(initParams->LPFCutoff);
|
||||
pReqSets->SetHighPassFilterCutoff(initParams->HPFCutoff);
|
||||
pReqSets->SetPan(initParams->Pan);
|
||||
pReqSets->SetAllowOrphaned(initParams->AllowOrphaned);
|
||||
pReqSets->SetVirtualisationScoreOffset(initParams->VirtualisationScoreOffset);
|
||||
pReqSets->SetSpeakerMask(initParams->SpeakerMask);
|
||||
soundPtr->SetStartOffset(initParams->StartOffset, initParams->IsStartOffsetPercentage);
|
||||
pReqSets->SetPosition(VECTOR3_TO_VEC3V(initParams->Position));
|
||||
pReqSets->SetPostSubmixVolumeAttenuation(initParams->PostSubmixAttenuation);
|
||||
|
||||
for(u32 i = 0; i < audSoundInitParams::kMaxInitParamVariables; i++)
|
||||
{
|
||||
if(initParams->Variables[i].nameHash != 0)
|
||||
{
|
||||
soundPtr->FindAndSetVariableValue(initParams->Variables[i].nameHash, initParams->Variables[i].value);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Don't do anything with occlusion groups, as these are now set in audSound::Init(), and will assert due to reference counting if ever done again
|
||||
// Now set occlusion groups from here, so that they're only set if the sound was successfully Init'd
|
||||
pReqSets->SetEnvironmentGroup(const_cast<audEnvironmentGroupInterface*>(initParams->EnvironmentGroup));
|
||||
pReqSets->SetClientVariable(initParams->u32ClientVar);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void audEntity::StopAndForgetSoundsPrivate(audSound* sound1, audSound* sound2, audSound* sound3, audSound* sound4,
|
||||
audSound* sound5, audSound* sound6, audSound* sound7, audSound* sound8,
|
||||
audSound* sound9, audSound* sound10, audSound* sound11, audSound* sound12, bool continueUpdatingEntity)
|
||||
{
|
||||
if (sound1)
|
||||
{
|
||||
sound1->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound2)
|
||||
{
|
||||
sound2->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound3)
|
||||
{
|
||||
sound3->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound4)
|
||||
{
|
||||
sound4->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound5)
|
||||
{
|
||||
sound5->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound6)
|
||||
{
|
||||
sound6->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound7)
|
||||
{
|
||||
sound7->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound8)
|
||||
{
|
||||
sound8->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound9)
|
||||
{
|
||||
sound9->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound10)
|
||||
{
|
||||
sound10->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound11)
|
||||
{
|
||||
sound11->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
if (sound12)
|
||||
{
|
||||
sound12->StopAndForget(continueUpdatingEntity);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace rage
|
2053
rage/base/src/audioengine/metadatamanager.cpp
Normal file
2053
rage/base/src/audioengine/metadatamanager.cpp
Normal file
File diff suppressed because it is too large
Load Diff
812
rage/base/src/audioengine/soundfactory.cpp
Normal file
812
rage/base/src/audioengine/soundfactory.cpp
Normal file
@ -0,0 +1,812 @@
|
||||
//
|
||||
// audioengine/soundfactory.cpp
|
||||
//
|
||||
// Copyright (C) 1999-2006 Rockstar Games. All Rights Reserved.
|
||||
//
|
||||
#include "engine.h"
|
||||
#include "remotecontrol.h"
|
||||
#include "soundfactory.h"
|
||||
#include "metadatamanager.h"
|
||||
|
||||
#include "audiosoundtypes/sound.h"
|
||||
#include "audiosoundtypes/soundclassfactory.h"
|
||||
|
||||
#include "diag/output.h"
|
||||
#include "profile/element.h"
|
||||
#include "profile/group.h"
|
||||
#include "profile/page.h"
|
||||
#include "system/memory.h"
|
||||
#include "system/param.h"
|
||||
#include "system/timemgr.h"
|
||||
|
||||
namespace rage {
|
||||
|
||||
#if !__SPU
|
||||
|
||||
PF_PAGE(SoundFactoryTimingPage,"SoundFactory Timing");
|
||||
PF_GROUP(SoundFactoryTiming);
|
||||
PF_LINK(SoundFactoryTimingPage, SoundFactoryTiming);
|
||||
PF_TIMER(BucketLockTime, SoundFactoryTiming);
|
||||
|
||||
PARAM(printlargesounds, "[RAGE Audio] warn when playing large sound hierarchies");
|
||||
PARAM(fakesoundschema, "[RAGE Audio] fake the sound schema version");
|
||||
#if __BANK
|
||||
PARAM(loadtestsounds, "Load test_sounds.dat");
|
||||
|
||||
u32 audSoundFactory::sm_NumParentSoundsCreated = 0;
|
||||
u32 audSoundFactory::sm_NumSoundsCreated = 0;
|
||||
atRangeArray<audSoundFactory::BucketSoundCount, 32> audSoundFactory::sm_BucketSoundCount;
|
||||
#endif
|
||||
|
||||
|
||||
audSoundFactory::audSoundFactory()
|
||||
{
|
||||
#if __BANK
|
||||
m_HadAuditionStop = m_HadAuditionStart = false;
|
||||
m_AuditionStopSoundHash = m_AuditionStartSoundHash = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
audSoundFactory::~audSoundFactory()
|
||||
{
|
||||
}
|
||||
|
||||
audSound *audSoundFactory::GetInstance(const u32 soundNameHash, const audSoundInternalInitParams* initParams, audSoundScratchInitParams *scratchInitParams, audSoundParentInitParams *parentInitParams)
|
||||
{
|
||||
void *pMetadata = m_MetadataMgr.GetObjectMetadataPtr(soundNameHash);
|
||||
return GetInstanceFromMetadata(pMetadata, NULL, initParams, scratchInitParams, parentInitParams, true);
|
||||
}
|
||||
|
||||
audSound *audSoundFactory::GetInstance(const audMetadataRef soundRef, const audSoundInternalInitParams* initParams, audSoundScratchInitParams *scratchInitParams, audSoundParentInitParams *parentInitParams)
|
||||
{
|
||||
void *pMetadata = m_MetadataMgr.GetObjectMetadataPtr(soundRef);
|
||||
return GetInstanceFromMetadata(pMetadata, NULL, initParams, scratchInitParams, parentInitParams, true);
|
||||
}
|
||||
|
||||
audSound *audSoundFactory::GetChildInstance(const audMetadataRef metadataOffset, audSound *parent, const audSoundInternalInitParams* initParams, audSoundScratchInitParams *scratchInitParams, bool lockBucket)
|
||||
{
|
||||
void *pMetadata = m_MetadataMgr.GetObjectMetadataPtr(metadataOffset);
|
||||
return GetInstanceFromMetadata(pMetadata, parent, initParams, scratchInitParams, NULL, lockBucket);
|
||||
}
|
||||
|
||||
audSound *audSoundFactory::GetChildInstance(u32 soundNameHash, audSound *parent, const audSoundInternalInitParams* initParams, audSoundScratchInitParams *scratchInitParams, bool lockBucket)
|
||||
{
|
||||
void *pMetadata = m_MetadataMgr.GetObjectMetadataPtr(soundNameHash);
|
||||
return GetInstanceFromMetadata(pMetadata, parent, initParams, scratchInitParams, NULL, lockBucket);
|
||||
}
|
||||
|
||||
audSound *audSoundFactory::GetInstanceFromMetadata(const void *metadata, audSound *parent, const audSoundInternalInitParams* initParams, audSoundScratchInitParams *scratchInitParams, audSoundParentInitParams *parentInitParams, bool lockBucket)
|
||||
{
|
||||
audSound *pSound = NULL;
|
||||
if(!metadata)
|
||||
return pSound;
|
||||
|
||||
u32 classID = *((u8*)metadata);
|
||||
|
||||
// no longer need to lock this bucket for the entire Init process if we're locking on SPU
|
||||
#if !AUD_SOUNDPOOL_LOCK_ON_SPU || 1
|
||||
if (lockBucket)
|
||||
{
|
||||
PF_FUNC(BucketLockTime);
|
||||
audSound::GetStaticPool().LockBucket(initParams->BucketId);
|
||||
}
|
||||
#endif
|
||||
|
||||
pSound = gSoundClassFactory(initParams->BucketId, classID);
|
||||
|
||||
if(pSound)
|
||||
{
|
||||
BANK_ONLY(sm_NumSoundsCreated++);
|
||||
|
||||
#if AUD_DEBUG_SOUNDS
|
||||
pSound->SetIsInitialising(true);
|
||||
#endif // AUD_DEBUG_SOUNDS
|
||||
|
||||
audAssertf((parent?parent->GetMetadata() != (Sound*)metadata:true), "Attempted to instantiate a self-referencing sound: %s", "(unknown)");
|
||||
|
||||
if(parent)
|
||||
{
|
||||
// need to setparent before Init()
|
||||
pSound->SetParent(initParams->BucketId, parent);
|
||||
|
||||
BANK_ONLY(sm_BucketSoundCount[initParams->BucketId].NumSoundsCreatedInHierarchy++);
|
||||
BANK_ONLY(sm_BucketSoundCount[initParams->BucketId].PeakSoundSlotsForHierarchy = Max(sm_BucketSoundCount[initParams->BucketId].PeakSoundSlotsForHierarchy, sm_BucketSoundCount[initParams->BucketId].NumSoundSlotsFreeForHierarchy - Min<u32>(sm_BucketSoundCount[initParams->BucketId].NumSoundSlotsFreeForHierarchy,audSound::GetStaticPool().GetBucket(initParams->BucketId)->numSoundSlotsFree)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert(parentInitParams);
|
||||
pSound->InitAsParent(parentInitParams);
|
||||
BANK_ONLY(sm_NumParentSoundsCreated++);
|
||||
BANK_ONLY(sm_BucketSoundCount[initParams->BucketId].NumSoundsCreatedInHierarchy = 1);
|
||||
BANK_ONLY(sm_BucketSoundCount[initParams->BucketId].NumSoundSlotsFreeForHierarchy = audSound::GetStaticPool().GetBucket(initParams->BucketId)->numSoundSlotsFree);
|
||||
BANK_ONLY(sm_BucketSoundCount[initParams->BucketId].PeakSoundSlotsForHierarchy = 1);
|
||||
}
|
||||
|
||||
// If we fail to prepare because the effect route is invalid, *don't* delete the sound.
|
||||
// We want to act as though it initalized/prepared correctly so that the rest of the sound hierarchy is allowed to play out
|
||||
if(!pSound->Init(metadata, initParams, scratchInitParams) && pSound->IsEffectRouteValid())
|
||||
{
|
||||
delete pSound;
|
||||
pSound = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if AUD_DEBUG_SOUNDS
|
||||
pSound->SetIsInitialising(false);
|
||||
#endif
|
||||
pSound->SetIsInitialised();
|
||||
if(!parent)
|
||||
{
|
||||
pSound->PostInitAsParent(parentInitParams);
|
||||
audSound::GetStaticPool().MarkSoundSlotAsParent(initParams->BucketId, audSound::GetStaticPool().GetSoundSlotIndex(initParams->BucketId, pSound));
|
||||
|
||||
#if __USEDEBUGAUDIO
|
||||
const u32 slotsUsed = sm_BucketSoundCount[initParams->BucketId].PeakSoundSlotsForHierarchy;
|
||||
if(initParams->IsAuditioning || (PARAM_printlargesounds.Get() && (sm_BucketSoundCount[initParams->BucketId].NumSoundsCreatedInHierarchy > 40 || slotsUsed > 40)))
|
||||
{
|
||||
const Sound *soundData = reinterpret_cast<const Sound*>(metadata);
|
||||
const char *soundName = m_MetadataMgr.GetObjectNameFromNameTableOffset(soundData->NameTableOffset);
|
||||
audWarningf("Sound hierarchy %s created %u sounds (%u sound slots)", soundName, sm_BucketSoundCount[initParams->BucketId].NumSoundsCreatedInHierarchy, slotsUsed);
|
||||
}
|
||||
#endif // __BANK
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#if __USEDEBUGAUDIO
|
||||
if(m_MetadataMgr.IsRAVEConnected())
|
||||
{
|
||||
if(audSound::GetStaticPool().GetBucket(initParams->BucketId)->numSoundSlotsFree == 0)
|
||||
{
|
||||
const Sound *soundData = reinterpret_cast<const Sound*>(metadata);
|
||||
const char *soundName = m_MetadataMgr.GetObjectNameFromNameTableOffset(soundData->NameTableOffset);
|
||||
audWarningf("Failed to create sound %s (type id %u) - no space in the bucket", soundName, classID);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if !AUD_SOUNDPOOL_LOCK_ON_SPU || 1
|
||||
if (lockBucket)
|
||||
audSound::GetStaticPool().UnlockBucket(initParams->BucketId);
|
||||
#endif
|
||||
return pSound;
|
||||
}
|
||||
|
||||
audEnvironmentSound *audSoundFactory::GetEnvironmentSound(audSound *parent, const audSoundInternalInitParams *initParams, audSoundScratchInitParams *scratchInitParams) const
|
||||
{
|
||||
audEnvironmentSound *sound = (audEnvironmentSound*)audSound::GetStaticPool().AllocateSoundSlot(sizeof(audEnvironmentSound), initParams->BucketId);
|
||||
if(sound)
|
||||
{
|
||||
::new(sound) audEnvironmentSound();
|
||||
sound->SetParent(initParams->BucketId, parent);
|
||||
#if AUD_DEBUG_SOUNDS
|
||||
sound->SetIsInitialising(true);
|
||||
#endif
|
||||
if(!sound->Init(NULL, initParams, scratchInitParams))
|
||||
{
|
||||
delete sound;
|
||||
return NULL;
|
||||
}
|
||||
#if AUD_DEBUG_SOUNDS
|
||||
sound->SetIsInitialising(false);
|
||||
#endif
|
||||
sound->SetIsInitialised();
|
||||
}
|
||||
return sound;
|
||||
}
|
||||
|
||||
const Sound *audSoundFactory::GetMetadataPtr(const u32 nameHash) const
|
||||
{
|
||||
return GetMetadataPtr(GetMetadataManager().GetObjectMetadataRefFromHash(nameHash));
|
||||
}
|
||||
|
||||
const Sound *audSoundFactory::GetMetadataPtr(const audMetadataRef metadataRef) const
|
||||
{
|
||||
Sound *ret = (Sound*)GetMetadataManager().GetObjectMetadataPtr(metadataRef);
|
||||
if(ret)
|
||||
{
|
||||
if(audVerifyf(ret->ClassId != Sound::TYPE_ID &&
|
||||
gSoundsIsOfType(ret->ClassId, Sound::TYPE_ID), "Trying to request invalid sound metadata, got type %u (name %s)", ret->ClassId, GetMetadataManager().GetObjectName(metadataRef)))
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void audSoundFactory::ProcessHierarchy(const u32 soundNameHash, audSoundProcessHierarchyFn& fn) const
|
||||
{
|
||||
audMetadataRef metadataRef = GetMetadataManager().GetObjectMetadataRefFromHash(soundNameHash);
|
||||
if(metadataRef.IsValid())
|
||||
{
|
||||
ProcessHierarchy(metadataRef, fn);
|
||||
}
|
||||
}
|
||||
|
||||
void audSoundFactory::ProcessHierarchy(audMetadataRef metadataRef, audSoundProcessHierarchyFn& fn) const
|
||||
{
|
||||
const Sound* soundMetadataCompressed = GetMetadataPtr(metadataRef);
|
||||
|
||||
if(soundMetadataCompressed)
|
||||
{
|
||||
Sound uncompressedMetadata;
|
||||
const void* actualSoundMetadata = audSound::DecompressMetadata_Untyped(soundMetadataCompressed, uncompressedMetadata);
|
||||
|
||||
audAssertf(soundMetadataCompressed->ClassId <= AUD_NUM_SOUNDDEFS, "Unrecognised sound type (ID %d) encountered when parsing sound hierarchy", soundMetadataCompressed->ClassId);
|
||||
fn(soundMetadataCompressed->ClassId, actualSoundMetadata);
|
||||
|
||||
if(actualSoundMetadata)
|
||||
{
|
||||
switch(soundMetadataCompressed->ClassId)
|
||||
{
|
||||
case SimpleSound::TYPE_ID:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case LoopingSound::TYPE_ID:
|
||||
{
|
||||
const LoopingSound * sound = reinterpret_cast<const LoopingSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case EnvelopeSound::TYPE_ID:
|
||||
{
|
||||
const EnvelopeSound * sound = reinterpret_cast<const EnvelopeSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case TwinLoopSound::TYPE_ID:
|
||||
{
|
||||
const TwinLoopSound * sound = reinterpret_cast<const TwinLoopSound*>(actualSoundMetadata);
|
||||
|
||||
for(u32 loop = 0; loop < sound->numSoundRefs; loop++)
|
||||
{
|
||||
ProcessHierarchy(sound->SoundRef[loop].SoundId, fn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SpeechSound::TYPE_ID:
|
||||
break;
|
||||
|
||||
case OnStopSound::TYPE_ID:
|
||||
{
|
||||
const OnStopSound * sound = reinterpret_cast<const OnStopSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->ChildSoundRef, fn);
|
||||
ProcessHierarchy(sound->FinishedSoundRef, fn);
|
||||
ProcessHierarchy(sound->StopSoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case WrapperSound::TYPE_ID:
|
||||
{
|
||||
const WrapperSound * sound = reinterpret_cast<const WrapperSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case SequentialSound::TYPE_ID:
|
||||
{
|
||||
const SequentialSound * sound = reinterpret_cast<const SequentialSound*>(actualSoundMetadata);
|
||||
|
||||
for(u32 loop = 0; loop < sound->numSoundRefs; loop++)
|
||||
{
|
||||
ProcessHierarchy(sound->SoundRef[loop].SoundId, fn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case StreamingSound::TYPE_ID:
|
||||
{
|
||||
const StreamingSound * sound = reinterpret_cast<const StreamingSound*>(actualSoundMetadata);
|
||||
|
||||
for(u32 loop = 0; loop < sound->numSoundRefs; loop++)
|
||||
{
|
||||
ProcessHierarchy(sound->SoundRef[loop].SoundId, fn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RetriggeredOverlappedSound::TYPE_ID:
|
||||
{
|
||||
const RetriggeredOverlappedSound * sound = reinterpret_cast<const RetriggeredOverlappedSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
ProcessHierarchy(sound->StartSound, fn);
|
||||
ProcessHierarchy(sound->StopSound, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case CrossfadeSound::TYPE_ID:
|
||||
{
|
||||
const CrossfadeSound * sound = reinterpret_cast<const CrossfadeSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->FarSoundRef, fn);
|
||||
ProcessHierarchy(sound->NearSoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case CollapsingStereoSound::TYPE_ID:
|
||||
{
|
||||
const CollapsingStereoSound * sound = reinterpret_cast<const CollapsingStereoSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->LeftSoundRef, fn);
|
||||
ProcessHierarchy(sound->RightSoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case MultitrackSound::TYPE_ID:
|
||||
{
|
||||
const MultitrackSound * sound = reinterpret_cast<const MultitrackSound*>(actualSoundMetadata);
|
||||
|
||||
for(u32 loop = 0; loop < sound->numSoundRefs; loop++)
|
||||
{
|
||||
ProcessHierarchy(sound->SoundRef[loop].SoundId, fn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RandomizedSound::TYPE_ID:
|
||||
{
|
||||
const RandomizedSound * sound = reinterpret_cast<const RandomizedSound*>(actualSoundMetadata);
|
||||
|
||||
// variations are after variable length history array
|
||||
u8 *p = (u8*)&sound->HistorySpace[sound->numHistorySpaceElems];
|
||||
u8 size = *p;
|
||||
p++;
|
||||
RandomizedSound::tVariations* variations = (RandomizedSound::tVariations*)p;
|
||||
|
||||
for(u32 loop = 0; loop < size; loop++)
|
||||
{
|
||||
ProcessHierarchy(variations[loop].Variation, fn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case EnvironmentSound::TYPE_ID:
|
||||
break;
|
||||
|
||||
case DynamicEntitySound::TYPE_ID:
|
||||
break;
|
||||
|
||||
case SequentialOverlapSound::TYPE_ID:
|
||||
{
|
||||
const SequentialOverlapSound * sound = reinterpret_cast<const SequentialOverlapSound*>(actualSoundMetadata);
|
||||
|
||||
for(u32 loop = 0; loop < sound->numChildSounds; loop++)
|
||||
{
|
||||
ProcessHierarchy(sound->ChildSound[loop].SoundRef, fn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ModularSynthSound::TYPE_ID:
|
||||
{
|
||||
const ModularSynthSound * sound = reinterpret_cast<const ModularSynthSound*>(actualSoundMetadata);
|
||||
|
||||
for(u32 loop = 0; loop < sound->numEnvironmentSounds; loop++)
|
||||
{
|
||||
ProcessHierarchy(sound->EnvironmentSound[loop].SoundRef, fn);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case GranularSound::TYPE_ID:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case DirectionalSound::TYPE_ID:
|
||||
{
|
||||
const DirectionalSound *sound = reinterpret_cast<const DirectionalSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
break;
|
||||
}
|
||||
|
||||
case SwitchSound::TYPE_ID:
|
||||
{
|
||||
const SwitchSound *sound = reinterpret_cast<const SwitchSound*>(actualSoundMetadata);
|
||||
|
||||
for(u32 loop = 0; loop < sound->numSoundRefs; loop++)
|
||||
{
|
||||
ProcessHierarchy(sound->SoundRef[loop].SoundId, fn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VariableCurveSound::TYPE_ID:
|
||||
{
|
||||
const VariableCurveSound *sound = reinterpret_cast<const VariableCurveSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
break;
|
||||
}
|
||||
|
||||
case VariablePrintValueSound::TYPE_ID:
|
||||
break;
|
||||
|
||||
case VariableBlockSound::TYPE_ID:
|
||||
{
|
||||
const VariableBlockSound *sound = reinterpret_cast<const VariableBlockSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case IfSound::TYPE_ID:
|
||||
{
|
||||
const IfSound *sound = reinterpret_cast<const IfSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->TrueSoundRef, fn);
|
||||
ProcessHierarchy(sound->FalseSoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case MathOperationSound::TYPE_ID:
|
||||
{
|
||||
const MathOperationSound *sound = reinterpret_cast<const MathOperationSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case FluctuatorSound::TYPE_ID:
|
||||
{
|
||||
const FluctuatorSound * sound = reinterpret_cast<const FluctuatorSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case ParameterTransformSound::TYPE_ID:
|
||||
{
|
||||
const ParameterTransformSound * sound = reinterpret_cast<const ParameterTransformSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
case AutomationSound::TYPE_ID:
|
||||
{
|
||||
const AutomationSound * sound = reinterpret_cast<const AutomationSound*>(actualSoundMetadata);
|
||||
ProcessHierarchy(sound->SoundRef, fn);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
// If we hit this assert then a new sound has been created - just need to add an appropriate case label above to support it
|
||||
audAssertf(false, "Unhandled sound type (ID %d) encountered when parsing sound hierarchy", soundMetadataCompressed->ClassId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool audSoundFactory::Init()
|
||||
{
|
||||
RAGE_TRACK(audSoundFactory_Init);
|
||||
const char *metadataFileName = g_AudioEngine.GetConfig().GetSoundMetadata();
|
||||
|
||||
audDisplayf("sizeof(audSound): %" SIZETFMT "u", sizeof(audSound));
|
||||
audDisplayf("largest sound size: %u", gSoundClassFactoryMaxSize());
|
||||
|
||||
s32 schemaVersion = SOUNDDEFS_SCHEMA_VERSION;
|
||||
|
||||
#if __BANK
|
||||
if(PARAM_fakesoundschema.Get(schemaVersion))
|
||||
{
|
||||
audWarningf("Faking sound schema version: using %d rather than %d", schemaVersion, SOUNDDEFS_SCHEMA_VERSION);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool ret;
|
||||
|
||||
#if __BANK && ENABLE_DEBUG_HEAP
|
||||
// When using RAVE for sound data we turn off compression, which costs around 1.8MB with the current set.
|
||||
// This is enough to cause problems for the game, so allocate sound data from DEBUG memory in this case.
|
||||
if(g_sysHasDebugHeap && g_AudioEngine.GetRemoteControl().IsPresent() &&
|
||||
g_AudioEngine.GetRemoteControl().ShouldUseRAVEForMetadataType(ATSTRINGHASH("SOUNDS", 0x94FA081B)))
|
||||
{
|
||||
audDisplayf("Allocating uncompressed sound data from debug memory");
|
||||
RAGE_TRACK(audSoundFactory_Debug);
|
||||
USE_DEBUG_MEMORY();
|
||||
ret = m_MetadataMgr.Init("Sounds", metadataFileName, audMetadataManager::External_NameTable_BankOnly, schemaVersion, schemaVersion >= 51);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if __BANK && ENABLE_DEBUG_HEAP
|
||||
audDisplayf("Using regular memory for sound data: %d, %d", g_sysHasDebugHeap, g_AudioEngine.GetRemoteControl().ShouldUseRAVEForMetadataType(ATSTRINGHASH("SOUNDS", 0x94FA081B)));
|
||||
#endif
|
||||
|
||||
ret = m_MetadataMgr.Init("Sounds", metadataFileName, audMetadataManager::External_NameTable_BankOnly, schemaVersion, schemaVersion >= 51);
|
||||
}
|
||||
|
||||
m_MetadataMgr.SetObjectModifiedCallback(this);
|
||||
|
||||
#if __BANK
|
||||
if(PARAM_loadtestsounds.Get())
|
||||
{
|
||||
LoadMetadataChunk("TEST", "audio:/config/test_sounds.dat");
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void audSoundFactory::Shutdown()
|
||||
{
|
||||
m_MetadataMgr.Shutdown();
|
||||
}
|
||||
|
||||
const char *audSoundFactory::GetBankNameFromIndex(const u32 bankNameIndex) const
|
||||
{
|
||||
const u32* remappedBank = m_BankRemappings.Access(bankNameIndex);
|
||||
return m_MetadataMgr.GetStringFromTableIndex(remappedBank ? *remappedBank : bankNameIndex);
|
||||
}
|
||||
|
||||
u32 audSoundFactory::GetBankIndexFromName(const char *bankName) const
|
||||
{
|
||||
const u32 bankId = m_MetadataMgr.GetStringIdFromName(bankName);
|
||||
const u32* remappedBank = m_BankRemappings.Access(bankId);
|
||||
return remappedBank ? *remappedBank : bankId;
|
||||
}
|
||||
|
||||
u32 audSoundFactory::GetBankIndexFromName(const u32 bankNameHash) const
|
||||
{
|
||||
const u32 bankId = m_MetadataMgr.GetStringIdFromHash(bankNameHash);
|
||||
const u32* remappedBank = m_BankRemappings.Access(bankId);
|
||||
return remappedBank ? *remappedBank : bankId;
|
||||
}
|
||||
|
||||
u32 audSoundFactory::GetBankIndexFromMetadataRef(const u32 ref) const
|
||||
{
|
||||
const u32 bankId = m_MetadataMgr.GetStringTableIndexFromMetadataRef(ref);
|
||||
const u32* remappedBank = m_BankRemappings.Access(bankId);
|
||||
return remappedBank ? *remappedBank : bankId;
|
||||
}
|
||||
|
||||
void audSoundFactory::AddBankRemapping(u32 originalBankNameHash, u32 newBankNameHash)
|
||||
{
|
||||
// Go directly via the metadatamanger so we don't use the remapping table!
|
||||
u32 originalBankId = m_MetadataMgr.GetStringIdFromHash(originalBankNameHash);
|
||||
u32 newBankId = m_MetadataMgr.GetStringIdFromHash(newBankNameHash);
|
||||
|
||||
if(audVerifyf(originalBankId != AUD_INVALID_BANK_ID && newBankId != AUD_INVALID_BANK_ID, "Invalid original bank ID used in bank remapping (%d -> %d)", originalBankId, newBankId))
|
||||
{
|
||||
u32* existingRemapping = m_BankRemappings.Access(originalBankId);
|
||||
|
||||
if(!existingRemapping)
|
||||
{
|
||||
audDisplayf("Adding bank mapping from %s (%d) to %s (%d)", m_MetadataMgr.GetStringFromTableIndex(originalBankId), originalBankId, m_MetadataMgr.GetStringFromTableIndex(newBankId), newBankId);
|
||||
m_BankRemappings.Insert(originalBankId, newBankId);
|
||||
}
|
||||
else if(*existingRemapping != newBankId)
|
||||
{
|
||||
audDisplayf("Modifying bank mapping from %s (%d) to %s (%d) (was %s (%d)", m_MetadataMgr.GetStringFromTableIndex(originalBankId), originalBankId, m_MetadataMgr.GetStringFromTableIndex(newBankId), newBankId, m_MetadataMgr.GetStringFromTableIndex(*existingRemapping), *existingRemapping);
|
||||
*existingRemapping = newBankId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void audSoundFactory::RemoveBankRemapping(u32 originalBankNameHash)
|
||||
{
|
||||
// Go directly via the metadatamanger so we don't use the remapping table!
|
||||
u32 originalBankId = m_MetadataMgr.GetStringIdFromHash(originalBankNameHash);
|
||||
|
||||
if(m_BankRemappings.Delete(originalBankId))
|
||||
{
|
||||
audDisplayf("Removing bank remapping for %s (%d)", m_MetadataMgr.GetStringFromTableIndex(originalBankId), originalBankId);
|
||||
}
|
||||
}
|
||||
|
||||
u32 audSoundFactory::GetMaxSoundTypeSize()
|
||||
{
|
||||
return Max(gSoundClassFactoryMaxSize(), u32(sizeof(audMathOp)*MathOperationSound::MAX_OPERATIONS));
|
||||
}
|
||||
|
||||
#if __BANK && 0
|
||||
void audSoundFactory::OnObjectAuditionStart(const u32 soundNameHash)
|
||||
{
|
||||
audMetadataObjectInfo info;
|
||||
if(m_MetadataMgr.GetObjectInfo(soundNameHash, info))
|
||||
{
|
||||
if(gSoundsIsOfType(info.GetType(), Sound::TYPE_ID))
|
||||
{
|
||||
g_AudioEngine.GetRemoteControl().TriggerSound(soundNameHash);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
audWarningf("RAVE Auditioning: Failed to find sound with hash %u", soundNameHash);
|
||||
}
|
||||
}
|
||||
|
||||
void audSoundFactory::OnObjectAuditionStop(const u32 UNUSED_PARAM(soundNameHash))
|
||||
{
|
||||
g_AudioEngine.GetRemoteControl().StopSound();
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *audSoundFactory::GetTypeName(const u32 typeId) const
|
||||
{
|
||||
return gSoundClassFactoryGetTypeName(typeId);
|
||||
}
|
||||
#endif //!__SPU
|
||||
|
||||
|
||||
#if __SPU
|
||||
#define PPU_ONLY_SOUND_FN(soundType, typeFn) NULL
|
||||
#else
|
||||
#define PPU_ONLY_SOUND_FN(soundType, typeFn) &soundType::typeFn
|
||||
#endif
|
||||
|
||||
|
||||
#if !AUD_SOUND_USE_VIRTUALS
|
||||
|
||||
#define SOUND_FUNC_LIST(fnName,typeFn) \
|
||||
(Sound ## fnName ## Function)&audLoopingSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audEnvelopeSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audTwinLoopSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audSpeechSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audOnStopSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audWrapperSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audSequentialSound::typeFn, \
|
||||
(Sound ## fnName ## Function)PPU_ONLY_SOUND_FN(audStreamingSound, typeFn), \
|
||||
(Sound ## fnName ## Function)&audRetriggeredOverlappedSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audCrossfadeSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audCollapsingStereoSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audSimpleSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audMultitrackSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audRandomizedSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audEnvironmentSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audDynamicEntitySound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audSequentialOverlapSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audModularSynthSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audGranularSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audDirectionalSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audKineticSound::typeFn, \
|
||||
(Sound ## fnName ## Function)&audSwitchSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audVariableCurveSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audVariablePrintValueSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audVariableBlockSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audIfSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audMathOperationSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audParameterTransformSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audFluctuatorSound::typeFn,\
|
||||
(Sound ## fnName ## Function)&audAutomationSound::typeFn, \
|
||||
(Sound ## fnName ## Function)PPU_ONLY_SOUND_FN(audExternalStreamSound, typeFn)
|
||||
|
||||
#if __SPU
|
||||
#define AUD_SPU_REL __attribute__((__section__(".data.rel.ro")))
|
||||
#else
|
||||
#define AUD_SPU_REL
|
||||
#endif
|
||||
#define SOUND_FUNC_TABLE(fn, typeFn) Sound ## fn ## Function audSound::sm_SoundType ## fn ## Functions[AUD_NUM_SOUNDDEFS] AUD_SPU_REL = { SOUND_FUNC_LIST(fn,typeFn) }
|
||||
|
||||
#if AUD_CPP_MEMBER_INVOKES
|
||||
|
||||
SOUND_FUNC_TABLE(Update, AudioUpdate);
|
||||
SOUND_FUNC_TABLE(Play, AudioPlay);
|
||||
SOUND_FUNC_TABLE(Prepare, AudioPrepare);
|
||||
SOUND_FUNC_TABLE(Kill, AudioKill);
|
||||
SOUND_FUNC_TABLE(ActionReleaseRequest, ActionReleaseRequest);
|
||||
SOUND_FUNC_TABLE(ComputeDurationMsExcludingStartOffsetAndPredelay, ComputeDurationMsExcludingStartOffsetAndPredelay);
|
||||
SOUND_FUNC_TABLE(Pause, Pause);
|
||||
SOUND_FUNC_TABLE(Destruct, sDestruct);
|
||||
|
||||
#else
|
||||
|
||||
SOUND_FUNC_TABLE(Update, sAudioUpdate);
|
||||
SOUND_FUNC_TABLE(Play, sAudioPlay);
|
||||
SOUND_FUNC_TABLE(Prepare, sAudioPrepare);
|
||||
SOUND_FUNC_TABLE(Kill, sAudioKill);
|
||||
SOUND_FUNC_TABLE(ActionReleaseRequest, sActionReleaseRequest);
|
||||
SOUND_FUNC_TABLE(ComputeDurationMsExcludingStartOffsetAndPredelay, sComputeDurationMsExcludingStartOffsetAndPredelay);
|
||||
SOUND_FUNC_TABLE(Pause, sPause);
|
||||
SOUND_FUNC_TABLE(Destruct, sDestruct);
|
||||
|
||||
#endif
|
||||
|
||||
#if __SPU
|
||||
|
||||
|
||||
void InitFunctionPointers()
|
||||
{
|
||||
#if 1
|
||||
// Calculate the PIC offset that needs to be added to each vtable entry.
|
||||
// The ila loads the non-relocated address of the relative branch
|
||||
// target, which can the be subtracted from the "return address" stored
|
||||
// by the branch.
|
||||
register u32 picOffset;
|
||||
register qword t0, t1;
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"ila %1,.+8\n\t"
|
||||
"brsl %2,.+4\n\t"
|
||||
"sf %0,%1,%2"
|
||||
: "=r"(picOffset),
|
||||
"=r"(t0),
|
||||
"=r"(t1)
|
||||
);
|
||||
|
||||
static u32 s_prevRelocation AUD_SPU_REL = 0;
|
||||
const s32 adjust = picOffset - s_prevRelocation;
|
||||
|
||||
for(s32 i = 0; i < AUD_NUM_SOUNDDEFS; i++)
|
||||
{
|
||||
audSound::sm_SoundTypeUpdateFunctions[i] = (SoundUpdateFunction)((size_t)audSound::sm_SoundTypeUpdateFunctions[i]+adjust);
|
||||
audSound::sm_SoundTypePlayFunctions[i] = (SoundPlayFunction)((size_t)audSound::sm_SoundTypePlayFunctions[i]+adjust);
|
||||
audSound::sm_SoundTypePrepareFunctions[i] = (SoundPrepareFunction)((size_t)audSound::sm_SoundTypePrepareFunctions[i]+adjust);
|
||||
audSound::sm_SoundTypeKillFunctions[i] = (SoundKillFunction)((size_t)audSound::sm_SoundTypeKillFunctions[i]+adjust);
|
||||
audSound::sm_SoundTypeActionReleaseRequestFunctions[i] = (SoundActionReleaseRequestFunction)((size_t)audSound::sm_SoundTypeActionReleaseRequestFunctions[i]+adjust);
|
||||
audSound::sm_SoundTypeComputeDurationMsExcludingStartOffsetAndPredelayFunctions[i] = (SoundComputeDurationMsExcludingStartOffsetAndPredelayFunction)((size_t)audSound::sm_SoundTypeComputeDurationMsExcludingStartOffsetAndPredelayFunctions[i]+adjust);
|
||||
audSound::sm_SoundTypePauseFunctions[i] = (SoundPauseFunction)((size_t)audSound::sm_SoundTypePauseFunctions[i]+adjust);
|
||||
audSound::sm_SoundTypeDestructFunctions[i] = (SoundDestructFunction)((size_t)audSound::sm_SoundTypeDestructFunctions[i] +adjust);
|
||||
}
|
||||
|
||||
//audDisplayf("%u, %u, %u, %zu, %zu", picOffset, s_prevRelocation, adjust, (size_t)&audLoopingSound::sAudioUpdate, (size_t)audSound::sm_SoundTypeUpdateFunctions[0]);
|
||||
|
||||
s_prevRelocation = picOffset;
|
||||
#else
|
||||
s32 i = 0;
|
||||
|
||||
#define SETUP_FUNC_TABLE(fn, typeFn) i = 0;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audLoopingSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audEnvelopeSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audTwinLoopSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audSpeechSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audOnStopSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audWrapperSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audSequentialSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)PPU_ONLY_SOUND_FN(audStreamingSound, typeFn);\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audRetriggeredOverlappedSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audCrossfadeSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audCollapsingStereoSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audSimpleSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audMultitrackSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audRandomizedSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audEnvironmentSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audDynamicEntitySound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audSequentialOverlapSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audModularSynthSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audGranularSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audDirectionalSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audKineticSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audSwitchSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audVariableCurveSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audVariablePrintValueSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audVariableBlockSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audIfSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audMathOperationSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audParameterTransformSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audFluctuatorSound::typeFn;\
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)&audAutomationSound::typeFn; \
|
||||
audSound::sm_SoundType ## fn ## Functions[i++] = (Sound ## fn ##Function)PPU_ONLY_SOUND_FN(audExternalStreamSound, typeFn);
|
||||
|
||||
#if AUD_CPP_MEMBER_INVOKES
|
||||
// Route directly to member functions
|
||||
SETUP_FUNC_TABLE(Update, AudioUpdate);
|
||||
SETUP_FUNC_TABLE(Play, AudioPlay);
|
||||
SETUP_FUNC_TABLE(Prepare, AudioPrepare);
|
||||
SETUP_FUNC_TABLE(Kill, AudioKill);
|
||||
SETUP_FUNC_TABLE(ActionReleaseRequest, ActionReleaseRequest);
|
||||
SETUP_FUNC_TABLE(ComputeDurationMsExcludingStartOffsetAndPredelay, ComputeDurationMsExcludingStartOffsetAndPredelay);
|
||||
SETUP_FUNC_TABLE(Pause, Pause);
|
||||
SETUP_FUNC_TABLE(Destruct, sDestruct);
|
||||
#else
|
||||
// Route via static wrappers
|
||||
SETUP_FUNC_TABLE(Update, sAudioUpdate);
|
||||
SETUP_FUNC_TABLE(Play, sAudioPlay);
|
||||
SETUP_FUNC_TABLE(Prepare, sAudioPrepare);
|
||||
SETUP_FUNC_TABLE(Kill, sAudioKill);
|
||||
SETUP_FUNC_TABLE(ActionReleaseRequest, sActionReleaseRequest);
|
||||
SETUP_FUNC_TABLE(ComputeDurationMsExcludingStartOffsetAndPredelay, sComputeDurationMsExcludingStartOffsetAndPredelay);
|
||||
SETUP_FUNC_TABLE(Pause, sPause);
|
||||
SETUP_FUNC_TABLE(Destruct, sDestruct);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
} // namespace rage
|
1603
rage/base/src/audioengine/soundpool.cpp
Normal file
1603
rage/base/src/audioengine/soundpool.cpp
Normal file
File diff suppressed because it is too large
Load Diff
126
rage/base/src/audioengine/soundset.cpp
Normal file
126
rage/base/src/audioengine/soundset.cpp
Normal file
@ -0,0 +1,126 @@
|
||||
#include "soundset.h"
|
||||
#include "engine.h"
|
||||
#include "audioengine/soundfactory.h"
|
||||
|
||||
#include "string/stringhash.h"
|
||||
|
||||
namespace rage
|
||||
{
|
||||
bool audSoundSet::Init(const char *name)
|
||||
{
|
||||
return Init(atStringHash(name));
|
||||
}
|
||||
|
||||
bool audSoundSet::Init(const u32 nameHash)
|
||||
{
|
||||
m_NameHash = nameHash;
|
||||
const SoundSet *setData = g_AudioEngine.GetSoundManager().GetFactory().GetMetadataManager().GetObject<SoundSet>(nameHash);
|
||||
return Init(setData);
|
||||
}
|
||||
|
||||
bool audSoundSet::Init(const SoundSet *metadata)
|
||||
{
|
||||
if(metadata)
|
||||
{
|
||||
m_Data = metadata;
|
||||
#if __USEDEBUGAUDIO
|
||||
// validate sorting
|
||||
for(u32 i = 1; i < m_Data->numSounds; i++)
|
||||
{
|
||||
audAssertf(m_Data->Sounds[i-1].Name < m_Data->Sounds[i].Name, "SoundSet %s not correctly sorted (index %u is out of order)", g_AudioEngine.GetSoundManager().GetFactory().GetMetadataManager().GetObjectNameFromNameTableOffset(metadata->NameTableOffset), i);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 audSoundSet::FindIndex(const u32 nameHash) const
|
||||
{
|
||||
if(m_Data && m_Data->numSounds)
|
||||
{
|
||||
// binary search this list
|
||||
s32 start = 0;
|
||||
s32 middle;
|
||||
s32 end = static_cast<s32>(m_Data->numSounds) - 1;
|
||||
|
||||
while(start <= end)
|
||||
{
|
||||
middle = (start + end) >> 1;
|
||||
if(nameHash > m_Data->Sounds[middle].Name)
|
||||
{
|
||||
start = middle + 1;
|
||||
}
|
||||
else if(nameHash < m_Data->Sounds[middle].Name)
|
||||
{
|
||||
end = middle - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
audMetadataRef audSoundSet::Find(const u32 nameHash) const
|
||||
{
|
||||
#if __USEDEBUGAUDIO
|
||||
// Reinitialise to pick up RAVE edits that override our metadata.
|
||||
if(m_Data && g_AudioEngine.GetSoundManager().GetFactory().GetMetadataManager().IsRAVEConnected())
|
||||
{
|
||||
const char *thisName = g_AudioEngine.GetSoundManager().GetFactory().GetMetadataManager().GetNameFromNTO_Debug(m_Data->NameTableOffset);
|
||||
const_cast<audSoundSet*>(this)->Init(thisName);
|
||||
}
|
||||
#endif
|
||||
if(m_Data && m_Data->numSounds)
|
||||
{
|
||||
// binary search this list
|
||||
s32 start = 0;
|
||||
s32 middle;
|
||||
s32 end = static_cast<s32>(m_Data->numSounds) - 1;
|
||||
|
||||
while(start <= end)
|
||||
{
|
||||
middle = (start + end) >> 1;
|
||||
if(nameHash > m_Data->Sounds[middle].Name)
|
||||
{
|
||||
start = middle + 1;
|
||||
}
|
||||
else if(nameHash < m_Data->Sounds[middle].Name)
|
||||
{
|
||||
end = middle - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_Data->Sounds[middle].Sound;
|
||||
}
|
||||
}
|
||||
}
|
||||
return audMetadataRef();
|
||||
}
|
||||
|
||||
audMetadataRef audSoundSet::Find(const char *name) const
|
||||
{
|
||||
return Find(atStringHash(name));
|
||||
}
|
||||
|
||||
void audSoundSetFieldRef::ResolveMetadataRef()
|
||||
{
|
||||
if(IsSoundSetValid())
|
||||
{
|
||||
audSoundSet soundSet;
|
||||
|
||||
if(soundSet.Init(GetSoundSetHash()))
|
||||
{
|
||||
m_MetadataRef = soundSet.Find(GetFieldHash());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_MetadataRef = SOUNDFACTORY.GetMetadataManager().GetObjectMetadataRefFromHash(GetFieldHash());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace rage
|
1019
rage/base/src/audiosoundtypes/environmentsound.cpp
Normal file
1019
rage/base/src/audiosoundtypes/environmentsound.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2465
rage/base/src/audiosoundtypes/sound.cpp
Normal file
2465
rage/base/src/audiosoundtypes/sound.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2114
rage/base/src/audiosoundtypes/sounddefs.h
Normal file
2114
rage/base/src/audiosoundtypes/sounddefs.h
Normal file
File diff suppressed because it is too large
Load Diff
535
rage/base/src/forceinclude/win64_bankrelease.h
Normal file
535
rage/base/src/forceinclude/win64_bankrelease.h
Normal file
@ -0,0 +1,535 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4302)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 1
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
535
rage/base/src/forceinclude/win64_beta.h
Normal file
535
rage/base/src/forceinclude/win64_beta.h
Normal file
@ -0,0 +1,535 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4302)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
535
rage/base/src/forceinclude/win64_debug.h
Normal file
535
rage/base/src/forceinclude/win64_debug.h
Normal file
@ -0,0 +1,535 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4302)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 0
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
535
rage/base/src/forceinclude/win64_final.h
Normal file
535
rage/base/src/forceinclude/win64_final.h
Normal file
@ -0,0 +1,535 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4302)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 0
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 1
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
536
rage/base/src/forceinclude/win64_gametoolbeta.h
Normal file
536
rage/base/src/forceinclude/win64_gametoolbeta.h
Normal file
@ -0,0 +1,536 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 0
|
||||
#define __GAMETOOL 1
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT __restrict
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
536
rage/base/src/forceinclude/win64_gametooldebug.h
Normal file
536
rage/base/src/forceinclude/win64_gametooldebug.h
Normal file
@ -0,0 +1,536 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 0
|
||||
#define __GAMETOOL 1
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT __restrict
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 0
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
536
rage/base/src/forceinclude/win64_gametoolrelease.h
Normal file
536
rage/base/src/forceinclude/win64_gametoolrelease.h
Normal file
@ -0,0 +1,536 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 0
|
||||
#define __GAMETOOL 1
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT __restrict
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 0
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
535
rage/base/src/forceinclude/win64_master.h
Normal file
535
rage/base/src/forceinclude/win64_master.h
Normal file
@ -0,0 +1,535 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4302)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 0
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 1
|
||||
#define __MASTER 1
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
535
rage/base/src/forceinclude/win64_profile.h
Normal file
535
rage/base/src/forceinclude/win64_profile.h
Normal file
@ -0,0 +1,535 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4302)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 0
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 1
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
535
rage/base/src/forceinclude/win64_release.h
Normal file
535
rage/base/src/forceinclude/win64_release.h
Normal file
@ -0,0 +1,535 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4302)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 0
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
536
rage/base/src/forceinclude/win64_rscbeta.h
Normal file
536
rage/base/src/forceinclude/win64_rscbeta.h
Normal file
@ -0,0 +1,536 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 1
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
536
rage/base/src/forceinclude/win64_rscdebug.h
Normal file
536
rage/base/src/forceinclude/win64_rscdebug.h
Normal file
@ -0,0 +1,536 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 1
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 0
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
536
rage/base/src/forceinclude/win64_rscrelease.h
Normal file
536
rage/base/src/forceinclude/win64_rscrelease.h
Normal file
@ -0,0 +1,536 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 1
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 1
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
#define RSG_XBOX 0
|
||||
#define RSG_PROSPERO 0
|
||||
#define RSG_SCARLETT 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 0
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 0
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
533
rage/base/src/forceinclude/win64_toolbeta.h
Normal file
533
rage/base/src/forceinclude/win64_toolbeta.h
Normal file
@ -0,0 +1,533 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 0
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT __restrict
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 1
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
533
rage/base/src/forceinclude/win64_tooldebug.h
Normal file
533
rage/base/src/forceinclude/win64_tooldebug.h
Normal file
@ -0,0 +1,533 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 0
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT __restrict
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 1
|
||||
#define __OPTIMIZED 0
|
||||
#define __BANK 1
|
||||
#define __ASSERT 1
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 1
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
533
rage/base/src/forceinclude/win64_toolrelease.h
Normal file
533
rage/base/src/forceinclude/win64_toolrelease.h
Normal file
@ -0,0 +1,533 @@
|
||||
// This file is automatically generated. DO NOT MODIFY DIRECTLY!
|
||||
// To rebuild the forceinclude files, modify the templates in rage/base/src/forceinclude/templates/
|
||||
// and then run rage/base/src/forceinclude/templates/makeheaders.bat
|
||||
|
||||
#ifndef _RSG_FORCE_INCLUDE_
|
||||
#define _RSG_FORCE_INCLUDE_
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_NS_RAGE namespace rage {
|
||||
#define END_NS_RAGE }
|
||||
#else
|
||||
#define BEGIN_NS_RAGE
|
||||
#define END_NS_RAGE
|
||||
#endif
|
||||
#define RAGE_RELEASE 378
|
||||
#define RAGE_RELEASE_STRING "378"
|
||||
#define RAGE_MAJOR_VERSION 1
|
||||
#define RAGE_MINOR_VERSION 15
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define UNUSED_PARAM(x)
|
||||
|
||||
// So we can tell it's the new build system and not the VC6-based one.
|
||||
#define BUILD_SYSTEM_VERSION 0x0200
|
||||
|
||||
// For compatibility with old code
|
||||
#define IS_CONSOLE __CONSOLE
|
||||
|
||||
#ifndef __SPUFRAG
|
||||
#define __SPUFRAG 0
|
||||
#endif
|
||||
|
||||
// Ensure that the correct compiler version is being used
|
||||
|
||||
// 2008 ?
|
||||
#if _MSC_VER == 1500
|
||||
# if _MSC_FULL_VER != 150030729 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2008, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
// 2010 ?
|
||||
#elif _MSC_VER == 1600
|
||||
# if _MSC_FULL_VER != 160040219 || _MSC_BUILD != 01
|
||||
# error "When compiling with Visual Studio 2010, service pack 1 is required"
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define I64FMT "I64"
|
||||
#define LI64FMT L"I64"
|
||||
#ifdef _M_X64
|
||||
#define SIZETFMT "I"
|
||||
#define PTRDIFFTFMT "I"
|
||||
#else
|
||||
#define SIZETFMT ""
|
||||
#define PTRDIFFTFMT ""
|
||||
#endif
|
||||
|
||||
// Networking
|
||||
#define RSG_NP 0
|
||||
#define RSG_XBL 0
|
||||
#define RSG_GAMESPY 1
|
||||
|
||||
// Basic types
|
||||
BEGIN_NS_RAGE
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned __int64 u64;
|
||||
typedef struct __declspec(intrin_type) __declspec(align(16)) __u128 {
|
||||
float m128_f32[4];
|
||||
} __u128;
|
||||
typedef __u128 u128;
|
||||
|
||||
typedef signed char s8;
|
||||
typedef signed short s16;
|
||||
typedef signed int s32;
|
||||
typedef signed __int64 s64;
|
||||
|
||||
typedef float f32;
|
||||
#if defined(_M_X64)
|
||||
typedef u64 uptr;
|
||||
#else
|
||||
#error "x64 tools not installed on this machine!"
|
||||
#endif
|
||||
|
||||
END_NS_RAGE
|
||||
|
||||
#define GTA_REPLAY_RAGE
|
||||
|
||||
// Platform definitions
|
||||
#define __BE 0
|
||||
#define __CONSOLE 0
|
||||
#define __PS3 0
|
||||
#define __PPU 0
|
||||
#define __SPU 0
|
||||
#define __WIN32 1
|
||||
#define __OSX 0
|
||||
#define __POSIX 0
|
||||
#define __XENON 0
|
||||
#define __PSP2 0
|
||||
#define __CAFE 0
|
||||
#define __LINUX 0
|
||||
#define __WIN32PC 1
|
||||
#define __PAGING 0
|
||||
#define __GAMETOOL 0
|
||||
#define __RESOURCECOMPILER 0
|
||||
|
||||
#define RSG_BE 0
|
||||
#define RSG_PS3 0
|
||||
#define RSG_PPU 0
|
||||
#define RSG_SPU 0
|
||||
#define RSG_WIN32 1
|
||||
#define RSG_XENON 0
|
||||
#define RSG_PC 1
|
||||
#define RSG_DURANGO 0
|
||||
#define RSG_ORBIS 0
|
||||
#define RSG_WINRT 0
|
||||
#define RSG_XDK 0
|
||||
#define RSG_GDK 0
|
||||
#define RSG_LINUX 0
|
||||
#define RSG_IOS 0
|
||||
#define RSG_ANDROID 0
|
||||
#define RSG_WINPHONE 0
|
||||
#define RSG_MOBILE (RSG_IOS | RSG_ANDROID | RSG_WINPHONE)
|
||||
#define RSG_NX 0
|
||||
#define RSG_P 0
|
||||
#define RSG_GGP 0
|
||||
#define RSG_OSX 0
|
||||
#define RSG_SCE 0
|
||||
|
||||
#define RSG_CPU_PPC 0
|
||||
#define RSG_CPU_SPU 0
|
||||
#define RSG_CPU_INTEL 1
|
||||
#define RSG_CPU_X86 0
|
||||
#define RSG_CPU_X64 1
|
||||
|
||||
#define CONSOLE_ONLY(...)
|
||||
#define PS3_ONLY(...)
|
||||
#define PPU_ONLY(...)
|
||||
#define SPU_ONLY(...)
|
||||
#define WIN32_ONLY(...) __VA_ARGS__
|
||||
#define XENON_ONLY(...)
|
||||
#define PSP2_ONLY(...)
|
||||
#define CAFE_ONLY(...)
|
||||
#define LINUX_ONLY(...)
|
||||
#define WIN32PC_ONLY(...) __VA_ARGS__
|
||||
#define ORBIS_ONLY(...)
|
||||
#define PROSPERO_ONLY(...)
|
||||
#define NP_ONLY(...)
|
||||
#define SCE_ONLY(...)
|
||||
#define DURANGO_ONLY(...)
|
||||
#define WINRT_ONLY(...)
|
||||
#define SCARLETT_ONLY(...)
|
||||
#define XBL_ONLY(...)
|
||||
#define XDK_ONLY(...)
|
||||
#define GDK_ONLY(...)
|
||||
#define XBOX_ONLY(...)
|
||||
|
||||
#define ALIGNAS(x) __declspec(align(x))
|
||||
#define BEGIN_ALIGNED(x) __declspec(align(x))
|
||||
#define ALIGNED(x)
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define RESTRICT __restrict
|
||||
#define MAY_ALIAS
|
||||
|
||||
#pragma warning(disable: 4127)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable: 4244) // 'initializing': conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4267) // arg: conversion from 'big' to 'small', possible loss of data
|
||||
#pragma warning(disable: 4291)
|
||||
#pragma warning(disable: 4324) // structure was padded due to __declspec(align)
|
||||
#pragma warning(disable: 4512)
|
||||
#pragma warning(disable: 4530)
|
||||
#pragma warning(disable: 4505)
|
||||
#pragma warning(disable: 4710)
|
||||
#pragma warning(error: 4062)
|
||||
#pragma warning(error: 4263)
|
||||
#pragma warning(error: 4265)
|
||||
#pragma warning(error: 4668)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#define _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
#define __builtin_trap() __debugbreak()
|
||||
|
||||
#define PRAGMA_OPTIMIZE_OFF() __pragma(optimize("", off)) // PRAGMA-OPTIMIZE-ALLOW
|
||||
|
||||
// Build type definitions
|
||||
#define __DEV 0
|
||||
#define __OPTIMIZED 1
|
||||
#define __BANK 0
|
||||
#define __ASSERT 0
|
||||
#define __FINAL 0
|
||||
#define __MASTER 0
|
||||
#define __EDITOR 0
|
||||
#define __TOOL 1
|
||||
#define __EXPORTER 0
|
||||
#define __PROFILE 0
|
||||
#define __PACKEDDEBUG 1
|
||||
#define __SKIPDEBUGAUTH 1
|
||||
#define __USEDEBUGAUDIO 0
|
||||
#define DEBUGAUDIO_ONLY(...)
|
||||
#define DEBUGUNPACKED_ONLY(...)
|
||||
#define RSG_DEV __DEV
|
||||
#define RSG_BANK __BANK
|
||||
#define RSG_ASSERT __ASSERT
|
||||
#define RSG_TOOL __TOOL
|
||||
#define RSG_RSC __RESOURCECOMPILER
|
||||
#define RSG_FINAL __FINAL
|
||||
|
||||
#define RSG_LAUNCHER 0
|
||||
|
||||
#define GTA_SCRIPT_LEGACY_PLATFORM_VERSION 0
|
||||
|
||||
// Decode build system macros set above.
|
||||
#if __DEV
|
||||
# define DEV_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define DEV_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __BANK
|
||||
# define BANK_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define BANK_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PPU || __PSP2
|
||||
# define Likely(x) __builtin_expect(!!(x),1)
|
||||
# define Unlikely(x) __builtin_expect(!!(x),0)
|
||||
#else
|
||||
# define Likely(x) (x)
|
||||
# define Unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUG__
|
||||
# define PRINTF_LIKE_N(a) __attribute__((format (printf, (a), (a)+1)))
|
||||
#else
|
||||
# define PRINTF_LIKE_N(a)
|
||||
#endif
|
||||
|
||||
#if __DEV
|
||||
# define OPTIMISATIONS_OFF() PRAGMA_OPTIMIZE_OFF() // PRAGMA-OPTIMIZE-ALLOW
|
||||
#else
|
||||
# define OPTIMISATIONS_OFF()
|
||||
#endif
|
||||
|
||||
#if __DEV && __XENON
|
||||
# define __forceinline inline
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
|
||||
# define RAGE_MINIMAL_ASSERTS (__XENON && __OPTIMIZED)
|
||||
|
||||
# if RAGE_MINIMAL_ASSERTS
|
||||
# ifdef __SNC__
|
||||
# pragma diag_suppress 178
|
||||
# pragma diag_suppress 552
|
||||
# pragma diag_suppress 828
|
||||
# elif defined(_MSC_VER)
|
||||
# pragma warning(disable: 4100)
|
||||
# pragma warning(disable: 4101)
|
||||
# pragma warning(disable: 4189)
|
||||
# endif
|
||||
# define Assertf(x,fmt,...) Assert(x)
|
||||
# define Verifyf(x,fmt,...) AssertVerify(x)
|
||||
# else
|
||||
# define Assertf(x,fmt,...) (void)(Likely(x) || ::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0))
|
||||
# define Verifyf(x,fmt,...) (Likely(x) || ((::rage::diagAssertHelper(__FILE__,__LINE__,"%s: " fmt,#x,##__VA_ARGS__) || (__debugbreak(),0)),false))
|
||||
# endif
|
||||
# define Assert(x) (void)(Likely(x) || ::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0))
|
||||
# define FatalAssert(x) do{if(Unlikely(!(x))){Quitf(0,__FILE__"(%d): %s",__LINE__,#x);}}while(0)
|
||||
# define FatalAssertf(x,fmt,...) do{if(Unlikely(!(x))){Errorf(__FILE__"(%d): %s",__LINE__,#x);Quitf(0,fmt,##__VA_ARGS__);}}while(0)
|
||||
# define AssertVerify(x) (Likely(x) || ((::rage::diagAssertHelper2(__FILE__,__LINE__,#x) || (__debugbreak(),0)),false))
|
||||
|
||||
# define ASSERT_ONLY(...) __VA_ARGS__
|
||||
# define AssertMsg(x,msg) Assertf(x,"%s",msg)
|
||||
# define FatalAssertMsg(x,msg) FatalAssertf(x,"%s",msg)
|
||||
|
||||
# if __TOOL || !__OPTIMIZED || __WIN32PC
|
||||
# define FastAssert(x) Assert(x)
|
||||
# else
|
||||
# define FastAssert(x) (Likely(x) || (__debugbreak(),0))
|
||||
# endif
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
extern int diagAssertHelper(const char*,int,const char*,...)
|
||||
#ifdef __ORBIS__
|
||||
PRINTF_LIKE_N(3)
|
||||
#endif
|
||||
;
|
||||
extern int diagAssertHelper2(const char*,int,const char*);
|
||||
extern int DebugAssertFailed(void);
|
||||
END_NS_RAGE
|
||||
|
||||
# define DebugAssert(x) (void)(Likely(x) || ::rage::DebugAssertFailed())
|
||||
|
||||
# if RSG_ORBIS
|
||||
// Enable Sony's asserts in GNM
|
||||
# define SCE_GNM_DEBUG
|
||||
# endif
|
||||
|
||||
#else // !__ASSERT
|
||||
# define ASSERT_ONLY(...)
|
||||
# define Assert(x)
|
||||
# define Assertf(x,fmt,...)
|
||||
# define FastAssert(x)
|
||||
# define FatalAssert(x)
|
||||
# define FatalAssertf(x,fmt,...)
|
||||
# define FatalAssertMsg(x,msg)
|
||||
# define AssertMsg(x,msg)
|
||||
# define AssertVerify(x) (x)
|
||||
# define Verifyf(x,fmt,...) (x)
|
||||
# define DebugAssert(x)
|
||||
#endif
|
||||
|
||||
#define AlignedAssert(x,a) Assert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define AlignedAssertf(x,a,fmt,...) Assertf(((::rage::uptr)(x) & ((a)-1)) == 0,fmt,##__VA_ARGS__)
|
||||
#define Assert16(x) AlignedAssert(x,16)
|
||||
#define Assert128(x) AlignedAssert(x,128)
|
||||
|
||||
#define MacroJoin( X, Y ) MacroDoJoin(X, Y)
|
||||
#define MacroDoJoin( X, Y ) MacroDoJoin2(X, Y)
|
||||
#define MacroDoJoin2( X, Y ) X##Y
|
||||
#define CompileTimeAssert(e) typedef char MacroJoin(MacroJoin(__COMPILETIME_ASSERT, __LINE__), __)[(e)?1:-1]
|
||||
#define AlignedCompileTimeAssert(x,a) CompileTimeAssert(((::rage::uptr)(x) & ((a)-1)) == 0)
|
||||
#define CompileTimeAssert16(x) AlignedCompileTimeAssert(x,16)
|
||||
#define CompileTimeAssert128(x) AlignedCompileTimeAssert(x,128)
|
||||
|
||||
#if __EDITOR
|
||||
# define EDITOR_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EDITOR_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __TOOL
|
||||
# define TOOL_ONLY(...) __VA_ARGS__
|
||||
# define NOTTOOL_ONLY(...)
|
||||
#else
|
||||
# define TOOL_ONLY(...)
|
||||
# define NOTTOOL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __EXPORTER
|
||||
# define EXPORTER_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define EXPORTER_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __PAGING
|
||||
# define PAGING_ONLY(...) __VA_ARGS__
|
||||
#else
|
||||
# define PAGING_ONLY(...)
|
||||
#endif
|
||||
|
||||
#if __FINAL
|
||||
# define NOTFINAL_ONLY(...)
|
||||
#else
|
||||
# define NOTFINAL_ONLY(...) __VA_ARGS__
|
||||
#endif
|
||||
|
||||
#if __ASSERT
|
||||
# define AssertType(type,ptr) Assert(SafeCast(type,ptr) && #type)
|
||||
#else
|
||||
# define AssertType(type,ptr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <class L,class R> __forceinline const L& Assign(L& left,const R right) {
|
||||
left = static_cast<L>(right); FastAssert(left == right); return left; }
|
||||
template <typename _Type, int actualSize,int expectedSize> struct CTASHelper { CompileTimeAssert(actualSize == expectedSize); };
|
||||
#endif
|
||||
|
||||
#define BitfieldAssign(x,y) do { (x)=(y); FastAssert(unsigned(x) == unsigned(y)); } while (0)
|
||||
|
||||
#define __LTCG (__XENON && 0)
|
||||
|
||||
#if RSG_ORBIS
|
||||
#define ATTR_UNUSED __attribute__((unused))
|
||||
#else
|
||||
#define ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_M_X64)
|
||||
# define __64BIT 1
|
||||
# define CompileTimeAssertSize(s,if32,if64) ATTR_UNUSED static CTASHelper<s,int(sizeof(s)),if64> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# define OffsetOf(s,m) ((size_t)((::rage::s64)&(((s*)0)->m)))
|
||||
#else
|
||||
# define __64BIT 0
|
||||
# if __PPU
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)1)->m)-1)
|
||||
# define CompileTimeAssertSize(s,if32,if64) static __attribute__((unused)) CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# else
|
||||
# define OffsetOf(s,m) ((size_t)&(((s*)0)->m))
|
||||
# define CompileTimeAssertSize(s,if32,if64) static CTASHelper<s,int(sizeof(s)),if32> MacroJoin(MacroJoin(s,__LINE__),Helper)
|
||||
# endif // __PPU
|
||||
#endif
|
||||
|
||||
#if defined(__SNC__) && __SN_VER__ < 43001
|
||||
# define ATTR_COLD __attribute__((cold)) // same as =Xsaverestorefuncs=1 for this function
|
||||
# define ATTR_HOT __attribute__((hot)) // inlinesrf and also likely virtual target
|
||||
# define ATTR_INLINESRF __attribute__((inlinesrf)) // same as =Xsaverestorefuncs=0 for this function
|
||||
#else
|
||||
# define ATTR_COLD
|
||||
# define ATTR_HOT
|
||||
# define ATTR_INLINESRF
|
||||
#endif
|
||||
|
||||
#if __64BIT && !__PROFILE && !__FINAL && defined(__cplusplus)
|
||||
inline int ptrdiff_t_to_int(long long v) { if (v != int(v)) __debugbreak(); return int(v); }
|
||||
#elif __64BIT
|
||||
# define ptrdiff_t_to_int(x) ((int)(x))
|
||||
#else
|
||||
# define ptrdiff_t_to_int(x) (x)
|
||||
#endif
|
||||
|
||||
#define istrlen(x) ((int)strlen(x))
|
||||
#define ustrlen(x) ((unsigned)strlen(x))
|
||||
|
||||
BEGIN_NS_RAGE
|
||||
#if __DEV
|
||||
typedef u8 dev_u8;
|
||||
typedef s8 dev_s8;
|
||||
typedef u16 dev_u16;
|
||||
typedef s16 dev_s16;
|
||||
typedef u32 dev_u32;
|
||||
typedef s32 dev_s32;
|
||||
typedef u64 dev_u64;
|
||||
typedef s64 dev_s64;
|
||||
typedef float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __DEV
|
||||
typedef const u8 dev_u8;
|
||||
typedef const s8 dev_s8;
|
||||
typedef const u16 dev_u16;
|
||||
typedef const s16 dev_s16;
|
||||
typedef const u32 dev_u32;
|
||||
typedef const s32 dev_s32;
|
||||
typedef const u64 dev_u64;
|
||||
typedef const s64 dev_s64;
|
||||
typedef const float dev_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool dev_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __DEV
|
||||
|
||||
#if __BANK
|
||||
typedef u8 bank_u8;
|
||||
typedef s8 bank_s8;
|
||||
typedef u16 bank_u16;
|
||||
typedef s16 bank_s16;
|
||||
typedef u32 bank_u32;
|
||||
typedef s32 bank_s32;
|
||||
typedef u64 bank_u64;
|
||||
typedef s64 bank_s64;
|
||||
typedef float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#else // __BANK
|
||||
typedef const u8 bank_u8;
|
||||
typedef const s8 bank_s8;
|
||||
typedef const u16 bank_u16;
|
||||
typedef const s16 bank_s16;
|
||||
typedef const u32 bank_u32;
|
||||
typedef const s32 bank_s32;
|
||||
typedef const u64 bank_u64;
|
||||
typedef const s64 bank_s64;
|
||||
typedef const float bank_float;
|
||||
# ifdef __cplusplus
|
||||
typedef const bool bank_bool;
|
||||
# endif // __cplusplus
|
||||
#endif // __BANK
|
||||
END_NS_RAGE
|
||||
|
||||
#define __FINAL_LOGGING 0
|
||||
#define __NO_OUTPUT (__FINAL && !__FINAL_LOGGING)
|
||||
#define RSG_OUTPUT (!__NO_OUTPUT)
|
||||
|
||||
#if __NO_OUTPUT
|
||||
#define OUTPUT_ONLY(...)
|
||||
#if !RSG_PC
|
||||
#define Quitf(...) __debugbreak()
|
||||
#else
|
||||
extern void QuitNoOutput(int errorCode);
|
||||
#define Quitf(errorCode,...) do { (void)(__VA_ARGS__); QuitNoOutput(errorCode); } while(0)
|
||||
#endif // !RSG_PC
|
||||
#define Printf(...) do { } while (0)
|
||||
#define Displayf(...) do { } while (0)
|
||||
#define Warningf(...) do { } while (0)
|
||||
#define Errorf(...) do { } while (0)
|
||||
#define Debugf1(...) do { } while (0)
|
||||
#define Debugf2(...) do { } while (0)
|
||||
#define Debugf3(...) do { } while (0)
|
||||
#else
|
||||
#define OUTPUT_ONLY(...) __VA_ARGS__
|
||||
#ifdef __cplusplus
|
||||
extern void Printf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Displayf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Warningf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Errorf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(const char *fmt,...) PRINTF_LIKE_N(1);
|
||||
extern void Quitf(int errorCode,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf1(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf2(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
extern void Debugf3(int level,const char *fmt,...) PRINTF_LIKE_N(2);
|
||||
#endif
|
||||
#endif // __NO_OUTPUT
|
||||
#define HACK_GTA4 1
|
||||
#define HACK_MC4 0
|
||||
#define HACK_RDR2 0
|
||||
#define HACK_MP3 0
|
||||
#define HACK_JIMMY 0
|
||||
#define HACK_BULLY2 0
|
||||
#define HACK_MC5 0
|
||||
#define HACK_RDR3 0
|
||||
|
||||
#define GTA_VERSION 501
|
||||
#define RDR_VERSION 0
|
||||
#ifdef USING_RAGE
|
||||
using namespace rage;
|
||||
#endif // USING_RAGE
|
||||
|
||||
#endif //_RSG_FORCE_INCLUDE_
|
4914
rage/base/src/rline/rlpresence.cpp
Normal file
4914
rage/base/src/rline/rlpresence.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1408
rage/framework/src/streaming/CacheLoader.cpp
Normal file
1408
rage/framework/src/streaming/CacheLoader.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user