diff --git a/.gitignore b/.gitignore index bf9a9a67c..38a20ef08 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/doc/style.md b/doc/style.md index af6c15814..3bc316f1c 100644 --- a/doc/style.md +++ b/doc/style.md @@ -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* diff --git a/src/Input.c b/src/Input.c index 6c51679fd..0c2c490f6 100644 --- a/src/Input.c +++ b/src/Input.c @@ -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; } diff --git a/src/Launcher.c b/src/Launcher.c index 90014fe43..36d9c6bae 100644 --- a/src/Launcher.c +++ b/src/Launcher.c @@ -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 } diff --git a/src/Menus.c b/src/Menus.c index 4b6891223..c5664f203 100644 --- a/src/Menus.c +++ b/src/Menus.c @@ -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) { diff --git a/src/Platform_Web.c b/src/Platform_Web.c index 426361829..f1b43bec2 100644 --- a/src/Platform_Web.c +++ b/src/Platform_Web.c @@ -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); } diff --git a/src/Screens.c b/src/Screens.c index a88426e80..630f8d071 100644 --- a/src/Screens.c +++ b/src/Screens.c @@ -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; diff --git a/src/Window.h b/src/Window.h index 6eef09a39..972e3df73 100644 --- a/src/Window.h +++ b/src/Window.h @@ -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); diff --git a/src/Window_3DS.c b/src/Window_3DS.c index afae67601..8f3dfcf90 100644 --- a/src/Window_3DS.c +++ b/src/Window_3DS.c @@ -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); } diff --git a/src/Window_Android.c b/src/Window_Android.c index 31937e9e6..16b55f88d 100644 --- a/src/Window_Android.c +++ b/src/Window_Android.c @@ -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 */ diff --git a/src/Window_Carbon.c b/src/Window_Carbon.c index 12c1c0170..8b9efd994 100644 --- a/src/Window_Carbon.c +++ b/src/Window_Carbon.c @@ -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); diff --git a/src/Window_Dreamcast.c b/src/Window_Dreamcast.c index 9eed05f60..1f2d4c7fc 100644 --- a/src/Window_Dreamcast.c +++ b/src/Window_Dreamcast.c @@ -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); } diff --git a/src/Window_GCWii.c b/src/Window_GCWii.c index e2b806bde..25e4962f4 100644 --- a/src/Window_GCWii.c +++ b/src/Window_GCWii.c @@ -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); } diff --git a/src/Window_N64.c b/src/Window_N64.c index 282ad5469..dea2aff6e 100644 --- a/src/Window_N64.c +++ b/src/Window_N64.c @@ -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); } diff --git a/src/Window_PS2.c b/src/Window_PS2.c index 264a64e0b..c6dfc4455 100644 --- a/src/Window_PS2.c +++ b/src/Window_PS2.c @@ -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); } diff --git a/src/Window_PS3.c b/src/Window_PS3.c index 2b00ed78a..22f40792f 100644 --- a/src/Window_PS3.c +++ b/src/Window_PS3.c @@ -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); } diff --git a/src/Window_PSP.c b/src/Window_PSP.c index cf59790dd..52bff6927 100644 --- a/src/Window_PSP.c +++ b/src/Window_PSP.c @@ -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); } diff --git a/src/Window_PSVita.c b/src/Window_PSVita.c index b60059f44..ea8209213 100644 --- a/src/Window_PSVita.c +++ b/src/Window_PSVita.c @@ -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); } diff --git a/src/Window_SDL.c b/src/Window_SDL.c index 8c03d567f..34bfb0fe6 100644 --- a/src/Window_SDL.c +++ b/src/Window_SDL.c @@ -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; } } diff --git a/src/Window_Web.c b/src/Window_Web.c index fa6282f52..99ff73987 100644 --- a/src/Window_Web.c +++ b/src/Window_Web.c @@ -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 */ diff --git a/src/Window_Win.c b/src/Window_Win.c index 624b11da4..2a3a57e0b 100644 --- a/src/Window_Win.c +++ b/src/Window_Win.c @@ -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); } diff --git a/src/Window_X11.c b/src/Window_X11.c index fe8d262fd..033aba7cf 100644 --- a/src/Window_X11.c +++ b/src/Window_X11.c @@ -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; diff --git a/src/Window_Xbox.c b/src/Window_Xbox.c index c6478ea2c..fad75b4e3 100644 --- a/src/Window_Xbox.c +++ b/src/Window_Xbox.c @@ -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); } diff --git a/src/Window_Xbox360.c b/src/Window_Xbox360.c index 0fb812a41..71a02903a 100644 --- a/src/Window_Xbox360.c +++ b/src/Window_Xbox360.c @@ -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 */ } diff --git a/src/interop_BeOS.cpp b/src/interop_BeOS.cpp index e4f00043d..abf658989 100644 --- a/src/interop_BeOS.cpp +++ b/src/interop_BeOS.cpp @@ -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); } diff --git a/src/interop_cocoa.m b/src/interop_cocoa.m index c2d305231..af5c864fe 100644 --- a/src/interop_cocoa.m +++ b/src/interop_cocoa.m @@ -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]; } diff --git a/src/interop_ios.m b/src/interop_ios.m index 4e8269a26..4a80efe87 100644 --- a/src/interop_ios.m +++ b/src/interop_ios.m @@ -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); }