mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-06-23 01:20:10 -04:00
695879c4cb
* Add modern menu. Add and include LUS cvars .cmake file for macro usage in modern menu. * Un-ignore new .cmake * Copy new Resolution Editor stuff from 2ship (incomplete). Fix fullscreen checkbox. Finish changes for new UIWidgets. Cleanup ShipUtils. * Remove duplicate asm-differ entry from .gitmodules. * Re-implement Freecam options. * Cleanup freecam character follow buttons. Partially re-implement Multiplayer window as enhancement sidebar (needs text input widget to finish). Cleanup disables. --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
#include "ShipUtils.h"
|
|
#include <libultraship/libultraship.h>
|
|
|
|
extern "C" {
|
|
#include "macros.h"
|
|
}
|
|
|
|
constexpr f32 fourByThree = 4.0f / 3.0f;
|
|
|
|
extern "C" bool Ship_IsCStringEmpty(const char* str) {
|
|
return str == NULL || str[0] == '\0';
|
|
}
|
|
|
|
// Build vertex coordinates for a quad command
|
|
// In order of top left, top right, bottom left, then bottom right
|
|
// Supports flipping the texture horizontally
|
|
extern "C" void Ship_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH) {
|
|
vtxList[0].v.ob[0] = xStart;
|
|
vtxList[0].v.ob[1] = yStart;
|
|
vtxList[0].v.tc[0] = (flippedH ? width : 0) << 5;
|
|
vtxList[0].v.tc[1] = 0 << 5;
|
|
|
|
vtxList[1].v.ob[0] = xStart + width;
|
|
vtxList[1].v.ob[1] = yStart;
|
|
vtxList[1].v.tc[0] = (flippedH ? width * 2 : width) << 5;
|
|
vtxList[1].v.tc[1] = 0 << 5;
|
|
|
|
vtxList[2].v.ob[0] = xStart;
|
|
vtxList[2].v.ob[1] = yStart + height;
|
|
vtxList[2].v.tc[0] = (flippedH ? width : 0) << 5;
|
|
vtxList[2].v.tc[1] = height << 5;
|
|
|
|
vtxList[3].v.ob[0] = xStart + width;
|
|
vtxList[3].v.ob[1] = yStart + height;
|
|
vtxList[3].v.tc[0] = (flippedH ? width * 2 : width) << 5;
|
|
vtxList[3].v.tc[1] = height << 5;
|
|
}
|