diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-12 23:19:21 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-05-12 23:27:15 +0200 |
commit | 33dfaf7da11675fdad2909e39b6d15e49fc6cc68 (patch) | |
tree | ff2b3fe079b51b521cb26ceb2da0a5717b0601ff /src/rw | |
parent | Merge remote-tracking branch 'upstream/miami' into miami (diff) | |
parent | fix shotgun (diff) | |
download | re3-33dfaf7da11675fdad2909e39b6d15e49fc6cc68.tar re3-33dfaf7da11675fdad2909e39b6d15e49fc6cc68.tar.gz re3-33dfaf7da11675fdad2909e39b6d15e49fc6cc68.tar.bz2 re3-33dfaf7da11675fdad2909e39b6d15e49fc6cc68.tar.lz re3-33dfaf7da11675fdad2909e39b6d15e49fc6cc68.tar.xz re3-33dfaf7da11675fdad2909e39b6d15e49fc6cc68.tar.zst re3-33dfaf7da11675fdad2909e39b6d15e49fc6cc68.zip |
Diffstat (limited to 'src/rw')
-rw-r--r-- | src/rw/RwHelper.cpp | 40 | ||||
-rw-r--r-- | src/rw/TexRead.cpp | 1 | ||||
-rw-r--r-- | src/rw/VisibilityPlugins.cpp | 8 |
3 files changed, 25 insertions, 24 deletions
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 525c2910..91916df3 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -61,15 +61,15 @@ void * RwMallocAlign(RwUInt32 size, RwUInt32 align) { void *mem = (void *)malloc(size + align); - + ASSERT(mem != nil); - - void *addr = (void *)((((RwUInt32)mem) + align) & ~(align - 1)); - + + void *addr = (void *)((((uintptr)mem) + align) & ~(align - 1)); + ASSERT(addr != nil); - + *(((void **)addr) - 1) = mem; - + return addr; } @@ -77,11 +77,11 @@ void RwFreeAlign(void *mem) { ASSERT(mem != nil); - + void *addr = *(((void **)mem) - 1); - + ASSERT(addr != nil); - + free(addr); } @@ -391,7 +391,7 @@ CameraSize(RwCamera * camera, RwRect * rect, RwEngineGetVideoModeInfo(&videoMode, RwEngineGetCurrentVideoMode()); - + origSize.w = RwRasterGetWidth(RwCameraGetRaster(camera)); origSize.h = RwRasterGetHeight(RwCameraGetRaster(camera)); @@ -402,7 +402,7 @@ CameraSize(RwCamera * camera, RwRect * rect, /* For full screen applications, resizing the camera just doesn't * make sense, use the video mode size. */ - + r.x = r.y = 0; r.w = videoMode.width; r.h = videoMode.height; @@ -424,11 +424,11 @@ CameraSize(RwCamera * camera, RwRect * rect, { RwRaster *raster; RwRaster *zRaster; - + /* * Destroy rasters... */ - + raster = RwCameraGetRaster(camera); if( raster ) { @@ -440,14 +440,14 @@ CameraSize(RwCamera * camera, RwRect * rect, { RwRasterDestroy(zRaster); } - + /* - * Create new rasters... + * Create new rasters... */ raster = RwRasterCreate(rect->w, rect->h, 0, rwRASTERTYPECAMERA); zRaster = RwRasterCreate(rect->w, rect->h, 0, rwRASTERTYPEZBUFFER); - + if( raster && zRaster ) { RwCameraSetRaster(camera, raster); @@ -470,8 +470,8 @@ CameraSize(RwCamera * camera, RwRect * rect, rect->w = origSize.w; rect->h = origSize.h; - /* - * Use default values... + /* + * Use default values... */ raster = RwRasterCreate(rect->w, rect->h, 0, rwRASTERTYPECAMERA); @@ -505,9 +505,9 @@ CameraSize(RwCamera * camera, RwRect * rect, vw.y = viewWindow; } } - + RwCameraSetViewWindow(camera, &vw); - + RsGlobal.width = rect->w; RsGlobal.height = rect->h; } diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp index 60945665..122ce655 100644 --- a/src/rw/TexRead.cpp +++ b/src/rw/TexRead.cpp @@ -3,6 +3,7 @@ #pragma warning( pop ) #include "common.h" #include "crossplatform.h" +#include "platform.h" #include "Timer.h" #ifdef GTA_PC diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp index 6e6ad705..5639fbbd 100644 --- a/src/rw/VisibilityPlugins.cpp +++ b/src/rw/VisibilityPlugins.cpp @@ -149,7 +149,7 @@ CVisibilityPlugins::SetupVehicleVariables(RpClump *vehicle) RpMaterial* SetAlphaCB(RpMaterial *material, void *data) { - ((RwRGBA*)RpMaterialGetColor(material))->alpha = (uint8)(uint32)data; + ((RwRGBA*)RpMaterialGetColor(material))->alpha = (uint8)(uintptr)data; return material; } @@ -875,15 +875,15 @@ void CVisibilityPlugins::SetClumpModelInfo(RpClump *clump, CClumpModelInfo *modelInfo) { CVehicleModelInfo *vmi; - SetFrameHierarchyId(RpClumpGetFrame(clump), (int32)modelInfo); + SetFrameHierarchyId(RpClumpGetFrame(clump), (uintptr)modelInfo); // Unused switch (modelInfo->GetModelType()) { // ignore MLO case MITYPE_VEHICLE: vmi = (CVehicleModelInfo*)modelInfo; - if(vmi->m_vehicleType == VEHICLE_TYPE_TRAIN || - vmi->m_vehicleType == VEHICLE_TYPE_HELI || + if(vmi->m_vehicleType == VEHICLE_TYPE_TRAIN || + vmi->m_vehicleType == VEHICLE_TYPE_HELI || vmi->m_vehicleType == VEHICLE_TYPE_PLANE) CLUMPEXT(clump)->visibilityCB = VehicleVisibilityCB_BigVehicle; else |