summaryrefslogtreecommitdiffstats
path: root/src/rw/RwHelper.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-05-11 04:55:57 +0200
committereray orçunus <erayorcunus@gmail.com>2020-05-11 20:00:55 +0200
commit8a4fa58cd42b7cca4a86fe2d9913b839b554bf10 (patch)
tree294e44de2168e1b581ba847775d827924c07bf2e /src/rw/RwHelper.cpp
parentMerge pull request #509 from Fire-Head/master (diff)
downloadre3-8a4fa58cd42b7cca4a86fe2d9913b839b554bf10.tar
re3-8a4fa58cd42b7cca4a86fe2d9913b839b554bf10.tar.gz
re3-8a4fa58cd42b7cca4a86fe2d9913b839b554bf10.tar.bz2
re3-8a4fa58cd42b7cca4a86fe2d9913b839b554bf10.tar.lz
re3-8a4fa58cd42b7cca4a86fe2d9913b839b554bf10.tar.xz
re3-8a4fa58cd42b7cca4a86fe2d9913b839b554bf10.tar.zst
re3-8a4fa58cd42b7cca4a86fe2d9913b839b554bf10.zip
Diffstat (limited to 'src/rw/RwHelper.cpp')
-rw-r--r--src/rw/RwHelper.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp
index cb1d4ab5..5026e2c8 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -60,15 +60,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;
}
@@ -76,11 +76,11 @@ void
RwFreeAlign(void *mem)
{
ASSERT(mem != nil);
-
+
void *addr = *(((void **)mem) - 1);
-
+
ASSERT(addr != nil);
-
+
free(addr);
}
@@ -381,7 +381,7 @@ CameraSize(RwCamera * camera, RwRect * rect,
RwEngineGetVideoModeInfo(&videoMode,
RwEngineGetCurrentVideoMode());
-
+
origSize.w = RwRasterGetWidth(RwCameraGetRaster(camera));
origSize.h = RwRasterGetHeight(RwCameraGetRaster(camera));
@@ -392,7 +392,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;
@@ -414,11 +414,11 @@ CameraSize(RwCamera * camera, RwRect * rect,
{
RwRaster *raster;
RwRaster *zRaster;
-
+
/*
* Destroy rasters...
*/
-
+
raster = RwCameraGetRaster(camera);
if( raster )
{
@@ -430,14 +430,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);
@@ -460,8 +460,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);
@@ -495,9 +495,9 @@ CameraSize(RwCamera * camera, RwRect * rect,
vw.y = viewWindow;
}
}
-
+
RwCameraSetViewWindow(camera, &vw);
-
+
RsGlobal.width = rect->w;
RsGlobal.height = rect->h;
}