summaryrefslogtreecommitdiffstats
path: root/src/RwHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/RwHelper.cpp')
-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