mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
DS: Fix UI sort of to work
This commit is contained in:
parent
6d8a0fb933
commit
526bd40646
@ -27,6 +27,8 @@ void Gfx_Create(void) {
|
||||
glViewport(0, 0, 255, 191);
|
||||
|
||||
vramSetBankA(VRAM_A_TEXTURE);
|
||||
vramSetBankB(VRAM_B_TEXTURE);
|
||||
vramSetBankC(VRAM_C_TEXTURE);
|
||||
// setup memory for textures
|
||||
|
||||
glPolyFmt(POLY_ALPHA(31) | POLY_CULL_NONE);
|
||||
@ -168,6 +170,8 @@ void Gfx_CalcOrthoMatrix(struct Matrix* matrix, float width, float height, float
|
||||
/* Transposed, source https://learn.microsoft.com/en-us/windows/win32/opengl/glortho */
|
||||
/* The simplified calculation below uses: L = 0, R = width, T = 0, B = height */
|
||||
*matrix = Matrix_Identity;
|
||||
width /= 32.0f;
|
||||
height /= 32.0f;
|
||||
|
||||
matrix->row1.x = 2.0f / width;
|
||||
matrix->row2.y = -2.0f / height;
|
||||
@ -224,9 +228,9 @@ static void PreprocessTexturedVertices(void) {
|
||||
for (int i = 0; i < buf_count; i++, src++, dst++)
|
||||
{
|
||||
struct VertexTextured v = *src;
|
||||
dst->x = floattov16(v.x / 16.0f);
|
||||
dst->y = floattov16(v.y / 16.0f);
|
||||
dst->z = floattov16(v.z / 16.0f);
|
||||
dst->x = floattov16(v.x / 32.0f);
|
||||
dst->y = floattov16(v.y / 32.0f);
|
||||
dst->z = floattov16(v.z / 32.0f);
|
||||
dst->u = v.U;
|
||||
dst->v = v.V;
|
||||
dst->r = PackedCol_R(v.Col);
|
||||
@ -242,9 +246,9 @@ static void PreprocessColouredVertices(void) {
|
||||
for (int i = 0; i < buf_count; i++, src++, dst++)
|
||||
{
|
||||
struct VertexColoured v = *src;
|
||||
dst->x = floattov16(v.x / 16.0f);
|
||||
dst->y = floattov16(v.y / 16.0f);
|
||||
dst->z = floattov16(v.z / 16.0f);
|
||||
dst->x = floattov16(v.x / 32.0f);
|
||||
dst->y = floattov16(v.y / 32.0f);
|
||||
dst->z = floattov16(v.z / 32.0f);
|
||||
dst->r = PackedCol_R(v.Col);
|
||||
dst->g = PackedCol_G(v.Col);
|
||||
dst->b = PackedCol_B(v.Col);
|
||||
@ -355,7 +359,7 @@ void Gfx_LoadMatrix(MatrixType type, const struct Matrix* matrix) {
|
||||
// That's way too small to be useful, so counteract that by scaling down
|
||||
// vertices and then scaling up the matrix multiplication
|
||||
if (type == MATRIX_VIEW)
|
||||
glScalef32(floattof32(16.0f), floattof32(16.0f), floattof32(16.0f));
|
||||
glScalef32(floattof32(32.0f), floattof32(32.0f), floattof32(32.0f));
|
||||
}
|
||||
|
||||
void Gfx_LoadIdentityMatrix(MatrixType type) {
|
||||
|
@ -94,11 +94,20 @@ static void GetNativePath(char* str, const cc_string* path) {
|
||||
}
|
||||
|
||||
cc_result Directory_Create(const cc_string* path) {
|
||||
return ERR_NOT_SUPPORTED;
|
||||
if (!fat_available) return ENOSYS;
|
||||
|
||||
char str[NATIVE_STR_LEN];
|
||||
GetNativePath(str, path);
|
||||
return mkdir(str, 0) == -1 ? errno : 0;
|
||||
}
|
||||
|
||||
int File_Exists(const cc_string* path) {
|
||||
return false;
|
||||
if (!fat_available) return false;
|
||||
|
||||
char str[NATIVE_STR_LEN];
|
||||
struct stat sb;
|
||||
GetNativePath(str, path);
|
||||
return stat(str, &sb) == 0 && S_ISREG(sb.st_mode);
|
||||
}
|
||||
|
||||
cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCallback callback) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user