RwCameraGetCurrentCamera

This commit is contained in:
aap 2020-05-27 09:47:21 +02:00
parent d71cbae9df
commit 02741dc64f
2 changed files with 4 additions and 10 deletions

View file

@ -1028,12 +1028,6 @@ DebugMenuProcess(void)
} }
#ifdef LIBRW
#define CURRENTCAM (rw::engine->currentCamera)
#else
#define CURRENTCAM ((RwCamera*)RWSRCGLOBAL(curCamera))
#endif
void void
DebugMenuRender(void) DebugMenuRender(void)
{ {
@ -1048,7 +1042,7 @@ DebugMenuRender(void)
RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0);
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
RwCamera *cam = CURRENTCAM; RwCamera *cam = RwCameraGetCurrentCamera();
screenWidth = RwRasterGetWidth(RwCameraGetRaster(cam)); screenWidth = RwRasterGetWidth(RwCameraGetRaster(cam));
screenHeight = RwRasterGetHeight(RwCameraGetRaster(cam)); screenHeight = RwRasterGetHeight(RwCameraGetRaster(cam));
@ -1080,7 +1074,7 @@ drawArrow(RwRect r, int direction, int style)
static RwImVertexIndex indices[] = { 0, 1, 2, 2, 1, 3 }; static RwImVertexIndex indices[] = { 0, 1, 2, 2, 1, 3 };
static RwIm2DVertex arrowVerts[4]; static RwIm2DVertex arrowVerts[4];
RwCamera *cam = CURRENTCAM; RwCamera *cam = RwCameraGetCurrentCamera();
float recipz = 1.0f/RwCameraGetNearClipPlane(cam); float recipz = 1.0f/RwCameraGetNearClipPlane(cam);
int width = RwRasterGetWidth(arrow); int width = RwRasterGetWidth(arrow);
@ -1183,7 +1177,7 @@ drawMouse(void)
static RwIm2DVertex vertices[4]; static RwIm2DVertex vertices[4];
RwIm2DVertex *vert; RwIm2DVertex *vert;
RwCamera *cam; RwCamera *cam;
cam = CURRENTCAM; cam = RwCameraGetCurrentCamera();
float x = mouseX; float x = mouseX;
float y = mouseY; float y = mouseY;
float w = RwRasterGetWidth(cursor); float w = RwRasterGetWidth(cursor);

View file

@ -152,7 +152,7 @@ RwReal RwCameraGetNearClipPlane(const RwCamera *camera) { return camera->n
RwReal RwCameraGetFarClipPlane(const RwCamera *camera) { return camera->farPlane; } RwReal RwCameraGetFarClipPlane(const RwCamera *camera) { return camera->farPlane; }
RwCamera *RwCameraSetFogDistance(RwCamera *camera, RwReal fogDistance) { camera->fogPlane = fogDistance; return camera; } RwCamera *RwCameraSetFogDistance(RwCamera *camera, RwReal fogDistance) { camera->fogPlane = fogDistance; return camera; }
RwReal RwCameraGetFogDistance(const RwCamera *camera) { return camera->fogPlane; } RwReal RwCameraGetFogDistance(const RwCamera *camera) { return camera->fogPlane; }
RwCamera *RwCameraGetCurrentCamera(void); RwCamera *RwCameraGetCurrentCamera(void) { return rw::engine->currentCamera; }
RwCameraProjection RwCameraGetProjection(const RwCamera *camera); RwCameraProjection RwCameraGetProjection(const RwCamera *camera);
const RwV2d *RwCameraGetViewWindow(const RwCamera *camera) { return &camera->viewWindow; } const RwV2d *RwCameraGetViewWindow(const RwCamera *camera) { return &camera->viewWindow; }
RwMatrix *RwCameraGetViewMatrix(RwCamera *camera) { return &camera->viewMatrix; } RwMatrix *RwCameraGetViewMatrix(RwCamera *camera) { return &camera->viewMatrix; }