Rename Window_Close to Window_RequestClose to better reflect what it does, also ignore game files in root directory for .gitignore

This commit is contained in:
UnknownShadow200 2024-01-14 15:25:12 +11:00
parent 936abbf453
commit dda2f34523
27 changed files with 51 additions and 105 deletions

86
.gitignore vendored
View File

@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
# User-specific files # Visual studio User-specific files
*.suo *.suo
*.user *.user
*.sln.docstates *.sln.docstates
@ -28,11 +28,13 @@ android/local.properties
x64/ x64/
x86/ x86/
build/ build/
bld/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
[Oo]utput/ [Oo]utput/
[Pp]rofilingSessions/ [Pp]rofilingSessions/
src/.vs/
# ClassiCube game files
src/audio src/audio
src/texpacks src/texpacks
src/maps src/maps
@ -42,7 +44,18 @@ src/options.txt
src/ClassiCube* src/ClassiCube*
src/screenshots src/screenshots
src/fontscache.txt src/fontscache.txt
src/.vs/
# ClassiCube game files
audio
texpacks
maps
texturecache
logs
options.txt
ClassiCube*
screenshots
fontscache.txt
#GCC object files #GCC object files
*.o *.o
@ -87,9 +100,6 @@ dlldata.c
*.svclog *.svclog
*.scc *.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files # Visual C++ cache files
ipch/ ipch/
*.aps *.aps
@ -103,61 +113,14 @@ ipch/
*.vsp *.vsp
*.vspx *.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in # ReSharper is a .NET coding add-in
_ReSharper*/ _ReSharper*/
*.[Rr]e[Ss]harper *.[Rr]e[Ss]harper
*.DotSettings.user *.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder # Installshield output folder
[Ee]xpress/ [Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages # NuGet Packages
*.nupkg *.nupkg
# The packages folder can be ignored because of Package Restore # The packages folder can be ignored because of Package Restore
@ -184,11 +147,6 @@ ClientBin/
*.dbmdl *.dbmdl
*.dbproj.schemaview *.dbproj.schemaview
*.pfx *.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file # Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed, # to a newer Visual Studio version. Backup files are not needed,
@ -197,15 +155,3 @@ _UpgradeReport_Files/
Backup*/ Backup*/
UpgradeLog*.XML UpgradeLog*.XML
UpgradeLog*.htm UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/

View File

@ -15,7 +15,7 @@ Note: The explicit integer size typedefs may not have been defined if you aren't
### Strings ### Strings
A custom string type (`cc_string`) is used rather than `char*` strings in most places (see [strings](doc/strings.md) page for more details) A custom string type (`cc_string`) is used rather than `char*` strings in most places (see [strings](strings.md) page for more details)
*Note: Several functions will take raw `char*` for performance, but this is not encouraged* *Note: Several functions will take raw `char*` for performance, but this is not encouraged*

View File

@ -1090,7 +1090,7 @@ static void OnInputDown(void* obj, int key, cc_bool was) {
if (InputHandler_IsShutdown(key)) { if (InputHandler_IsShutdown(key)) {
/* TODO: Do we need a separate exit function in Game class? */ /* TODO: Do we need a separate exit function in Game class? */
Window_Close(); return; Window_RequestClose(); return;
} else if (KeyBind_Claims(KEYBIND_SCREENSHOT, key) && !was) { } else if (KeyBind_Claims(KEYBIND_SCREENSHOT, key) && !was) {
Game_ScreenshotRequested = true; return; Game_ScreenshotRequested = true; return;
} }

View File

@ -293,7 +293,7 @@ void Launcher_Run(void) {
if (res) Logger_SysWarn(res, action); if (res) Logger_SysWarn(res, action);
} }
if (WindowInfo.Exists) Window_Close(); if (WindowInfo.Exists) Window_RequestClose();
#endif #endif
} }

View File

@ -500,7 +500,7 @@ static struct PauseScreen {
struct TextWidget title; struct TextWidget title;
} PauseScreen; } PauseScreen;
static void PauseScreenBase_Quit(void* a, void* b) { Window_Close(); } static void PauseScreenBase_Quit(void* a, void* b) { Window_RequestClose(); }
static void PauseScreenBase_Game(void* a, void* b) { Gui_Remove((struct Screen*)&PauseScreen); } static void PauseScreenBase_Game(void* a, void* b) { Gui_Remove((struct Screen*)&PauseScreen); }
static void PauseScreenBase_ContextRecreated(struct PauseScreen* s, struct FontDesc* titleFont) { static void PauseScreenBase_ContextRecreated(struct PauseScreen* s, struct FontDesc* titleFont) {

View File

@ -330,7 +330,7 @@ cc_bool Process_OpenSupported = true;
void Process_Exit(cc_result code) { void Process_Exit(cc_result code) {
/* 'Window' (i.e. the web canvas) isn't implicitly closed when process is exited */ /* 'Window' (i.e. the web canvas) isn't implicitly closed when process is exited */
if (code) Window_Close(); if (code) Window_RequestClose();
/* game normally calls exit with code = 0 due to async IndexedDB loading */ /* game normally calls exit with code = 0 due to async IndexedDB loading */
if (code) exit(code); if (code) exit(code);
} }

View File

@ -2058,7 +2058,7 @@ static void DisconnectScreen_OnReconnect(void* s, void* w) {
Gui_ShowDefault(); Gui_ShowDefault();
Server.BeginConnect(); Server.BeginConnect();
} }
static void DisconnectScreen_OnQuit(void* s, void* w) { Window_Close(); } static void DisconnectScreen_OnQuit(void* s, void* w) { Window_RequestClose(); }
static void DisconnectScreen_Init(void* screen) { static void DisconnectScreen_Init(void* screen) {
struct DisconnectScreen* s = (struct DisconnectScreen*)screen; struct DisconnectScreen* s = (struct DisconnectScreen*)screen;

View File

@ -121,9 +121,9 @@ void Window_Show(void);
/* Sets the size of the internal bounds of the window in pixels. */ /* Sets the size of the internal bounds of the window in pixels. */
/* NOTE: This size excludes the bounds of borders + title */ /* NOTE: This size excludes the bounds of borders + title */
void Window_SetSize(int width, int height); void Window_SetSize(int width, int height);
/* Closes then destroys the window. */ /* Attempts to close the window. (And on some backends also destroys the window) */
/* Raises the WindowClosing and WindowClosed events. */ /* May raise the WindowClosing and WindowClosed events. */
void Window_Close(void); void Window_RequestClose(void);
/* Processes all pending window messages/events. */ /* Processes all pending window messages/events. */
void Window_ProcessEvents(double delta); void Window_ProcessEvents(double delta);

View File

@ -69,7 +69,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -198,7 +198,7 @@ static void JNICALL java_onPause(JNIEnv* env, jobject o) {
static void JNICALL java_onDestroy(JNIEnv* env, jobject o) { static void JNICALL java_onDestroy(JNIEnv* env, jobject o) {
Platform_LogConst("APP - ON DESTROY"); Platform_LogConst("APP - ON DESTROY");
if (WindowInfo.Exists) Window_Close(); if (WindowInfo.Exists) Window_RequestClose();
/* TODO: signal to java code we're done */ /* TODO: signal to java code we're done */
/* JavaICall_Void(env, JAVA_processedDestroyed", NULL); */ /* JavaICall_Void(env, JAVA_processedDestroyed", NULL); */
} }
@ -355,7 +355,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } /* Window already visible */ void Window_Show(void) { } /* Window already visible */
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
WindowInfo.Exists = false; WindowInfo.Exists = false;
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
/* TODO: Do we need to call finish here */ /* TODO: Do we need to call finish here */

View File

@ -29,7 +29,7 @@ static void Window_CommonInit(void) {
} }
static pascal OSErr HandleQuitMessage(const AppleEvent* ev, AppleEvent* reply, long handlerRefcon) { static pascal OSErr HandleQuitMessage(const AppleEvent* ev, AppleEvent* reply, long handlerRefcon) {
Window_Close(); Window_RequestClose();
return 0; return 0;
} }
@ -544,7 +544,7 @@ void Window_SetSize(int width, int height) {
SizeWindow(win_handle, width, height, true); SizeWindow(win_handle, width, height, true);
} }
void Window_Close(void) { void Window_RequestClose(void) {
/* DisposeWindow only sends a kEventWindowClosed */ /* DisposeWindow only sends a kEventWindowClosed */
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
if (WindowInfo.Exists) DisposeWindow(win_handle); if (WindowInfo.Exists) DisposeWindow(win_handle);

View File

@ -61,7 +61,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -30,7 +30,7 @@ int Display_ScaleY(int y) { return y; }
static void OnPowerOff(void) { static void OnPowerOff(void) {
WindowInfo.Exists = false; WindowInfo.Exists = false;
Window_Close(); Window_RequestClose();
} }
static void InitVideo(void) { static void InitVideo(void) {
// Initialise the video system // Initialise the video system
@ -96,7 +96,7 @@ void Window_Create3D(int width, int height) {
launcherMode = false; launcherMode = false;
} }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -56,7 +56,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -77,7 +77,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -33,7 +33,7 @@ static void sysutil_callback(u64 status, u64 param, void* usrdata) {
switch (status) { switch (status) {
case SYSUTIL_EXIT_GAME: case SYSUTIL_EXIT_GAME:
WindowInfo.Exists = false; WindowInfo.Exists = false;
Window_Close(); Window_RequestClose();
break; break;
} }
} }
@ -89,7 +89,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -57,7 +57,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -77,7 +77,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -96,7 +96,7 @@ void Window_SetSize(int width, int height) {
SDL_SetWindowSize(win_handle, width, height); SDL_SetWindowSize(win_handle, width, height);
} }
void Window_Close(void) { void Window_RequestClose(void) {
SDL_Event e; SDL_Event e;
e.type = SDL_QUIT; e.type = SDL_QUIT;
SDL_PushEvent(&e); SDL_PushEvent(&e);
@ -223,7 +223,7 @@ static void OnWindowEvent(const SDL_Event* e) {
Event_RaiseVoid(&WindowEvents.FocusChanged); Event_RaiseVoid(&WindowEvents.FocusChanged);
break; break;
case SDL_WINDOWEVENT_CLOSE: case SDL_WINDOWEVENT_CLOSE:
Window_Close(); Window_RequestClose();
break; break;
} }
} }

View File

@ -183,7 +183,7 @@ static const char* OnBeforeUnload(int type, const void* ev, void *data) {
emscripten_exit_pointerlock(); emscripten_exit_pointerlock();
return "You have unsaved changes. Are you sure you want to quit?"; return "You have unsaved changes. Are you sure you want to quit?";
} }
Window_Close(); Window_RequestClose();
return NULL; return NULL;
} }
@ -498,7 +498,7 @@ void Window_SetSize(int width, int height) {
UpdateWindowBounds(); UpdateWindowBounds();
} }
void Window_Close(void) { void Window_RequestClose(void) {
WindowInfo.Exists = false; WindowInfo.Exists = false;
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
/* If the game is closed while in fullscreen, the last rendered frame stays */ /* If the game is closed while in fullscreen, the last rendered frame stays */

View File

@ -507,7 +507,7 @@ void Window_SetSize(int width, int height) {
Rect_Width(rect), Rect_Height(rect), SWP_NOMOVE); Rect_Width(rect), Rect_Height(rect), SWP_NOMOVE);
} }
void Window_Close(void) { void Window_RequestClose(void) {
PostMessageA(win_handle, WM_CLOSE, 0, 0); PostMessageA(win_handle, WM_CLOSE, 0, 0);
} }

View File

@ -449,7 +449,7 @@ void Window_SetSize(int width, int height) {
Window_ProcessEvents(0.0); Window_ProcessEvents(0.0);
} }
void Window_Close(void) { void Window_RequestClose(void) {
XEvent ev = { 0 }; XEvent ev = { 0 };
ev.type = ClientMessage; ev.type = ClientMessage;
ev.xclient.format = 32; ev.xclient.format = 32;

View File

@ -100,7 +100,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }

View File

@ -69,7 +69,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { } void Window_Show(void) { }
void Window_SetSize(int width, int height) { } void Window_SetSize(int width, int height) { }
void Window_Close(void) { void Window_RequestClose(void) {
/* TODO implement */ /* TODO implement */
} }

View File

@ -512,7 +512,7 @@ void Window_SetSize(int width, int height) {
win_handle->Unlock(); win_handle->Unlock();
} }
void Window_Close(void) { void Window_RequestClose(void) {
BMessage* msg = new BMessage(B_QUIT_REQUESTED); BMessage* msg = new BMessage(B_QUIT_REQUESTED);
app_handle->PostMessage(msg); app_handle->PostMessage(msg);
} }

View File

@ -36,7 +36,7 @@ static void Window_CommonInit(void) {
} }
static pascal OSErr HandleQuitMessage(const AppleEvent* ev, AppleEvent* reply, long handlerRefcon) { static pascal OSErr HandleQuitMessage(const AppleEvent* ev, AppleEvent* reply, long handlerRefcon) {
Window_Close(); Window_RequestClose();
return 0; return 0;
} }
@ -431,7 +431,7 @@ void Window_SetSize(int width, int height) {
[winHandle setFrame:rect display:YES]; [winHandle setFrame:rect display:YES];
} }
void Window_Close(void) { void Window_RequestClose(void) {
[winHandle close]; [winHandle close];
} }

View File

@ -403,7 +403,7 @@ void Window_Show(void) {
[win_handle makeKeyAndVisible]; [win_handle makeKeyAndVisible];
} }
void Window_Close(void) { void Window_RequestClose(void) {
WindowInfo.Exists = false; WindowInfo.Exists = false;
Event_RaiseVoid(&WindowEvents.Closing); Event_RaiseVoid(&WindowEvents.Closing);
} }