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
## files generated by popular Visual Studio add-ons.
# User-specific files
# Visual studio User-specific files
*.suo
*.user
*.sln.docstates
@ -28,11 +28,13 @@ android/local.properties
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
[Oo]utput/
[Pp]rofilingSessions/
src/.vs/
# ClassiCube game files
src/audio
src/texpacks
src/maps
@ -42,7 +44,18 @@ src/options.txt
src/ClassiCube*
src/screenshots
src/fontscache.txt
src/.vs/
# ClassiCube game files
audio
texpacks
maps
texturecache
logs
options.txt
ClassiCube*
screenshots
fontscache.txt
#GCC object files
*.o
@ -87,9 +100,6 @@ dlldata.c
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
@ -103,61 +113,14 @@ ipch/
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.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
[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
*.nupkg
# The packages folder can be ignored because of Package Restore
@ -184,11 +147,6 @@ ClientBin/
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
@ -197,15 +155,3 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
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
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*

View file

@ -1090,7 +1090,7 @@ static void OnInputDown(void* obj, int key, cc_bool was) {
if (InputHandler_IsShutdown(key)) {
/* 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) {
Game_ScreenshotRequested = true; return;
}

View file

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

View file

@ -500,7 +500,7 @@ static struct PauseScreen {
struct TextWidget title;
} 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_ContextRecreated(struct PauseScreen* s, struct FontDesc* titleFont) {

View file

@ -330,7 +330,7 @@ cc_bool Process_OpenSupported = true;
void Process_Exit(cc_result code) {
/* '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 */
if (code) exit(code);
}

View file

@ -2058,7 +2058,7 @@ static void DisconnectScreen_OnReconnect(void* s, void* w) {
Gui_ShowDefault();
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) {
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. */
/* NOTE: This size excludes the bounds of borders + title */
void Window_SetSize(int width, int height);
/* Closes then destroys the window. */
/* Raises the WindowClosing and WindowClosed events. */
void Window_Close(void);
/* Attempts to close the window. (And on some backends also destroys the window) */
/* May raise the WindowClosing and WindowClosed events. */
void Window_RequestClose(void);
/* Processes all pending window messages/events. */
void Window_ProcessEvents(double delta);

View file

@ -69,7 +69,7 @@ int Window_IsObscured(void) { return 0; }
void Window_Show(void) { }
void Window_SetSize(int width, int height) { }
void Window_Close(void) {
void Window_RequestClose(void) {
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) {
Platform_LogConst("APP - ON DESTROY");
if (WindowInfo.Exists) Window_Close();
if (WindowInfo.Exists) Window_RequestClose();
/* TODO: signal to java code we're done */
/* 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_SetSize(int width, int height) { }
void Window_Close(void) {
void Window_RequestClose(void) {
WindowInfo.Exists = false;
Event_RaiseVoid(&WindowEvents.Closing);
/* 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) {
Window_Close();
Window_RequestClose();
return 0;
}
@ -544,7 +544,7 @@ void Window_SetSize(int width, int height) {
SizeWindow(win_handle, width, height, true);
}
void Window_Close(void) {
void Window_RequestClose(void) {
/* DisposeWindow only sends a kEventWindowClosed */
Event_RaiseVoid(&WindowEvents.Closing);
if (WindowInfo.Exists) DisposeWindow(win_handle);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -183,7 +183,7 @@ static const char* OnBeforeUnload(int type, const void* ev, void *data) {
emscripten_exit_pointerlock();
return "You have unsaved changes. Are you sure you want to quit?";
}
Window_Close();
Window_RequestClose();
return NULL;
}
@ -498,7 +498,7 @@ void Window_SetSize(int width, int height) {
UpdateWindowBounds();
}
void Window_Close(void) {
void Window_RequestClose(void) {
WindowInfo.Exists = false;
Event_RaiseVoid(&WindowEvents.Closing);
/* 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);
}
void Window_Close(void) {
void Window_RequestClose(void) {
PostMessageA(win_handle, WM_CLOSE, 0, 0);
}

View file

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

View file

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

View file

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

View file

@ -512,7 +512,7 @@ void Window_SetSize(int width, int height) {
win_handle->Unlock();
}
void Window_Close(void) {
void Window_RequestClose(void) {
BMessage* msg = new BMessage(B_QUIT_REQUESTED);
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) {
Window_Close();
Window_RequestClose();
return 0;
}
@ -431,7 +431,7 @@ void Window_SetSize(int width, int height) {
[winHandle setFrame:rect display:YES];
}
void Window_Close(void) {
void Window_RequestClose(void) {
[winHandle close];
}

View file

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