one step closer to c89 compatibility

This commit is contained in:
UnknownShadow200 2020-02-06 19:17:41 +11:00
parent 4e01518ce2
commit 07b56e6ba3
4 changed files with 15 additions and 10 deletions

View File

@ -298,11 +298,11 @@ void Launcher_Run(void) {
/*########################################################################################################################*
*---------------------------------------------------------Colours/Skin----------------------------------------------------*
*#########################################################################################################################*/
#define DEFAULT_BACKGROUND_COL BitmapCol_Make(153, 127, 172, 255);
#define DEFAULT_BUTTON_BORDER_COL BitmapCol_Make( 97, 81, 110, 255);
#define DEFAULT_BUTTON_FORE_ACTIVE_COL BitmapCol_Make(189, 168, 206, 255);
#define DEFAULT_BUTTON_FORE_COL BitmapCol_Make(141, 114, 165, 255);
#define DEFAULT_BUTTON_HIGHLIGHT_COL BitmapCol_Make(162, 131, 186, 255);
#define DEFAULT_BACKGROUND_COL BitmapCol_Make(153, 127, 172, 255)
#define DEFAULT_BUTTON_BORDER_COL BitmapCol_Make( 97, 81, 110, 255)
#define DEFAULT_BUTTON_FORE_ACTIVE_COL BitmapCol_Make(189, 168, 206, 255)
#define DEFAULT_BUTTON_FORE_COL BitmapCol_Make(141, 114, 165, 255)
#define DEFAULT_BUTTON_HIGHLIGHT_COL BitmapCol_Make(162, 131, 186, 255)
BitmapCol Launcher_BackgroundCol = DEFAULT_BACKGROUND_COL;
BitmapCol Launcher_ButtonBorderCol = DEFAULT_BUTTON_BORDER_COL;

View File

@ -231,10 +231,10 @@ struct SymbolAndName { IMAGEHLP_SYMBOL Symbol; char Name[256]; };
static int Logger_GetFrames(CONTEXT* ctx, cc_uintptr* addrs, int max) {
STACKFRAME frame = { 0 };
DWORD type;
frame.AddrPC.Mode = AddrModeFlat;
frame.AddrFrame.Mode = AddrModeFlat;
frame.AddrStack.Mode = AddrModeFlat;
DWORD type;
#if defined _M_IX86
type = IMAGE_FILE_MACHINE_I386;

View File

@ -225,9 +225,12 @@ void Platform_Log(const String* message) {
#define FILETIME_EPOCH 50491123200000ULL
#define FileTime_TotalMS(time) ((time / 10000) + FILETIME_EPOCH)
TimeMS DateTime_CurrentUTC_MS(void) {
FILETIME ft; GetSystemTimeAsFileTime(&ft);
FILETIME ft;
cc_uint64 raw;
GetSystemTimeAsFileTime(&ft);
/* in 100 nanosecond units, since Jan 1 1601 */
cc_uint64 raw = ft.dwLowDateTime | ((cc_uint64)ft.dwHighDateTime << 32);
raw = ft.dwLowDateTime | ((cc_uint64)ft.dwHighDateTime << 32);
return FileTime_TotalMS(raw);
}
@ -380,6 +383,7 @@ int File_Exists(const String* path) {
cc_result Directory_Enum(const String* dirPath, void* obj, Directory_EnumCallback callback) {
String path; char pathBuffer[MAX_PATH + 10];
TCHAR str[NATIVE_STR_LEN];
TCHAR* src;
WIN32_FIND_DATA entry;
HANDLE find;
cc_result res;
@ -398,7 +402,7 @@ cc_result Directory_Enum(const String* dirPath, void* obj, Directory_EnumCallbac
String_Format1(&path, "%s/", dirPath);
/* ignore . and .. entry */
TCHAR* src = entry.cFileName;
src = entry.cFileName;
if (src[0] == '.' && src[1] == '\0') continue;
if (src[0] == '.' && src[1] == '.' && src[2] == '\0') continue;

View File

@ -549,13 +549,14 @@ void Window_Close(void) {
}
void Window_ProcessEvents(void) {
HWND foreground;
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, 1)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
HWND foreground = GetForegroundWindow();
foreground = GetForegroundWindow();
if (foreground) {
Window_Focused = foreground == win_handle;
}