Merge branch 'master' into opus

# Conflicts:
#	eax/eax.h
#	premake5.lua
#	src/audio/oal/stream.cpp
This commit is contained in:
Sergeanur 2020-05-24 00:45:45 +03:00
commit bd67db523a
21 changed files with 382 additions and 383 deletions

View file

@ -12,7 +12,7 @@
extern "C" { extern "C" {
#endif // __cplusplus #endif // __cplusplus
#ifndef OPENAL #ifndef AUDIO_OAL
#include <dsound.h> #include <dsound.h>
/* /*
@ -49,14 +49,9 @@ extern "C" {
typedef void (CDECL *LPGETCURRENTVERSION)(LPDWORD major, LPDWORD minor); typedef void (CDECL *LPGETCURRENTVERSION)(LPDWORD major, LPDWORD minor);
#else // OPENAL #else // AUDIO_OAL
#ifndef _WIN32
#include <AL/al.h> #include <AL/al.h>
#include <string.h> #include <string.h>
#else
#include <AL/al.h>
#include <string.h>
#endif
#ifndef GUID_DEFINED #ifndef GUID_DEFINED
#define GUID_DEFINED #define GUID_DEFINED

View file

@ -56,6 +56,9 @@ workspace "re3"
"win-x86-RW33_d3d8-mss", "win-x86-RW33_d3d8-mss",
"win-x86-librw_d3d9-mss", "win-x86-librw_d3d9-mss",
"win-x86-librw_gl3_glfw-mss", "win-x86-librw_gl3_glfw-mss",
"win-x86-RW33_d3d8-oal",
"win-x86-librw_d3d9-oal",
"win-x86-librw_gl3_glfw-oal",
} }
filter { "system:linux" } filter { "system:linux" }
@ -188,19 +191,15 @@ project "re3"
includedirs { "src/extras" } includedirs { "src/extras" }
includedirs { "eax" } includedirs { "eax" }
includedirs { "milessdk/include" }
includedirs { "eax" } includedirs { "eax" }
includedirs { "openal-soft/include" }
includedirs { "mpg123/include" }
includedirs { "libsndfile/include" }
if _OPTIONS["with-opus"] then if _OPTIONS["with-opus"] then
includedirs { "ogg/include" } includedirs { "ogg/include" }
includedirs { "opus/include" } includedirs { "opus/include" }
includedirs { "opusfile/include" } includedirs { "opusfile/include" }
end end
libdirs { "milessdk/lib" } libdirs { "milessdk/lib" }
libdirs { "openal-soft/libs/Win32" } libdirs { "openal-soft/libs/Win32" }
libdirs { "mpg123/lib" } libdirs { "mpg123/lib" }
libdirs { "libsndfile/lib" } libdirs { "libsndfile/lib" }
@ -212,6 +211,10 @@ project "re3"
filter {} filter {}
end end
filter "platforms:*oal"
defines { "AUDIO_OAL" }
filter {}
if(os.getenv("GTA_III_RE_DIR")) then if(os.getenv("GTA_III_RE_DIR")) then
setpaths("$(GTA_III_RE_DIR)/", "%(cfg.buildtarget.name)", "") setpaths("$(GTA_III_RE_DIR)/", "%(cfg.buildtarget.name)", "")
end end
@ -223,8 +226,15 @@ project "re3"
characterset ("MBCS") characterset ("MBCS")
targetextension ".exe" targetextension ".exe"
filter "platforms:linux*" filter "platforms:win*oal"
defines { "OPENAL" } includedirs { "openal-soft/include" }
includedirs { "libsndfile/include" }
includedirs { "mpg123/include" }
libdirs { "openal-soft/libs/Win32" }
libdirs { "libsndfile/lib" }
libdirs { "mpg123/lib" }
filter "platforms:linux*oal"
links { "openal", "mpg123", "sndfile", "pthread" } links { "openal", "mpg123", "sndfile", "pthread" }
if _OPTIONS["with-opus"] then if _OPTIONS["with-opus"] then

File diff suppressed because it is too large Load diff

View file

@ -39,8 +39,8 @@ cAudioManager::cAudioManager()
} }
m_nAudioEntitiesTotal = 0; m_nAudioEntitiesTotal = 0;
m_FrameCounter = 0; m_FrameCounter = 0;
m_bFifthFrameFlag = 0; m_bFifthFrameFlag = false;
m_bTimerJustReset = 0; m_bTimerJustReset = false;
m_nTimer = 0; m_nTimer = 0;
} }

View file

@ -328,7 +328,7 @@ public:
float GetCollisionRatio(float a, float b, float c, float d) const; float GetCollisionRatio(float a, float b, float c, float d) const;
float GetDistanceSquared(const CVector &v) const; float GetDistanceSquared(const CVector &v) const;
int32 GetJumboTaxiFreq() const; int32 GetJumboTaxiFreq() const;
bool GetMissionAudioLoadingStatus() const; uint8 GetMissionAudioLoadingStatus() const;
int8 GetMissionScriptPoliceAudioPlayingStatus() const; int8 GetMissionScriptPoliceAudioPlayingStatus() const;
uint8 GetNum3DProvidersAvailable() const; uint8 GetNum3DProvidersAvailable() const;
int32 GetPedCommentSfx(CPed *ped, int32 sound); int32 GetPedCommentSfx(CPed *ped, int32 sound);

View file

@ -1,7 +1,7 @@
#include "channel.h" #include "common.h"
#ifdef AUDIO_OAL #ifdef AUDIO_OAL
#include "common.h" #include "channel.h"
#include "sampman.h" #include "sampman.h"
#ifndef _WIN32 #ifndef _WIN32

View file

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "common.h"
#ifdef AUDIO_OAL #ifdef AUDIO_OAL
#include "oal/oal_utils.h" #include "oal/oal_utils.h"

View file

@ -1,3 +1,4 @@
#include "common.h"
#include "oal_utils.h" #include "oal_utils.h"
#ifdef AUDIO_OAL #ifdef AUDIO_OAL

View file

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "common.h"
#ifdef AUDIO_OAL #ifdef AUDIO_OAL
#include "eax.h" #include "eax.h"

View file

@ -1,7 +1,7 @@
#include "stream.h" #include "common.h"
#ifdef AUDIO_OAL #ifdef AUDIO_OAL
#include "common.h" #include "stream.h"
#include "sampman.h" #include "sampman.h"
#ifdef AUDIO_OPUS #ifdef AUDIO_OPUS

View file

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "common.h"
#ifdef AUDIO_OAL #ifdef AUDIO_OAL
#include <AL/al.h> #include <AL/al.h>

View file

@ -4333,7 +4333,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command)
} }
case COMMAND_SET_CAR_HEAVY: case COMMAND_SET_CAR_HEAVY:
{ {
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 2);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle); assert(pVehicle);
pVehicle->bIsHeavy = (ScriptParams[1] != 0); pVehicle->bIsHeavy = (ScriptParams[1] != 0);

View file

@ -196,11 +196,6 @@ enum Config {
#define USE_TXD_CDIMAGE // generate and load textures from txd.img #define USE_TXD_CDIMAGE // generate and load textures from txd.img
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number #define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
//#define USE_TEXTURE_POOL //#define USE_TEXTURE_POOL
#ifdef _WIN32
#define AUDIO_MSS
#else
#define AUDIO_OAL
#endif
// Particle // Particle
//#define PC_PARTICLE //#define PC_PARTICLE

View file

@ -328,7 +328,7 @@ PluginAttach(void)
static RwBool static RwBool
Initialise3D(void *param) Initialise3D(void *param)
{ {
if (RsRwInitialise(param)) if (RsRwInitialize(param))
{ {
#ifdef DEBUGMENU #ifdef DEBUGMENU
DebugMenuInit(); DebugMenuInit();
@ -1146,10 +1146,10 @@ AppEventHandler(RsEvent event, void *param)
{ {
switch( event ) switch( event )
{ {
case rsINITIALISE: case rsINITIALIZE:
{ {
CGame::InitialiseOnceBeforeRW(); CGame::InitialiseOnceBeforeRW();
return RsInitialise() ? rsEVENTPROCESSED : rsEVENTERROR; return RsInitialize() ? rsEVENTPROCESSED : rsEVENTERROR;
} }
case rsCAMERASIZE: case rsCAMERASIZE:
@ -1161,7 +1161,7 @@ AppEventHandler(RsEvent event, void *param)
return rsEVENTPROCESSED; return rsEVENTPROCESSED;
} }
case rsRWINITIALISE: case rsRWINITIALIZE:
{ {
return Initialise3D(param) ? rsEVENTPROCESSED : rsEVENTERROR; return Initialise3D(param) ? rsEVENTPROCESSED : rsEVENTERROR;
} }

View file

@ -274,7 +274,7 @@ psNativeTextureSupport(void)
***************************************************************************** *****************************************************************************
*/ */
RwBool RwBool
psInitialise(void) psInitialize(void)
{ {
PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f; PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f;
@ -789,7 +789,7 @@ RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode)
useDefault = TRUE; useDefault = TRUE;
if ( RsEventHandler(rsRWINITIALISE, &openParams) == rsEVENTERROR ) if ( RsEventHandler(rsRWINITIALIZE, &openParams) == rsEVENTERROR )
return FALSE; return FALSE;
RwInitialised = TRUE; RwInitialised = TRUE;
@ -1312,7 +1312,7 @@ main(int argc, char *argv[])
* Initialize the platform independent data. * Initialize the platform independent data.
* This will in turn initialize the platform specific data... * This will in turn initialize the platform specific data...
*/ */
if( RsEventHandler(rsINITIALISE, nil) == rsEVENTERROR ) if( RsEventHandler(rsINITIALIZE, nil) == rsEVENTERROR )
{ {
return FALSE; return FALSE;
} }
@ -1355,7 +1355,7 @@ main(int argc, char *argv[])
/* /*
* Initialize the 3D (RenderWare) components of the app... * Initialize the 3D (RenderWare) components of the app...
*/ */
if( rsEVENTERROR == RsEventHandler(rsRWINITIALISE, &openParams) ) if( rsEVENTERROR == RsEventHandler(rsRWINITIALIZE, &openParams) )
{ {
RsEventHandler(rsTERMINATE, nil); RsEventHandler(rsTERMINATE, nil);

View file

@ -15,7 +15,7 @@ extern RwUInt32 psTimer(void);
extern double psTimer(void); extern double psTimer(void);
#endif #endif
extern RwBool psInitialise(void); extern RwBool psInitialize(void);
extern void psTerminate(void); extern void psTerminate(void);
extern void psCameraShowRaster(RwCamera *camera); extern void psCameraShowRaster(RwCamera *camera);

View file

@ -246,8 +246,8 @@ RsEventHandler(RsEvent event, void *param)
result = (rsEVENTPROCESSED); result = (rsEVENTPROCESSED);
break; break;
case rsRWINITIALISE: case rsRWINITIALIZE:
result = (RsRwInitialise(param) ? result = (RsRwInitialize(param) ?
rsEVENTPROCESSED : rsEVENTERROR); rsEVENTPROCESSED : rsEVENTERROR);
break; break;
@ -256,9 +256,9 @@ RsEventHandler(RsEvent event, void *param)
result = (rsEVENTPROCESSED); result = (rsEVENTPROCESSED);
break; break;
case rsINITIALISE: case rsINITIALIZE:
result = result =
(RsInitialise()? rsEVENTPROCESSED : rsEVENTERROR); (RsInitialize()? rsEVENTPROCESSED : rsEVENTERROR);
break; break;
default: default:
@ -294,7 +294,7 @@ RsRwTerminate(void)
***************************************************************************** *****************************************************************************
*/ */
RwBool RwBool
RsRwInitialise(void *displayID) RsRwInitialize(void *displayID)
{ {
RwEngineOpenParams openParams; RwEngineOpenParams openParams;
@ -383,7 +383,7 @@ RsTerminate(void)
***************************************************************************** *****************************************************************************
*/ */
RwBool RwBool
RsInitialise(void) RsInitialize(void)
{ {
/* /*
* Initialize Platform independent data... * Initialize Platform independent data...
@ -415,7 +415,7 @@ RsInitialise(void)
RsGlobal.pad.inputEventHandler = nil; RsGlobal.pad.inputEventHandler = nil;
RsGlobal.pad.used = FALSE; RsGlobal.pad.used = FALSE;
result = psInitialise(); result = psInitialize();
return result; return result;
} }

View file

@ -61,10 +61,10 @@ enum RsEvent
_rs_18, _rs_18,
_rs_19, _rs_19,
_rs_20, _rs_20,
rsRWINITIALISE, rsRWINITIALIZE,
rsRWTERMINATE, rsRWTERMINATE,
rsSELECTDEVICE, rsSELECTDEVICE,
rsINITIALISE, rsINITIALIZE,
rsTERMINATE, rsTERMINATE,
rsIDLE, rsIDLE,
rsFRONTENDIDLE, rsFRONTENDIDLE,
@ -242,13 +242,13 @@ extern RsEventStatus RsKeyboardEventHandler(RsEvent event, void *param);
extern RsEventStatus RsPadEventHandler(RsEvent event, void *param); extern RsEventStatus RsPadEventHandler(RsEvent event, void *param);
extern RwBool extern RwBool
RsInitialise(void); RsInitialize(void);
extern RwBool extern RwBool
RsRegisterImageLoader(void); RsRegisterImageLoader(void);
extern RwBool extern RwBool
RsRwInitialise(void *param); RsRwInitialize(void *param);
extern RwBool extern RwBool
RsSelectDevice(void); RsSelectDevice(void);

View file

@ -584,7 +584,7 @@ void _psPrintCpuInfo()
***************************************************************************** *****************************************************************************
*/ */
RwBool RwBool
psInitialise(void) psInitialize(void)
{ {
PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f; PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f;
@ -1525,7 +1525,7 @@ RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode)
useDefault = TRUE; useDefault = TRUE;
if ( RsEventHandler(rsRWINITIALISE, PSGLOBAL(window)) == rsEVENTERROR ) if ( RsEventHandler(rsRWINITIALIZE, PSGLOBAL(window)) == rsEVENTERROR )
return FALSE; return FALSE;
RwInitialised = TRUE; RwInitialised = TRUE;
@ -1896,7 +1896,7 @@ WinMain(HINSTANCE instance,
* Initialize the platform independent data. * Initialize the platform independent data.
* This will in turn initialize the platform specific data... * This will in turn initialize the platform specific data...
*/ */
if( RsEventHandler(rsINITIALISE, nil) == rsEVENTERROR ) if( RsEventHandler(rsINITIALIZE, nil) == rsEVENTERROR )
{ {
return FALSE; return FALSE;
} }
@ -1962,7 +1962,7 @@ WinMain(HINSTANCE instance,
/* /*
* Initialize the 3D (RenderWare) components of the app... * Initialize the 3D (RenderWare) components of the app...
*/ */
if( rsEVENTERROR == RsEventHandler(rsRWINITIALISE, PSGLOBAL(window)) ) if( rsEVENTERROR == RsEventHandler(rsRWINITIALIZE, PSGLOBAL(window)) )
{ {
DestroyWindow(PSGLOBAL(window)); DestroyWindow(PSGLOBAL(window));

View file

@ -184,7 +184,7 @@ bool CCranes::IsThisCarPickedUp(float X, float Y, CVehicle* pVehicle)
result = true; result = true;
} }
} }
return true; return result;
} }
void CCranes::UpdateCranes(void) void CCranes::UpdateCranes(void)

View file

@ -109,9 +109,6 @@ enum eFlightModel
FLIGHT_MODEL_SEAPLANE FLIGHT_MODEL_SEAPLANE
}; };
// Or Weapon.h?
void FireOneInstantHitRound(CVector *shotSource, CVector *shotTarget, int32 damage);
class CVehicle : public CPhysical class CVehicle : public CPhysical
{ {
public: public: