mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-10 07:49:57 -04:00
3DS: Embed citro3d source directly into the graphics backend
This commit is contained in:
parent
ad5804344c
commit
efa38fe4f4
@ -48,7 +48,7 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
|
|||||||
ASFLAGS := -g $(ARCH)
|
ASFLAGS := -g $(ARCH)
|
||||||
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||||
|
|
||||||
LIBS := -lcitro3d -lctru -lm
|
LIBS := -lctru -lm
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#include <citro3d.h>
|
|
||||||
#define BUFFER_BASE_PADDR OS_VRAM_PADDR // VRAM physical address
|
#define BUFFER_BASE_PADDR OS_VRAM_PADDR // VRAM physical address
|
||||||
|
#include "../third_party/citro3d.c"
|
||||||
|
|
||||||
// autogenerated from the .v.pica files by Makefile
|
// autogenerated from the .v.pica files by Makefile
|
||||||
extern const u8 coloured_shbin[];
|
extern const u8 coloured_shbin[];
|
||||||
@ -204,7 +204,6 @@ static void Calc3DProjection(int dir, struct Matrix* proj) {
|
|||||||
float slider = osGet3DSliderState();
|
float slider = osGet3DSliderState();
|
||||||
float iod = (slider / 3) * dir;
|
float iod = (slider / 3) * dir;
|
||||||
float shift = iod / (2.0f * 2.0f);
|
float shift = iod / (2.0f * 2.0f);
|
||||||
Platform_Log2("ADJ: %f3, %f3", &shift, &proj->row1.y);
|
|
||||||
|
|
||||||
proj_adj.row3.y = 1.0f * shift * -proj->row1.y;
|
proj_adj.row3.y = 1.0f * shift * -proj->row1.y;
|
||||||
Gfx.Projection = proj_adj;
|
Gfx.Projection = proj_adj;
|
||||||
@ -596,19 +595,20 @@ static void GPUBuffers_DeleteUnreferenced(void) {
|
|||||||
static cc_uint16* gfx_indices;
|
static cc_uint16* gfx_indices;
|
||||||
|
|
||||||
GfxResourceID Gfx_CreateIb2(int count, Gfx_FillIBFunc fillFunc, void* obj) {
|
GfxResourceID Gfx_CreateIb2(int count, Gfx_FillIBFunc fillFunc, void* obj) {
|
||||||
struct GPUBuffer* buffer = GPUBuffer_Alloc(count, sizeof(cc_uint16));
|
if (!gfx_indices) {
|
||||||
if (!buffer) Logger_Abort("Failed to allocate memory for index buffer");
|
gfx_indices = linearAlloc(count * sizeof(cc_uint16));
|
||||||
|
if (!gfx_indices) Logger_Abort("Failed to allocate memory for index buffer");
|
||||||
|
}
|
||||||
|
|
||||||
fillFunc((cc_uint16*)buffer->data, count, obj);
|
fillFunc(gfx_indices, count, obj);
|
||||||
return buffer;
|
return gfx_indices;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_BindIb(GfxResourceID ib) {
|
void Gfx_BindIb(GfxResourceID ib) {
|
||||||
struct GPUBuffer* buffer = (struct GPUBuffer*)ib;
|
// No need to bind again
|
||||||
gfx_indices = (cc_uint16*)buffer->data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_DeleteIb(GfxResourceID* ib) { GPUBuffer_Unref(ib); }
|
void Gfx_DeleteIb(GfxResourceID* ib) { }
|
||||||
|
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
|
2012
third_party/citro3d.c
vendored
Normal file
2012
third_party/citro3d.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user