mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-08 18:36:00 +03:00
Compare commits
No commits in common. "45ceb6354bd4710a1d04c4a5eacf15c7f06d2581" and "35e44e09762cc5ad0f3266614d3c413166b15fe3" have entirely different histories.
45ceb6354b
...
35e44e0976
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "client/Client.hpp"
|
#include "client/Client.hpp"
|
||||||
#include "gameui/CGWorldFrame.hpp"
|
#include "gameui/CGWorldFrame.hpp"
|
||||||
#include "gameui/GameScriptFunctions.hpp"
|
|
||||||
#include "gx/Coordinate.hpp"
|
#include "gx/Coordinate.hpp"
|
||||||
#include "gx/Device.hpp"
|
#include "gx/Device.hpp"
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
@ -73,7 +72,7 @@ void CGGameUI::Initialize() {
|
|||||||
//CGInputControl::UpdateMouseMode((int)Active, 1);
|
//CGInputControl::UpdateMouseMode((int)Active, 1);
|
||||||
|
|
||||||
FrameScript_Flush();
|
FrameScript_Flush();
|
||||||
LoadScriptFunctions();
|
//LoadScriptFunctions();
|
||||||
FrameScript_CreateEvents(g_scriptEvents, 722);
|
FrameScript_CreateEvents(g_scriptEvents, 722);
|
||||||
//CGGameUI::RegisterGameCVars();
|
//CGGameUI::RegisterGameCVars();
|
||||||
//CGUIBindings::Initialize();
|
//CGUIBindings::Initialize();
|
||||||
|
|||||||
@ -3,11 +3,7 @@
|
|||||||
#include "gx/Transform.hpp"
|
#include "gx/Transform.hpp"
|
||||||
#include "gx/Draw.hpp"
|
#include "gx/Draw.hpp"
|
||||||
#include "gx/Shader.hpp"
|
#include "gx/Shader.hpp"
|
||||||
#include "gx/Device.hpp"
|
|
||||||
#include "gx/RenderState.hpp"
|
|
||||||
#include "world/CWorld.hpp"
|
#include "world/CWorld.hpp"
|
||||||
#include "gameui/camera/CGCamera.hpp"
|
|
||||||
#include "event/EvtKeyDown.hpp"
|
|
||||||
|
|
||||||
#include <bc/Memory.hpp>
|
#include <bc/Memory.hpp>
|
||||||
#include <tempest/Matrix.hpp>
|
#include <tempest/Matrix.hpp>
|
||||||
@ -18,14 +14,7 @@ CGWorldFrame* CGWorldFrame::s_currentWorldFrame = nullptr;
|
|||||||
|
|
||||||
CGWorldFrame::CGWorldFrame(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
CGWorldFrame::CGWorldFrame(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
this->m_camera = NEW(CGCamera);
|
|
||||||
|
|
||||||
s_currentWorldFrame = this;
|
s_currentWorldFrame = this;
|
||||||
|
|
||||||
this->EnableEvent(SIMPLE_EVENT_KEY, -1);
|
|
||||||
this->EnableEvent(SIMPLE_EVENT_MOUSE, -1);
|
|
||||||
this->EnableEvent(SIMPLE_EVENT_MOUSEWHEEL, -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGWorldFrame::OnFrameRender(CRenderBatch* batch, uint32_t layer) {
|
void CGWorldFrame::OnFrameRender(CRenderBatch* batch, uint32_t layer) {
|
||||||
@ -35,42 +24,6 @@ void CGWorldFrame::OnFrameRender(CRenderBatch* batch, uint32_t layer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CGWorldFrame::OnLayerKeyDown(const CKeyEvent& evt) {
|
|
||||||
if (CSimpleFrame::OnLayerKeyDown(evt)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// WORKAROUND: Camera testing
|
|
||||||
C3Vector& position = this->m_camera->m_position;
|
|
||||||
|
|
||||||
float step = 0.1f;
|
|
||||||
|
|
||||||
switch (evt.key) {
|
|
||||||
case KEY_W:
|
|
||||||
position.z -= step;
|
|
||||||
break;
|
|
||||||
case KEY_A:
|
|
||||||
position.y -= step;
|
|
||||||
break;
|
|
||||||
case KEY_S:
|
|
||||||
position.z += step;
|
|
||||||
break;
|
|
||||||
case KEY_D:
|
|
||||||
position.y += step;
|
|
||||||
break;
|
|
||||||
case KEY_PLUS:
|
|
||||||
position.x += step;
|
|
||||||
break;
|
|
||||||
case KEY_MINUS:
|
|
||||||
position.x -= step;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
CSimpleFrame* CGWorldFrame::Create(CSimpleFrame* parent) {
|
CSimpleFrame* CGWorldFrame::Create(CSimpleFrame* parent) {
|
||||||
// TODO: Data = CDataAllocator__GetData(0, ".?AVCGWorldFrame@@", -2);
|
// TODO: Data = CDataAllocator__GetData(0, ".?AVCGWorldFrame@@", -2);
|
||||||
|
|
||||||
@ -100,40 +53,15 @@ void CGWorldFrame::RenderWorld(void* param) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CGWorldFrame::OnWorldUpdate() {
|
void CGWorldFrame::OnWorldUpdate() {
|
||||||
|
GxXformSetViewport(0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f);
|
||||||
|
CImVector clearColor = { 0x00, 0x00, 0x00, 0xFF };
|
||||||
|
GxSceneClear(3, clearColor);
|
||||||
|
C44Matrix matrix;
|
||||||
|
GxuXformCreateOrtho(0.0, 1.0, -0.5, 0.5, 0.0, 500.0, matrix);
|
||||||
|
GxXformSetView(C44Matrix());
|
||||||
|
GxXformSetProjection(matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGWorldFrame::OnWorldRender() {
|
void CGWorldFrame::OnWorldRender() {
|
||||||
CRect windowSize;
|
|
||||||
GxCapsWindowSize(windowSize);
|
|
||||||
if (windowSize.maxY - windowSize.minY == 0.0f || windowSize.maxX - windowSize.minX == 0.0f) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
GxRsPush();
|
|
||||||
|
|
||||||
C3Vector saveMin;
|
|
||||||
C3Vector saveMax;
|
|
||||||
|
|
||||||
GxXformViewport(saveMin.x, saveMax.x, saveMin.y, saveMax.y, saveMin.z, saveMax.z);
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
// WORKAROUND:
|
|
||||||
float maxZ = saveMax.z - (saveMax.z - saveMin.z) * 0.050000001;
|
|
||||||
GxXformSetViewport(saveMin.x, saveMax.x, saveMin.y, saveMax.y, saveMin.z, maxZ);
|
|
||||||
|
|
||||||
CShaderEffect::UpdateProjMatrix();
|
|
||||||
|
|
||||||
CWorld::Render();
|
CWorld::Render();
|
||||||
|
|
||||||
GxRsPop();
|
|
||||||
}
|
|
||||||
|
|
||||||
CGCamera* CGWorldFrame::GetActiveCamera() {
|
|
||||||
STORM_ASSERT(CGWorldFrame::s_currentWorldFrame);
|
|
||||||
STORM_ASSERT(CGWorldFrame::s_currentWorldFrame->m_camera);
|
|
||||||
return CGWorldFrame::s_currentWorldFrame->m_camera;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,22 +4,16 @@
|
|||||||
#include "ui/CSimpleFrame.hpp"
|
#include "ui/CSimpleFrame.hpp"
|
||||||
#include "ui/CSimpleTop.hpp"
|
#include "ui/CSimpleTop.hpp"
|
||||||
|
|
||||||
class CGCamera;
|
|
||||||
|
|
||||||
class CGWorldFrame : public CSimpleFrame {
|
class CGWorldFrame : public CSimpleFrame {
|
||||||
public:
|
public:
|
||||||
CGWorldFrame(CSimpleFrame* parent);
|
CGWorldFrame(CSimpleFrame* parent);
|
||||||
|
|
||||||
virtual void OnFrameRender(CRenderBatch* batch, uint32_t layer);
|
virtual void OnFrameRender(CRenderBatch* batch, uint32_t layer);
|
||||||
virtual int32_t OnLayerKeyDown(const CKeyEvent& evt);
|
|
||||||
|
|
||||||
static CSimpleFrame* Create(CSimpleFrame* parent);
|
static CSimpleFrame* Create(CSimpleFrame* parent);
|
||||||
static void RenderWorld(void* param);
|
static void RenderWorld(void* param);
|
||||||
static void OnWorldUpdate();
|
static void OnWorldUpdate();
|
||||||
static void OnWorldRender();
|
static void OnWorldRender();
|
||||||
static CGCamera* GetActiveCamera();
|
|
||||||
|
|
||||||
CGCamera* m_camera = nullptr;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CGWorldFrame* s_currentWorldFrame;
|
static CGWorldFrame* s_currentWorldFrame;
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
#include "gameui/GameScriptFunctions.hpp"
|
|
||||||
#include "ui/FrameScript.hpp"
|
|
||||||
#include "ui/ScriptFunctions.hpp"
|
|
||||||
|
|
||||||
void LoadScriptFunctions() {
|
|
||||||
RegisterSimpleFrameScriptMethods();
|
|
||||||
// TODO
|
|
||||||
CameraRegisterScriptFunctions();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CameraRegisterScriptFunctions() {
|
|
||||||
for (int32_t i = 0; i < NUM_SCRIPT_FUNCTIONS_CAMERA; ++i) {
|
|
||||||
FrameScript_RegisterFunction(
|
|
||||||
GameScript::s_ScriptFunctions_Camera[i].name,
|
|
||||||
GameScript::s_ScriptFunctions_Camera[i].method);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#ifndef GAMEUI_GAME_SCRIPT_FUNCTIONS_HPP
|
|
||||||
#define GAMEUI_GAME_SCRIPT_FUNCTIONS_HPP
|
|
||||||
|
|
||||||
#include "ui/Types.hpp"
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
struct lua_State;
|
|
||||||
|
|
||||||
#define NUM_SCRIPT_FUNCTIONS_CAMERA 22
|
|
||||||
|
|
||||||
namespace GameScript {
|
|
||||||
extern FrameScript_Method s_ScriptFunctions_Camera[NUM_SCRIPT_FUNCTIONS_CAMERA];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Utility
|
|
||||||
|
|
||||||
void LoadScriptFunctions();
|
|
||||||
void CameraRegisterScriptFunctions();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
#include "gameui/GameScriptFunctions.hpp"
|
|
||||||
#include "ui/FrameScript.hpp"
|
|
||||||
#include "util/Lua.hpp"
|
|
||||||
#include "util/Unimplemented.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
int32_t Script_CameraZoomIn(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_CameraZoomOut(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewInStart(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewInStop(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewOutStart(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewOutStop(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewLeftStart(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewLeftStop(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewRightStart(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewRightStop(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewUpStart(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewUpStop(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewDownStart(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_MoveViewDownStop(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_SetView(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_SaveView(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_ResetView(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_NextView(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_PrevView(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_FlipCameraYaw(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_VehicleCameraZoomIn(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_VehicleCameraZoomOut(lua_State* L) {
|
|
||||||
WHOA_UNIMPLEMENTED(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FrameScript_Method GameScript::s_ScriptFunctions_Camera[NUM_SCRIPT_FUNCTIONS_CAMERA] = {
|
|
||||||
{ "CameraZoomIn", &Script_CameraZoomIn },
|
|
||||||
{ "CameraZoomOut", &Script_CameraZoomOut },
|
|
||||||
{ "MoveViewInStart", &Script_MoveViewInStart },
|
|
||||||
{ "MoveViewInStop", &Script_MoveViewInStop },
|
|
||||||
{ "MoveViewOutStart", &Script_MoveViewOutStart },
|
|
||||||
{ "MoveViewOutStop", &Script_MoveViewOutStop },
|
|
||||||
{ "MoveViewLeftStart", &Script_MoveViewLeftStart },
|
|
||||||
{ "MoveViewLeftStop", &Script_MoveViewLeftStop },
|
|
||||||
{ "MoveViewRightStart", &Script_MoveViewRightStart },
|
|
||||||
{ "MoveViewRightStop", &Script_MoveViewRightStop },
|
|
||||||
{ "MoveViewUpStart", &Script_MoveViewUpStart },
|
|
||||||
{ "MoveViewUpStop", &Script_MoveViewUpStop },
|
|
||||||
{ "MoveViewDownStart", &Script_MoveViewDownStart },
|
|
||||||
{ "MoveViewDownStop", &Script_MoveViewDownStop },
|
|
||||||
{ "SetView", &Script_SetView },
|
|
||||||
{ "SaveView", &Script_SaveView },
|
|
||||||
{ "ResetView", &Script_ResetView },
|
|
||||||
{ "NextView", &Script_NextView },
|
|
||||||
{ "PrevView", &Script_PrevView },
|
|
||||||
{ "FlipCameraYaw", &Script_FlipCameraYaw },
|
|
||||||
{ "VehicleCameraZoomIn", &Script_VehicleCameraZoomIn },
|
|
||||||
{ "VehicleCameraZoomOut", &Script_VehicleCameraZoomOut },
|
|
||||||
};
|
|
||||||
@ -1 +0,0 @@
|
|||||||
#include "gameui/camera/CGCamera.hpp"
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#ifndef GAME_UI_CAMERA_CGCAMERA_HPP
|
|
||||||
#define GAME_UI_CAMERA_CGCAMERA_HPP
|
|
||||||
|
|
||||||
#include "gameui/camera/CSimpleCamera.hpp"
|
|
||||||
|
|
||||||
class CGCamera : public CSimpleCamera {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // GAME_UI_CAMERA_CGCAMERA_HPP
|
|
||||||
@ -5,7 +5,6 @@
|
|||||||
#include <tempest/matrix/C44Matrix.hpp>
|
#include <tempest/matrix/C44Matrix.hpp>
|
||||||
|
|
||||||
#include "gx/Transform.hpp"
|
#include "gx/Transform.hpp"
|
||||||
#include "gx/Shader.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
static void FaceDirection(const C3Vector& direction, C3Vector* xprime, C3Vector* yprime, C3Vector* zprime) {
|
static void FaceDirection(const C3Vector& direction, C3Vector* xprime, C3Vector* yprime, C3Vector* zprime) {
|
||||||
@ -146,12 +145,10 @@ void CSimpleCamera::SetGxProjectionAndView(const CRect& projectionRect) {
|
|||||||
this->m_aspect = (projectionRect.maxX - projectionRect.minX) / (projectionRect.maxY - projectionRect.minY);
|
this->m_aspect = (projectionRect.maxX - projectionRect.minX) / (projectionRect.maxY - projectionRect.minY);
|
||||||
|
|
||||||
C44Matrix mProj;
|
C44Matrix mProj;
|
||||||
GxXformProjection(mProj);
|
|
||||||
|
|
||||||
GxuXformCreateProjection_SG(this->m_fov, this->m_aspect, this->m_nearZ, this->m_farZ, mProj);
|
GxuXformCreateProjection_SG(this->m_fov, this->m_aspect, this->m_nearZ, this->m_farZ, mProj);
|
||||||
GxXformSetProjection(mProj);
|
GxXformSetProjection(mProj);
|
||||||
|
|
||||||
C44Matrix mView;
|
C44Matrix mView;
|
||||||
GxuXformCreateLookAtSgCompat(this->m_position, this->m_position + Forward(), Up(), mView);
|
GxuXformCreateLookAtSgCompat(C3Vector(), Forward(), Up(), mView);
|
||||||
GxXformSetView(mView);
|
GxXformSetView(mView);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,27 +12,27 @@ class CSimpleCamera {
|
|||||||
CSimpleCamera(float nearZ, float farZ, float fov);
|
CSimpleCamera(float nearZ, float farZ, float fov);
|
||||||
virtual ~CSimpleCamera();
|
virtual ~CSimpleCamera();
|
||||||
|
|
||||||
C3Vector& Position() { this->m_position; }
|
C3Vector& Position() { this->m_position; };
|
||||||
C33Matrix& Facing() { this->m_facing; }
|
C33Matrix& Facing() { this->m_facing; };
|
||||||
float NearZ() { this->m_nearZ; }
|
float NearZ() { this->m_nearZ; };
|
||||||
float FarZ() { this->m_farZ; }
|
float FarZ() { this->m_farZ; };
|
||||||
float FOV() { this->m_fov; }
|
float FOV() { this->m_fov; };
|
||||||
float Aspect() { this->m_aspect; }
|
float Aspect() { this->m_aspect; };
|
||||||
|
|
||||||
virtual C3Vector Forward();
|
virtual C3Vector Forward();
|
||||||
virtual C3Vector Right();
|
virtual C3Vector Right();
|
||||||
virtual C3Vector Up();
|
virtual C3Vector Up();
|
||||||
|
|
||||||
void SetPosition(const C3Vector& position) { this->m_position = position; }
|
void SetPosition(const C3Vector& position) { this->m_position = position; };
|
||||||
void SetPosition(float x, float y, float z) { this->m_position = C3Vector(x, y, z); }
|
void SetPosition(float x, float y, float z) { this->m_position = C3Vector(x, y, z); };
|
||||||
|
|
||||||
void SetFacing(float yaw, float pitch, float roll);
|
void SetFacing(float yaw, float pitch, float roll);
|
||||||
void SetFacing(const C3Vector& forward, const C3Vector& up);
|
void SetFacing(const C3Vector& forward, const C3Vector& up);
|
||||||
void SetFacing(const C3Vector& forward);
|
void SetFacing(const C3Vector& forward);
|
||||||
|
|
||||||
void SetFieldOfView(float value) { this->m_fov = value; }
|
void SetFieldOfView(float value) { this->m_fov = value; };
|
||||||
void SetNearZ(float value) { this->m_nearZ = value; }
|
void SetNearZ(float value) { this->m_nearZ = value; };
|
||||||
void SetFarZ(float value) { this->m_farZ = value; }
|
void SetFarZ(float value) { this->m_farZ = value; };
|
||||||
|
|
||||||
void SetGxProjectionAndView(const CRect& projectionRect);
|
void SetGxProjectionAndView(const CRect& projectionRect);
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,6 @@ target_link_libraries(world
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
gx
|
gx
|
||||||
model
|
model
|
||||||
gameui
|
|
||||||
PUBLIC
|
PUBLIC
|
||||||
bc
|
bc
|
||||||
common
|
common
|
||||||
|
|||||||
@ -1,13 +1,9 @@
|
|||||||
#include "world/CWorld.hpp"
|
#include "world/CWorld.hpp"
|
||||||
#include "gx/Device.hpp"
|
#include "gx/Device.hpp"
|
||||||
#include "gx/Shader.hpp"
|
#include "gx/Shader.hpp"
|
||||||
#include "gx/RenderState.hpp"
|
|
||||||
#include "model/Model2.hpp"
|
#include "model/Model2.hpp"
|
||||||
#include "world/World.hpp"
|
|
||||||
#include "world/map/CMap.hpp"
|
#include "world/map/CMap.hpp"
|
||||||
#include "world/daynight/DayNight.hpp"
|
#include "world/daynight/DayNight.hpp"
|
||||||
#include "gameui/camera/CGCamera.hpp"
|
|
||||||
#include "gameui/CGWorldFrame.hpp"
|
|
||||||
|
|
||||||
uint32_t CWorld::s_enables;
|
uint32_t CWorld::s_enables;
|
||||||
uint32_t CWorld::s_enables2;
|
uint32_t CWorld::s_enables2;
|
||||||
@ -54,10 +50,5 @@ void CWorld::LoadMap(const char* mapName, const C3Vector& position, int32_t zone
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CWorld::Render() {
|
void CWorld::Render() {
|
||||||
GxRsPush();
|
|
||||||
CRect rect;
|
|
||||||
CGWorldFrame::s_currentWorldFrame->GetRect(&rect);
|
|
||||||
CGWorldFrame::GetActiveCamera()->SetGxProjectionAndView(rect);
|
|
||||||
DayNight::RenderSky();
|
DayNight::RenderSky();
|
||||||
GxRsPop();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,9 +32,8 @@ void DNStars::Render() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->m_model->SetAnimating(1);
|
this->m_model->SetAnimating(1);
|
||||||
this->m_model->SetVisible(1);
|
|
||||||
|
|
||||||
// TODO: this->m_model->SetSomething(1);
|
// TODO
|
||||||
|
|
||||||
uint32_t elapsed = OsGetAsyncTimeMs() - this->m_time;
|
uint32_t elapsed = OsGetAsyncTimeMs() - this->m_time;
|
||||||
this->m_time += elapsed;
|
this->m_time += elapsed;
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
#include "world/daynight/DayNight.hpp"
|
#include "world/daynight/DayNight.hpp"
|
||||||
#include "world/daynight/DNStars.hpp"
|
#include "world/daynight/DNStars.hpp"
|
||||||
#include "gx/Transform.hpp"
|
|
||||||
#include "gx/RenderState.hpp"
|
|
||||||
#include "gx/Draw.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
namespace DayNight {
|
namespace DayNight {
|
||||||
@ -17,22 +14,6 @@ void LoadMap(int32_t zoneID) {
|
|||||||
|
|
||||||
void RenderSky() {
|
void RenderSky() {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
float minX;
|
|
||||||
float maxX;
|
|
||||||
float minY;
|
|
||||||
float maxY;
|
|
||||||
float minZ;
|
|
||||||
float maxZ;
|
|
||||||
GxXformViewport(minX, maxX, minY, maxY, minZ, maxZ);
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
GxXformSetViewport(minX, maxX, minY, maxY, 0.99902344f, 1.0f);
|
|
||||||
GxRsSet(GxRs_ScissorTest, 1);
|
|
||||||
CImVector color { 0xFF000000 };
|
|
||||||
GxSceneClear(3, color);
|
|
||||||
|
|
||||||
g_stars.Render();
|
g_stars.Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user