summaryrefslogtreecommitdiffstats
path: root/src/RwHelper.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-12 20:07:37 +0200
committeraap <aap@papnet.eu>2019-06-12 20:11:17 +0200
commita9517c01afad50d90c3afdee0fdc6238158378f2 (patch)
tree9226e392b0869576faccd8a3d66d68490d648417 /src/RwHelper.cpp
parentMerge branch 'master' into master (diff)
downloadre3-a9517c01afad50d90c3afdee0fdc6238158378f2.tar
re3-a9517c01afad50d90c3afdee0fdc6238158378f2.tar.gz
re3-a9517c01afad50d90c3afdee0fdc6238158378f2.tar.bz2
re3-a9517c01afad50d90c3afdee0fdc6238158378f2.tar.lz
re3-a9517c01afad50d90c3afdee0fdc6238158378f2.tar.xz
re3-a9517c01afad50d90c3afdee0fdc6238158378f2.tar.zst
re3-a9517c01afad50d90c3afdee0fdc6238158378f2.zip
Diffstat (limited to '')
-rw-r--r--src/RwHelper.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/RwHelper.cpp b/src/RwHelper.cpp
index cb0c1a4e..2ff58393 100644
--- a/src/RwHelper.cpp
+++ b/src/RwHelper.cpp
@@ -29,6 +29,23 @@ DefinedState(void)
RwD3D8SetRenderState(D3DRS_ALPHAREF, 2);
}
+RwFrame*
+GetFirstFrameCallback(RwFrame *child, void *data)
+{
+ *(RwFrame**)data = child;
+ return nil;
+}
+
+RwFrame*
+GetFirstChild(RwFrame *frame)
+{
+ RwFrame *child;
+
+ child = nil;
+ RwFrameForAllChildren(frame, GetFirstFrameCallback, &child);
+ return child;
+}
+
RwObject*
GetFirstObjectCallback(RwObject *object, void *data)
{
@@ -46,6 +63,23 @@ GetFirstObject(RwFrame *frame)
return obj;
}
+RpAtomic*
+GetFirstAtomicCallback(RpAtomic *atm, void *data)
+{
+ *(RpAtomic**)data = atm;
+ return nil;
+}
+
+RpAtomic*
+GetFirstAtomic(RpClump *clump)
+{
+ RpAtomic *atm;
+
+ atm = nil;
+ RpClumpForAllAtomics(clump, GetFirstAtomicCallback, &atm);
+ return atm;
+}
+
void
CameraSize(RwCamera * camera, RwRect * rect,
RwReal viewWindow, RwReal aspectRatio)
@@ -135,7 +169,7 @@ CameraSize(RwCamera * camera, RwRect * rect,
rect->x = origSize.x;
rect->y = origSize.y;
- rect->w = origSize.w;
+ rect->w = origSize.w;
rect->h = origSize.h;
/*
@@ -274,4 +308,4 @@ STARTPATCHES
InjectHook(0x527170, CameraSize, PATCH_JUMP);
InjectHook(0x527340, CameraDestroy, PATCH_JUMP);
InjectHook(0x5273B0, CameraCreate, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ENDPATCHES