Cleanup project a bit

This commit is contained in:
Filip Gawin 2019-06-30 12:53:39 +02:00
parent d12db35a9f
commit 2115faec38
37 changed files with 319 additions and 317 deletions

View File

@ -150,7 +150,6 @@ typedef interface IAMStats IAMStats;
extern "C"{ extern "C"{
#endif #endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * ); void __RPC_USER MIDL_user_free( void * );

View File

@ -24,7 +24,7 @@ extern "C" {
#define VFW_FIRST_CODE 0x200 #define VFW_FIRST_CODE 0x200
#define MAX_ERROR_TEXT_LEN 160 #define MAX_ERROR_TEXT_LEN 160
#include <VFWMSGS.H> // includes all message definitions #include <vfwmsgs.h> // includes all message definitions
typedef BOOL (WINAPI* AMGETERRORTEXTPROCA)(HRESULT, char *, DWORD); typedef BOOL (WINAPI* AMGETERRORTEXTPROCA)(HRESULT, char *, DWORD);
typedef BOOL (WINAPI* AMGETERRORTEXTPROCW)(HRESULT, WCHAR *, DWORD); typedef BOOL (WINAPI* AMGETERRORTEXTPROCW)(HRESULT, WCHAR *, DWORD);

View File

@ -862,7 +862,6 @@ typedef interface IVPManager IVPManager;
extern "C"{ extern "C"{
#endif #endif
void * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void * ); void __RPC_USER MIDL_user_free( void * );
/* interface __MIDL_itf_strmif_0000 */ /* interface __MIDL_itf_strmif_0000 */

View File

@ -790,7 +790,7 @@ CCam::WorkOutCamHeightWeeCar(CVector &TargetCoors, float TargetOrientation)
float RoadZ = 0.0f; float RoadZ = 0.0f;
float RoofZ = 0.0f; float RoofZ = 0.0f;
if(CWorld::ProcessVerticalLine(Source, -1000.0f, colpoint, ent, true, false, false, false, false, false, false) && if(CWorld::ProcessVerticalLine(Source, -1000.0f, colpoint, ent, true, false, false, false, false, false, nil) &&
ent->IsBuilding()){ ent->IsBuilding()){
FoundRoad = true; FoundRoad = true;
RoadZ = colpoint.point.z; RoadZ = colpoint.point.z;
@ -807,7 +807,7 @@ CCam::WorkOutCamHeightWeeCar(CVector &TargetCoors, float TargetOrientation)
TargetZOffSet = 0.0f; TargetZOffSet = 0.0f;
} }
}else{ }else{
if(CWorld::ProcessVerticalLine(Source, 1000.0f, colpoint, ent, true, false, false, false, false, false, false) && if(CWorld::ProcessVerticalLine(Source, 1000.0f, colpoint, ent, true, false, false, false, false, false, nil) &&
ent->IsBuilding()){ ent->IsBuilding()){
FoundRoof = true; FoundRoof = true;
RoofZ = colpoint.point.z; RoofZ = colpoint.point.z;

View File

@ -1,5 +1,4 @@
#pragma once #pragma once
#include "Placeable.h" #include "Placeable.h"
class CEntity; class CEntity;

View File

@ -1,4 +1,4 @@
#include <Windows.h> #include <windows.h>
#include "common.h" #include "common.h"
#include "patcher.h" #include "patcher.h"
#include "CdStream.h" #include "CdStream.h"
@ -53,9 +53,9 @@ CdStreamInitThread(void)
{ {
for ( int32 i = 0; i < gNumChannels; i++ ) for ( int32 i = 0; i < gNumChannels; i++ )
{ {
gpReadInfo[i].hSemaphore = CreateSemaphore(NULL, 0, 2, NULL); gpReadInfo[i].hSemaphore = CreateSemaphore(nil, 0, 2, nil);
if ( gpReadInfo[i].hSemaphore == NULL ) if ( gpReadInfo[i].hSemaphore == nil )
{ {
CDTRACE("failed to create sync semaphore"); CDTRACE("failed to create sync semaphore");
ASSERT(0); ASSERT(0);
@ -68,20 +68,20 @@ CdStreamInitThread(void)
gChannelRequestQ.head = 0; gChannelRequestQ.head = 0;
gChannelRequestQ.tail = 0; gChannelRequestQ.tail = 0;
gChannelRequestQ.size = gNumChannels + 1; gChannelRequestQ.size = gNumChannels + 1;
ASSERT(gChannelRequestQ.items != NULL ); ASSERT(gChannelRequestQ.items != nil );
gCdStreamSema = CreateSemaphore(NULL, 0, 5, "CdStream"); gCdStreamSema = CreateSemaphore(nil, 0, 5, "CdStream");
if ( gCdStreamSema == NULL ) if ( gCdStreamSema == nil )
{ {
CDTRACE("failed to create stream semaphore"); CDTRACE("failed to create stream semaphore");
ASSERT(0); ASSERT(0);
return; return;
} }
_gCdStreamThread = CreateThread(NULL, 64*1024/*64KB*/, CdStreamThread, NULL, CREATE_SUSPENDED, &_gCdStreamThreadId); _gCdStreamThread = CreateThread(nil, 64*1024/*64KB*/, CdStreamThread, nil, CREATE_SUSPENDED, &_gCdStreamThreadId);
if ( _gCdStreamThread == NULL ) if ( _gCdStreamThread == nil )
{ {
CDTRACE("failed to create streaming thread"); CDTRACE("failed to create streaming thread");
ASSERT(0); ASSERT(0);
@ -101,7 +101,7 @@ CdStreamInit(int32 numChannels)
DWORD NumberOfFreeClusters; DWORD NumberOfFreeClusters;
DWORD TotalNumberOfClusters; DWORD TotalNumberOfClusters;
GetDiskFreeSpace(NULL, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters); GetDiskFreeSpace(nil, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters);
_gdwCdStreamFlags = 0; _gdwCdStreamFlags = 0;
@ -118,7 +118,7 @@ CdStreamInit(int32 numChannels)
_gbCdStreamAsync = FALSE; _gbCdStreamAsync = FALSE;
void *pBuffer = (void *)RwMallocAlign(CDSTREAM_SECTOR_SIZE, BytesPerSector); void *pBuffer = (void *)RwMallocAlign(CDSTREAM_SECTOR_SIZE, BytesPerSector);
ASSERT( pBuffer != NULL ); ASSERT( pBuffer != nil );
SetLastError(0); SetLastError(0);
@ -127,7 +127,7 @@ CdStreamInit(int32 numChannels)
gNumChannels = numChannels; gNumChannels = numChannels;
gpReadInfo = (CdReadInfo *)LocalAlloc(LMEM_ZEROINIT, sizeof(CdReadInfo) * numChannels); gpReadInfo = (CdReadInfo *)LocalAlloc(LMEM_ZEROINIT, sizeof(CdReadInfo) * numChannels);
ASSERT( gpReadInfo != NULL ); ASSERT( gpReadInfo != nil );
CDDEBUG("read info %p", gpReadInfo); CDDEBUG("read info %p", gpReadInfo);
@ -156,15 +156,15 @@ CdStreamInit(int32 numChannels)
CdStreamInitThread(); CdStreamInitThread();
ASSERT( pBuffer != NULL ); ASSERT( pBuffer != nil );
RwFreeAlign(pBuffer); RwFreeAlign(pBuffer);
} }
uint32 uint32
GetGTA3ImgSize(void) GetGTA3ImgSize(void)
{ {
ASSERT( gImgFiles[0] != NULL ); ASSERT( gImgFiles[0] != nil );
return (uint32)GetFileSize(gImgFiles[0], NULL); return (uint32)GetFileSize(gImgFiles[0], nil);
} }
void void
@ -189,17 +189,17 @@ int32
CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size) CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
{ {
ASSERT( channel < gNumChannels ); ASSERT( channel < gNumChannels );
ASSERT( buffer != NULL ); ASSERT( buffer != nil );
lastPosnRead = size + offset; lastPosnRead = size + offset;
ASSERT( _GET_INDEX(offset) < MAX_CDIMAGES ); ASSERT( _GET_INDEX(offset) < MAX_CDIMAGES );
HANDLE hImage = gImgFiles[_GET_INDEX(offset)]; HANDLE hImage = gImgFiles[_GET_INDEX(offset)];
ASSERT( hImage != NULL ); ASSERT( hImage != nil );
CdReadInfo *pChannel = &gpReadInfo[channel]; CdReadInfo *pChannel = &gpReadInfo[channel];
ASSERT( pChannel != NULL ); ASSERT( pChannel != nil );
pChannel->hFile = hImage; pChannel->hFile = hImage;
@ -218,7 +218,7 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
AddToQueue(&gChannelRequestQ, channel); AddToQueue(&gChannelRequestQ, channel);
if ( !ReleaseSemaphore(gCdStreamSema, 1, NULL) ) if ( !ReleaseSemaphore(gCdStreamSema, 1, nil) )
printf("Signal Sema Error\n"); printf("Signal Sema Error\n");
return STREAM_SUCCESS; return STREAM_SUCCESS;
@ -228,7 +228,7 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
{ {
ASSERT( channel < gNumChannels ); ASSERT( channel < gNumChannels );
CdReadInfo *pChannel = &gpReadInfo[channel]; CdReadInfo *pChannel = &gpReadInfo[channel];
ASSERT( pChannel != NULL ); ASSERT( pChannel != nil );
pChannel->Overlapped.Offset = _GET_OFFSET(offset) * CDSTREAM_SECTOR_SIZE; pChannel->Overlapped.Offset = _GET_OFFSET(offset) * CDSTREAM_SECTOR_SIZE;
@ -239,11 +239,11 @@ CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size)
return STREAM_SUCCESS; return STREAM_SUCCESS;
} }
SetFilePointer(hImage, _GET_OFFSET(offset) * CDSTREAM_SECTOR_SIZE, NULL, FILE_BEGIN); SetFilePointer(hImage, _GET_OFFSET(offset) * CDSTREAM_SECTOR_SIZE, nil, FILE_BEGIN);
DWORD NumberOfBytesRead; DWORD NumberOfBytesRead;
if ( !ReadFile(hImage, buffer, size * CDSTREAM_SECTOR_SIZE, &NumberOfBytesRead, NULL) ) if ( !ReadFile(hImage, buffer, size * CDSTREAM_SECTOR_SIZE, &NumberOfBytesRead, nil) )
return STREAM_NONE; return STREAM_NONE;
else else
return STREAM_SUCCESS; return STREAM_SUCCESS;
@ -254,7 +254,7 @@ CdStreamGetStatus(int32 channel)
{ {
ASSERT( channel < gNumChannels ); ASSERT( channel < gNumChannels );
CdReadInfo *pChannel = &gpReadInfo[channel]; CdReadInfo *pChannel = &gpReadInfo[channel];
ASSERT( pChannel != NULL ); ASSERT( pChannel != nil );
if ( _gbCdStreamAsync ) if ( _gbCdStreamAsync )
{ {
@ -278,7 +278,7 @@ CdStreamGetStatus(int32 channel)
if ( _gbCdStreamOverlapped ) if ( _gbCdStreamOverlapped )
{ {
ASSERT( pChannel->hFile != NULL ); ASSERT( pChannel->hFile != nil );
if ( WaitForSingleObjectEx(pChannel->hFile, 0, TRUE) == WAIT_OBJECT_0 ) if ( WaitForSingleObjectEx(pChannel->hFile, 0, TRUE) == WAIT_OBJECT_0 )
return STREAM_NONE; return STREAM_NONE;
else else
@ -299,7 +299,7 @@ CdStreamSync(int32 channel)
{ {
ASSERT( channel < gNumChannels ); ASSERT( channel < gNumChannels );
CdReadInfo *pChannel = &gpReadInfo[channel]; CdReadInfo *pChannel = &gpReadInfo[channel];
ASSERT( pChannel != NULL ); ASSERT( pChannel != nil );
if ( _gbCdStreamAsync ) if ( _gbCdStreamAsync )
{ {
@ -307,7 +307,7 @@ CdStreamSync(int32 channel)
{ {
pChannel->bLocked = true; pChannel->bLocked = true;
ASSERT( pChannel->hSemaphore != NULL ); ASSERT( pChannel->hSemaphore != nil );
WaitForSingleObject(pChannel->hSemaphore, INFINITE); WaitForSingleObject(pChannel->hSemaphore, INFINITE);
} }
@ -321,7 +321,7 @@ CdStreamSync(int32 channel)
if ( _gbCdStreamOverlapped && pChannel->hFile ) if ( _gbCdStreamOverlapped && pChannel->hFile )
{ {
ASSERT(pChannel->hFile != NULL ); ASSERT(pChannel->hFile != nil );
if ( GetOverlappedResult(pChannel->hFile, &pChannel->Overlapped, &NumberOfBytesTransferred, TRUE) ) if ( GetOverlappedResult(pChannel->hFile, &pChannel->Overlapped, &NumberOfBytesTransferred, TRUE) )
return STREAM_NONE; return STREAM_NONE;
else else
@ -334,8 +334,8 @@ CdStreamSync(int32 channel)
void void
AddToQueue(Queue *queue, int32 item) AddToQueue(Queue *queue, int32 item)
{ {
ASSERT( queue != NULL ); ASSERT( queue != nil );
ASSERT( queue->items != NULL ); ASSERT( queue->items != nil );
queue->items[queue->tail] = item; queue->items[queue->tail] = item;
queue->tail = (queue->tail + 1) % queue->size; queue->tail = (queue->tail + 1) % queue->size;
@ -347,18 +347,18 @@ AddToQueue(Queue *queue, int32 item)
int32 int32
GetFirstInQueue(Queue *queue) GetFirstInQueue(Queue *queue)
{ {
ASSERT( queue != NULL ); ASSERT( queue != nil );
if ( queue->head == queue->tail ) if ( queue->head == queue->tail )
return -1; return -1;
ASSERT( queue->items != NULL ); ASSERT( queue->items != nil );
return queue->items[queue->head]; return queue->items[queue->head];
} }
void void
RemoveFirstInQueue(Queue *queue) RemoveFirstInQueue(Queue *queue)
{ {
ASSERT( queue != NULL ); ASSERT( queue != nil );
if ( queue->head == queue->tail ) if ( queue->head == queue->tail )
{ {
debug("Queue is empty\n"); debug("Queue is empty\n");
@ -381,7 +381,7 @@ WINAPI CdStreamThread(LPVOID lpThreadParameter)
ASSERT( channel < gNumChannels ); ASSERT( channel < gNumChannels );
CdReadInfo *pChannel = &gpReadInfo[channel]; CdReadInfo *pChannel = &gpReadInfo[channel];
ASSERT( pChannel != NULL ); ASSERT( pChannel != nil );
pChannel->bInUse = true; pChannel->bInUse = true;
@ -391,8 +391,8 @@ WINAPI CdStreamThread(LPVOID lpThreadParameter)
{ {
pChannel->Overlapped.Offset = pChannel->nSectorOffset * CDSTREAM_SECTOR_SIZE; pChannel->Overlapped.Offset = pChannel->nSectorOffset * CDSTREAM_SECTOR_SIZE;
ASSERT(pChannel->hFile != NULL ); ASSERT(pChannel->hFile != nil );
ASSERT(pChannel->pBuffer != NULL ); ASSERT(pChannel->pBuffer != nil );
DWORD NumberOfBytesTransferred; DWORD NumberOfBytesTransferred;
@ -416,10 +416,10 @@ WINAPI CdStreamThread(LPVOID lpThreadParameter)
} }
else else
{ {
ASSERT(pChannel->hFile != NULL ); ASSERT(pChannel->hFile != nil );
ASSERT(pChannel->pBuffer != NULL ); ASSERT(pChannel->pBuffer != nil );
SetFilePointer(pChannel->hFile, pChannel->nSectorOffset * CDSTREAM_SECTOR_SIZE, NULL, FILE_BEGIN); SetFilePointer(pChannel->hFile, pChannel->nSectorOffset * CDSTREAM_SECTOR_SIZE, nil, FILE_BEGIN);
DWORD NumberOfBytesRead; DWORD NumberOfBytesRead;
if ( ReadFile(pChannel->hFile, if ( ReadFile(pChannel->hFile,
@ -439,7 +439,7 @@ WINAPI CdStreamThread(LPVOID lpThreadParameter)
if ( pChannel->bLocked ) if ( pChannel->bLocked )
{ {
ASSERT( pChannel->hSemaphore != NULL ); ASSERT( pChannel->hSemaphore != nil );
ReleaseSemaphore(pChannel->hSemaphore, 1, NULL); ReleaseSemaphore(pChannel->hSemaphore, 1, NULL);
} }
@ -450,7 +450,7 @@ WINAPI CdStreamThread(LPVOID lpThreadParameter)
bool bool
CdStreamAddImage(char const *path) CdStreamAddImage(char const *path)
{ {
ASSERT(path != NULL); ASSERT(path != nil);
ASSERT(gNumImages < MAX_CDIMAGES); ASSERT(gNumImages < MAX_CDIMAGES);
SetLastError(0); SetLastError(0);
@ -458,12 +458,12 @@ CdStreamAddImage(char const *path)
gImgFiles[gNumImages] = CreateFile(path, gImgFiles[gNumImages] = CreateFile(path,
GENERIC_READ, GENERIC_READ,
FILE_SHARE_READ, FILE_SHARE_READ,
NULL, nil,
OPEN_EXISTING, OPEN_EXISTING,
_gdwCdStreamFlags | FILE_FLAG_RANDOM_ACCESS | FILE_ATTRIBUTE_READONLY, _gdwCdStreamFlags | FILE_FLAG_RANDOM_ACCESS | FILE_ATTRIBUTE_READONLY,
NULL); nil);
ASSERT( gImgFiles[gNumImages] != NULL ); ASSERT( gImgFiles[gNumImages] != nil );
if ( gImgFiles[gNumImages] == NULL ) if ( gImgFiles[gNumImages] == NULL )
return false; return false;
@ -478,10 +478,10 @@ char *
CdStreamGetImageName(int32 cd) CdStreamGetImageName(int32 cd)
{ {
ASSERT(cd < MAX_CDIMAGES); ASSERT(cd < MAX_CDIMAGES);
if ( gImgFiles[cd] != NULL ) if ( gImgFiles[cd] != nil )
return gCdImageNames[cd]; return gCdImageNames[cd];
return NULL; return nil;
} }
void void
@ -495,7 +495,7 @@ CdStreamRemoveImages(void)
SetLastError(0); SetLastError(0);
CloseHandle(gImgFiles[i]); CloseHandle(gImgFiles[i]);
gImgFiles[i] = NULL; gImgFiles[i] = nil;
} }
gNumImages = 0; gNumImages = 0;

View File

@ -38,7 +38,7 @@ void
LoadingScreenLoadingFile(const char *filename) LoadingScreenLoadingFile(const char *filename)
{ {
sprintf(gString, "Loading %s", GetFilename(filename)); sprintf(gString, "Loading %s", GetFilename(filename));
LoadingScreen("Loading the Game", gString, 0); LoadingScreen("Loading the Game", gString, nil);
} }
void void
@ -144,7 +144,7 @@ CFileLoader::LoadLine(int fd)
int i; int i;
char *line; char *line;
if(CFileMgr::ReadLine(fd, ms_line, 256) == nil) if(CFileMgr::ReadLine(fd, ms_line, 256) == false)
return nil; return nil;
for(i = 0; ms_line[i] != '\0'; i++) for(i = 0; ms_line[i] != '\0'; i++)
if(ms_line[i] < ' ' || ms_line[i] == ',') if(ms_line[i] < ' ' || ms_line[i] == ',')
@ -311,7 +311,7 @@ CFileLoader::FindRelatedModelInfoCB(RpAtomic *atomic, void *data)
nodename = GetFrameNodeName(RpClumpGetFrame(atomic)); nodename = GetFrameNodeName(RpClumpGetFrame(atomic));
GetNameAndLOD(nodename, name, &n); GetNameAndLOD(nodename, name, &n);
mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(name, 0); mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(name, nil);
if(mi){ if(mi){
assert(mi->IsSimple()); assert(mi->IsSimple());
mi->SetAtomic(n, atomic); mi->SetAtomic(n, atomic);
@ -360,7 +360,7 @@ CFileLoader::LoadClumpFile(const char *filename)
if(clump){ if(clump){
nodename = GetFrameNodeName(RpClumpGetFrame(clump)); nodename = GetFrameNodeName(RpClumpGetFrame(clump));
GetNameAndLOD(nodename, name, &n); GetNameAndLOD(nodename, name, &n);
mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(name, 0); mi = (CClumpModelInfo*)CModelInfo::GetModelInfo(name, nil);
assert(mi->IsClump()); assert(mi->IsClump());
if(mi) if(mi)
mi->SetClump(clump); mi->SetClump(clump);
@ -457,7 +457,7 @@ CFileLoader::SetRelatedModelInfoCB(RpAtomic *atomic, void *data)
RpClumpRemoveAtomic(clump, atomic); RpClumpRemoveAtomic(clump, atomic);
RpAtomicSetFrame(atomic, RwFrameCreate()); RpAtomicSetFrame(atomic, RwFrameCreate());
CVisibilityPlugins::SetAtomicModelInfo(atomic, gpRelatedModelInfo); CVisibilityPlugins::SetAtomicModelInfo(atomic, gpRelatedModelInfo);
CVisibilityPlugins::SetAtomicRenderCallback(atomic, 0); CVisibilityPlugins::SetAtomicRenderCallback(atomic, nil);
return atomic; return atomic;
} }

View File

@ -187,10 +187,10 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
{ {
CMouseControllerState state; CMouseControllerState state;
if ( PSGLOBAL(mouse) == NULL ) if ( PSGLOBAL(mouse) == nil )
_InputInitialiseMouse(); _InputInitialiseMouse();
if ( PSGLOBAL(mouse) != NULL ) if ( PSGLOBAL(mouse) != nil )
{ {
DIDEVCAPS devCaps; DIDEVCAPS devCaps;
devCaps.dwSize = sizeof(DIDEVCAPS); devCaps.dwSize = sizeof(DIDEVCAPS);
@ -228,12 +228,12 @@ void CPad::UpdateMouse()
{ {
if ( IsForegroundApp() ) if ( IsForegroundApp() )
{ {
if ( PSGLOBAL(mouse) == NULL ) if ( PSGLOBAL(mouse) == nil )
_InputInitialiseMouse(); _InputInitialiseMouse();
DIMOUSESTATE2 state; DIMOUSESTATE2 state;
if ( PSGLOBAL(mouse) != NULL && SUCCEEDED(_InputGetMouseState(&state)) ) if ( PSGLOBAL(mouse) != nil && SUCCEEDED(_InputGetMouseState(&state)) )
{ {
int32 signX = 1; int32 signX = 1;
int32 signy = 1; int32 signy = 1;
@ -386,7 +386,7 @@ void CPad::StartShake_Train(float fX, float fY)
if ( CCutsceneMgr::IsRunning() || CGame::playingIntro ) if ( CCutsceneMgr::IsRunning() || CGame::playingIntro )
return; return;
if (FindPlayerVehicle() != NULL && FindPlayerVehicle()->IsTrain() ) if (FindPlayerVehicle() != nil && FindPlayerVehicle()->IsTrain() )
return; return;
float fDist = ( TheCamera.GetPosition() - CVector(fX, fY, 0.0f) ).Magnitude2D(); float fDist = ( TheCamera.GetPosition() - CVector(fX, fY, 0.0f) ).Magnitude2D();
@ -1822,7 +1822,7 @@ char *CPad::EditString(char *pStr, int32 nSize)
// extenter/up/down // extenter/up/down
if ( GetPad(0)->GetEnterJustDown() || GetPad(0)->GetUpJustDown() || GetPad(0)->GetDownJustDown() ) if ( GetPad(0)->GetEnterJustDown() || GetPad(0)->GetUpJustDown() || GetPad(0)->GetDownJustDown() )
return NULL; return nil;
return pStr; return pStr;
} }

View File

@ -2,10 +2,10 @@
class CPlaceable class CPlaceable
{ {
// disable allocation
static void *operator new(size_t) { assert(0); return nil; }
static void operator delete(void*, size_t) { assert(0); }
public: public:
// disable allocation
static void *operator new(size_t) = delete;
CMatrix m_matrix; CMatrix m_matrix;
CPlaceable(void); CPlaceable(void);

View File

@ -43,7 +43,7 @@ CSprite2d *CRadar::TonySprite = (CSprite2d*)0x885B58;
CSprite2d *CRadar::WeaponSprite = (CSprite2d*)0x941534; CSprite2d *CRadar::WeaponSprite = (CSprite2d*)0x941534;
CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = { CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
NULL, nil,
AsukaSprite, AsukaSprite,
BombSprite, BombSprite,
CatSprite, CatSprite,

View File

@ -1,7 +1,7 @@
#define WITHD3D #define WITHD3D
#include "common.h" #include "common.h"
#include "patcher.h" #include "patcher.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "skeleton.h" #include "skeleton.h"
void * void *
@ -9,11 +9,11 @@ RwMallocAlign(RwUInt32 size, RwUInt32 align)
{ {
void *mem = (void *)malloc(size + align); void *mem = (void *)malloc(size + align);
ASSERT(mem != NULL); ASSERT(mem != nil);
void *addr = (void *)((((RwUInt32)mem) + align) & ~(align - 1)); void *addr = (void *)((((RwUInt32)mem) + align) & ~(align - 1));
ASSERT(addr != NULL); ASSERT(addr != nil);
*(((void **)addr) - 1) = mem; *(((void **)addr) - 1) = mem;
@ -23,11 +23,11 @@ RwMallocAlign(RwUInt32 size, RwUInt32 align)
void void
RwFreeAlign(void *mem) RwFreeAlign(void *mem)
{ {
ASSERT(mem != NULL); ASSERT(mem != nil);
void *addr = *(((void **)mem) - 1); void *addr = *(((void **)mem) - 1);
ASSERT(addr != NULL); ASSERT(addr != nil);
free(addr); free(addr);
} }
@ -283,7 +283,7 @@ CameraDestroy(RwCamera *camera)
RwRasterDestroy(raster); RwRasterDestroy(raster);
if ((tmpRaster != NULL) && (tmpRaster != raster)) if ((tmpRaster != nil) && (tmpRaster != raster))
{ {
RwRasterDestroy(tmpRaster); RwRasterDestroy(tmpRaster);
} }
@ -296,7 +296,7 @@ CameraDestroy(RwCamera *camera)
RwRasterDestroy(raster); RwRasterDestroy(raster);
if ((tmpRaster != NULL) && (tmpRaster != raster)) if ((tmpRaster != nil) && (tmpRaster != raster))
{ {
RwRasterDestroy(tmpRaster); RwRasterDestroy(tmpRaster);
} }
@ -344,7 +344,7 @@ CameraCreate(RwInt32 width, RwInt32 height, RwBool zBuffer)
/* if we're here then an error must have occurred so clean up */ /* if we're here then an error must have occurred so clean up */
CameraDestroy(camera); CameraDestroy(camera);
return (NULL); return (nil);
} }
STARTPATCHES STARTPATCHES

View File

@ -54,7 +54,7 @@ _rpMatFXD3D8AtomicMatFXDefaultRender(RxD3D8InstanceData *inst, int flags, RwText
if(flags & (rpGEOMETRYTEXTURED|rpGEOMETRYTEXTURED2) && texture) if(flags & (rpGEOMETRYTEXTURED|rpGEOMETRYTEXTURED2) && texture)
RwD3D8SetTexture(texture, 0); RwD3D8SetTexture(texture, 0);
else else
RwD3D8SetTexture(NULL, 0); RwD3D8SetTexture(nil, 0);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)(inst->vertexAlpha || inst->material->color.alpha != 0xFF)); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)(inst->vertexAlpha || inst->material->color.alpha != 0xFF));
RwD3D8SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, inst->vertexAlpha != 0); RwD3D8SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, inst->vertexAlpha != 0);
RwD3D8SetPixelShader(0); RwD3D8SetPixelShader(0);

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include "Game.h"
enum { enum {
STREAM_OFFSET_MODEL = 0, STREAM_OFFSET_MODEL = 0,
STREAM_OFFSET_TXD = STREAM_OFFSET_MODEL+MODELINFOSIZE, STREAM_OFFSET_TXD = STREAM_OFFSET_MODEL+MODELINFOSIZE,

View File

@ -1,4 +1,4 @@
#include <Windows.h> #include <windows.h>
#include "common.h" #include "common.h"
#include "patcher.h" #include "patcher.h"
#include "DMAudio.h" #include "DMAudio.h"

View File

@ -164,7 +164,7 @@ CTxdStore::StartLoadTxd(int slot, RwStream *stream)
return def->texDict != nil; return def->texDict != nil;
}else{ }else{
printf("Failed to load TXD\n"); printf("Failed to load TXD\n");
return nil; return false;
} }
} }

View File

@ -9,7 +9,7 @@ CAnimBlendHierarchy::CAnimBlendHierarchy(void)
numSequences = 0; numSequences = 0;
compressed = 0; compressed = 0;
totalLength = 0.0f; totalLength = 0.0f;
linkPtr = 0; linkPtr = nil;
} }
void void

View File

@ -366,7 +366,7 @@ RpAnimBlendClumpUpdateAnimations(RpClump *clump, float timeDelta)
updateData.foobar = 1; updateData.foobar = 1;
} }
} }
updateData.nodes[i] = 0; updateData.nodes[i] = nil;
clumpData->ForAllFrames(FrameUpdateCallBack, &updateData); clumpData->ForAllFrames(FrameUpdateCallBack, &updateData);

View File

@ -55,7 +55,7 @@ void cMusicManager::DisplayRadioStationName()
if (!CTimer::GetIsPaused() && !TheCamera.m_WideScreenOn && cMusicManager::PlayerInCar() && !CReplay::IsPlayingBack()) { if (!CTimer::GetIsPaused() && !TheCamera.m_WideScreenOn && cMusicManager::PlayerInCar() && !CReplay::IsPlayingBack()) {
if (MusicManager.m_bPlayerInCar && !MusicManager.m_bPreviousPlayerInCar) if (MusicManager.m_bPlayerInCar && !MusicManager.m_bPreviousPlayerInCar)
pCurrentStation = nullptr; pCurrentStation = nil;
if (cSampleManager.IsMP3RadioChannelAvailable()) { if (cSampleManager.IsMP3RadioChannelAvailable()) {
gStreamedSound = MusicManager.m_nCurrentStreamedSound; gStreamedSound = MusicManager.m_nCurrentStreamedSound;
@ -103,7 +103,7 @@ void cMusicManager::DisplayRadioStationName()
} }
} }
wchar *string = nullptr; wchar *string = nil;
switch (pRetune) { switch (pRetune) {
case HEAD_RADIO: case HEAD_RADIO:

View File

@ -14,7 +14,7 @@
#include <new> #include <new>
#ifdef WITHD3D #ifdef WITHD3D
#include <Windows.h> #include <windows.h>
#include <d3d8types.h> #include <d3d8types.h>
#endif #endif
@ -43,7 +43,7 @@ typedef int64_t int64;
// hardcode ucs-2 // hardcode ucs-2
typedef uint16_t wchar; typedef uint16_t wchar;
#define nil NULL #define nil nullptr
#include "config.h" #include "config.h"
@ -53,7 +53,7 @@ typedef uint16_t wchar;
extern void **rwengine; extern void **rwengine;
#define RwEngineInstance (*rwengine) #define RwEngineInstance (*rwengine)
#include "skel\skeleton.h" #include "skeleton.h"
#include "Draw.h" #include "Draw.h"
/* /*
@ -164,3 +164,6 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
#define PERCENT(x, p) ((float(x) * (float(p) / 100.0f))) #define PERCENT(x, p) ((float(x) * (float(p) / 100.0f)))
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
#define BIT(num) (1<<(num)) #define BIT(num) (1<<(num))
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))

View File

@ -19,14 +19,14 @@ CPedPlacement::FindZCoorForPed(CVector* pos)
pos->z + 1.0f pos->z + 1.0f
); );
if (CWorld::ProcessVerticalLine(vec, startZ, foundCol, foundEnt, true, false, false, false, true, false, false)) if (CWorld::ProcessVerticalLine(vec, startZ, foundCol, foundEnt, true, false, false, false, true, false, nil))
foundColZ = foundCol.point.z; foundColZ = foundCol.point.z;
// Adjust coords and do a second test // Adjust coords and do a second test
vec.x += 0.1f; vec.x += 0.1f;
vec.y += 0.1f; vec.y += 0.1f;
if (CWorld::ProcessVerticalLine(vec, startZ, foundCol, foundEnt, true, false, false, false, true, false, false)) if (CWorld::ProcessVerticalLine(vec, startZ, foundCol, foundEnt, true, false, false, false, true, false, nil))
foundColZ2 = foundCol.point.z; foundColZ2 = foundCol.point.z;
zForPed = max(foundColZ, foundColZ2); zForPed = max(foundColZ, foundColZ2);

View File

@ -75,7 +75,7 @@ inline bool DebugMenuLoad(void)
if(gDebugMenuAPI.isLoaded) if(gDebugMenuAPI.isLoaded)
return true; return true;
HMODULE mod = LoadLibraryA("debugmenu"); HMODULE mod = LoadLibraryA("debugmenu");
if(mod == 0){ if(mod == nil){
char modulePath[MAX_PATH]; char modulePath[MAX_PATH];
HMODULE dllModule; HMODULE dllModule;
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)&gDebugMenuAPI, &dllModule); GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)&gDebugMenuAPI, &dllModule);
@ -85,7 +85,7 @@ inline bool DebugMenuLoad(void)
strcat(modulePath, "debugmenu"); strcat(modulePath, "debugmenu");
mod = LoadLibraryA(modulePath); mod = LoadLibraryA(modulePath);
} }
if(mod == 0) if(mod == nil)
return false; return false;
gDebugMenuAPI.addint8 = (DebugMenuAddInt8_TYPE)GetProcAddress(mod, "DebugMenuAddInt8"); gDebugMenuAPI.addint8 = (DebugMenuAddInt8_TYPE)GetProcAddress(mod, "DebugMenuAddInt8");
gDebugMenuAPI.addint16 = (DebugMenuAddInt16_TYPE)GetProcAddress(mod, "DebugMenuAddInt16"); gDebugMenuAPI.addint16 = (DebugMenuAddInt16_TYPE)GetProcAddress(mod, "DebugMenuAddInt16");

View File

@ -1,14 +1,14 @@
#include "common.h" #include "common.h"
#include "patcher.h" #include "patcher.h"
#include "main.h" #include "main.h"
#include "lights.h" #include "Lights.h"
#include "PointLights.h" #include "PointLights.h"
#include "RpAnimBlend.h" #include "RpAnimBlend.h"
#include "AnimBlendClumpData.h" #include "AnimBlendClumpData.h"
#include "Renderer.h" #include "Renderer.h"
#include "ModelIndices.h" #include "ModelIndices.h"
#include "Shadows.h" #include "Shadows.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "CutsceneObject.h" #include "CutsceneObject.h"
CCutsceneObject::CCutsceneObject(void) CCutsceneObject::CCutsceneObject(void)

View File

@ -4,7 +4,7 @@
#include "Particle.h" #include "Particle.h"
#include "Stats.h" #include "Stats.h"
#include "World.h" #include "World.h"
#include "DMaudio.h" #include "DMAudio.h"
#include "RpAnimBlend.h" #include "RpAnimBlend.h"
#include "Ped.h" #include "Ped.h"
#include "PlayerPed.h" #include "PlayerPed.h"
@ -416,7 +416,7 @@ CPed::RemoveBodyPart(PedNode nodeId, int8 unk)
if (nodeId != PED_HEAD) if (nodeId != PED_HEAD)
CPed::SpawnFlyingComponent(nodeId, unk); CPed::SpawnFlyingComponent(nodeId, unk);
RecurseFrameChildrenVisibilityCB(frame, 0); RecurseFrameChildrenVisibilityCB(frame, nil);
pos.x = 0.0f; pos.x = 0.0f;
pos.y = 0.0f; pos.y = 0.0f;
pos.z = 0.0f; pos.z = 0.0f;
@ -447,7 +447,7 @@ CPed::RemoveBodyPart(PedNode nodeId, int8 unk)
RwObject* RwObject*
CPed::SetPedAtomicVisibilityCB(RwObject *object, void *data) CPed::SetPedAtomicVisibilityCB(RwObject *object, void *data)
{ {
if (data == 0) if (data == nil)
RpAtomicSetFlags(object, 0); RpAtomicSetFlags(object, 0);
return object; return object;
} }
@ -456,7 +456,7 @@ RwFrame*
CPed::RecurseFrameChildrenVisibilityCB(RwFrame *frame, void *data) CPed::RecurseFrameChildrenVisibilityCB(RwFrame *frame, void *data)
{ {
RwFrameForAllObjects(frame, SetPedAtomicVisibilityCB, data); RwFrameForAllObjects(frame, SetPedAtomicVisibilityCB, data);
RwFrameForAllChildren(frame, RecurseFrameChildrenVisibilityCB, 0); RwFrameForAllChildren(frame, RecurseFrameChildrenVisibilityCB, nil);
return frame; return frame;
} }
@ -824,7 +824,7 @@ CPed::Attack(void)
&& GetWeapon()->m_eWeaponState != WEAPONSTATE_RELOADING) { && GetWeapon()->m_eWeaponState != WEAPONSTATE_RELOADING) {
weaponAnim = weaponAnimAssoc->animId; weaponAnim = weaponAnimAssoc->animId;
if (ourWeaponFire != WEAPON_FIRE_MELEE || CheckForPedsOnGroundToAttack(((CPlayerPed*)this), 0) < PED_ON_THE_FLOOR) { if (ourWeaponFire != WEAPON_FIRE_MELEE || CheckForPedsOnGroundToAttack(((CPlayerPed*)this), nil) < PED_ON_THE_FLOOR) {
if (weaponAnim != ourWeapon->m_Anim2ToPlay || weaponAnim == ANIM_RBLOCK_CSHOOT) { if (weaponAnim != ourWeapon->m_Anim2ToPlay || weaponAnim == ANIM_RBLOCK_CSHOOT) {
weaponAnimAssoc->Start(ourWeapon->m_fAnimLoopStart); weaponAnimAssoc->Start(ourWeapon->m_fAnimLoopStart);
} else { } else {
@ -873,7 +873,7 @@ CPed::Attack(void)
if (lastReloadWasInFuture) { if (lastReloadWasInFuture) {
if (ourWeaponFire != WEAPON_FIRE_PROJECTILE || !CPed::IsPlayer() || ((CPlayerPed*)this)->field_1380) { if (ourWeaponFire != WEAPON_FIRE_PROJECTILE || !CPed::IsPlayer() || ((CPlayerPed*)this)->field_1380) {
if (!CGame::nastyGame || ourWeaponFire != WEAPON_FIRE_MELEE || CheckForPedsOnGroundToAttack(((CPlayerPed*)this), 0) < PED_ON_THE_FLOOR) { if (!CGame::nastyGame || ourWeaponFire != WEAPON_FIRE_MELEE || CheckForPedsOnGroundToAttack(((CPlayerPed*)this), nil) < PED_ON_THE_FLOOR) {
weaponAnimAssoc = CAnimManager::BlendAnimation((RpClump*)m_rwObject, ASSOCGRP_STD, ourWeapon->m_AnimToPlay, 8.0f); weaponAnimAssoc = CAnimManager::BlendAnimation((RpClump*)m_rwObject, ASSOCGRP_STD, ourWeapon->m_AnimToPlay, 8.0f);
} else { } else {
weaponAnimAssoc = CAnimManager::BlendAnimation((RpClump*)m_rwObject, ASSOCGRP_STD, ourWeapon->m_Anim2ToPlay, 8.0f); weaponAnimAssoc = CAnimManager::BlendAnimation((RpClump*)m_rwObject, ASSOCGRP_STD, ourWeapon->m_Anim2ToPlay, 8.0f);
@ -892,14 +892,14 @@ CPed::Attack(void)
} }
} }
else else
CPed::FinishedAttackCB(0, this); CPed::FinishedAttackCB(nil, this);
} }
void void
CPed::RemoveWeaponModel(int modelId) CPed::RemoveWeaponModel(int modelId)
{ {
// modelId is not used!! This function just removes the current weapon. // modelId is not used!! This function just removes the current weapon.
RwFrameForAllObjects(GetNodeFrame(PED_HANDR),RemoveAllModelCB,0); RwFrameForAllObjects(GetNodeFrame(PED_HANDR),RemoveAllModelCB,nil);
m_wepModelID = -1; m_wepModelID = -1;
} }

View File

@ -41,7 +41,7 @@
#include "Lights.h" #include "Lights.h"
#include "Credits.h" #include "Credits.h"
#include "CullZones.h" #include "CullZones.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "TxdStore.h" #include "TxdStore.h"
#include "FileMgr.h" #include "FileMgr.h"
#include "Text.h" #include "Text.h"

View File

@ -9,7 +9,7 @@
CBaseModelInfo::CBaseModelInfo(ModeInfoType type) CBaseModelInfo::CBaseModelInfo(ModeInfoType type)
{ {
m_colModel = nil; m_colModel = nil;
m_twodEffects = 0; m_twodEffects = nil;
m_objectId = -1; m_objectId = -1;
m_refCount = 0; m_refCount = 0;
m_txdSlot = -1; m_txdSlot = -1;
@ -23,7 +23,7 @@ CBaseModelInfo::Shutdown(void)
{ {
DeleteCollisionModel(); DeleteCollisionModel();
DeleteRwObject(); DeleteRwObject();
m_twodEffects = 0; m_twodEffects = nil;
m_num2dEffects = 0; m_num2dEffects = 0;
m_txdSlot = -1; m_txdSlot = -1;
} }

View File

@ -48,7 +48,7 @@ CClumpModelInfo::SetClump(RpClump *clump)
AddTexDictionaryRef(); AddTexDictionaryRef();
RpClumpForAllAtomics(clump, SetAtomicRendererCB, nil); RpClumpForAllAtomics(clump, SetAtomicRendererCB, nil);
if(strncmp(GetName(), "playerh", 8) == 0) if(strncmp(GetName(), "playerh", 8) == 0)
RpClumpForAllAtomics(clump, SetAtomicRendererCB, CVisibilityPlugins::RenderPlayerCB); RpClumpForAllAtomics(clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
} }
void void

View File

@ -25,7 +25,7 @@ RwObjectNameIdAssocation CPedModelInfo::m_pPedIds[12] = {
{ "Sfootl", PED_FOOTL, 0, }, { "Sfootl", PED_FOOTL, 0, },
{ "Sfootr", PED_FOOTR, 0, }, { "Sfootr", PED_FOOTR, 0, },
{ "Slowerlegr", PED_LOWERLEGR, 0, }, { "Slowerlegr", PED_LOWERLEGR, 0, },
{ NULL, 0, 0, }, { nil, 0, 0, },
}; };
void void
@ -36,7 +36,7 @@ CPedModelInfo::SetClump(RpClump *clump)
if(m_hitColModel == nil) if(m_hitColModel == nil)
CreateHitColModel(); CreateHitColModel();
if(strncmp(GetName(), "player", 7) == 0) if(strncmp(GetName(), "player", 7) == 0)
RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, CVisibilityPlugins::RenderPlayerCB); RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
} }
RpAtomic* RpAtomic*
@ -82,8 +82,8 @@ CPedModelInfo::SetLowDetailClump(RpClump *lodclump)
RpClumpForAllAtomics(m_clump, CountAtomicsCB, &numAtm); // actually unused RpClumpForAllAtomics(m_clump, CountAtomicsCB, &numAtm); // actually unused
RpClumpForAllAtomics(lodclump, CountAtomicsCB, &numLodAtm); RpClumpForAllAtomics(lodclump, CountAtomicsCB, &numLodAtm);
RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, CVisibilityPlugins::RenderPedHiDetailCB); RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPedHiDetailCB);
RpClumpForAllAtomics(lodclump, SetAtomicRendererCB, CVisibilityPlugins::RenderPedLowDetailCB); RpClumpForAllAtomics(lodclump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPedLowDetailCB);
pAtm = atomics; pAtm = atomics;
RpClumpForAllAtomics(lodclump, GetAtomicListCB, &pAtm); RpClumpForAllAtomics(lodclump, GetAtomicListCB, &pAtm);
@ -112,14 +112,14 @@ struct ColNodeInfo
// TODO: find out piece types // TODO: find out piece types
#define NUMPEDINFONODES 8 #define NUMPEDINFONODES 8
ColNodeInfo m_pColNodeInfos[NUMPEDINFONODES] = { ColNodeInfo m_pColNodeInfos[NUMPEDINFONODES] = {
{ NULL, PED_HEAD, 6, 0.0f, 0.05f, 0.2f }, { nil, PED_HEAD, 6, 0.0f, 0.05f, 0.2f },
{ "Storso", 0, 0, 0.0f, 0.15f, 0.2f }, { "Storso", 0, 0, 0.0f, 0.15f, 0.2f },
{ "Storso", 0, 0, 0.0f, -0.05f, 0.3f }, { "Storso", 0, 0, 0.0f, -0.05f, 0.3f },
{ NULL, PED_TORSO, 1, 0.0f, -0.07f, 0.3f }, { nil, PED_TORSO, 1, 0.0f, -0.07f, 0.3f },
{ NULL, PED_UPPERARML, 2, 0.07f, -0.1f, 0.2f }, { nil, PED_UPPERARML, 2, 0.07f, -0.1f, 0.2f },
{ NULL, PED_UPPERARMR, 3, -0.07f, -0.1f, 0.2f }, { nil, PED_UPPERARMR, 3, -0.07f, -0.1f, 0.2f },
{ "Slowerlegl", 0, 4, 0.0f, 0.07f, 0.25f }, { "Slowerlegl", 0, 4, 0.0f, 0.07f, 0.25f },
{ NULL, PED_LOWERLEGR, 5, 0.0f, 0.07f, 0.25f }, { nil, PED_LOWERLEGR, 5, 0.0f, 0.07f, 0.25f },
}; };
RwObject* RwObject*

View File

@ -1003,7 +1003,7 @@ CVehicleModelInfo::SetEnvironmentMapCB(RpMaterial *material, void *data)
if(spec <= 0.0f) if(spec <= 0.0f)
RpMatFXMaterialSetEffects(material, rpMATFXEFFECTNULL); RpMatFXMaterialSetEffects(material, rpMATFXEFFECTNULL);
else{ else{
if(RpMaterialGetTexture(material) == 0) if(RpMaterialGetTexture(material) == nil)
RpMaterialSetTexture(material, gpWhiteTexture); RpMaterialSetTexture(material, gpWhiteTexture);
RpMatFXMaterialSetEffects(material, rpMATFXEFFECTENVMAP); RpMatFXMaterialSetEffects(material, rpMATFXEFFECTENVMAP);
#ifndef PS2_MATFX #ifndef PS2_MATFX

View File

@ -1,6 +1,6 @@
#include <direct.h> #include <direct.h>
#include <csignal> #include <csignal>
#include <Windows.h> #include <windows.h>
#include "common.h" #include "common.h"
#include "patcher.h" #include "patcher.h"
#include "Renderer.h" #include "Renderer.h"
@ -293,7 +293,7 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
strcat_s(re3_buff, re3_buffsize, "(Press Retry to debug the application)"); strcat_s(re3_buff, re3_buffsize, "(Press Retry to debug the application)");
nCode = ::MessageBoxA(NULL, re3_buff, "RE3 Assertion Failed!", nCode = ::MessageBoxA(nil, re3_buff, "RE3 Assertion Failed!",
MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);
if (nCode == IDABORT) if (nCode == IDABORT)

View File

@ -9,7 +9,7 @@
#include "World.h" #include "World.h"
#include "Weather.h" #include "Weather.h"
#include "Collision.h" #include "Collision.h"
#include "TimeCycle.h" #include "Timecycle.h"
#include "Coronas.h" #include "Coronas.h"
struct FlareDef struct FlareDef

View File

@ -543,7 +543,7 @@ void CHud::Draw()
} }
} }
else { else {
m_pLastZoneName = 0; m_pLastZoneName = nil;
m_ZoneState = 0; m_ZoneState = 0;
m_ZoneFadeTimer = 0; m_ZoneFadeTimer = 0;
m_ZoneNameTimer = 0; m_ZoneNameTimer = 0;
@ -639,7 +639,7 @@ void CHud::Draw()
} }
} }
else { else {
m_pLastVehicleName = 0; m_pLastVehicleName = nil;
m_VehicleState = 0; m_VehicleState = 0;
m_VehicleFadeTimer = 0; m_VehicleFadeTimer = 0;
m_VehicleNameTimer = 0; m_VehicleNameTimer = 0;
@ -1234,9 +1234,9 @@ WRAPPER void CHud::GetRidOfAllHudMessages(void) { EAXJMP(0x504F90); }
void CHud::GetRidOfAllHudMessages() void CHud::GetRidOfAllHudMessages()
{ {
m_ZoneState = 0; m_ZoneState = 0;
m_pLastZoneName = 0; m_pLastZoneName = nil;
m_ZoneNameTimer = 0; m_ZoneNameTimer = 0;
m_pZoneName = 0; m_pZoneName = nil;
for (int i = 0; i < 256; i++) { for (int i = 0; i < 256; i++) {
m_HelpMessage[i] = 0; m_HelpMessage[i] = 0;
@ -1249,9 +1249,9 @@ void CHud::GetRidOfAllHudMessages()
m_HelpMessageState = 0; m_HelpMessageState = 0;
m_HelpMessageQuick = 0; m_HelpMessageQuick = 0;
m_HelpMessageDisplayTime = 1.0f; m_HelpMessageDisplayTime = 1.0f;
m_VehicleName = 0; m_VehicleName = nil;
m_pLastVehicleName = 0; m_pLastVehicleName = nil;
m_pVehicleNameToPrint = 0; m_pVehicleNameToPrint = nil;
m_VehicleNameTimer = 0; m_VehicleNameTimer = 0;
m_VehicleFadeTimer = 0; m_VehicleFadeTimer = 0;
m_VehicleState = 0; m_VehicleState = 0;
@ -1284,8 +1284,8 @@ void CHud::Initialise()
Sprites[i].SetTexture(WeaponFilenames[i * 2]); Sprites[i].SetTexture(WeaponFilenames[i * 2]);
} }
gpSniperSightTex = RwTextureRead("sitesniper", 0); gpSniperSightTex = RwTextureRead("sitesniper", nil);
gpRocketSightTex = RwTextureRead("siterocket", 0); gpRocketSightTex = RwTextureRead("siterocket", nil);
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
} }
@ -1427,10 +1427,10 @@ void CHud::Shutdown()
} }
RwTextureDestroy(gpSniperSightTex); RwTextureDestroy(gpSniperSightTex);
gpSniperSightTex = 0; gpSniperSightTex = nil;
RwTextureDestroy(gpRocketSightTex); RwTextureDestroy(gpRocketSightTex);
gpRocketSightTex = 0; gpRocketSightTex = nil;
int HudTXD = CTxdStore::FindTxdSlot("hud"); int HudTXD = CTxdStore::FindTxdSlot("hud");
CTxdStore::RemoveTxdSlot(HudTXD); CTxdStore::RemoveTxdSlot(HudTXD);

View File

@ -107,7 +107,7 @@ CMBlur::CreateImmediateModeData(RwCamera *cam, RwRect *rect)
void void
CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 addalpha) CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 addalpha)
{ {
RwRGBA color = { red, green, blue, blur }; RwRGBA color = { (RwUInt8)red, (RwUInt8)green, (RwUInt8)blue, (RwUInt8)blur };
if(BlurOn){ if(BlurOn){
if(pFrontBuffer){ if(pFrontBuffer){
if(ms_bJustInitialised) if(ms_bJustInitialised)

View File

@ -240,7 +240,7 @@ void CParticle::ReloadConfig()
for ( int32 i = 0; i < MAX_PARTICLES_ON_SCREEN; i++ ) for ( int32 i = 0; i < MAX_PARTICLES_ON_SCREEN; i++ )
{ {
if ( i == MAX_PARTICLES_ON_SCREEN - 1 ) if ( i == MAX_PARTICLES_ON_SCREEN - 1 )
gParticleArray[i].m_pNext = NULL; gParticleArray[i].m_pNext = nil;
else else
gParticleArray[i].m_pNext = &gParticleArray[i + 1]; gParticleArray[i].m_pNext = &gParticleArray[i + 1];
@ -310,37 +310,37 @@ void CParticle::Initialise()
for ( int32 i = 0; i < MAX_SMOKE_FILES; i++ ) for ( int32 i = 0; i < MAX_SMOKE_FILES; i++ )
{ {
gpSmokeTex[i] = RwTextureRead(SmokeFiles[i], NULL); gpSmokeTex[i] = RwTextureRead(SmokeFiles[i], nil);
gpSmokeRaster[i] = RwTextureGetRaster(gpSmokeTex[i]); gpSmokeRaster[i] = RwTextureGetRaster(gpSmokeTex[i]);
} }
for ( int32 i = 0; i < MAX_SMOKE2_FILES; i++ ) for ( int32 i = 0; i < MAX_SMOKE2_FILES; i++ )
{ {
gpSmoke2Tex[i] = RwTextureRead(Smoke2Files[i], NULL); gpSmoke2Tex[i] = RwTextureRead(Smoke2Files[i], nil);
gpSmoke2Raster[i] = RwTextureGetRaster(gpSmoke2Tex[i]); gpSmoke2Raster[i] = RwTextureGetRaster(gpSmoke2Tex[i]);
} }
for ( int32 i = 0; i < MAX_RUBBER_FILES; i++ ) for ( int32 i = 0; i < MAX_RUBBER_FILES; i++ )
{ {
gpRubberTex[i] = RwTextureRead(RubberFiles[i], NULL); gpRubberTex[i] = RwTextureRead(RubberFiles[i], nil);
gpRubberRaster[i] = RwTextureGetRaster(gpRubberTex[i]); gpRubberRaster[i] = RwTextureGetRaster(gpRubberTex[i]);
} }
for ( int32 i = 0; i < MAX_RAINSPLASH_FILES; i++ ) for ( int32 i = 0; i < MAX_RAINSPLASH_FILES; i++ )
{ {
gpRainSplashTex[i] = RwTextureRead(RainSplashFiles[i], NULL); gpRainSplashTex[i] = RwTextureRead(RainSplashFiles[i], nil);
gpRainSplashRaster[i] = RwTextureGetRaster(gpRainSplashTex[i]); gpRainSplashRaster[i] = RwTextureGetRaster(gpRainSplashTex[i]);
} }
for ( int32 i = 0; i < MAX_WATERSPRAY_FILES; i++ ) for ( int32 i = 0; i < MAX_WATERSPRAY_FILES; i++ )
{ {
gpWatersprayTex[i] = RwTextureRead(WatersprayFiles[i], NULL); gpWatersprayTex[i] = RwTextureRead(WatersprayFiles[i], nil);
gpWatersprayRaster[i] = RwTextureGetRaster(gpWatersprayTex[i]); gpWatersprayRaster[i] = RwTextureGetRaster(gpWatersprayTex[i]);
} }
for ( int32 i = 0; i < MAX_EXPLOSIONMEDIUM_FILES; i++ ) for ( int32 i = 0; i < MAX_EXPLOSIONMEDIUM_FILES; i++ )
{ {
gpExplosionMediumTex[i] = RwTextureRead(ExplosionMediumFiles[i], NULL); gpExplosionMediumTex[i] = RwTextureRead(ExplosionMediumFiles[i], nil);
gpExplosionMediumRaster[i] = RwTextureGetRaster(gpExplosionMediumTex[i]); gpExplosionMediumRaster[i] = RwTextureGetRaster(gpExplosionMediumTex[i]);
} }
@ -352,13 +352,13 @@ void CParticle::Initialise()
for ( int32 i = 0; i < MAX_RAINDROP_FILES; i++ ) for ( int32 i = 0; i < MAX_RAINDROP_FILES; i++ )
{ {
gpRainDropTex[i] = RwTextureRead(RaindropFiles[i], NULL); gpRainDropTex[i] = RwTextureRead(RaindropFiles[i], nil);
gpRainDropRaster[i] = RwTextureGetRaster(gpRainDropTex[i]); gpRainDropRaster[i] = RwTextureGetRaster(gpRainDropTex[i]);
} }
for ( int32 i = 0; i < MAX_RAINSPLASHUP_FILES; i++ ) for ( int32 i = 0; i < MAX_RAINSPLASHUP_FILES; i++ )
{ {
gpRainSplashupTex[i] = RwTextureRead(RainSplashupFiles[i], NULL); gpRainSplashupTex[i] = RwTextureRead(RainSplashupFiles[i], nil);
gpRainSplashupRaster[i] = RwTextureGetRaster(gpRainSplashupTex[i]); gpRainSplashupRaster[i] = RwTextureGetRaster(gpRainSplashupTex[i]);
} }
@ -370,57 +370,57 @@ void CParticle::Initialise()
for ( int32 i = 0; i < MAX_CARDEBRIS_FILES; i++ ) for ( int32 i = 0; i < MAX_CARDEBRIS_FILES; i++ )
{ {
gpCarDebrisTex[i] = RwTextureRead(CardebrisFiles[i], NULL); gpCarDebrisTex[i] = RwTextureRead(CardebrisFiles[i], nil);
gpCarDebrisRaster[i] = RwTextureGetRaster(gpCarDebrisTex[i]); gpCarDebrisRaster[i] = RwTextureGetRaster(gpCarDebrisTex[i]);
} }
for ( int32 i = 0; i < MAX_CARSPLASH_FILES; i++ ) for ( int32 i = 0; i < MAX_CARSPLASH_FILES; i++ )
{ {
gpCarSplashTex[i] = RwTextureRead(CarsplashFiles[i], NULL); gpCarSplashTex[i] = RwTextureRead(CarsplashFiles[i], nil);
gpCarSplashRaster[i] = RwTextureGetRaster(gpCarSplashTex[i]); gpCarSplashRaster[i] = RwTextureGetRaster(gpCarSplashTex[i]);
} }
gpFlame1Tex = RwTextureRead("flame1", NULL); gpFlame1Tex = RwTextureRead("flame1", NULL);
gpFlame1Raster = RwTextureGetRaster(gpFlame1Tex); gpFlame1Raster = RwTextureGetRaster(gpFlame1Tex);
gpFlame5Tex = RwTextureRead("flame5", NULL); gpFlame5Tex = RwTextureRead("flame5", nil);
gpFlame5Raster = RwTextureGetRaster(gpFlame1Tex); // copy-paste bug ? gpFlame5Raster = RwTextureGetRaster(gpFlame1Tex); // copy-paste bug ?
gpRainDropSmallTex = RwTextureRead("rainsmall", NULL); gpRainDropSmallTex = RwTextureRead("rainsmall", nil);
gpRainDropSmallRaster = RwTextureGetRaster(gpRainDropSmallTex); gpRainDropSmallRaster = RwTextureGetRaster(gpRainDropSmallTex);
gpBloodTex = RwTextureRead("blood", NULL); gpBloodTex = RwTextureRead("blood", nil);
gpBloodRaster = RwTextureGetRaster(gpBloodTex); gpBloodRaster = RwTextureGetRaster(gpBloodTex);
gpLeafTex = RwTextureRead("gameleaf01_64", NULL); gpLeafTex = RwTextureRead("gameleaf01_64", nil);
gpLeafRaster = RwTextureGetRaster(gpLeafTex); gpLeafRaster = RwTextureGetRaster(gpLeafTex);
gpCloudTex1 = RwTextureRead("cloud3", NULL); gpCloudTex1 = RwTextureRead("cloud3", nil);
gpCloudRaster1 = RwTextureGetRaster(gpCloudTex1); gpCloudRaster1 = RwTextureGetRaster(gpCloudTex1);
gpCloudTex4 = RwTextureRead("cloudmasked", NULL); gpCloudTex4 = RwTextureRead("cloudmasked", nil);
gpCloudRaster4 = RwTextureGetRaster(gpCloudTex4); gpCloudRaster4 = RwTextureGetRaster(gpCloudTex4);
gpBloodSmallTex = RwTextureRead("bloodsplat2", NULL); gpBloodSmallTex = RwTextureRead("bloodsplat2", nil);
gpBloodSmallRaster = RwTextureGetRaster(gpBloodSmallTex); gpBloodSmallRaster = RwTextureGetRaster(gpBloodSmallTex);
gpGungeTex = RwTextureRead("gunge", NULL); gpGungeTex = RwTextureRead("gunge", nil);
gpGungeRaster = RwTextureGetRaster(gpGungeTex); gpGungeRaster = RwTextureGetRaster(gpGungeTex);
gpCollisionSmokeTex = RwTextureRead("collisionsmoke", NULL); gpCollisionSmokeTex = RwTextureRead("collisionsmoke", nil);
gpCollisionSmokeRaster = RwTextureGetRaster(gpCollisionSmokeTex); gpCollisionSmokeRaster = RwTextureGetRaster(gpCollisionSmokeTex);
gpBulletHitTex = RwTextureRead("bullethitsmoke", NULL); gpBulletHitTex = RwTextureRead("bullethitsmoke", nil);
gpBulletHitRaster = RwTextureGetRaster(gpBulletHitTex); gpBulletHitRaster = RwTextureGetRaster(gpBulletHitTex);
gpGunShellTex = RwTextureRead("gunshell", NULL); gpGunShellTex = RwTextureRead("gunshell", nil);
gpGunShellRaster = RwTextureGetRaster(gpGunShellTex); gpGunShellRaster = RwTextureGetRaster(gpGunShellTex);
gpWakeOldTex = RwTextureRead("wake_old", NULL); gpWakeOldTex = RwTextureRead("wake_old", nil);
gpWakeOldRaster = RwTextureGetRaster(gpWakeOldTex); gpWakeOldRaster = RwTextureGetRaster(gpWakeOldTex);
gpPointlightTex = RwTextureRead("pointlight", NULL); gpPointlightTex = RwTextureRead("pointlight", nil);
gpPointlightRaster = RwTextureGetRaster(gpPointlightTex); gpPointlightRaster = RwTextureGetRaster(gpPointlightTex);
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
@ -451,7 +451,7 @@ void CParticle::Initialise()
case PARTICLE_GUNSMOKE: case PARTICLE_GUNSMOKE:
case PARTICLE_SPLASH: case PARTICLE_SPLASH:
entry->m_ppRaster = NULL; entry->m_ppRaster = nil;
break; break;
case PARTICLE_FLAME: case PARTICLE_FLAME:
@ -584,7 +584,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpSmokeTex[i]); RwTextureDestroy(gpSmokeTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpSmokeTex[i] = NULL; gpSmokeTex[i] = nil;
#endif #endif
} }
@ -592,7 +592,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpSmoke2Tex[i]); RwTextureDestroy(gpSmoke2Tex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpSmoke2Tex[i] = NULL; gpSmoke2Tex[i] = nil;
#endif #endif
} }
@ -600,7 +600,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpRubberTex[i]); RwTextureDestroy(gpRubberTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpRubberTex[i] = NULL; gpRubberTex[i] = nil;
#endif #endif
} }
@ -608,7 +608,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpRainSplashTex[i]); RwTextureDestroy(gpRainSplashTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpRainSplashTex[i] = NULL; gpRainSplashTex[i] = nil;
#endif #endif
} }
@ -616,7 +616,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpWatersprayTex[i]); RwTextureDestroy(gpWatersprayTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpWatersprayTex[i] = NULL; gpWatersprayTex[i] = nil;
#endif #endif
} }
@ -624,7 +624,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpExplosionMediumTex[i]); RwTextureDestroy(gpExplosionMediumTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpExplosionMediumTex[i] = NULL; gpExplosionMediumTex[i] = nil;
#endif #endif
} }
@ -632,7 +632,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpGunFlashTex[i]); RwTextureDestroy(gpGunFlashTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpGunFlashTex[i] = NULL; gpGunFlashTex[i] = nil;
#endif #endif
} }
@ -640,7 +640,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpRainDropTex[i]); RwTextureDestroy(gpRainDropTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpRainDropTex[i] = NULL; gpRainDropTex[i] = nil;
#endif #endif
} }
@ -648,7 +648,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpRainSplashupTex[i]); RwTextureDestroy(gpRainSplashupTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpRainSplashupTex[i] = NULL; gpRainSplashupTex[i] = nil;
#endif #endif
} }
@ -656,7 +656,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpBirdfrontTex[i]); RwTextureDestroy(gpBirdfrontTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpBirdfrontTex[i] = NULL; gpBirdfrontTex[i] = nil;
#endif #endif
} }
@ -664,7 +664,7 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpCarDebrisTex[i]); RwTextureDestroy(gpCarDebrisTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpCarDebrisTex[i] = NULL; gpCarDebrisTex[i] = nil;
#endif #endif
} }
@ -672,78 +672,78 @@ void CParticle::Shutdown()
{ {
RwTextureDestroy(gpCarSplashTex[i]); RwTextureDestroy(gpCarSplashTex[i]);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpCarSplashTex[i] = NULL; gpCarSplashTex[i] = nil;
#endif #endif
} }
RwTextureDestroy(gpFlame1Tex); RwTextureDestroy(gpFlame1Tex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpFlame1Tex = NULL; gpFlame1Tex = nil;
#endif #endif
RwTextureDestroy(gpFlame5Tex); RwTextureDestroy(gpFlame5Tex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpFlame5Tex = NULL; gpFlame5Tex = nil;
#endif #endif
RwTextureDestroy(gpRainDropSmallTex); RwTextureDestroy(gpRainDropSmallTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpRainDropSmallTex = NULL; gpRainDropSmallTex = nil;
#endif #endif
RwTextureDestroy(gpBloodTex); RwTextureDestroy(gpBloodTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpBloodTex = NULL; gpBloodTex = nil;
#endif #endif
RwTextureDestroy(gpLeafTex); RwTextureDestroy(gpLeafTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpLeafTex = NULL; gpLeafTex = nil;
#endif #endif
RwTextureDestroy(gpCloudTex1); RwTextureDestroy(gpCloudTex1);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpCloudTex1 = NULL; gpCloudTex1 = nil;
#endif #endif
RwTextureDestroy(gpCloudTex4); RwTextureDestroy(gpCloudTex4);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpCloudTex4 = NULL; gpCloudTex4 = nil;
#endif #endif
RwTextureDestroy(gpBloodSmallTex); RwTextureDestroy(gpBloodSmallTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpBloodSmallTex = NULL; gpBloodSmallTex = nil;
#endif #endif
RwTextureDestroy(gpGungeTex); RwTextureDestroy(gpGungeTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpGungeTex = NULL; gpGungeTex = nil;
#endif #endif
RwTextureDestroy(gpCollisionSmokeTex); RwTextureDestroy(gpCollisionSmokeTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpCollisionSmokeTex = NULL; gpCollisionSmokeTex = nil;
#endif #endif
RwTextureDestroy(gpBulletHitTex); RwTextureDestroy(gpBulletHitTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpBulletHitTex = NULL; gpBulletHitTex = nil;
#endif #endif
RwTextureDestroy(gpGunShellTex); RwTextureDestroy(gpGunShellTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpGunShellTex = NULL; gpGunShellTex = nil;
#endif #endif
RwTextureDestroy(gpWakeOldTex); RwTextureDestroy(gpWakeOldTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpWakeOldTex = NULL; gpWakeOldTex = nil;
#endif #endif
RwTextureDestroy(gpPointlightTex); RwTextureDestroy(gpPointlightTex);
#ifdef GTA3_1_1_PATCH #ifdef GTA3_1_1_PATCH
gpPointlightTex = NULL; gpPointlightTex = nil;
#endif #endif
int32 slot; int32 slot;
@ -775,18 +775,18 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
|| type == PARTICLE_CARCOLLISION_DUST ) || type == PARTICLE_CARCOLLISION_DUST )
&& nParticleCreationInterval & CTimer::GetFrameCounter() ) && nParticleCreationInterval & CTimer::GetFrameCounter() )
{ {
return NULL; return nil;
} }
CParticle *pParticle = m_pUnusedListHead; CParticle *pParticle = m_pUnusedListHead;
if ( pParticle == NULL ) if ( pParticle == nil )
return NULL; return nil;
tParticleSystemData *psystem = &mod_ParticleSystemManager.m_aParticles[type]; tParticleSystemData *psystem = &mod_ParticleSystemManager.m_aParticles[type];
if ( psystem->m_fCreateRange != 0.0f && psystem->m_fCreateRange < ( TheCamera.GetPosition() - vecPos ).MagnitudeSqr() ) if ( psystem->m_fCreateRange != 0.0f && psystem->m_fCreateRange < ( TheCamera.GetPosition() - vecPos ).MagnitudeSqr() )
return NULL; return nil;
pParticle->m_fSize = psystem->m_fDefaultInitialRadius; pParticle->m_fSize = psystem->m_fDefaultInitialRadius;
@ -918,13 +918,13 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
if ( !CWorld::ProcessVerticalLine( if ( !CWorld::ProcessVerticalLine(
pParticle->m_vecPosition + CVector(0.0f, 0.0f, 0.5f), pParticle->m_vecPosition + CVector(0.0f, 0.0f, 0.5f),
-100.0f, point, entity, true, true, false, false, true, false, NULL) ) -100.0f, point, entity, true, true, false, false, true, false, nil) )
{ {
return NULL; return nil;
} }
if ( point.point.z >= pParticle->m_vecPosition.z ) if ( point.point.z >= pParticle->m_vecPosition.z )
return NULL; return nil;
pParticle->m_fZGround = point.point.z; pParticle->m_fZGround = point.point.z;
bValidGroundFound = true; bValidGroundFound = true;
@ -944,7 +944,7 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
Z_Ground = CWorld::FindGroundZFor3DCoord(vecPos.x, vecPos.y, vecPos.z, (bool *)&bZFound); Z_Ground = CWorld::FindGroundZFor3DCoord(vecPos.x, vecPos.y, vecPos.z, (bool *)&bZFound);
if ( bZFound == false ) if ( bZFound == false )
return NULL; return nil;
pParticle->m_fZGround = Z_Ground; pParticle->m_fZGround = Z_Ground;
} }
@ -1009,13 +1009,13 @@ void CParticle::Update()
{ {
tParticleSystemData *psystem = &mod_ParticleSystemManager.m_aParticles[i]; tParticleSystemData *psystem = &mod_ParticleSystemManager.m_aParticles[i];
CParticle *particle = psystem->m_pParticles; CParticle *particle = psystem->m_pParticles;
CParticle *prevParticle = NULL; CParticle *prevParticle = nil;
bool bRemoveParticle; bool bRemoveParticle;
if ( particle == NULL ) if ( particle == nil )
continue; continue;
for ( ; particle != NULL; _Next(particle, prevParticle, psystem, bRemoveParticle) ) for ( ; particle != nil; _Next(particle, prevParticle, psystem, bRemoveParticle) )
{ {
bRemoveParticle = false; bRemoveParticle = false;
@ -1121,7 +1121,7 @@ void CParticle::Update()
particle->m_vecPosition.y, particle->m_vecPosition.y,
0.05f + particle->m_fZGround 0.05f + particle->m_fZGround
), ),
CVector(0.0f, 0.0f, 0.0f), NULL, 0.0f, 0, 0, 0, 0); CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, 0, 0, 0, 0);
} }
else else
{ {
@ -1132,7 +1132,7 @@ void CParticle::Update()
particle->m_vecPosition.y, particle->m_vecPosition.y,
0.05f + particle->m_fZGround 0.05f + particle->m_fZGround
), ),
CVector(0.0f, 0.0f, 0.0f), NULL, 0.0f, 0, 0, 0, 0); CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, 0, 0, 0, 0);
} }
continue; continue;
@ -1156,7 +1156,7 @@ void CParticle::Update()
particle->m_vecPosition.y, particle->m_vecPosition.y,
0.05f + particle->m_fZGround 0.05f + particle->m_fZGround
), ),
CVector(0.0f, 0.0f, 0.0f), NULL, 0.0f, 0, 0, 0, 0); CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, 0, 0, 0, 0);
} }
else else
{ {
@ -1167,7 +1167,7 @@ void CParticle::Update()
particle->m_vecPosition.y, particle->m_vecPosition.y,
0.05f + particle->m_fZGround 0.05f + particle->m_fZGround
), ),
CVector(0.0f, 0.0f, 0.0f), NULL, 0.0f, 0, 0, 0, 0); CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, 0, 0, 0, 0);
} }
} }
@ -1218,7 +1218,7 @@ void CParticle::Update()
CEntity *entity; CEntity *entity;
if ( CWorld::ProcessVerticalLine(particle->m_vecPosition, moveStep.z, point, entity, if ( CWorld::ProcessVerticalLine(particle->m_vecPosition, moveStep.z, point, entity,
true, true, false, false, true, false, NULL) ) true, true, false, false, true, false, nil) )
{ {
if ( moveStep.z <= point.point.z ) if ( moveStep.z <= point.point.z )
{ {
@ -1258,7 +1258,7 @@ void CParticle::Update()
CGeneral::GetRandomNumberInRange(-0.02f, 0.02f), CGeneral::GetRandomNumberInRange(-0.02f, 0.02f),
CGeneral::GetRandomNumberInRange(0.05f, 0.1f) CGeneral::GetRandomNumberInRange(0.05f, 0.1f)
), ),
NULL, nil,
particle->m_fSize, color, particle->m_nRotationStep, 0, 0, 0); particle->m_fSize, color, particle->m_nRotationStep, 0, 0, 0);
PlayOneShotScriptObject(_SOUND_BULLET_SHELL_HIT_GROUND_1, particle->m_vecPosition); PlayOneShotScriptObject(_SOUND_BULLET_SHELL_HIT_GROUND_1, particle->m_vecPosition);
@ -1277,7 +1277,7 @@ void CParticle::Update()
0.05f + particle->m_fZGround 0.05f + particle->m_fZGround
), ),
CVector(0.0f, 0.0f, CGeneral::GetRandomNumberInRange(0.03f, 0.06f)), CVector(0.0f, 0.0f, CGeneral::GetRandomNumberInRange(0.03f, 0.06f)),
NULL, nil,
particle->m_fSize, color, 0, 0, 0, 0); particle->m_fSize, color, 0, 0, 0, 0);
PlayOneShotScriptObject(_SOUND_BULLET_SHELL_HIT_GROUND_2, particle->m_vecPosition); PlayOneShotScriptObject(_SOUND_BULLET_SHELL_HIT_GROUND_2, particle->m_vecPosition);
@ -1309,7 +1309,7 @@ void CParticle::Update()
CEntity *entity; CEntity *entity;
if ( CWorld::ProcessVerticalLine(particle->m_vecPosition, moveStep.z, point, entity, if ( CWorld::ProcessVerticalLine(particle->m_vecPosition, moveStep.z, point, entity,
true, false, false, false, true, false, NULL) ) true, false, false, false, true, false, nil) )
{ {
if ( moveStep.z <= point.point.z ) if ( moveStep.z <= point.point.z )
{ {
@ -1317,7 +1317,7 @@ void CParticle::Update()
if ( psystem->m_Type == PARTICLE_HELI_ATTACK ) if ( psystem->m_Type == PARTICLE_HELI_ATTACK )
{ {
bRemoveParticle = true; bRemoveParticle = true;
AddParticle(PARTICLE_STEAM, moveStep, CVector(0.0f, 0.0f, 0.05f), NULL, 0.2f, 0, 0, 0, 0); AddParticle(PARTICLE_STEAM, moveStep, CVector(0.0f, 0.0f, 0.05f), nil, 0.2f, 0, 0, 0, 0);
continue; continue;
} }
} }
@ -1444,7 +1444,7 @@ void CParticle::Render()
uint32 flags = DRAW_OPAQUE; uint32 flags = DRAW_OPAQUE;
RwRaster *prevFrame = NULL; RwRaster *prevFrame = nil;
for ( int32 i = 0; i < MAX_PARTICLES; i++ ) for ( int32 i = 0; i < MAX_PARTICLES; i++ )
{ {
@ -1495,7 +1495,7 @@ void CParticle::Render()
flags = psystem->Flags; flags = psystem->Flags;
} }
if ( frames != NULL ) if ( frames != nil )
{ {
RwRaster *curFrame = *frames; RwRaster *curFrame = *frames;
if ( curFrame != prevFrame ) if ( curFrame != prevFrame )
@ -1507,14 +1507,14 @@ void CParticle::Render()
} }
} }
while ( particle != NULL ) while ( particle != nil )
{ {
bool canDraw = true; bool canDraw = true;
if ( particle->m_nAlpha == 0 ) if ( particle->m_nAlpha == 0 )
canDraw = false; canDraw = false;
if ( canDraw && psystem->m_nFinalAnimationFrame != 0 && frames != NULL ) if ( canDraw && psystem->m_nFinalAnimationFrame != 0 && frames != nil )
{ {
RwRaster *curFrame = frames[particle->m_nCurrentFrame]; RwRaster *curFrame = frames[particle->m_nCurrentFrame];
if ( prevFrame != curFrame ) if ( prevFrame != curFrame )
@ -1754,7 +1754,7 @@ void CParticle::RemovePSystem(tParticleType type)
tParticleSystemData *psystemdata = &mod_ParticleSystemManager.m_aParticles[type]; tParticleSystemData *psystemdata = &mod_ParticleSystemManager.m_aParticles[type];
for ( CParticle *particle = psystemdata->m_pParticles; particle; particle = psystemdata->m_pParticles ) for ( CParticle *particle = psystemdata->m_pParticles; particle; particle = psystemdata->m_pParticles )
RemoveParticle(particle, NULL, psystemdata); RemoveParticle(particle, nil, psystemdata);
} }
void CParticle::RemoveParticle(CParticle *pParticle, CParticle *pPrevParticle, tParticleSystemData *pPSystemData) void CParticle::RemoveParticle(CParticle *pParticle, CParticle *pPrevParticle, tParticleSystemData *pPSystemData)
@ -1796,7 +1796,7 @@ void CParticle::AddJetExplosion(CVector const &vecPos, float fPower, float fSize
CGeneral::GetRandomNumberInRange(-0.2f, 0.2f), CGeneral::GetRandomNumberInRange(-0.2f, 0.2f),
CGeneral::GetRandomNumberInRange(-0.2f, 0.0f) CGeneral::GetRandomNumberInRange(-0.2f, 0.0f)
), ),
NULL, nil,
fSize, color, 0, 0, 0, 0); fSize, color, 0, 0, 0, 0);
AddParticle(PARTICLE_EXPLOSION_MFAST, AddParticle(PARTICLE_EXPLOSION_MFAST,
@ -1807,7 +1807,7 @@ void CParticle::AddJetExplosion(CVector const &vecPos, float fPower, float fSize
CGeneral::GetRandomNumberInRange(-0.04f, 0.04f), CGeneral::GetRandomNumberInRange(-0.04f, 0.04f),
CGeneral::GetRandomNumberInRange(0.0f, 0.07f) CGeneral::GetRandomNumberInRange(0.0f, 0.07f)
), ),
NULL, nil,
fSize, color, 0, 0, 0, 0); fSize, color, 0, 0, 0, 0);
AddParticle(PARTICLE_EXPLOSION_MFAST, AddParticle(PARTICLE_EXPLOSION_MFAST,
@ -1818,7 +1818,7 @@ void CParticle::AddJetExplosion(CVector const &vecPos, float fPower, float fSize
CGeneral::GetRandomNumberInRange(-0.04f, 0.04f), CGeneral::GetRandomNumberInRange(-0.04f, 0.04f),
CGeneral::GetRandomNumberInRange(0.0f, 0.07f) CGeneral::GetRandomNumberInRange(0.0f, 0.07f)
), ),
NULL, nil,
fSize, color, 0, 0, 0, 0); fSize, color, 0, 0, 0, 0);
vecStepPos += vecRandOffset; vecStepPos += vecRandOffset;
@ -1843,7 +1843,7 @@ void CParticle::AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatr
AddParticle(PARTICLE_CARCOLLISION_DUST, AddParticle(PARTICLE_CARCOLLISION_DUST,
pos, pos,
CVector(0.0f, 0.0f, 0.0f), CVector(0.0f, 0.0f, 0.0f),
NULL, nil,
0.3f, color, 0, 0, 0, 0); 0.3f, color, 0, 0, 0, 0);
} }
} }

View File

@ -65,7 +65,7 @@ public:
static void Initialise(); static void Initialise();
static void Shutdown(); static void Shutdown();
static CParticle *AddParticle(tParticleType type, CVector const &vecPos, CVector const &vecDir, CEntity *pEntity = NULL, float fSize = 0.0f, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0); static CParticle *AddParticle(tParticleType type, CVector const &vecPos, CVector const &vecDir, CEntity *pEntity = nil, float fSize = 0.0f, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0);
static CParticle *AddParticle(tParticleType type, CVector const &vecPos, CVector const &vecDir, CEntity *pEntity, float fSize, RwRGBA const &color, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0); static CParticle *AddParticle(tParticleType type, CVector const &vecPos, CVector const &vecDir, CEntity *pEntity, float fSize, RwRGBA const &color, int32 nRotationSpeed = 0, int32 nRotation = 0, int32 nCurFrame = 0, int32 nLifeSpan = 0);
static void Update(); static void Update();

View File

@ -19,7 +19,7 @@ void cParticleSystemMgr::Initialise()
LoadParticleData(); LoadParticleData();
for ( int32 i = 0; i < MAX_PARTICLES; i++ ) for ( int32 i = 0; i < MAX_PARTICLES; i++ )
m_aParticles[i].m_pParticles = NULL; m_aParticles[i].m_pParticles = nil;
} }
void cParticleSystemMgr::LoadParticleData() void cParticleSystemMgr::LoadParticleData()
@ -28,7 +28,7 @@ void cParticleSystemMgr::LoadParticleData()
CFileMgr::LoadFile(ParticleFilename, work_buff, ARRAY_SIZE(work_buff), "r"); CFileMgr::LoadFile(ParticleFilename, work_buff, ARRAY_SIZE(work_buff), "r");
CFileMgr::SetDir(""); CFileMgr::SetDir("");
tParticleSystemData *entry = NULL; tParticleSystemData *entry = nil;
int32 type = PARTICLE_FIRST; int32 type = PARTICLE_FIRST;
char *lineStart = (char *)work_buff; char *lineStart = (char *)work_buff;
@ -39,8 +39,8 @@ void cParticleSystemMgr::LoadParticleData()
while ( true ) while ( true )
{ {
ASSERT(lineStart != NULL); ASSERT(lineStart != nil);
ASSERT(lineEnd != NULL); ASSERT(lineEnd != nil);
while ( *lineEnd != '\n' ) while ( *lineEnd != '\n' )
++lineEnd; ++lineEnd;
@ -64,7 +64,7 @@ void cParticleSystemMgr::LoadParticleData()
char *value = strtok(line, delims); char *value = strtok(line, delims);
ASSERT(value != NULL); ASSERT(value != nil);
do do
{ {
@ -73,7 +73,7 @@ void cParticleSystemMgr::LoadParticleData()
case CFG_PARAM_PARTICLE_TYPE_NAME: case CFG_PARAM_PARTICLE_TYPE_NAME:
ASSERT(type < MAX_PARTICLES); ASSERT(type < MAX_PARTICLES);
entry = &m_aParticles[type]; entry = &m_aParticles[type];
ASSERT(entry != NULL); ASSERT(entry != nil);
entry->m_Type = (tParticleType)type++; entry->m_Type = (tParticleType)type++;
strcpy(entry->m_aName, value); strcpy(entry->m_aName, value);
break; break;
@ -227,14 +227,14 @@ void cParticleSystemMgr::LoadParticleData()
break; break;
} }
value = strtok(NULL, delims); value = strtok(nil, delims);
param++; param++;
if ( param > CFG_PARAM_LAST ) if ( param > CFG_PARAM_LAST )
param = CFG_PARAM_FIRST; param = CFG_PARAM_FIRST;
} while ( value != NULL ); } while ( value != nil );
} }
lineEnd++; lineEnd++;

View File

@ -303,12 +303,12 @@ RsRwInitialise(void *displayID)
/* /*
* Initialize debug message handling... * Initialize debug message handling...
*/ */
RsEventHandler(rsINITDEBUG, NULL); RsEventHandler(rsINITDEBUG, nil);
/* /*
* Attach all plugins... * Attach all plugins...
*/ */
if (RsEventHandler(rsPLUGINATTACH, NULL) == rsEVENTERROR) if (RsEventHandler(rsPLUGINATTACH, nil) == rsEVENTERROR)
{ {
return (FALSE); return (FALSE);
} }
@ -316,7 +316,7 @@ RsRwInitialise(void *displayID)
/* /*
* Attach input devices... * Attach input devices...
*/ */
if (RsEventHandler(rsINPUTDEVICEATTACH, NULL) == rsEVENTERROR) if (RsEventHandler(rsINPUTDEVICEATTACH, nil) == rsEVENTERROR)
{ {
return (FALSE); return (FALSE);
} }
@ -346,7 +346,7 @@ RsRwInitialise(void *displayID)
/* /*
* Register loaders for an image with a particular file extension... * Register loaders for an image with a particular file extension...
*/ */
RsEventHandler(rsREGISTERIMAGELOADER, NULL); RsEventHandler(rsREGISTERIMAGELOADER, nil);
psNativeTextureSupport(); psNativeTextureSupport();
@ -390,17 +390,17 @@ RsInitialise(void)
/* setup the keyboard */ /* setup the keyboard */
RsGlobal.keyboard.inputDeviceType = rsKEYBOARD; RsGlobal.keyboard.inputDeviceType = rsKEYBOARD;
RsGlobal.keyboard.inputEventHandler = 0; RsGlobal.keyboard.inputEventHandler = nil;
RsGlobal.keyboard.used = FALSE; RsGlobal.keyboard.used = FALSE;
/* setup the mouse */ /* setup the mouse */
RsGlobal.mouse.inputDeviceType = rsMOUSE; RsGlobal.mouse.inputDeviceType = rsMOUSE;
RsGlobal.mouse.inputEventHandler = 0; RsGlobal.mouse.inputEventHandler = nil;
RsGlobal.mouse.used = FALSE; RsGlobal.mouse.used = FALSE;
/* setup the pad */ /* setup the pad */
RsGlobal.pad.inputDeviceType = rsPAD; RsGlobal.pad.inputDeviceType = rsPAD;
RsGlobal.pad.inputEventHandler = 0; RsGlobal.pad.inputEventHandler = nil;
RsGlobal.pad.used = FALSE; RsGlobal.pad.used = FALSE;
result = psInitialise(); result = psInitialise();

View File

@ -93,16 +93,16 @@ static psGlobalType &PsGlobal = *(psGlobalType*)0x72CF60;
#include "Frontend.h" #include "Frontend.h"
#include "Game.h" #include "Game.h"
#include "PCSave.h" #include "PCSave.h"
#include "Sprite2D.h" #include "Sprite2d.h"
VALIDATE_SIZE(psGlobalType, 0x28); VALIDATE_SIZE(psGlobalType, 0x28);
// DirectShow interfaces // DirectShow interfaces
IGraphBuilder *pGB = NULL; IGraphBuilder *pGB = nil;
IMediaControl *pMC = NULL; IMediaControl *pMC = nil;
IMediaEventEx *pME = NULL; IMediaEventEx *pME = nil;
IVideoWindow *pVW = NULL; IVideoWindow *pVW = nil;
IMediaSeeking *pMS = NULL; IMediaSeeking *pMS = nil;
DWORD dwDXVersion; DWORD dwDXVersion;
DWORD _dwMemTotalPhys; DWORD _dwMemTotalPhys;
@ -169,13 +169,13 @@ void _psCreateFolder(LPCSTR path)
{ {
HANDLE hfle = CreateFile(path, GENERIC_READ, HANDLE hfle = CreateFile(path, GENERIC_READ,
FILE_SHARE_READ, FILE_SHARE_READ,
NULL, nil,
OPEN_EXISTING, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_NORMAL, FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_NORMAL,
NULL); nil);
if ( hfle == INVALID_HANDLE_VALUE ) if ( hfle == INVALID_HANDLE_VALUE )
CreateDirectory(path, NULL); CreateDirectory(path, nil);
else else
CloseHandle(hfle); CloseHandle(hfle);
} }
@ -304,7 +304,7 @@ psMouseSetPos(RwV2d *pos)
RwMemoryFunctions* RwMemoryFunctions*
psGetMemoryFunctions(void) psGetMemoryFunctions(void)
{ {
return 0; return nil;
} }
/* /*
@ -344,9 +344,9 @@ InitApplication(HANDLE instance)
windowClass.cbClsExtra = 0; windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0; windowClass.cbWndExtra = 0;
windowClass.hInstance = (HINSTANCE)instance; windowClass.hInstance = (HINSTANCE)instance;
windowClass.hIcon = NULL; windowClass.hIcon = nil;
windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); windowClass.hCursor = LoadCursor(nil, IDC_ARROW);
windowClass.hbrBackground = NULL; windowClass.hbrBackground = nil;
windowClass.lpszMenuName = NULL; windowClass.lpszMenuName = NULL;
windowClass.lpszClassName = AppClassName; windowClass.lpszClassName = AppClassName;
@ -382,7 +382,7 @@ InitInstance(HANDLE instance)
WS_OVERLAPPEDWINDOW, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
rect.right - rect.left, rect.bottom - rect.top, rect.right - rect.left, rect.bottom - rect.top,
(HWND)NULL, (HMENU)NULL, (HINSTANCE)instance, NULL); (HWND)nil, (HMENU)nil, (HINSTANCE)instance, nil);
} }
void _GetVideoMemInfo(LPDWORD total, LPDWORD avaible) void _GetVideoMemInfo(LPDWORD total, LPDWORD avaible)
@ -390,7 +390,7 @@ void _GetVideoMemInfo(LPDWORD total, LPDWORD avaible)
HRESULT hr; HRESULT hr;
LPDIRECTDRAW7 pDD7; LPDIRECTDRAW7 pDD7;
hr = DirectDrawCreateEx(NULL, (VOID**)&pDD7, IID_IDirectDraw7, NULL); hr = DirectDrawCreateEx(nil, (VOID**)&pDD7, IID_IDirectDraw7, nil);
if ( FAILED(hr) ) if ( FAILED(hr) )
return; return;
@ -430,15 +430,15 @@ typedef HRESULT(WINAPI * DIRECTDRAWCREATEEX)( GUID*, VOID**, REFIID, IUnknown* )
DWORD GetDXVersion() DWORD GetDXVersion()
{ {
DIRECTDRAWCREATEEX DirectDrawCreateEx = NULL; DIRECTDRAWCREATEEX DirectDrawCreateEx = NULL;
HINSTANCE hDDrawDLL = NULL; HINSTANCE hDDrawDLL = nil;
HINSTANCE hD3D8DLL = NULL; HINSTANCE hD3D8DLL = nil;
HINSTANCE hDPNHPASTDLL = NULL; HINSTANCE hDPNHPASTDLL = NULL;
DWORD dwDXVersion = 0; DWORD dwDXVersion = 0;
//HRESULT hr; //HRESULT hr;
// First see if DDRAW.DLL even exists. // First see if DDRAW.DLL even exists.
hDDrawDLL = LoadLibrary( "DDRAW.DLL" ); hDDrawDLL = LoadLibrary( "DDRAW.DLL" );
if( hDDrawDLL == NULL ) if( hDDrawDLL == nil )
{ {
dwDXVersion = 0; dwDXVersion = 0;
OutputDebugString( "Couldn't LoadLibrary DDraw\r\n" ); OutputDebugString( "Couldn't LoadLibrary DDraw\r\n" );
@ -454,15 +454,15 @@ DWORD GetDXVersion()
LPDIRECTDRAW7 pDD7; LPDIRECTDRAW7 pDD7;
DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress( hDDrawDLL, DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress( hDDrawDLL,
"DirectDrawCreateEx" ); "DirectDrawCreateEx" );
if( NULL == DirectDrawCreateEx ) if( nil == DirectDrawCreateEx )
{ {
FreeLibrary( hDDrawDLL ); FreeLibrary( hDDrawDLL );
OutputDebugString( "Couldn't GetProcAddress DirectDrawCreateEx\r\n" ); OutputDebugString( "Couldn't GetProcAddress DirectDrawCreateEx\r\n" );
return dwDXVersion; return dwDXVersion;
} }
if( FAILED( DirectDrawCreateEx( NULL, (VOID**)&pDD7, IID_IDirectDraw7, if( FAILED( DirectDrawCreateEx( nil, (VOID**)&pDD7, IID_IDirectDraw7,
NULL ) ) ) nil ) ) )
{ {
FreeLibrary( hDDrawDLL ); FreeLibrary( hDDrawDLL );
OutputDebugString( "Couldn't DirectDrawCreateEx\r\n" ); OutputDebugString( "Couldn't DirectDrawCreateEx\r\n" );
@ -480,7 +480,7 @@ DWORD GetDXVersion()
// Simply see if D3D8.dll exists. // Simply see if D3D8.dll exists.
hD3D8DLL = LoadLibrary( "D3D8.DLL" ); hD3D8DLL = LoadLibrary( "D3D8.DLL" );
if( hD3D8DLL == NULL ) if( hD3D8DLL == nil )
{ {
FreeLibrary( hDDrawDLL ); FreeLibrary( hDDrawDLL );
OutputDebugString( "Couldn't LoadLibrary D3D8.DLL\r\n" ); OutputDebugString( "Couldn't LoadLibrary D3D8.DLL\r\n" );
@ -497,7 +497,7 @@ DWORD GetDXVersion()
// Simply see if dpnhpast.dll exists. // Simply see if dpnhpast.dll exists.
hDPNHPASTDLL = LoadLibrary( "dpnhpast.dll" ); hDPNHPASTDLL = LoadLibrary( "dpnhpast.dll" );
if( hDPNHPASTDLL == NULL ) if( hDPNHPASTDLL == nil )
{ {
FreeLibrary( hDPNHPASTDLL ); FreeLibrary( hDPNHPASTDLL );
OutputDebugString( "Couldn't LoadLibrary dpnhpast.dll\r\n" ); OutputDebugString( "Couldn't LoadLibrary dpnhpast.dll\r\n" );
@ -617,10 +617,10 @@ psInitialise(void)
PsGlobal.fullScreen = FALSE; PsGlobal.fullScreen = FALSE;
PsGlobal.dinterface = NULL; PsGlobal.dinterface = nil;
PsGlobal.mouse = NULL; PsGlobal.mouse = nil;
PsGlobal.joy1 = NULL; PsGlobal.joy1 = nil;
PsGlobal.joy2 = NULL; PsGlobal.joy2 = nil;
CFileMgr::Initialise(); CFileMgr::Initialise();
@ -681,7 +681,7 @@ psInitialise(void)
if ( _dwOperatingSystemVersion == OS_WIN95 ) if ( _dwOperatingSystemVersion == OS_WIN95 )
{ {
MessageBoxW(NULL, MessageBoxW(nil,
(LPCWSTR)TheText.Get("WIN_95"), // Grand Theft Auto III cannot run on Windows 95 (LPCWSTR)TheText.Get("WIN_95"), // Grand Theft Auto III cannot run on Windows 95
(LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III (LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III
MB_OK); MB_OK);
@ -691,7 +691,7 @@ psInitialise(void)
if ( dwDXVersion < 0x801 ) if ( dwDXVersion < 0x801 )
{ {
MessageBoxW(NULL, MessageBoxW(nil,
(LPCWSTR)TheText.Get("WIN_DX"), // Grand Theft Auto III requires at least DirectX version 8.1 (LPCWSTR)TheText.Get("WIN_DX"), // Grand Theft Auto III requires at least DirectX version 8.1
(LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III (LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III
MB_OK); MB_OK);
@ -716,7 +716,7 @@ psInitialise(void)
if ( _dwMemAvailVideo < (12 * 1024 * 1024) /*12 MB*/ ) if ( _dwMemAvailVideo < (12 * 1024 * 1024) /*12 MB*/ )
{ {
MessageBoxW(NULL, MessageBoxW(nil,
(LPCWSTR)TheText.Get("WIN_VDM"), // Grand Theft Auto III requires at least 12MB of available video memory (LPCWSTR)TheText.Get("WIN_VDM"), // Grand Theft Auto III requires at least 12MB of available video memory
(LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III (LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III
MB_OK); MB_OK);
@ -759,7 +759,7 @@ RwBool _psFreeVideoModeList()
numModes = _psGetNumVideModes(); numModes = _psGetNumVideModes();
if ( _VMList == NULL ) if ( _VMList == nil )
return TRUE; return TRUE;
for ( i = 0; i < numModes; i++ ) for ( i = 0; i < numModes; i++ )
@ -769,7 +769,7 @@ RwBool _psFreeVideoModeList()
RwFree(_VMList); RwFree(_VMList);
_VMList = NULL; _VMList = nil;
return TRUE; return TRUE;
} }
@ -782,7 +782,7 @@ RwChar **_psGetVideoModeList()
RwInt32 numModes; RwInt32 numModes;
RwInt32 i; RwInt32 i;
if ( _VMList != NULL ) if ( _VMList != nil )
{ {
return _VMList; return _VMList;
} }
@ -810,10 +810,10 @@ RwChar **_psGetVideoModeList()
rwsprintf(_VMList[i],"%lu X %lu X %lu", vm.width, vm.height, vm.depth); rwsprintf(_VMList[i],"%lu X %lu X %lu", vm.width, vm.height, vm.depth);
} }
else else
_VMList[i] = NULL; _VMList[i] = nil;
} }
else else
_VMList[i] = NULL; _VMList[i] = nil;
} }
return _VMList; return _VMList;
@ -824,7 +824,7 @@ RwChar **_psGetVideoModeList()
*/ */
void _psSelectScreenVM(RwInt32 videoMode) void _psSelectScreenVM(RwInt32 videoMode)
{ {
RwTexDictionarySetCurrent( NULL ); RwTexDictionarySetCurrent( nil );
FrontEndMenuManager.UnloadTextures(); FrontEndMenuManager.UnloadTextures();
@ -834,7 +834,7 @@ void _psSelectScreenVM(RwInt32 videoMode)
ShowWindow(PSGLOBAL(window), SW_HIDE); ShowWindow(PSGLOBAL(window), SW_HIDE);
MessageBoxW(NULL, MessageBoxW(nil,
(LPCWSTR)TheText.Get("WIN_RSZ"), // Failed to select new screen resolution (LPCWSTR)TheText.Get("WIN_RSZ"), // Failed to select new screen resolution
(LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III (LPCWSTR)TheText.Get("WIN_TTL"), // Grand Theft Auto III
MB_OK); MB_OK);
@ -850,7 +850,7 @@ void WaitForState(FILTER_STATE State)
{ {
HRESULT hr; HRESULT hr;
ASSERT(pMC != NULL); ASSERT(pMC != nil);
// Make sure we have switched to the required state // Make sure we have switched to the required state
LONG lfs; LONG lfs;
@ -868,7 +868,7 @@ void HandleGraphEvent(void)
LONG evCode, evParam1, evParam2; LONG evCode, evParam1, evParam2;
HRESULT hr=S_OK; HRESULT hr=S_OK;
ASSERT(pME != NULL); ASSERT(pME != nil);
// Process all queued events // Process all queued events
while (SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR *)&evParam1, while (SUCCEEDED(pME->GetEvent(&evCode, (LONG_PTR *)&evParam1,
@ -922,7 +922,7 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
{ {
ShowCursor(FALSE); ShowCursor(FALSE);
SetCursor(NULL); SetCursor(nil);
break; // is this correct ? break; // is this correct ?
} }
@ -1111,14 +1111,14 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
case GS_LOGO_MPEG: case GS_LOGO_MPEG:
case GS_INTRO_MPEG: case GS_INTRO_MPEG:
{ {
ASSERT(pMC != NULL); ASSERT(pMC != nil);
LONG state; LONG state;
pMC->GetState(10, &state); pMC->GetState(10, &state);
if ( !(BOOL)wParam ) // losing activation if ( !(BOOL)wParam ) // losing activation
{ {
if ( state == State_Running && pMC != NULL ) if ( state == State_Running && pMC != nil )
{ {
HRESULT hr = pMC->Pause(); HRESULT hr = pMC->Pause();
@ -1132,7 +1132,7 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
{ {
CenterVideo(); CenterVideo();
if ( state != State_Running && pMC != NULL ) if ( state != State_Running && pMC != nil )
{ {
HRESULT hr = pMC->Run(); HRESULT hr = pMC->Run();
@ -1183,7 +1183,7 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
/* /*
* Quit message handling. * Quit message handling.
*/ */
ClipCursor(NULL); ClipCursor(nil);
_InputShutdown(); _InputShutdown();
@ -1260,7 +1260,7 @@ UINT GetBestRefreshRate(UINT width, UINT height, UINT depth)
{ {
LPDIRECT3D8 d3d = Direct3DCreate8(D3D_SDK_VERSION); LPDIRECT3D8 d3d = Direct3DCreate8(D3D_SDK_VERSION);
ASSERT(d3d != NULL); ASSERT(d3d != nil);
INT refreshRate = -1; INT refreshRate = -1;
D3DFORMAT format; D3DFORMAT format;
@ -1367,7 +1367,7 @@ psSelectDevice()
if ( !modeFound ) if ( !modeFound )
{ {
MessageBox(NULL, "Cannot find 640x480 video mode", "GTA3", MB_OK); MessageBox(nil, "Cannot find 640x480 video mode", "GTA3", MB_OK);
return FALSE; return FALSE;
} }
} }
@ -1417,7 +1417,7 @@ RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode)
{ {
RwInitialised = FALSE; RwInitialised = FALSE;
RsEventHandler(rsRWTERMINATE, NULL); RsEventHandler(rsRWTERMINATE, nil);
GcurSel = subSystem; GcurSel = subSystem;
GcurSelVM = videoMode; GcurSelVM = videoMode;
@ -1544,11 +1544,11 @@ void InitialiseLanguage()
#pragma warning( disable : 4302) #pragma warning( disable : 4302)
WORD primUserLCID = PRIMARYLANGID(GetSystemDefaultLCID()); WORD primUserLCID = PRIMARYLANGID(GetSystemDefaultLCID());
WORD primSystemLCID = PRIMARYLANGID(GetUserDefaultLCID()); WORD primSystemLCID = PRIMARYLANGID(GetUserDefaultLCID());
WORD primLayout = PRIMARYLANGID(GetKeyboardLayout(0)); WORD primLayout = PRIMARYLANGID((DWORD)GetKeyboardLayout(0));
WORD subUserLCID = SUBLANGID(GetSystemDefaultLCID()); WORD subUserLCID = SUBLANGID(GetSystemDefaultLCID());
WORD subSystemLCID = SUBLANGID(GetUserDefaultLCID()); WORD subSystemLCID = SUBLANGID(GetUserDefaultLCID());
WORD subLayout = SUBLANGID(GetKeyboardLayout(0)); WORD subLayout = SUBLANGID((DWORD)GetKeyboardLayout(0));
#pragma warning( pop ) #pragma warning( pop )
if ( primUserLCID == LANG_GERMAN if ( primUserLCID == LANG_GERMAN
@ -1648,7 +1648,7 @@ void CenterVideo(void)
HRESULT hr = S_OK; HRESULT hr = S_OK;
RECT rect; RECT rect;
ASSERT(pVW != NULL); ASSERT(pVW != nil);
GetClientRect(PSGLOBAL(window), &rect); GetClientRect(PSGLOBAL(window), &rect);
@ -1674,16 +1674,16 @@ void PlayMovieInWindow(int cmdShow, LPTSTR szFile)
MultiByteToWideChar(CP_ACP, 0, szFile, -1, wFileName, sizeof(wFileName) - 1); MultiByteToWideChar(CP_ACP, 0, szFile, -1, wFileName, sizeof(wFileName) - 1);
// Initialize COM // Initialize COM
JIF(CoInitialize(NULL)); JIF(CoInitialize(nil));
// Get the interface for DirectShow's GraphBuilder // Get the interface for DirectShow's GraphBuilder
JIF(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, JIF(CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC,
IID_IGraphBuilder, (void **)&pGB)); IID_IGraphBuilder, (void **)&pGB));
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
// Have the graph builder construct its the appropriate graph automatically // Have the graph builder construct its the appropriate graph automatically
JIF(pGB->RenderFile(&wFileName[0], NULL)); JIF(pGB->RenderFile(&wFileName[0], nil));
// QueryInterface for DirectShow interfaces // QueryInterface for DirectShow interfaces
JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC)); JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC));
@ -1707,10 +1707,10 @@ void PlayMovieInWindow(int cmdShow, LPTSTR szFile)
SetFocus(PSGLOBAL(window)); SetFocus(PSGLOBAL(window));
} }
ASSERT(pGB != NULL); ASSERT(pGB != nil);
ASSERT(pVW != NULL); ASSERT(pVW != nil);
ASSERT(pME != NULL); ASSERT(pME != nil);
ASSERT(pMC != NULL); ASSERT(pMC != nil);
if(FAILED(hr)) if(FAILED(hr))
CloseClip(); CloseClip();
@ -1750,7 +1750,7 @@ void CloseClip(void)
void HandleExit() void HandleExit()
{ {
MSG message; MSG message;
while ( PeekMessage(&message, NULL, 0U, 0U, PM_REMOVE|PM_NOYIELD) ) while ( PeekMessage(&message, nil, 0U, 0U, PM_REMOVE|PM_NOYIELD) )
{ {
if( message.message == WM_QUIT ) if( message.message == WM_QUIT )
{ {
@ -1778,13 +1778,13 @@ _WinMain(HINSTANCE instance,
RwInt32 argc, i; RwInt32 argc, i;
RwChar **argv; RwChar **argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
/* /*
* 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, NULL) == rsEVENTERROR ) if( RsEventHandler(rsINITIALISE, nil) == rsEVENTERROR )
{ {
return FALSE; return FALSE;
} }
@ -1822,7 +1822,7 @@ _WinMain(HINSTANCE instance,
* Create the window... * Create the window...
*/ */
PSGLOBAL(window) = InitInstance(instance); PSGLOBAL(window) = InitInstance(instance);
if( PSGLOBAL(window) == NULL ) if( PSGLOBAL(window) == nil )
{ {
return FALSE; return FALSE;
} }
@ -1841,7 +1841,7 @@ _WinMain(HINSTANCE instance,
ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp()); ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp());
SetWindowLong(PSGLOBAL(window), GWL_STYLE, WS_POPUP); SetWindowLong(PSGLOBAL(window), GWL_STYLE, WS_POPUP);
SetWindowPos(PSGLOBAL(window), 0, 0, 0, 0, 0, SetWindowPos(PSGLOBAL(window), nil, 0, 0, 0, 0,
SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER| SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|
SWP_FRAMECHANGED); SWP_FRAMECHANGED);
@ -1852,7 +1852,7 @@ _WinMain(HINSTANCE instance,
{ {
DestroyWindow(PSGLOBAL(window)); DestroyWindow(PSGLOBAL(window));
RsEventHandler(rsTERMINATE, NULL); RsEventHandler(rsTERMINATE, nil);
return FALSE; return FALSE;
} }
@ -1880,9 +1880,9 @@ _WinMain(HINSTANCE instance,
RsEventHandler(rsCAMERASIZE, &r); RsEventHandler(rsCAMERASIZE, &r);
} }
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, nil, SPIF_SENDCHANGE);
SystemParametersInfo(SPI_SETPOWEROFFACTIVE, FALSE, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETPOWEROFFACTIVE, FALSE, nil, SPIF_SENDCHANGE);
SystemParametersInfo(SPI_SETLOWPOWERACTIVE, FALSE, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETLOWPOWERACTIVE, FALSE, nil, SPIF_SENDCHANGE);
STICKYKEYS SavedStickyKeys; STICKYKEYS SavedStickyKeys;
@ -1924,7 +1924,7 @@ _WinMain(HINSTANCE instance,
gGameState = GS_INIT_FRONTEND; gGameState = GS_INIT_FRONTEND;
TRACE("gGameState = GS_INIT_FRONTEND"); TRACE("gGameState = GS_INIT_FRONTEND");
LoadingScreen(NULL, NULL, "loadsc0"); LoadingScreen(nil, nil, "loadsc0");
if ( !CGame::InitialiseOnceAfterRW() ) if ( !CGame::InitialiseOnceAfterRW() )
RsGlobal.quit = TRUE; RsGlobal.quit = TRUE;
#endif #endif
@ -1951,7 +1951,7 @@ _WinMain(HINSTANCE instance,
while( !RsGlobal.quit && !FrontEndMenuManager.m_bStartGameLoading ) while( !RsGlobal.quit && !FrontEndMenuManager.m_bStartGameLoading )
{ {
if( PeekMessage(&message, NULL, 0U, 0U, PM_REMOVE|PM_NOYIELD) ) if( PeekMessage(&message, nil, 0U, 0U, PM_REMOVE|PM_NOYIELD) )
{ {
if( message.message == WM_QUIT ) if( message.message == WM_QUIT )
{ {
@ -2044,7 +2044,7 @@ _WinMain(HINSTANCE instance,
CloseClip(); CloseClip();
CoUninitialize(); CoUninitialize();
LoadingScreen(NULL, NULL, "loadsc0"); LoadingScreen(nil, nil, "loadsc0");
if ( !CGame::InitialiseOnceAfterRW() ) if ( !CGame::InitialiseOnceAfterRW() )
RsGlobal.quit = TRUE; RsGlobal.quit = TRUE;
@ -2056,7 +2056,7 @@ _WinMain(HINSTANCE instance,
case GS_INIT_FRONTEND: case GS_INIT_FRONTEND:
{ {
LoadingScreen(NULL, NULL, "loadsc0"); LoadingScreen(nil, nil, "loadsc0");
FrontEndMenuManager.m_bGameNotLoaded = true; FrontEndMenuManager.m_bGameNotLoaded = true;
@ -2079,7 +2079,7 @@ _WinMain(HINSTANCE instance,
GetWindowPlacement(PSGLOBAL(window), &wp); GetWindowPlacement(PSGLOBAL(window), &wp);
if ( wp.showCmd != SW_SHOWMINIMIZED ) if ( wp.showCmd != SW_SHOWMINIMIZED )
RsEventHandler(rsFRONTENDIDLE, NULL); RsEventHandler(rsFRONTENDIDLE, nil);
if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bLoadingSavedGame ) if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bLoadingSavedGame )
{ {
@ -2191,7 +2191,7 @@ _WinMain(HINSTANCE instance,
/* /*
* Tidy up the 3D (RenderWare) components of the application... * Tidy up the 3D (RenderWare) components of the application...
*/ */
RsEventHandler(rsRWTERMINATE, NULL); RsEventHandler(rsRWTERMINATE, nil);
/* /*
* Kill the window... * Kill the window...
@ -2201,7 +2201,7 @@ _WinMain(HINSTANCE instance,
/* /*
* Free the platform dependent data... * Free the platform dependent data...
*/ */
RsEventHandler(rsTERMINATE, NULL); RsEventHandler(rsTERMINATE, nil);
/* /*
* Free the argv strings... * Free the argv strings...
@ -2211,9 +2211,9 @@ _WinMain(HINSTANCE instance,
ShowCursor(TRUE); ShowCursor(TRUE);
SystemParametersInfo(SPI_SETSTICKYKEYS, sizeof(STICKYKEYS), &SavedStickyKeys, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETSTICKYKEYS, sizeof(STICKYKEYS), &SavedStickyKeys, SPIF_SENDCHANGE);
SystemParametersInfo(SPI_SETPOWEROFFACTIVE, TRUE, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETPOWEROFFACTIVE, TRUE, nil, SPIF_SENDCHANGE);
SystemParametersInfo(SPI_SETLOWPOWERACTIVE, TRUE, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETLOWPOWERACTIVE, TRUE, nil, SPIF_SENDCHANGE);
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, NULL, SPIF_SENDCHANGE); SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, nil, SPIF_SENDCHANGE);
SetErrorMode(0); SetErrorMode(0);
@ -2233,8 +2233,8 @@ HRESULT _InputInitialise()
HRESULT hr; HRESULT hr;
// Create a DInput object // Create a DInput object
if( FAILED( hr = DirectInput8Create( GetModuleHandle(NULL), DIRECTINPUT_VERSION, if( FAILED( hr = DirectInput8Create( GetModuleHandle(nil), DIRECTINPUT_VERSION,
IID_IDirectInput8, (VOID**)&PSGLOBAL(dinterface), NULL ) ) ) IID_IDirectInput8, (VOID**)&PSGLOBAL(dinterface), nil ) ) )
return hr; return hr;
return S_OK; return S_OK;
@ -2245,7 +2245,7 @@ HRESULT _InputInitialiseMouse()
HRESULT hr; HRESULT hr;
// Obtain an interface to the system mouse device. // Obtain an interface to the system mouse device.
if( FAILED( hr = PSGLOBAL(dinterface)->CreateDevice( GUID_SysMouse, &PSGLOBAL(mouse), NULL ) ) ) if( FAILED( hr = PSGLOBAL(dinterface)->CreateDevice( GUID_SysMouse, &PSGLOBAL(mouse), nil ) ) )
return hr; return hr;
// Set the data format to "mouse format" - a predefined data format // Set the data format to "mouse format" - a predefined data format
@ -2277,11 +2277,11 @@ HRESULT CapturePad(RwInt32 padID)
{ {
HRESULT hr; HRESULT hr;
DIJOYSTATE2 js; DIJOYSTATE2 js;
LPDIRECTINPUTDEVICE8 pPad = NULL; LPDIRECTINPUTDEVICE8 pPad = nil;
pPad = ( padID == 0 ) ? PSGLOBAL(joy1) : PSGLOBAL(joy2); pPad = ( padID == 0 ) ? PSGLOBAL(joy1) : PSGLOBAL(joy2);
if ( NULL == pPad ) if ( nil == pPad )
return S_OK; return S_OK;
// Poll the device to read the current state // Poll the device to read the current state
@ -2331,7 +2331,7 @@ HRESULT CapturePad(RwInt32 padID)
RsPadEventHandler(rsPADBUTTONUP, (void *)&bs); RsPadEventHandler(rsPADBUTTONUP, (void *)&bs);
bool deviceAvailable = pPad != NULL; bool deviceAvailable = pPad != nil;
if ( deviceAvailable ) if ( deviceAvailable )
{ {
@ -2393,7 +2393,7 @@ void _InputInitialiseJoys()
_InputAddJoys(); _InputAddJoys();
if ( PSGLOBAL(joy1) != NULL ) if ( PSGLOBAL(joy1) != nil )
{ {
devCaps.dwSize = sizeof(DIDEVCAPS); devCaps.dwSize = sizeof(DIDEVCAPS);
PSGLOBAL(joy1)->GetCapabilities(&devCaps); PSGLOBAL(joy1)->GetCapabilities(&devCaps);
@ -2411,7 +2411,7 @@ void _InputInitialiseJoys()
ControlsManager.InitDefaultControlConfigJoyPad(devCaps.dwButtons); ControlsManager.InitDefaultControlConfigJoyPad(devCaps.dwButtons);
} }
if ( PSGLOBAL(joy2) != NULL ) if ( PSGLOBAL(joy2) != nil )
{ {
PSGLOBAL(joy2)->GetProperty(DIPROP_VIDPID, (LPDIPROPHEADER)&prop); PSGLOBAL(joy2)->GetProperty(DIPROP_VIDPID, (LPDIPROPHEADER)&prop);
AllValidWinJoys.m_aJoys[1].m_nVendorID = LOWORD(prop.dwData); AllValidWinJoys.m_aJoys[1].m_nVendorID = LOWORD(prop.dwData);
@ -2440,7 +2440,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
// get the info about the object from the device // get the info about the object from the device
range.diph.dwObj = DIJOFS_X; range.diph.dwObj = DIJOFS_X;
if ( lpDevice != NULL ) if ( lpDevice != nil )
{ {
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_X, DIPH_BYOFFSET ) ) ) if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_X, DIPH_BYOFFSET ) ) )
{ {
@ -2452,7 +2452,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
} }
range.diph.dwObj = DIJOFS_Y; range.diph.dwObj = DIJOFS_Y;
if ( lpDevice != NULL ) if ( lpDevice != nil )
{ {
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_Y, DIPH_BYOFFSET ) ) ) if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_Y, DIPH_BYOFFSET ) ) )
{ {
@ -2464,7 +2464,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
} }
range.diph.dwObj = DIJOFS_Z; range.diph.dwObj = DIJOFS_Z;
if ( lpDevice != NULL ) if ( lpDevice != nil )
{ {
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_Z, DIPH_BYOFFSET ) ) ) if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_Z, DIPH_BYOFFSET ) ) )
{ {
@ -2476,7 +2476,7 @@ HRESULT _InputAddJoyStick(LPDIRECTINPUTDEVICE8 lpDevice, INT num)
} }
range.diph.dwObj = DIJOFS_RZ; range.diph.dwObj = DIJOFS_RZ;
if ( lpDevice != NULL ) if ( lpDevice != nil )
{ {
if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_RZ, DIPH_BYOFFSET ) ) ) if ( SUCCEEDED( lpDevice->GetObjectInfo( &objInst, DIJOFS_RZ, DIPH_BYOFFSET ) ) )
{ {
@ -2495,17 +2495,17 @@ HRESULT _InputAddJoys()
{ {
HRESULT hr; HRESULT hr;
hr = PSGLOBAL(dinterface)->EnumDevices(DI8DEVCLASS_GAMECTRL, _InputEnumDevicesCallback, NULL, DIEDFL_ATTACHEDONLY ); hr = PSGLOBAL(dinterface)->EnumDevices(DI8DEVCLASS_GAMECTRL, _InputEnumDevicesCallback, nil, DIEDFL_ATTACHEDONLY );
if( FAILED(hr) ) if( FAILED(hr) )
return hr; return hr;
if ( PSGLOBAL(joy1) == NULL ) if ( PSGLOBAL(joy1) == nil )
return S_FALSE; return S_FALSE;
_InputAddJoyStick(PSGLOBAL(joy1), 0); _InputAddJoyStick(PSGLOBAL(joy1), 0);
if ( PSGLOBAL(joy2) == NULL ) if ( PSGLOBAL(joy2) == nil )
return S_OK; // we have one device already so return OK and ignore second return S_OK; // we have one device already so return OK and ignore second
_InputAddJoyStick(PSGLOBAL(joy2), 1); _InputAddJoyStick(PSGLOBAL(joy2), 1);
@ -2517,7 +2517,7 @@ HRESULT _InputGetMouseState(DIMOUSESTATE2 *state)
{ {
HRESULT hr; HRESULT hr;
if ( PSGLOBAL(mouse) == NULL ) if ( PSGLOBAL(mouse) == nil )
return S_FALSE; return S_FALSE;
// Get the input's device state, and put the state in dims // Get the input's device state, and put the state in dims
@ -2557,7 +2557,7 @@ BOOL CALLBACK _InputEnumDevicesCallback( const DIDEVICEINSTANCE* pdidInstance, V
static INT Count = 0; static INT Count = 0;
LPDIRECTINPUTDEVICE8 pJoystick = NULL; LPDIRECTINPUTDEVICE8 pJoystick = nil;
if ( Count == 0 ) if ( Count == 0 )
pJoystick = PSGLOBAL(joy1); pJoystick = PSGLOBAL(joy1);
@ -2565,7 +2565,7 @@ BOOL CALLBACK _InputEnumDevicesCallback( const DIDEVICEINSTANCE* pdidInstance, V
pJoystick = PSGLOBAL(joy2); pJoystick = PSGLOBAL(joy2);
// Obtain an interface to the enumerated joystick. // Obtain an interface to the enumerated joystick.
hr = PSGLOBAL(dinterface)->CreateDevice( pdidInstance->guidInstance, &pJoystick, NULL ); hr = PSGLOBAL(dinterface)->CreateDevice( pdidInstance->guidInstance, &pJoystick, nil );
// If it failed, then we can't use this joystick. (Maybe the user unplugged // If it failed, then we can't use this joystick. (Maybe the user unplugged
// it while we were in the middle of enumerating it.) // it while we were in the middle of enumerating it.)