This commit is contained in:
2024-09-03 23:16:26 +01:00
parent b5fe21928f
commit 0941000e13
2 changed files with 8 additions and 4 deletions

View File

@@ -65,10 +65,14 @@ internal void gameUpdateAndRender(GameMemory *memory, GameOffscreenBuffer *video
state->blueOffset += (int)(4.0f*controllerInput->stickAvgY); state->blueOffset += (int)(4.0f*controllerInput->stickAvgY);
} else { } else {
if (controllerInput->stickRight.endedDown) { if (controllerInput->stickRight.endedDown) {
state->toneHz = 440 + 128;
state->greenOffset -= 4; state->greenOffset -= 4;
} else if (controllerInput->stickLeft.endedDown) { } else if (controllerInput->stickLeft.endedDown) {
state->toneHz = 440 - 128;
state->greenOffset += 4; state->greenOffset += 4;
} } else {
state->toneHz = 440;
}
if (controllerInput->stickUp.endedDown) { if (controllerInput->stickUp.endedDown) {
state->blueOffset += 4; state->blueOffset += 4;
} else if (controllerInput->stickDown.endedDown) { } else if (controllerInput->stickDown.endedDown) {

View File

@@ -432,9 +432,9 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, PSTR commandLin
win32ProcessPendingMessages(newKeyboardController); win32ProcessPendingMessages(newKeyboardController);
XINPUT_STATE controllerState; XINPUT_STATE controllerState;
int maxControllerCount = 1 + XUSER_MAX_COUNT; int maxControllerCount = XUSER_MAX_COUNT;
if (maxControllerCount > ArrayCount(newInput->controllers)) { if (maxControllerCount > ArrayCount(newInput->controllers) - 1) {
maxControllerCount = ArrayCount(newInput->controllers); maxControllerCount = ArrayCount(newInput->controllers) - 1;
} }
for (DWORD controllerIndex = 0; controllerIndex < XUSER_MAX_COUNT; controllerIndex++) { for (DWORD controllerIndex = 0; controllerIndex < XUSER_MAX_COUNT; controllerIndex++) {