浏览代码

update

tags/day-25
Ledda 2 个月前
父节点
当前提交
0941000e13
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. +5
    -1
      src/handmade.cpp
  2. +3
    -3
      src/win32_handmade.cpp

+ 5
- 1
src/handmade.cpp 查看文件

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


+ 3
- 3
src/win32_handmade.cpp 查看文件

@@ -432,9 +432,9 @@ int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prevInstance, PSTR commandLin
win32ProcessPendingMessages(newKeyboardController);

XINPUT_STATE controllerState;
int maxControllerCount = 1 + XUSER_MAX_COUNT;
if (maxControllerCount > ArrayCount(newInput->controllers)) {
maxControllerCount = ArrayCount(newInput->controllers);
int maxControllerCount = XUSER_MAX_COUNT;
if (maxControllerCount > ArrayCount(newInput->controllers) - 1) {
maxControllerCount = ArrayCount(newInput->controllers) - 1;
}

for (DWORD controllerIndex = 0; controllerIndex < XUSER_MAX_COUNT; controllerIndex++) {


正在加载...
取消
保存