mirror of
https://github.com/CTR-tools/CTR-ModSDK.git
synced 2025-03-01 09:36:28 +00:00
Small refactor
This commit is contained in:
parent
a53b8c88e0
commit
391188cae5
@ -8,16 +8,20 @@ void DECOMP_CTR_Box_DrawSolidBox(RECT * r, Color color, u_long * ot)
|
||||
|
||||
const PrimCode primCode = { .poly = { .renderCode = RenderCode_Polygon, .quad = 1 } };
|
||||
color.code = primCode;
|
||||
|
||||
p->colorCode = color;
|
||||
p->v[0].pos.x = r->x;
|
||||
p->v[0].pos.y = r->y;
|
||||
p->v[1].pos.x = r->x + r->w;
|
||||
p->v[1].pos.y = r->y;
|
||||
p->v[2].pos.x = r->x;
|
||||
p->v[2].pos.y = r->y + r->h;
|
||||
p->v[3].pos.x = r->x + r->w;
|
||||
p->v[3].pos.y = r->y + r->h;
|
||||
|
||||
s16 topX = r->x;
|
||||
s16 topY = r->y;
|
||||
s16 bottomX = r->x + r->w;
|
||||
s16 bottomY = r->y + r->h;
|
||||
p->v[0].pos.x = topX;
|
||||
p->v[0].pos.y = topY;
|
||||
p->v[1].pos.x = bottomX;
|
||||
p->v[1].pos.y = topY;
|
||||
p->v[2].pos.x = topX;
|
||||
p->v[2].pos.y = bottomY;
|
||||
p->v[3].pos.x = bottomX;
|
||||
p->v[3].pos.y = bottomY;
|
||||
|
||||
AddPrimitive(p, ot);
|
||||
}
|
@ -8,14 +8,18 @@ void DECOMP_CTR_Box_DrawWireBox(RECT * r, Color color, void * ot)
|
||||
|
||||
const PrimCode primCode = { .line = { .renderCode = RenderCode_Line, .polyline = 1 } };
|
||||
color.code = primCode;
|
||||
|
||||
p->colorCode = color;
|
||||
p->v[0].pos.x = r->x;
|
||||
p->v[0].pos.y = r->y;
|
||||
p->v[1].pos.x = r->x + r->w;
|
||||
p->v[1].pos.y = r->y;
|
||||
p->v[2].pos.x = r->x + r->w;
|
||||
p->v[2].pos.y = r->y + r->h;
|
||||
|
||||
s16 topX = r->x;
|
||||
s16 topY = r->y;
|
||||
s16 bottomX = r->x + r->w;
|
||||
s16 bottomY = r->y + r->h;
|
||||
p->v[0].pos.x = topX;
|
||||
p->v[0].pos.y = topY;
|
||||
p->v[1].pos.x = bottomX;
|
||||
p->v[1].pos.y = topY;
|
||||
p->v[2].pos.x = bottomX;
|
||||
p->v[2].pos.y = bottomY;
|
||||
p->end = 0x55555555;
|
||||
|
||||
AddPrimitive(p, ot);
|
||||
@ -23,12 +27,12 @@ void DECOMP_CTR_Box_DrawWireBox(RECT * r, Color color, void * ot)
|
||||
if (p == nullptr) { return; }
|
||||
|
||||
p->colorCode = color;
|
||||
p->v[0].pos.x = r->x;
|
||||
p->v[0].pos.y = r->y;
|
||||
p->v[1].pos.x = r->x;
|
||||
p->v[1].pos.y = r->y + r->h;
|
||||
p->v[2].pos.x = r->x + r->w;
|
||||
p->v[2].pos.y = r->y + r->h;
|
||||
p->v[0].pos.x = topX;
|
||||
p->v[0].pos.y = topY;
|
||||
p->v[1].pos.x = topX;
|
||||
p->v[1].pos.y = bottomY;
|
||||
p->v[2].pos.x = bottomX;
|
||||
p->v[2].pos.y = bottomY;
|
||||
p->end = 0x55555555;
|
||||
|
||||
AddPrimitive(p, ot);
|
||||
|
@ -16,7 +16,7 @@
|
||||
//#define USE_BIGQUEUE // Requires RAMEX: Extended loading queue
|
||||
//#define USE_HIGH1P // Requires BIGQUEUE: All high model drivers
|
||||
//#define USE_RANDOM // Requires HIGH1P: Character Randomizer
|
||||
#define USE_ONLINE // Requires HIGH1P: Online Multiplayer
|
||||
//#define USE_ONLINE // Requires HIGH1P: Online Multiplayer
|
||||
//#define USE_HIGHMP // Requires RAMEX: Multiplayer Maxed mod
|
||||
|
||||
//#define USE_VR // Virtual Reality
|
||||
|
Loading…
x
Reference in New Issue
Block a user