From d18d8acc43b8ae6457039c0786aaf2edc48c58c9 Mon Sep 17 00:00:00 2001 From: VDm Date: Sat, 29 Mar 2025 23:23:47 +0400 Subject: [PATCH] feat(gx): add constructors of CGxFormat --- src/gx/CGxFormat.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++ src/gx/CGxFormat.hpp | 14 +++++++++++++ 2 files changed, 61 insertions(+) diff --git a/src/gx/CGxFormat.cpp b/src/gx/CGxFormat.cpp index f14838a..140daa9 100644 --- a/src/gx/CGxFormat.cpp +++ b/src/gx/CGxFormat.cpp @@ -1,3 +1,50 @@ #include "gx/CGxFormat.hpp" const char* CGxFormat::formatToColorBitsString[Formats_Last] = { "16", "24", "24", "30", "16", "24", "24", "32" }; + +CGxFormat::CGxFormat() { + this->size.x = 0; + this->size.y = 0; + this->pos.x = 0; + this->pos.y = 0; + this->sampleQuality = 0.0; + this->maximize = 0; + this->stereoEnabled = false; + this->sampleCount = 1; + this->aspect = 1; + this->unk1 = -1; + this->unk2 = -1; + this->unk3 = -1; + this->unk4 = -1; + this->unk5 = -1; + this->unk6 = -1; +} + +CGxFormat::CGxFormat(bool p_window, const C2iVector& p_size, Format p_colorFormat, Format p_depthFormat, uint32_t p_refreshRate, uint32_t p_vsync, bool p_hwTnl, bool p_fixLag, bool p_hwCursor, bool p_aspect, bool p_maximize) { + this->size.x = 0; + this->size.y = 0; + this->pos.x = 0; + this->pos.y = 0; + this->hwTnL = p_hwTnl; + this->hwCursor = p_hwCursor; + this->fixLag = p_fixLag; + this->window = p_window; + this->depthFormat = p_depthFormat; + this->size.x = p_size.x; + this->size.y = p_size.y; + this->sampleQuality = 0.0; + this->colorFormat = p_colorFormat; + this->refreshRate = p_refreshRate; + this->vsync = p_vsync; + this->aspect = p_aspect; + this->stereoEnabled = 0; + this->maximize = p_maximize; + this->backbuffers = 1; + this->sampleCount = 1; + this->unk1 = -1; + this->unk2 = -1; + this->unk3 = -1; + this->unk4 = -1; + this->unk5 = -1; + this->unk6 = -1; +} diff --git a/src/gx/CGxFormat.hpp b/src/gx/CGxFormat.hpp index 0e33aa4..7f2960e 100644 --- a/src/gx/CGxFormat.hpp +++ b/src/gx/CGxFormat.hpp @@ -19,20 +19,34 @@ class CGxFormat { Formats_Last = 8 }; + CGxFormat(); + CGxFormat(bool p_window, const C2iVector& p_size, Format p_colorFormat, Format p_depthFormat, uint32_t p_refreshRate, uint32_t p_vsync, bool p_hwTnl, bool p_fixLag, bool p_hwCursor, bool p_aspect, bool p_maximize); + static const char* formatToColorBitsString[Formats_Last]; // Member variables + uint32_t apiSpecificModeID; bool hwTnL; bool hwCursor; bool fixLag; int8_t window; + int8_t aspect; int32_t maximize; Format depthFormat; C2iVector size; + uint32_t backbuffers; uint32_t sampleCount; + float sampleQuality; Format colorFormat; uint32_t refreshRate; uint32_t vsync; + bool stereoEnabled; + uint32_t unk1; + uint32_t unk2; + uint32_t unk3; + uint32_t unk4; + uint32_t unk5; + uint32_t unk6; C2iVector pos; };