build fix

This commit is contained in:
nesbox 2018-09-04 23:57:00 +03:00
parent beee7e8c65
commit e55b2a2f9a
1 changed files with 8 additions and 1 deletions

View File

@ -67,6 +67,11 @@ static struct
bool state[tic_keys_count]; bool state[tic_keys_count];
struct
{
bool state[tic_keys_count];
} touch;
} keyboard; } keyboard;
u32 touchCounter; u32 touchCounter;
@ -419,7 +424,7 @@ static void processKeyboard()
enum{BufSize = COUNT_OF(input->keyboard.keys)}; enum{BufSize = COUNT_OF(input->keyboard.keys)};
for(s32 i = 0, c = 0; i < COUNT_OF(platform.keyboard.state) && c < BufSize; i++) for(s32 i = 0, c = 0; i < COUNT_OF(platform.keyboard.state) && c < BufSize; i++)
if(platform.keyboard.state[i]) if(platform.keyboard.state[i] || platform.keyboard.touch.state[i])
input->keyboard.keys[c++] = i; input->keyboard.keys[c++] = i;
} }
@ -499,6 +504,8 @@ static void processTouchKeyboard()
enum {BufSize = COUNT_OF(input->keyboard.keys)}; enum {BufSize = COUNT_OF(input->keyboard.keys)};
SDL_memset(&platform.keyboard.touch.state, 0, sizeof platform.keyboard.touch.state);
for (s32 i = 0; i < devices; i++) for (s32 i = 0; i < devices; i++)
{ {
SDL_TouchID id = SDL_GetTouchDevice(i); SDL_TouchID id = SDL_GetTouchDevice(i);