This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
49 additions
and
938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
#pragma once | ||
|
||
#include <stdbool.h> | ||
#include <stdint.h> | ||
#include <libtrx/game/console/common.h> | ||
|
||
void Console_Init(void); | ||
void Console_Shutdown(void); | ||
void Console_Draw(void); | ||
|
||
void Console_Open(void); | ||
void Console_Close(void); | ||
bool Console_IsOpened(void); | ||
|
||
void Console_Log(const char *fmt, ...); | ||
void Console_ScrollLogs(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,19 @@ | ||
#include "game/ui/common.h" | ||
#include <libtrx/game/ui/common.h> | ||
|
||
#include <libtrx/vector.h> | ||
#include <windows.h> | ||
|
||
void UI_Init(void) | ||
UI_INPUT UI_TranslateInput(uint32_t system_keycode) | ||
{ | ||
UI_Events_Init(); | ||
} | ||
|
||
void UI_Shutdown(void) | ||
{ | ||
UI_Events_Shutdown(); | ||
} | ||
|
||
void UI_HandleKeyDown(const uint32_t key) | ||
{ | ||
const UI_EVENT event = { | ||
.name = "key_down", | ||
.sender = NULL, | ||
.data = (void *)(uintptr_t)key, | ||
}; | ||
UI_Events_Fire(&event); | ||
} | ||
|
||
void UI_HandleKeyUp(const uint32_t key) | ||
{ | ||
const UI_EVENT event = { | ||
.name = "key_up", | ||
.sender = NULL, | ||
.data = (void *)(uintptr_t)key, | ||
}; | ||
UI_Events_Fire(&event); | ||
} | ||
|
||
void UI_HandleChar(const uint32_t char_) | ||
{ | ||
const UI_EVENT event = { | ||
.name = "char", | ||
.sender = NULL, | ||
.data = (void *)(uintptr_t)char_, | ||
}; | ||
UI_Events_Fire(&event); | ||
// clang-format off | ||
switch (system_keycode) { | ||
case VK_LEFT: return UI_KEY_LEFT; | ||
case VK_RIGHT: return UI_KEY_RIGHT; | ||
case VK_HOME: return UI_KEY_HOME; | ||
case VK_END: return UI_KEY_END; | ||
case VK_BACK: return UI_KEY_BACK; | ||
case VK_RETURN: return UI_KEY_RETURN; | ||
case VK_ESCAPE: return UI_KEY_ESCAPE; | ||
} | ||
// clang-format on | ||
return -1; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.