fixed finicky clear button combo
This commit is contained in:
parent
ad058fbe93
commit
52ea93de45
48
main.c
48
main.c
|
@ -48,6 +48,15 @@ int main(int argc, char **argv)
|
|||
OSScreenPutFontEx(SCREEN_TV, 0, 0, "SimpleDrawU (TV).");
|
||||
OSScreenPutFontEx(SCREEN_DRC, 0, 0, "SimpleDrawU (Gamepad).");
|
||||
|
||||
enum penColor {
|
||||
white = 0xFFFFFF00,
|
||||
black = 0x00000000,
|
||||
red = 0xBF5B5B00,
|
||||
yellow = 0xC6B95500,
|
||||
blue = 0x3C8D8800,
|
||||
green = 0x86B46000,
|
||||
};
|
||||
|
||||
while (WHBProcIsRunning())
|
||||
{
|
||||
VPADRead(VPAD_CHAN_0, &status, 1, &error);
|
||||
|
@ -77,37 +86,37 @@ int main(int argc, char **argv)
|
|||
break;
|
||||
|
||||
// clear screen
|
||||
if ((status.trigger & VPAD_BUTTON_PLUS) && (status.trigger & VPAD_BUTTON_MINUS))
|
||||
if ((status.hold & VPAD_BUTTON_PLUS) && (status.hold & VPAD_BUTTON_MINUS))
|
||||
{
|
||||
OSScreenClearBufferEx(SCREEN_TV, 0x00000000);
|
||||
OSScreenClearBufferEx(SCREEN_DRC, 0x00000000);
|
||||
}
|
||||
|
||||
// select color
|
||||
if (status.trigger & VPAD_BUTTON_PLUS)
|
||||
if (status.hold & VPAD_BUTTON_PLUS)
|
||||
{
|
||||
penColor = 0xFFFFFF00;
|
||||
} // white
|
||||
if (status.trigger & VPAD_BUTTON_MINUS)
|
||||
penColor = white;
|
||||
}
|
||||
if (status.hold & VPAD_BUTTON_MINUS)
|
||||
{
|
||||
penColor = 0x00000000;
|
||||
} // black
|
||||
if (status.trigger & VPAD_BUTTON_A)
|
||||
penColor = black;
|
||||
}
|
||||
if (status.hold & VPAD_BUTTON_A)
|
||||
{
|
||||
penColor = 0xBF5B5B00;
|
||||
} // red
|
||||
if (status.trigger & VPAD_BUTTON_B)
|
||||
penColor = red;
|
||||
}
|
||||
if (status.hold & VPAD_BUTTON_B)
|
||||
{
|
||||
penColor = 0xC6B95500;
|
||||
} // yellow
|
||||
if (status.trigger & VPAD_BUTTON_X)
|
||||
penColor = yellow;
|
||||
}
|
||||
if (status.hold & VPAD_BUTTON_X)
|
||||
{
|
||||
penColor = 0x3C8D8800;
|
||||
} // blue
|
||||
if (status.trigger & VPAD_BUTTON_Y)
|
||||
penColor = blue;
|
||||
}
|
||||
if (status.hold & VPAD_BUTTON_Y)
|
||||
{
|
||||
penColor = 0x86B46000;
|
||||
} // green
|
||||
penColor = green;
|
||||
}
|
||||
|
||||
// draw on screen
|
||||
if (gamepadTouchScreen.touched)
|
||||
|
@ -128,7 +137,6 @@ int main(int argc, char **argv)
|
|||
DCFlushRange(tvBuffer, tvBufferSize);
|
||||
DCFlushRange(drcBuffer, drcBufferSize);
|
||||
|
||||
committing your graphics changes. */
|
||||
OSScreenFlipBuffersEx(SCREEN_TV);
|
||||
OSScreenFlipBuffersEx(SCREEN_DRC);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue