diff --git a/src/Graphics_Xbox360.c b/src/Graphics_Xbox360.c index e37d89b21..22a00bb6b 100644 --- a/src/Graphics_Xbox360.c +++ b/src/Graphics_Xbox360.c @@ -278,6 +278,7 @@ void Gfx_UnlockDynamicVb(GfxResourceID vb) { Gfx_UnlockVb(vb); Gfx_BindVb(vb); *#########################################################################################################################*/ void Gfx_SetVertexFormat(VertexFormat fmt) { if (fmt == gfx_format) return; + Platform_LogConst("CHANGE FORMAT"); gfx_format = fmt; gfx_stride = strideSizes[fmt]; @@ -292,20 +293,24 @@ void Gfx_SetVertexFormat(VertexFormat fmt) { } void Gfx_DrawVb_Lines(int verticesCount) { + Platform_Log1("DRAW_LINES: %i", &verticesCount); Xe_DrawPrimitive(xe, XE_PRIMTYPE_LINELIST, 0, verticesCount >> 1); } void Gfx_DrawVb_IndexedTris(int verticesCount) { + Platform_Log1("DRAW_TRIS: %i", &verticesCount); Xe_DrawIndexedPrimitive(xe, XE_PRIMTYPE_TRIANGLELIST, // TODO QUADLIST instead? 0, 0, verticesCount, 0, verticesCount >> 1); } void Gfx_DrawVb_IndexedTris_Range(int verticesCount, int startVertex) { + Platform_Log1("DRAW_TRIS_RANGE: %i", &verticesCount); Xe_DrawIndexedPrimitive(xe, XE_PRIMTYPE_TRIANGLELIST, startVertex, 0, verticesCount, 0, verticesCount >> 1); } void Gfx_DrawIndexedTris_T2fC4b(int verticesCount, int startVertex) { + Platform_Log1("DRAW_TRIS_MAP: %i", &verticesCount); Xe_DrawIndexedPrimitive(xe, XE_PRIMTYPE_TRIANGLELIST, startVertex, 0, verticesCount, 0, verticesCount >> 1); } @@ -319,6 +324,7 @@ static struct Matrix _view, _proj, _mvp; void Gfx_LoadMatrix(MatrixType type, const struct Matrix* matrix) { struct Matrix* dst = type == MATRIX_PROJ ? &_proj : &_view; *dst = *matrix; + Platform_LogConst("LOAD MATRIX"); Matrix_Mul(&_mvp, &_view, &_proj); // TODO: Is this a global uniform, or does it need to be reloaded on shader change? @@ -380,6 +386,7 @@ void Gfx_SetVSync(cc_bool vsync) { } void Gfx_BeginFrame(void) { + Platform_LogConst("BEGIN FRAME"); } void Gfx_ClearBuffers(GfxBuffers buffers) { @@ -388,8 +395,10 @@ void Gfx_ClearBuffers(GfxBuffers buffers) { } void Gfx_EndFrame(void) { + Platform_LogConst("END FRAME A"); Xe_Resolve(xe); Xe_Sync(xe); + Platform_LogConst("END FRAME B"); } cc_bool Gfx_WarnIfNecessary(void) { return false; } diff --git a/src/Input.c b/src/Input.c index 6238ef7d8..ac0368c10 100644 --- a/src/Input.c +++ b/src/Input.c @@ -591,6 +591,16 @@ void Gamepad_Tick(float delta) { } } +static CC_NOINLINE void Gamepad_Add(int i, long deviceID, const struct BindMapping_* defaults) { + Mem_Copy(&Gamepad_Devices[i].base, &padDevice, sizeof(struct InputDevice)); + Gamepad_Devices[i].base.rawIndex = i; + Gamepad_Devices[i].base.currentBinds = padBind_Mappings[i]; + Gamepad_Devices[i].base.defaultBinds = defaults; + Gamepad_Devices[i].deviceID = deviceID; + + InputBind_Load(&Gamepad_Devices[i].base); +} + int Gamepad_Connect(long deviceID, const struct BindMapping_* defaults) { int i; for (i = 0; i < INPUT_MAX_GAMEPADS; i++) @@ -598,13 +608,7 @@ int Gamepad_Connect(long deviceID, const struct BindMapping_* defaults) { if (Gamepad_Devices[i].deviceID == deviceID) return i; if (Gamepad_Devices[i].deviceID != 0) continue; - Mem_Copy(&Gamepad_Devices[i].base, &padDevice, sizeof(struct InputDevice)); - Gamepad_Devices[i].base.rawIndex = i; - Gamepad_Devices[i].base.currentBinds = padBind_Mappings[i]; - Gamepad_Devices[i].base.defaultBinds = defaults; - Gamepad_Devices[i].deviceID = deviceID; - - InputBind_Load(&Gamepad_Devices[i].base); + Gamepad_Add(i, deviceID, defaults); return i; }