mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 01:38:17 +08:00
[saco] Implement CUnkClass15 constructor
* Implement `CUnkClass15::sub_1006BE40()` * Implement various RenderWare function calls * Update `DoInitStuff()`
This commit is contained in:
1 parent
c01899123c
commit
6506991783
7 files changed
+367
-1
No files matched your search
@@ -0,0 +1,62 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CUnkClass15::CUnkClass15()
|
||||
{
|
||||
m_pCamera = NULL;
|
||||
m_pFrame = NULL;
|
||||
m_pTexture = NULL;
|
||||
field_18 = 0;
|
||||
m_pLight = NULL;
|
||||
|
||||
sub_1006BE40();
|
||||
}
|
||||
|
||||
bool CUnkClass15::sub_1006BE40()
|
||||
{
|
||||
RwRGBAReal color;
|
||||
VECTOR v;
|
||||
VECTOR2D viewWindow;
|
||||
|
||||
m_pLight = RpLightCreate(2);
|
||||
|
||||
if(!m_pLight) return false;
|
||||
|
||||
color.r = 1.0f;
|
||||
color.g = 1.0f;
|
||||
color.b = 1.0f;
|
||||
color.a = 1.0f;
|
||||
|
||||
RpLightSetColor(m_pLight, &color);
|
||||
|
||||
m_pRaster1 = RwRasterCreate(256, 256, 0, 1285);
|
||||
m_pRaster2 = RwRasterCreate(256, 256, 0, 1);
|
||||
|
||||
m_pCamera = RwCameraCreate();
|
||||
m_pFrame = RwFrameCreate();
|
||||
|
||||
v.X = 0.0f;
|
||||
v.Y = 0.0f;
|
||||
v.Z = 50.0f;
|
||||
|
||||
RwFrameTranslate(m_pFrame, &v, 1);
|
||||
RwFrameRotate(m_pFrame, 0, 90.0f);
|
||||
|
||||
if(!m_pCamera || !m_pFrame || !m_pRaster1 || !m_pRaster2)
|
||||
return false;
|
||||
|
||||
SetCameraFrameAndZBuffer(m_pCamera, m_pRaster1, m_pRaster2);
|
||||
RwObjectHasFrameSetFrame(m_pCamera, m_pFrame);
|
||||
RwCameraSetClipPlane(m_pCamera, 300.0f, 0.01f);
|
||||
|
||||
viewWindow.X = 0.5f;
|
||||
viewWindow.Y = 0.5f;
|
||||
|
||||
RwCameraSetViewWindow(m_pCamera, &viewWindow);
|
||||
RwCameraSetProjection(m_pCamera, 1);
|
||||
RpWorldAddCamera(m_pCamera);
|
||||
|
||||
m_pTexture = RwTextureCreate(m_pRaster1);
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in new issue
Block a user