mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-26 22:06:06 +03:00
fix(daynight): fix compilation issues
This commit is contained in:
parent
add79bdc94
commit
a886fe7d63
@ -2165,7 +2165,7 @@ void CGxDeviceD3d::SceneClear(uint32_t mask, CImVector color) {
|
|||||||
this->IXformSetViewport();
|
this->IXformSetViewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
D3DCOLOR d3dColor = color.b | (color.g | (color.r << 8) << 8);
|
D3DCOLOR d3dColor = D3DCOLOR_RGBA(color.r, color.g, color.b, color.a);
|
||||||
|
|
||||||
this->m_d3dDevice->Clear(0, nullptr, flags, d3dColor, 1.0f, 0);
|
this->m_d3dDevice->Clear(0, nullptr, flags, d3dColor, 1.0f, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,13 +23,15 @@ void DNSky::Render() {
|
|||||||
GxRsSet(GxRs_DepthWrite, 0);
|
GxRsSet(GxRs_DepthWrite, 0);
|
||||||
GxRsSet(GxRs_BlendingMode, GxBlend_Add);
|
GxRsSet(GxRs_BlendingMode, GxBlend_Add);
|
||||||
GxRsSetAlphaRef();
|
GxRsSetAlphaRef();
|
||||||
GxPrimVertexPtr(
|
GxPrimLockVertexPtrs(
|
||||||
this->m_nVerts, this->m_geoVerts.Ptr(), 12,
|
this->m_nVerts, this->m_geoVerts.Ptr(), sizeof(C3Vector),
|
||||||
|
nullptr, 0,
|
||||||
|
this->m_clrVerts.Ptr(), sizeof(CImVector),
|
||||||
nullptr, 0,
|
nullptr, 0,
|
||||||
this->m_clrVerts.Ptr(), 4,
|
|
||||||
nullptr, 0,
|
nullptr, 0,
|
||||||
nullptr, 0);
|
nullptr, 0);
|
||||||
GxDrawLockedElements(GxPrim_TriangleStrip, this->m_nIndices, this->m_indices.Ptr());
|
GxDrawLockedElements(GxPrim_TriangleStrip, this->m_nIndices, this->m_indices.Ptr());
|
||||||
|
GxPrimUnlockVertexPtrs();
|
||||||
GxXformPop(GxXform_World);
|
GxXformPop(GxXform_World);
|
||||||
GxRsPop();
|
GxRsPop();
|
||||||
}
|
}
|
||||||
@ -74,10 +76,10 @@ void DNSky::GenSphere(float sphRadius) {
|
|||||||
for (int32_t j = 0; j < geoSize; ++j) {
|
for (int32_t j = 0; j < geoSize; ++j) {
|
||||||
auto& vertex = this->m_geoVerts[lastGeoIndex++];
|
auto& vertex = this->m_geoVerts[lastGeoIndex++];
|
||||||
|
|
||||||
float v19 = static_cast<float>(j) * 0.041666668f * 6.2831855f;
|
float v19 = static_cast<float>(j) * 0.041666668f * CMath::TWO_PI;
|
||||||
vertex.x = CMath::sinf(v19) * v16 * sphRadius;
|
vertex.x = CMath::sin(v19) * v16 * sphRadius;
|
||||||
vertex.y = v16 * CMath::cosf(v19) * sphRadius0;
|
vertex.y = v16 * CMath::cos(v19) * sphRadius;
|
||||||
vertex.z = sphRadius * v12 - CMath::cosf(0.7853981852531433f);
|
vertex.z = sphRadius * v12 - CMath::cos(0.7853981852531433f);
|
||||||
|
|
||||||
if (CMath::fequal(phi, 0.0f) || CMath::fequal(phi, CMath::PI)) {
|
if (CMath::fequal(phi, 0.0f) || CMath::fequal(phi, CMath::PI)) {
|
||||||
break;
|
break;
|
||||||
@ -98,4 +100,11 @@ void DNSky::GenSphere(float sphRadius) {
|
|||||||
this->m_nIndices = lastIndex; // Should be always equal to 300
|
this->m_nIndices = lastIndex; // Should be always equal to 300
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DNSky::SetColors() {
|
||||||
|
// TODO
|
||||||
|
for (uint32_t i = 0; i < this->m_clrVerts.Count(); ++i) {
|
||||||
|
this->m_clrVerts[i] = { 0xFF, 0, 0xFF, 0xFF };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace DayNight
|
} // namespace DayNight
|
||||||
|
|||||||
@ -15,6 +15,7 @@ class DNSky {
|
|||||||
|
|
||||||
void Render();
|
void Render();
|
||||||
void GenSphere(float sphRadius);
|
void GenSphere(float sphRadius);
|
||||||
|
void SetColors();
|
||||||
|
|
||||||
static float m_stripSizes[SKY_NUMBANDS];
|
static float m_stripSizes[SKY_NUMBANDS];
|
||||||
static float m_fadeAngle[SKY_NUMBANDS];
|
static float m_fadeAngle[SKY_NUMBANDS];
|
||||||
|
|||||||
@ -61,10 +61,20 @@ void LoadMap(int32_t zoneID) {
|
|||||||
g_stars.Initialize();
|
g_stars.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetColors() {
|
||||||
|
// TODO
|
||||||
|
g_sky.SetColors();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateLighting() {
|
||||||
|
// TODO
|
||||||
|
SetColors();
|
||||||
|
}
|
||||||
|
|
||||||
void Update() {
|
void Update() {
|
||||||
// TODO
|
// TODO
|
||||||
|
UpdateLighting();
|
||||||
g_stars.Update();
|
g_stars.Update();
|
||||||
g_sky.Render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderSky() {
|
void RenderSky() {
|
||||||
@ -82,10 +92,11 @@ void RenderSky() {
|
|||||||
|
|
||||||
GxXformSetViewport(minX, maxX, minY, maxY, 0.99902344f, 1.0f);
|
GxXformSetViewport(minX, maxX, minY, maxY, 0.99902344f, 1.0f);
|
||||||
GxRsSet(GxRs_ScissorTest, 1);
|
GxRsSet(GxRs_ScissorTest, 1);
|
||||||
CImVector color { 0xFF000000 };
|
CImVector clearColor = { 124, 125, 61, 0xFF };
|
||||||
GxSceneClear(3, color);
|
GxSceneClear(3, clearColor);
|
||||||
|
|
||||||
g_stars.Render();
|
//g_stars.Render();
|
||||||
|
g_sky.Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
DNInfo* GetInfo() {
|
DNInfo* GetInfo() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user