From 5101172f236bdf4ce861c35b1a7a3957bd5f0c7b Mon Sep 17 00:00:00 2001 From: yvt Date: Mon, 24 Feb 2014 18:50:59 +0900 Subject: [PATCH] Removed FLTK-based main window --- OpenSpades.xcodeproj/project.pbxproj | 28 +- Sources/Gui/Credits.inc | 73 ++ Sources/Gui/MainScreenHelper.cpp | 8 +- Sources/Gui/MainWindow.cpp | 667 ----------------- Sources/Gui/MainWindow.h | 204 ----- Sources/Gui/MainWindowHandler.cpp | 1032 -------------------------- 6 files changed, 85 insertions(+), 1927 deletions(-) create mode 100644 Sources/Gui/Credits.inc delete mode 100644 Sources/Gui/MainWindow.cpp delete mode 100644 Sources/Gui/MainWindow.h delete mode 100644 Sources/Gui/MainWindowHandler.cpp diff --git a/OpenSpades.xcodeproj/project.pbxproj b/OpenSpades.xcodeproj/project.pbxproj index 8485bdb9..42f7efe4 100644 --- a/OpenSpades.xcodeproj/project.pbxproj +++ b/OpenSpades.xcodeproj/project.pbxproj @@ -71,6 +71,9 @@ E844888417D2633C005105D0 /* json_writer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E844887E17D2633C005105D0 /* json_writer.cpp */; }; E844888717D2669C005105D0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E844888617D26699005105D0 /* libcurl.dylib */; }; E844888A17D39CD3005105D0 /* ErrorDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E844888817D39CD0005105D0 /* ErrorDialog.cpp */; }; + E84E221618BB4601001282B0 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF039B178EDAC9000683D4 /* libz.dylib */; }; + E84E221718BB4B41001282B0 /* libfltk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF03E4178EF5FF000683D4 /* libfltk.a */; }; + E84E221918BB4BA0001282B0 /* Credits.inc in Sources */ = {isa = PBXBuildFile; fileRef = E84E221818BB4BA0001282B0 /* Credits.inc */; }; E852337B1839B28C00F40541 /* VersionInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E85233791839B28C00F40541 /* VersionInfo.cpp */; }; E8567E571792B24D009D83E0 /* IAudioChunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8567E551792B24D009D83E0 /* IAudioChunk.cpp */; }; E8567E5A1792BEFC009D83E0 /* ALDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8567E581792BEFC009D83E0 /* ALDevice.cpp */; }; @@ -189,7 +192,6 @@ E8C92A0C18695EA500740C9F /* SWModelRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8C92A0A18695EA500740C9F /* SWModelRenderer.cpp */; }; E8C92A0F186A902500740C9F /* CpuID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8C92A0E186A902500740C9F /* CpuID.cpp */; }; E8CF039A178EDABD000683D4 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF0399178EDABD000683D4 /* OpenAL.framework */; }; - E8CF039C178EDAC9000683D4 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF039B178EDAC9000683D4 /* libz.dylib */; }; E8CF03A8178EDF6A000683D4 /* IRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8CF03A6178EDF6A000683D4 /* IRenderer.cpp */; }; E8CF03AB178EDF74000683D4 /* GLRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8CF03A9178EDF74000683D4 /* GLRenderer.cpp */; }; E8CF03AE178EDFCD000683D4 /* IGLDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8CF03AC178EDFCD000683D4 /* IGLDevice.cpp */; }; @@ -207,8 +209,6 @@ E8CF03DA178EF166000683D4 /* AutoLocker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8CF03D8178EF165000683D4 /* AutoLocker.cpp */; }; E8CF03E0178EF4E9000683D4 /* IRunnable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8CF03DE178EF4E9000683D4 /* IRunnable.cpp */; }; E8CF03E3178EF57E000683D4 /* SDLRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8CF03E1178EF57E000683D4 /* SDLRunner.cpp */; }; - E8CF03E5178EF600000683D4 /* libfltk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF03E4178EF5FF000683D4 /* libfltk.a */; }; - E8CF03E9178EF822000683D4 /* MainWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8CF03E7178EF822000683D4 /* MainWindow.cpp */; }; E8CF03EB178EF8FE000683D4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF03EA178EF8FE000683D4 /* CoreFoundation.framework */; }; E8CF03ED178EF904000683D4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF03EC178EF904000683D4 /* CoreGraphics.framework */; }; E8CF03EF178EF909000683D4 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8CF03EE178EF909000683D4 /* CoreText.framework */; }; @@ -247,10 +247,6 @@ E8E0AFB8179C0F2900C6B5A9 /* GLFramebufferManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8E0AFB6179C0F2800C6B5A9 /* GLFramebufferManager.cpp */; }; E8E44686179CC4FF00BE8855 /* IBitmapCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8E44684179CC4FF00BE8855 /* IBitmapCodec.cpp */; }; E8E44689179CC65900BE8855 /* TargaReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8E44687179CC65900BE8855 /* TargaReader.cpp */; }; - E8E4468F179CE7A200BE8855 /* libfltk_images.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E8E4468D179CE7A200BE8855 /* libfltk_images.a */; }; - E8E44690179CE7A200BE8855 /* libfltk_jpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E8E4468E179CE7A200BE8855 /* libfltk_jpeg.a */; }; - E8E44692179CE7B800BE8855 /* libpng15.15.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E8E44691179CE7B800BE8855 /* libpng15.15.dylib */; }; - E8E44695179D19DC00BE8855 /* MainWindowHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8E44693179D19DC00BE8855 /* MainWindowHandler.cpp */; }; E8E44698179D2CA100BE8855 /* IGLSpriteRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8E44696179D2CA100BE8855 /* IGLSpriteRenderer.cpp */; }; E8E4469B179D2EDD00BE8855 /* GLSoftSpriteRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8E44699179D2EDC00BE8855 /* GLSoftSpriteRenderer.cpp */; }; E8E4469E179D59A900BE8855 /* GLCameraBlurFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8E4469C179D59A900BE8855 /* GLCameraBlurFilter.cpp */; }; @@ -437,6 +433,7 @@ E844888B17D3A059005105D0 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; E84E221318BB449A001282B0 /* FindGLEW2.cmake */ = {isa = PBXFileReference; lastKnownFileType = text; path = FindGLEW2.cmake; sourceTree = ""; }; E84E221418BB449A001282B0 /* FindSDL2.cmake */ = {isa = PBXFileReference; lastKnownFileType = text; path = FindSDL2.cmake; sourceTree = ""; }; + E84E221818BB4BA0001282B0 /* Credits.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = Credits.inc; sourceTree = ""; }; E85233791839B28C00F40541 /* VersionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VersionInfo.cpp; sourceTree = ""; }; E852337A1839B28C00F40541 /* VersionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionInfo.h; sourceTree = ""; }; E8567E551792B24D009D83E0 /* IAudioChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IAudioChunk.cpp; sourceTree = ""; }; @@ -721,8 +718,6 @@ E8CF03E1178EF57E000683D4 /* SDLRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SDLRunner.cpp; sourceTree = ""; }; E8CF03E2178EF57E000683D4 /* SDLRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLRunner.h; sourceTree = ""; }; E8CF03E4178EF5FF000683D4 /* libfltk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfltk.a; path = ../../../../../usr/local/lib/libfltk.a; sourceTree = ""; }; - E8CF03E7178EF822000683D4 /* MainWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainWindow.cpp; sourceTree = ""; }; - E8CF03E8178EF822000683D4 /* MainWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainWindow.h; sourceTree = ""; }; E8CF03EA178EF8FE000683D4 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; E8CF03EC178EF904000683D4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; E8CF03EE178EF909000683D4 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; }; @@ -797,7 +792,6 @@ E8E4468D179CE7A200BE8855 /* libfltk_images.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfltk_images.a; path = ../../../../../usr/local/lib/libfltk_images.a; sourceTree = ""; }; E8E4468E179CE7A200BE8855 /* libfltk_jpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfltk_jpeg.a; path = ../../../../../usr/local/lib/libfltk_jpeg.a; sourceTree = ""; }; E8E44691179CE7B800BE8855 /* libpng15.15.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpng15.15.dylib; path = ../../../../../opt/X11/lib/libpng15.15.dylib; sourceTree = ""; }; - E8E44693179D19DC00BE8855 /* MainWindowHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainWindowHandler.cpp; sourceTree = ""; }; E8E44696179D2CA100BE8855 /* IGLSpriteRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IGLSpriteRenderer.cpp; sourceTree = ""; }; E8E44697179D2CA100BE8855 /* IGLSpriteRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IGLSpriteRenderer.h; sourceTree = ""; }; E8E44699179D2EDC00BE8855 /* GLSoftSpriteRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLSoftSpriteRenderer.cpp; sourceTree = ""; }; @@ -840,19 +834,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + E84E221718BB4B41001282B0 /* libfltk.a in Frameworks */, + E84E221618BB4601001282B0 /* libz.dylib in Frameworks */, E87AB82518BB3A04006B7D73 /* SDL2_image.framework in Frameworks */, E844888717D2669C005105D0 /* libcurl.dylib in Frameworks */, - E8E44692179CE7B800BE8855 /* libpng15.15.dylib in Frameworks */, - E8E4468F179CE7A200BE8855 /* libfltk_images.a in Frameworks */, - E8E44690179CE7A200BE8855 /* libfltk_jpeg.a in Frameworks */, E8CF03F3178EF916000683D4 /* Cocoa.framework in Frameworks */, E8CF03F1178EF911000683D4 /* Foundation.framework in Frameworks */, E8CF03EF178EF909000683D4 /* CoreText.framework in Frameworks */, E8CF03ED178EF904000683D4 /* CoreGraphics.framework in Frameworks */, E8CF03EB178EF8FE000683D4 /* CoreFoundation.framework in Frameworks */, - E8CF03E5178EF600000683D4 /* libfltk.a in Frameworks */, E8CF03C5178EE78C000683D4 /* OpenGL.framework in Frameworks */, - E8CF039C178EDAC9000683D4 /* libz.dylib in Frameworks */, E8CF039A178EDABD000683D4 /* OpenAL.framework in Frameworks */, E8B93AD518559EC700BD01E1 /* SDL2.framework in Frameworks */, ); @@ -1408,9 +1399,6 @@ E8CF03BC178EE502000683D4 /* SDLGLDevice.h */, E8CF03E1178EF57E000683D4 /* SDLRunner.cpp */, E8CF03E2178EF57E000683D4 /* SDLRunner.h */, - E8CF03E7178EF822000683D4 /* MainWindow.cpp */, - E8CF03E8178EF822000683D4 /* MainWindow.h */, - E8E44693179D19DC00BE8855 /* MainWindowHandler.cpp */, E80B289117A683500056179E /* SDLAsyncRunner.cpp */, E80B289217A683500056179E /* SDLAsyncRunner.h */, E80B28C517AF872A0056179E /* DetailConfigWindowHandler.cpp */, @@ -1429,6 +1417,7 @@ E842888A18A3CF6C0060743D /* StartupScreen.h */, E842888C18A3D1520060743D /* StartupScreenHelper.cpp */, E842888D18A3D1520060743D /* StartupScreenHelper.h */, + E84E221818BB4BA0001282B0 /* Credits.inc */, ); path = Gui; sourceTree = ""; @@ -1857,7 +1846,6 @@ E8CF03DA178EF166000683D4 /* AutoLocker.cpp in Sources */, E8CF03E0178EF4E9000683D4 /* IRunnable.cpp in Sources */, E8CF03E3178EF57E000683D4 /* SDLRunner.cpp in Sources */, - E8CF03E9178EF822000683D4 /* MainWindow.cpp in Sources */, E8CF03F6178FAA8B000683D4 /* IImage.cpp in Sources */, E8CF03F9178FABA4000683D4 /* SceneDefinition.cpp in Sources */, E8C92A0C18695EA500740C9F /* SWModelRenderer.cpp in Sources */, @@ -1949,7 +1937,6 @@ E8E44686179CC4FF00BE8855 /* IBitmapCodec.cpp in Sources */, E8F74CFD1845D4D00085AA54 /* ClientUIHelper.cpp in Sources */, E8E44689179CC65900BE8855 /* TargaReader.cpp in Sources */, - E8E44695179D19DC00BE8855 /* MainWindowHandler.cpp in Sources */, E8E44698179D2CA100BE8855 /* IGLSpriteRenderer.cpp in Sources */, E8E4469B179D2EDD00BE8855 /* GLSoftSpriteRenderer.cpp in Sources */, E8E4469E179D59A900BE8855 /* GLCameraBlurFilter.cpp in Sources */, @@ -2041,6 +2028,7 @@ E8B6B6B617DE27B500E35523 /* as_tokenizer.cpp in Sources */, E852337B1839B28C00F40541 /* VersionInfo.cpp in Sources */, E8B6B6B717DE27B500E35523 /* as_typeinfo.cpp in Sources */, + E84E221918BB4BA0001282B0 /* Credits.inc in Sources */, E8B6B6B817DE27B500E35523 /* as_variablescope.cpp in Sources */, E8B6B6B917DE289700E35523 /* as_callfunc_x86.cpp in Sources */, E8B6B6BF17DF456F00E35523 /* GLSparseShadowMapRenderer.cpp in Sources */, diff --git a/Sources/Gui/Credits.inc b/Sources/Gui/Credits.inc new file mode 100644 index 00000000..cc29c2c4 --- /dev/null +++ b/Sources/Gui/Credits.inc @@ -0,0 +1,73 @@ +static const char *credits = R"**( + +${PACKAGE_STRING} + +Credits +------- + +"yvt" - Most of the code +"Dany0" - System profiler, ideas, etc. +"learn_more" - CMake support, server browser, ideas +"iamgreaser" - AoS 0.76 protocol support +"Ericson2314" - Better installation guide +"JoJoe_Stinky" - Win32 Icon, Killfeed icons + + +Portions of program is based on following softwares +--------------------------------------------------- + +pyspades + +Licensed by GPLv3. CREDITS/CONTRIBUTIONS/ACKNOWLEDGEMENTS: + +Mathias "Mat^2" Kaerlev - Most of the code +"hompy" - Floating block detection, IRC client, general code, etc. +"Triplefox" - Map generator code, network code, etc. +"Sham" - Hosting and testing +"Yourself" - Scripts +"bildramer" - Floating block detection (A*) and misc. code +"TheGrandmaster" - Tester, ideas and the official map +"Tegu" - Logo, ideas, testing and the official map +"Enari" - Testing, misc. code and ideas + + +This program includes following components +------------------------------------------ + +- AngelCode Scripting Library + +Copyright (C) 2003-2013 Andreas Jönsson + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + + * The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. + * Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + * This notice may not be removed or altered from any source distribution. + + +- ENet + +Copyright (C) 2002-2011 Lee Salzman + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +- Kiss FFT + +Copyright (C) 2003-2010 Mark Borgerding. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +)**"; diff --git a/Sources/Gui/MainScreenHelper.cpp b/Sources/Gui/MainScreenHelper.cpp index 1ff2053a..f3a61695 100644 --- a/Sources/Gui/MainScreenHelper.cpp +++ b/Sources/Gui/MainScreenHelper.cpp @@ -29,7 +29,6 @@ #include #include #include -#include "MainWindow.h" // for credits SPADES_SETTING(cl_serverListUrl, "http://services.buildandshoot.com/serverlist.json"); @@ -221,12 +220,13 @@ namespace spades { return out; } +#include "Credits.inc" // C++11 raw string literal makes some tools (ex. xgettext, Xcode) misbehave + std::string MainScreenHelper::GetCredits() { - std::string html = std::string(reinterpret_cast(aboutText), sizeof(aboutText)); + std::string html = credits; html = Replace(html, "${PACKAGE_STRING}", PACKAGE_STRING); - html = Replace(html, "©", "(C)"); - return TextifyHTML(html); + return html; } struct serverSorter { diff --git a/Sources/Gui/MainWindow.cpp b/Sources/Gui/MainWindow.cpp deleted file mode 100644 index 1ea97fb8..00000000 --- a/Sources/Gui/MainWindow.cpp +++ /dev/null @@ -1,667 +0,0 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0302 - -#include "MainWindow.h" - -void MainWindow::cb_quickHostInput_i(Fl_Input*, void*) { - SavePrefs(); -} -void MainWindow::cb_quickHostInput(Fl_Input* o, void* v) { - ((MainWindow*)(o->parent()->parent()))->cb_quickHostInput_i(o,v); -} - -void MainWindow::cb_versionChoice_i(Fl_Choice*, void*) { - versionSelectionChanged(); -} -void MainWindow::cb_versionChoice(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()))->cb_versionChoice_i(o,v); -} - -void MainWindow::cb_connectButton_i(Fl_Return_Button*, void*) { - QuickConnectPressed(); -} -void MainWindow::cb_connectButton(Fl_Return_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()))->cb_connectButton_i(o,v); -} - -void MainWindow::cb_startButton_i(Fl_Return_Button*, void*) { - StartGamePressed(); -} -void MainWindow::cb_startButton(Fl_Return_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()))->cb_startButton_i(o,v); -} - -void MainWindow::cb_bypassStartupCheck_i(Fl_Check_Button*, void*) { - SavePrefs(); -} -void MainWindow::cb_bypassStartupCheck(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()))->cb_bypassStartupCheck_i(o,v); -} - -void MainWindow::cb_fullscreenCheck_i(Fl_Check_Button*, void*) { - SavePrefs(); -} -void MainWindow::cb_fullscreenCheck(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_fullscreenCheck_i(o,v); -} - -void MainWindow::cb_modeSelect_i(Fl_Input_Choice*, void*) { - SavePrefs(); -} -void MainWindow::cb_modeSelect(Fl_Input_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_modeSelect_i(o,v); -} - -void MainWindow::cb_verticalSyncCheck_i(Fl_Check_Button*, void*) { - SavePrefs(); -} -void MainWindow::cb_verticalSyncCheck(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_verticalSyncCheck_i(o,v); -} - -void MainWindow::cb_rendererSelect_i(Fl_Choice*, void*) { - SavePrefs(); -} -void MainWindow::cb_rendererSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_rendererSelect_i(o,v); -} - -void MainWindow::cb_polyInput_i(Fl_Spinner*, void*) { - SavePrefs(); -} -void MainWindow::cb_polyInput(Fl_Spinner* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_polyInput_i(o,v); -} - -void MainWindow::cb_audioSelect_i(Fl_Choice*, void*) { - SavePrefs(); -} -void MainWindow::cb_audioSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_audioSelect_i(o,v); -} - -void MainWindow::cb_radiosityCheck_i(Fl_Light_Button*, void*) { - SavePrefs(); -} -void MainWindow::cb_radiosityCheck(Fl_Light_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_radiosityCheck_i(o,v); -} - -void MainWindow::cb_directLightSelect_i(Fl_Choice*, void*) { - if(directLightSelect->value() == 2) - DisableMSAA(); -SavePrefs(); -} -void MainWindow::cb_directLightSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_directLightSelect_i(o,v); -} - -void MainWindow::cb_shaderSelect_i(Fl_Choice*, void*) { - if(shaderSelect->value() == 1) - DisableMSAA(); -SavePrefs(); -} -void MainWindow::cb_shaderSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_shaderSelect_i(o,v); -} - -void MainWindow::cb_bloodCheck_i(Fl_Light_Button*, void*) { - SavePrefs(); -} -void MainWindow::cb_bloodCheck(Fl_Light_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_bloodCheck_i(o,v); -} - -void MainWindow::cb_postFilterSelect_i(Fl_Choice*, void*) { - SavePrefs(); -} -void MainWindow::cb_postFilterSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_postFilterSelect_i(o,v); -} - -void MainWindow::cb_particleSelect_i(Fl_Choice*, void*) { - SavePrefs(); -} -void MainWindow::cb_particleSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_particleSelect_i(o,v); -} - -void MainWindow::cb_msaaSelect_i(Fl_Choice*, void*) { - MSAAEnabled(); -SavePrefs(); -} -void MainWindow::cb_msaaSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_msaaSelect_i(o,v); -} - -void MainWindow::cb_playerNameInput_i(Fl_Input*, void*) { - SavePrefs(); -} -void MainWindow::cb_playerNameInput(Fl_Input* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_playerNameInput_i(o,v); -} - -void MainWindow::cb_Advanced_i(Fl_Button*, void*) { - OpenDetailConfig(); -} -void MainWindow::cb_Advanced(Fl_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()))->cb_Advanced_i(o,v); -} - -void MainWindow::cb_fastModeSelect_i(Fl_Choice*, void*) { - SavePrefs(); -} -void MainWindow::cb_fastModeSelect(Fl_Choice* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_fastModeSelect_i(o,v); -} - -void MainWindow::cb_serverListbox_i(Fl_Browser*, void*) { - ServerSelectionChanged(); -} -void MainWindow::cb_serverListbox(Fl_Browser* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()))->cb_serverListbox_i(o,v); -} - -void MainWindow::cb_checkFilterEmpty_i(Fl_Check_Button*, void*) { - updateFilters(); -} -void MainWindow::cb_checkFilterEmpty(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()->parent()))->cb_checkFilterEmpty_i(o,v); -} - -void MainWindow::cb_checkFilterFull_i(Fl_Check_Button*, void*) { - updateFilters(); -} -void MainWindow::cb_checkFilterFull(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()->parent()))->cb_checkFilterFull_i(o,v); -} - -void MainWindow::cb_checkFilterV75_i(Fl_Check_Button*, void*) { - updateFilters(); -} -void MainWindow::cb_checkFilterV75(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()->parent()))->cb_checkFilterV75_i(o,v); -} - -void MainWindow::cb_checkFilterV76_i(Fl_Check_Button*, void*) { - updateFilters(); -} -void MainWindow::cb_checkFilterV76(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()->parent()))->cb_checkFilterV76_i(o,v); -} - -void MainWindow::cb_checkFilterVOther_i(Fl_Check_Button*, void*) { - updateFilters(); -} -void MainWindow::cb_checkFilterVOther(Fl_Check_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()->parent()))->cb_checkFilterVOther_i(o,v); -} - -void MainWindow::cb_Connect_i(Fl_Button*, void*) { - connectLocal075Pressed(); -} -void MainWindow::cb_Connect(Fl_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_Connect_i(o,v); -} - -void MainWindow::cb_Connect1_i(Fl_Button*, void*) { - connectLocal076Pressed(); -} -void MainWindow::cb_Connect1(Fl_Button* o, void* v) { - ((MainWindow*)(o->parent()->parent()->parent()->parent()))->cb_Connect1_i(o,v); -} -MainWindow::MainWindow(int X, int Y, int W, int H, const char *L) - : Fl_Window(X, Y, W, H, L) { - _MainWindow(); -} - -MainWindow::MainWindow(int W, int H, const char *L) - : Fl_Window(0, 0, W, H, L) { - clear_flag(16); - _MainWindow(); -} - -MainWindow::MainWindow() - : Fl_Window(0, 0, 616, 357, "OpenSpades Startup") { - clear_flag(16); - _MainWindow(); -} - -void MainWindow::_MainWindow() { -this->box(FL_FLAT_BOX); -this->color(FL_BACKGROUND_COLOR); -this->selection_color(FL_BACKGROUND_COLOR); -this->labeltype(FL_NO_LABEL); -this->labelfont(0); -this->labelsize(12); -this->labelcolor(FL_FOREGROUND_COLOR); -this->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE)); -this->when(FL_WHEN_RELEASE); -{ quickConnectGroup = new Fl_Group(105, 80, 500, 25); - quickConnectGroup->hide(); - { quickHostInput = new Fl_Input(105, 80, 275, 25, "Quick Connect:"); - quickHostInput->callback((Fl_Callback*)cb_quickHostInput); - } // Fl_Input* quickHostInput - { versionChoice = new Fl_Choice(440, 80, 60, 25, "Version"); - versionChoice->down_box(FL_BORDER_BOX); - versionChoice->callback((Fl_Callback*)cb_versionChoice); - } // Fl_Choice* versionChoice - { connectButton = new Fl_Return_Button(505, 80, 100, 25, "Connect"); - connectButton->callback((Fl_Callback*)cb_connectButton); - } // Fl_Return_Button* connectButton - quickConnectGroup->end(); -} // Fl_Group* quickConnectGroup -{ launchMainScreenGroup = new Fl_Group(5, 80, 605, 25); - { startButton = new Fl_Return_Button(475, 80, 135, 25, "Start Game"); - startButton->callback((Fl_Callback*)cb_startButton); - } // Fl_Return_Button* startButton - { bypassStartupCheck = new Fl_Check_Button(5, 80, 465, 25, "Bypass this startup screen the next time OpenSpades starts"); - bypassStartupCheck->down_box(FL_DOWN_BOX); - bypassStartupCheck->callback((Fl_Callback*)cb_bypassStartupCheck); - } // Fl_Check_Button* bypassStartupCheck - launchMainScreenGroup->end(); -} // Fl_Group* launchMainScreenGroup -{ mainTab = new Fl_Tabs(5, 110, 605, 240); - mainTab->labelsize(11); - { groupAbout = new Fl_Group(10, 130, 595, 215, "About"); - groupAbout->hide(); - { aboutView = new Fl_Help_View(10, 135, 595, 210); - } // Fl_Help_View* aboutView - groupAbout->end(); - } // Fl_Group* groupAbout - { Fl_Group* o = new Fl_Group(10, 130, 595, 220, "Setup"); - { Fl_Group* o = new Fl_Group(10, 150, 385, 70, "Video"); - o->box(FL_ENGRAVED_FRAME); - o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); - { fullscreenCheck = new Fl_Check_Button(20, 190, 100, 25, "Full Screen"); - fullscreenCheck->down_box(FL_DOWN_BOX); - fullscreenCheck->callback((Fl_Callback*)cb_fullscreenCheck); - } // Fl_Check_Button* fullscreenCheck - { modeSelect = new Fl_Input_Choice(65, 160, 160, 25, "Mode"); - modeSelect->callback((Fl_Callback*)cb_modeSelect); - modeSelect->when(FL_WHEN_CHANGED); - } // Fl_Input_Choice* modeSelect - { verticalSyncCheck = new Fl_Check_Button(150, 190, 110, 25, "Vertical Sync"); - verticalSyncCheck->down_box(FL_DOWN_BOX); - verticalSyncCheck->callback((Fl_Callback*)cb_verticalSyncCheck); - } // Fl_Check_Button* verticalSyncCheck - { rendererSelect = new Fl_Choice(235, 160, 150, 25); - rendererSelect->down_box(FL_BORDER_BOX); - rendererSelect->callback((Fl_Callback*)cb_rendererSelect); - } // Fl_Choice* rendererSelect - o->end(); - } // Fl_Group* o - { Fl_Group* o = new Fl_Group(400, 150, 205, 80, "Audio"); - o->box(FL_ENGRAVED_FRAME); - o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); - { polyInput = new Fl_Spinner(545, 195, 50, 25, "Max Polyphonics:"); - polyInput->callback((Fl_Callback*)cb_polyInput); - polyInput->when(FL_WHEN_CHANGED); - } // Fl_Spinner* polyInput - { audioSelect = new Fl_Choice(410, 160, 185, 25); - audioSelect->down_box(FL_BORDER_BOX); - audioSelect->callback((Fl_Callback*)cb_audioSelect); - } // Fl_Choice* audioSelect - o->end(); - } // Fl_Group* o - { glRendererGroup = new Fl_Group(10, 240, 385, 105, "Graphics"); - glRendererGroup->box(FL_ENGRAVED_FRAME); - glRendererGroup->align(Fl_Align(FL_ALIGN_TOP_LEFT)); - { radiosityCheck = new Fl_Light_Button(20, 310, 170, 25, "Global Illumination"); - radiosityCheck->callback((Fl_Callback*)cb_radiosityCheck); - radiosityCheck->when(FL_WHEN_CHANGED); - } // Fl_Light_Button* radiosityCheck - { directLightSelect = new Fl_Choice(265, 280, 120, 25, "Lighting"); - directLightSelect->down_box(FL_BORDER_BOX); - directLightSelect->callback((Fl_Callback*)cb_directLightSelect); - directLightSelect->when(FL_WHEN_CHANGED); - } // Fl_Choice* directLightSelect - { shaderSelect = new Fl_Choice(265, 310, 120, 25, "Shader FX"); - shaderSelect->down_box(FL_BORDER_BOX); - shaderSelect->callback((Fl_Callback*)cb_shaderSelect); - shaderSelect->when(FL_WHEN_CHANGED); - } // Fl_Choice* shaderSelect - { bloodCheck = new Fl_Light_Button(20, 310, 100, 25, "Blood"); - bloodCheck->callback((Fl_Callback*)cb_bloodCheck); - bloodCheck->when(FL_WHEN_CHANGED); - bloodCheck->hide(); - } // Fl_Light_Button* bloodCheck - { postFilterSelect = new Fl_Choice(265, 250, 120, 25, "Post FX"); - postFilterSelect->down_box(FL_BORDER_BOX); - postFilterSelect->callback((Fl_Callback*)cb_postFilterSelect); - } // Fl_Choice* postFilterSelect - { particleSelect = new Fl_Choice(90, 280, 100, 25, "Particle"); - particleSelect->down_box(FL_BORDER_BOX); - particleSelect->callback((Fl_Callback*)cb_particleSelect); - } // Fl_Choice* particleSelect - { msaaSelect = new Fl_Choice(90, 250, 100, 25, "AA:"); - msaaSelect->down_box(FL_BORDER_BOX); - msaaSelect->callback((Fl_Callback*)cb_msaaSelect); - msaaSelect->when(FL_WHEN_CHANGED); - } // Fl_Choice* msaaSelect - glRendererGroup->end(); - } // Fl_Group* glRendererGroup - { Fl_Group* o = new Fl_Group(400, 150, 205, 70, "Game Options"); - o->box(FL_ENGRAVED_FRAME); - o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); - o->hide(); - { playerNameInput = new Fl_Input(410, 175, 185, 25, "Player Name:"); - playerNameInput->callback((Fl_Callback*)cb_playerNameInput); - playerNameInput->align(Fl_Align(FL_ALIGN_TOP_LEFT)); - playerNameInput->when(FL_WHEN_CHANGED); - } // Fl_Input* playerNameInput - o->end(); - } // Fl_Group* o - { Fl_Button* o = new Fl_Button(415, 305, 170, 25, "Advanced Settings..."); - o->callback((Fl_Callback*)cb_Advanced); - } // Fl_Button* o - { swRendererGroup = new Fl_Group(10, 240, 385, 105, "Graphics"); - swRendererGroup->box(FL_ENGRAVED_BOX); - swRendererGroup->align(Fl_Align(FL_ALIGN_TOP_LEFT)); - { fastModeSelect = new Fl_Choice(120, 255, 125, 25, "Fast Mode"); - fastModeSelect->down_box(FL_BORDER_BOX); - fastModeSelect->callback((Fl_Callback*)cb_fastModeSelect); - } // Fl_Choice* fastModeSelect - swRendererGroup->end(); - } // Fl_Group* swRendererGroup - o->end(); - } // Fl_Group* o - { groupReport = new Fl_Group(10, 130, 595, 220, "System Report"); - groupReport->hide(); - { Fl_Group* o = new Fl_Group(10, 150, 595, 195, "Graphics"); - o->box(FL_ENGRAVED_FRAME); - o->align(Fl_Align(FL_ALIGN_TOP_LEFT)); - { outputGLRenderer = new Fl_Output(145, 160, 455, 20, "OpenGL Renderer"); - outputGLRenderer->labelsize(12); - outputGLRenderer->textsize(12); - } // Fl_Output* outputGLRenderer - { outputGLVersion = new Fl_Output(145, 185, 455, 20, "OpenGL Version"); - outputGLVersion->labelsize(12); - outputGLVersion->textsize(12); - } // Fl_Output* outputGLVersion - { outputGLSLVersion = new Fl_Output(145, 210, 455, 20, "GLSL Version"); - outputGLSLVersion->labelsize(12); - outputGLSLVersion->textsize(12); - } // Fl_Output* outputGLSLVersion - { glInfoView = new Fl_Help_View(145, 235, 455, 105, "OpenGL Extensions"); - glInfoView->labelsize(12); - glInfoView->align(Fl_Align(FL_ALIGN_LEFT_TOP)); - } // Fl_Help_View* glInfoView - o->end(); - } // Fl_Group* o - groupReport->end(); - } // Fl_Group* groupReport - { groupServerlist = new Fl_Tabs(10, 130, 595, 220, "Serverlist"); - groupServerlist->hide(); - { serverListbox = new Fl_Browser(10, 150, 595, 200, "Serverlist"); - serverListbox->type(2); - serverListbox->callback((Fl_Callback*)cb_serverListbox); - } // Fl_Browser* serverListbox - { Fl_Group* o = new Fl_Group(10, 150, 595, 200, "Filters"); - o->hide(); - { Fl_Group* o = new Fl_Group(20, 175, 80, 35, "Players"); - { checkFilterEmpty = new Fl_Check_Button(20, 175, 80, 15, "Empty"); - checkFilterEmpty->down_box(FL_DOWN_BOX); - checkFilterEmpty->value(1); - checkFilterEmpty->callback((Fl_Callback*)cb_checkFilterEmpty); - checkFilterEmpty->when(FL_WHEN_CHANGED); - } // Fl_Check_Button* checkFilterEmpty - { checkFilterFull = new Fl_Check_Button(20, 195, 80, 15, "Full"); - checkFilterFull->down_box(FL_DOWN_BOX); - checkFilterFull->value(1); - checkFilterFull->callback((Fl_Callback*)cb_checkFilterFull); - checkFilterFull->when(FL_WHEN_CHANGED); - } // Fl_Check_Button* checkFilterFull - o->end(); - } // Fl_Group* o - { Fl_Group* o = new Fl_Group(95, 175, 104, 60, "Version"); - { checkFilterV75 = new Fl_Check_Button(100, 175, 80, 15, "0.75"); - checkFilterV75->down_box(FL_DOWN_BOX); - checkFilterV75->value(1); - checkFilterV75->callback((Fl_Callback*)cb_checkFilterV75); - checkFilterV75->when(FL_WHEN_CHANGED); - } // Fl_Check_Button* checkFilterV75 - { checkFilterV76 = new Fl_Check_Button(100, 190, 80, 25, "0.76"); - checkFilterV76->down_box(FL_DOWN_BOX); - checkFilterV76->value(1); - checkFilterV76->callback((Fl_Callback*)cb_checkFilterV76); - checkFilterV76->when(FL_WHEN_CHANGED); - } // Fl_Check_Button* checkFilterV76 - { checkFilterVOther = new Fl_Check_Button(100, 205, 64, 30, "Other"); - checkFilterVOther->down_box(FL_DOWN_BOX); - checkFilterVOther->value(1); - checkFilterVOther->callback((Fl_Callback*)cb_checkFilterVOther); - checkFilterVOther->when(FL_WHEN_CHANGED); - } // Fl_Check_Button* checkFilterVOther - o->end(); - } // Fl_Group* o - o->end(); - } // Fl_Group* o - { Fl_Group* o = new Fl_Group(10, 150, 595, 200, "Misc"); - o->hide(); - { Fl_Button* o = new Fl_Button(20, 165, 140, 30, "Connect local v0.75"); - o->callback((Fl_Callback*)cb_Connect); - } // Fl_Button* o - { Fl_Button* o = new Fl_Button(20, 200, 140, 30, "Connect local v0.76"); - o->callback((Fl_Callback*)cb_Connect1); - } // Fl_Button* o - o->end(); - } // Fl_Group* o - groupServerlist->end(); - } // Fl_Tabs* groupServerlist - mainTab->end(); -} // Fl_Tabs* mainTab -{ bannerBox = new Fl_Box(5, 5, 605, 70); - bannerBox->box(FL_THIN_DOWN_FRAME); -} // Fl_Box* bannerBox -inited = false; -browser = 0; -end(); -} -unsigned char aboutText[4673] = /* binary data included from AboutText.html */ -{60,104,49,62,36,123,80,65,67,75,65,71,69,95,83,84,82,73,78,71,125,60,47, -104,49,62,10,10,60,104,50,62,67,114,101,100,105,116,115,60,47,104,50,62,10,60, -99,101,110,116,101,114,62,10,9,60,102,111,110,116,32,115,105,122,101,61,51,62, -10,34,121,118,116,34,32,45,32,77,111,115,116,32,111,102,32,116,104,101,32,99, -111,100,101,60,98,114,62,10,34,68,97,110,121,48,34,32,45,32,83,121,115,116,101, -109,32,112,114,111,102,105,108,101,114,44,32,105,100,101,97,115,44,32,101,116, -99,46,60,98,114,62,10,34,108,101,97,114,110,95,109,111,114,101,34,32,45,32,67, -77,97,107,101,32,115,117,112,112,111,114,116,44,32,115,101,114,118,101,114,32, -98,114,111,119,115,101,114,44,32,105,100,101,97,115,60,98,114,62,10,34,105,97, -109,103,114,101,97,115,101,114,34,32,45,32,65,111,83,32,48,46,55,54,32,112,114, -111,116,111,99,111,108,32,115,117,112,112,111,114,116,60,98,114,62,10,34,69,114, -105,99,115,111,110,50,51,49,52,34,32,45,32,66,101,116,116,101,114,32,105,110, -115,116,97,108,108,97,116,105,111,110,32,103,117,105,100,101,60,98,114,62,10,34, -74,111,74,111,101,95,83,116,105,110,107,121,34,32,45,32,87,105,110,51,50,32,73, -99,111,110,44,32,75,105,108,108,102,101,101,100,32,105,99,111,110,115,10,9,60, -47,102,111,110,116,62,10,60,47,99,101,110,116,101,114,62,10,10,60,104,50,62,80, -111,114,116,105,111,110,115,32,111,102,32,112,114,111,103,114,97,109,32,105,115, -32,98,97,115,101,100,32,111,110,32,102,111,108,108,111,119,105,110,103,32,115, -111,102,116,119,97,114,101,115,58,60,47,104,50,62,10,10,60,104,51,62,112,121, -115,112,97,100,101,115,60,47,104,51,62,10,10,60,112,62,76,105,99,101,110,115, -101,100,32,98,121,32,71,80,76,118,51,46,32,67,82,69,68,73,84,83,47,67,79,78,84, -82,73,66,85,84,73,79,78,83,47,65,67,75,78,79,87,76,69,68,71,69,77,69,78,84,83, -58,60,47,112,62,10,10,60,117,108,62,10,9,60,108,105,62,77,97,116,104,105,97, -115,32,34,77,97,116,94,50,34,32,75,97,101,114,108,101,118,32,45,32,77,111,115, -116,32,111,102,32,116,104,101,32,99,111,100,101,60,47,108,105,62,10,9,60,108, -105,62,34,104,111,109,112,121,34,32,45,32,70,108,111,97,116,105,110,103,32,98, -108,111,99,107,32,100,101,116,101,99,116,105,111,110,44,32,73,82,67,32,99,108, -105,101,110,116,44,32,103,101,110,101,114,97,108,32,99,111,100,101,44,32,101, -116,99,46,60,47,108,105,62,10,9,60,108,105,62,34,84,114,105,112,108,101,102,111, -120,34,32,45,32,77,97,112,32,103,101,110,101,114,97,116,111,114,32,99,111,100, -101,44,32,110,101,116,119,111,114,107,32,99,111,100,101,44,32,101,116,99,46,60, -47,108,105,62,10,9,60,108,105,62,34,83,104,97,109,34,32,45,32,72,111,115,116, -105,110,103,32,97,110,100,32,116,101,115,116,105,110,103,60,47,108,105,62,10,9, -60,108,105,62,34,89,111,117,114,115,101,108,102,34,32,45,32,83,99,114,105,112, -116,115,60,47,108,105,62,10,9,60,108,105,62,34,98,105,108,100,114,97,109,101, -114,34,32,45,32,70,108,111,97,116,105,110,103,32,98,108,111,99,107,32,100,101, -116,101,99,116,105,111,110,32,40,65,42,41,32,97,110,100,32,109,105,115,99,46,32, -99,111,100,101,60,47,108,105,62,10,9,60,108,105,62,34,84,104,101,71,114,97,110, -100,109,97,115,116,101,114,34,32,45,32,84,101,115,116,101,114,44,32,105,100,101, -97,115,32,97,110,100,32,116,104,101,32,111,102,102,105,99,105,97,108,32,109,97, -112,60,47,108,105,62,10,9,60,108,105,62,34,84,101,103,117,34,32,45,32,76,111, -103,111,44,32,105,100,101,97,115,44,32,116,101,115,116,105,110,103,32,97,110, -100,32,116,104,101,32,111,102,102,105,99,105,97,108,32,109,97,112,60,47,108,105, -62,10,9,60,108,105,62,34,69,110,97,114,105,34,32,45,32,84,101,115,116,105,110, -103,44,32,109,105,115,99,46,32,99,111,100,101,32,97,110,100,32,105,100,101,97, -115,60,47,108,105,62,10,60,47,117,108,62,10,10,10,60,104,50,62,84,104,105,115, -32,112,114,111,103,114,97,109,32,105,110,99,108,117,100,101,115,32,102,111,108, -108,111,119,105,110,103,32,99,111,109,112,111,110,101,110,116,115,58,60,47,104, -50,62,10,10,60,104,51,62,65,110,103,101,108,67,111,100,101,32,83,99,114,105, -112,116,105,110,103,32,76,105,98,114,97,114,121,60,47,104,51,62,10,10,60,112,62, -67,111,112,121,114,105,103,104,116,32,38,99,111,112,121,59,32,50,48,48,51,45, -50,48,49,51,32,65,110,100,114,101,97,115,32,74,195,182,110,115,115,111,110,60, -47,112,62,10,10,60,112,62,84,104,105,115,32,115,111,102,116,119,97,114,101,32, -105,115,32,112,114,111,118,105,100,101,100,32,39,97,115,45,105,115,39,44,32,119, -105,116,104,111,117,116,32,97,110,121,32,101,120,112,114,101,115,115,32,111,114, -32,105,109,112,108,105,101,100,32,119,97,114,114,97,110,116,121,46,32,73,110, -32,110,111,32,101,118,101,110,116,32,119,105,108,108,32,116,104,101,32,97,117, -116,104,111,114,115,32,98,101,32,104,101,108,100,32,108,105,97,98,108,101,32, -102,111,114,32,97,110,121,32,100,97,109,97,103,101,115,32,97,114,105,115,105, -110,103,32,102,114,111,109,32,116,104,101,32,117,115,101,32,111,102,32,116,104, -105,115,32,115,111,102,116,119,97,114,101,46,60,47,112,62,10,60,112,62,80,101, -114,109,105,115,115,105,111,110,32,105,115,32,103,114,97,110,116,101,100,32,116, -111,32,97,110,121,111,110,101,32,116,111,32,117,115,101,32,116,104,105,115,32, -115,111,102,116,119,97,114,101,32,102,111,114,32,97,110,121,32,112,117,114,112, -111,115,101,44,32,105,110,99,108,117,100,105,110,103,32,99,111,109,109,101,114, -99,105,97,108,32,97,112,112,108,105,99,97,116,105,111,110,115,44,32,97,110,100, -32,116,111,32,97,108,116,101,114,32,105,116,32,97,110,100,32,114,101,100,105, -115,116,114,105,98,117,116,101,32,105,116,32,102,114,101,101,108,121,44,32,115, -117,98,106,101,99,116,32,116,111,32,116,104,101,32,102,111,108,108,111,119,105, -110,103,32,114,101,115,116,114,105,99,116,105,111,110,115,58,60,47,112,62,10,60, -111,108,62,10,9,60,108,105,62,84,104,101,32,111,114,105,103,105,110,32,111,102, -32,116,104,105,115,32,115,111,102,116,119,97,114,101,32,109,117,115,116,32,110, -111,116,32,98,101,32,109,105,115,114,101,112,114,101,115,101,110,116,101,100,59, -32,121,111,117,32,109,117,115,116,32,110,111,116,32,99,108,97,105,109,32,116, -104,97,116,32,121,111,117,32,119,114,111,116,101,32,116,104,101,32,111,114,105, -103,105,110,97,108,32,115,111,102,116,119,97,114,101,46,32,73,102,32,121,111, -117,32,117,115,101,32,116,104,105,115,32,115,111,102,116,119,97,114,101,32,105, -110,32,97,32,112,114,111,100,117,99,116,44,32,97,110,32,97,99,107,110,111,119, -108,101,100,103,109,101,110,116,32,105,110,32,116,104,101,32,112,114,111,100, -117,99,116,32,100,111,99,117,109,101,110,116,97,116,105,111,110,32,119,111,117, -108,100,32,98,101,32,97,112,112,114,101,99,105,97,116,101,100,32,98,117,116,32, -105,115,32,110,111,116,32,114,101,113,117,105,114,101,100,46,60,47,108,105,62, -10,9,60,108,105,62,65,108,116,101,114,101,100,32,115,111,117,114,99,101,32,118, -101,114,115,105,111,110,115,32,109,117,115,116,32,98,101,32,112,108,97,105,110, -108,121,32,109,97,114,107,101,100,32,97,115,32,115,117,99,104,44,32,97,110,100, -32,109,117,115,116,32,110,111,116,32,98,101,32,109,105,115,114,101,112,114,101, -115,101,110,116,101,100,32,97,115,32,98,101,105,110,103,32,116,104,101,32,111, -114,105,103,105,110,97,108,32,115,111,102,116,119,97,114,101,46,60,47,108,105, -62,10,9,60,108,105,62,84,104,105,115,32,110,111,116,105,99,101,32,109,97,121, -32,110,111,116,32,98,101,32,114,101,109,111,118,101,100,32,111,114,32,97,108, -116,101,114,101,100,32,102,114,111,109,32,97,110,121,32,115,111,117,114,99,101, -32,100,105,115,116,114,105,98,117,116,105,111,110,46,60,47,108,105,62,10,60,47, -111,108,62,10,10,60,104,51,62,69,78,101,116,60,47,104,51,62,10,60,112,62,67,111, -112,121,114,105,103,104,116,32,38,99,111,112,121,59,32,50,48,48,50,45,50,48,49, -49,32,76,101,101,32,83,97,108,122,109,97,110,60,47,112,62,10,60,112,62,10,9,80, -101,114,109,105,115,115,105,111,110,32,105,115,32,104,101,114,101,98,121,32,103, -114,97,110,116,101,100,44,32,102,114,101,101,32,111,102,32,99,104,97,114,103, -101,44,32,116,111,32,97,110,121,32,112,101,114,115,111,110,32,111,98,116,97,105, -110,105,110,103,32,97,32,99,111,112,121,32,111,102,32,116,104,105,115,32,115, -111,102,116,119,97,114,101,32,97,110,100,32,97,115,115,111,99,105,97,116,101, -100,32,100,111,99,117,109,101,110,116,97,116,105,111,110,32,102,105,108,101,115, -32,40,116,104,101,32,34,83,111,102,116,119,97,114,101,34,41,44,32,116,111,32, -100,101,97,108,32,105,110,32,116,104,101,32,83,111,102,116,119,97,114,101,32, -119,105,116,104,111,117,116,32,114,101,115,116,114,105,99,116,105,111,110,44,32, -105,110,99,108,117,100,105,110,103,32,119,105,116,104,111,117,116,32,108,105, -109,105,116,97,116,105,111,110,32,116,104,101,32,114,105,103,104,116,115,32,116, -111,32,117,115,101,44,32,99,111,112,121,44,32,109,111,100,105,102,121,44,32,109, -101,114,103,101,44,32,112,117,98,108,105,115,104,44,32,100,105,115,116,114,105, -98,117,116,101,44,32,115,117,98,108,105,99,101,110,115,101,44,32,97,110,100,47, -111,114,32,115,101,108,108,32,99,111,112,105,101,115,32,111,102,32,116,104,101, -32,83,111,102,116,119,97,114,101,44,32,97,110,100,32,116,111,32,112,101,114, -109,105,116,32,112,101,114,115,111,110,115,32,116,111,32,119,104,111,109,32,116, -104,101,32,83,111,102,116,119,97,114,101,32,105,115,32,102,117,114,110,105,115, -104,101,100,32,116,111,32,100,111,32,115,111,44,32,115,117,98,106,101,99,116,32, -116,111,32,116,104,101,32,102,111,108,108,111,119,105,110,103,32,99,111,110,100, -105,116,105,111,110,115,58,10,60,47,112,62,10,60,112,62,10,9,84,104,101,32,97, -98,111,118,101,32,99,111,112,121,114,105,103,104,116,32,110,111,116,105,99,101, -32,97,110,100,32,116,104,105,115,32,112,101,114,109,105,115,115,105,111,110,32, -110,111,116,105,99,101,32,115,104,97,108,108,32,98,101,32,105,110,99,108,117, -100,101,100,32,105,110,32,97,108,108,32,99,111,112,105,101,115,32,111,114,32, -115,117,98,115,116,97,110,116,105,97,108,32,112,111,114,116,105,111,110,115,32, -111,102,32,116,104,101,32,83,111,102,116,119,97,114,101,46,10,60,47,112,62,10, -60,112,62,10,9,84,72,69,32,83,79,70,84,87,65,82,69,32,73,83,32,80,82,79,86,73, -68,69,68,32,34,65,83,32,73,83,34,44,32,87,73,84,72,79,85,84,32,87,65,82,82,65, -78,84,89,32,79,70,32,65,78,89,32,75,73,78,68,44,32,69,88,80,82,69,83,83,32,79, -82,32,73,77,80,76,73,69,68,44,32,73,78,67,76,85,68,73,78,71,32,66,85,84,32,78, -79,84,32,76,73,77,73,84,69,68,32,84,79,32,84,72,69,32,87,65,82,82,65,78,84,73, -69,83,32,79,70,32,77,69,82,67,72,65,78,84,65,66,73,76,73,84,89,44,32,70,73,84, -78,69,83,83,32,70,79,82,32,65,32,80,65,82,84,73,67,85,76,65,82,32,80,85,82,80, -79,83,69,32,65,78,68,32,78,79,78,73,78,70,82,73,78,71,69,77,69,78,84,46,32,73, -78,32,78,79,32,69,86,69,78,84,32,83,72,65,76,76,32,84,72,69,32,65,85,84,72,79, -82,83,32,79,82,32,67,79,80,89,82,73,71,72,84,32,72,79,76,68,69,82,83,32,66,69, -32,76,73,65,66,76,69,32,70,79,82,32,65,78,89,32,67,76,65,73,77,44,32,68,65,77, -65,71,69,83,32,79,82,32,79,84,72,69,82,32,76,73,65,66,73,76,73,84,89,44,32,87, -72,69,84,72,69,82,32,73,78,32,65,78,32,65,67,84,73,79,78,32,79,70,32,67,79,78, -84,82,65,67,84,44,32,84,79,82,84,32,79,82,32,79,84,72,69,82,87,73,83,69,44,32, -65,82,73,83,73,78,71,32,70,82,79,77,44,32,79,85,84,32,79,70,32,79,82,32,73,78, -32,67,79,78,78,69,67,84,73,79,78,32,87,73,84,72,32,84,72,69,32,83,79,70,84,87, -65,82,69,32,79,82,32,84,72,69,32,85,83,69,32,79,82,32,79,84,72,69,82,32,68,69, -65,76,73,78,71,83,32,73,78,32,84,72,69,32,83,79,70,84,87,65,82,69,46,10,60,47, -112,62,10,10,60,104,51,62,75,105,115,115,32,70,70,84,60,47,104,51,62,10,60,112, -62,67,111,112,121,114,105,103,104,116,32,38,99,111,112,121,59,32,50,48,48,51, -45,50,48,49,48,32,77,97,114,107,32,66,111,114,103,101,114,100,105,110,103,60, -47,112,62,10,60,112,62,65,108,108,32,114,105,103,104,116,115,32,114,101,115, -101,114,118,101,100,46,60,47,112,62,10,60,112,62,82,101,100,105,115,116,114,105, -98,117,116,105,111,110,32,97,110,100,32,117,115,101,32,105,110,32,115,111,117, -114,99,101,32,97,110,100,32,98,105,110,97,114,121,32,102,111,114,109,115,44,32, -119,105,116,104,32,111,114,32,119,105,116,104,111,117,116,32,109,111,100,105, -102,105,99,97,116,105,111,110,44,32,97,114,101,32,112,101,114,109,105,116,116, -101,100,32,112,114,111,118,105,100,101,100,32,116,104,97,116,32,116,104,101,32, -102,111,108,108,111,119,105,110,103,32,99,111,110,100,105,116,105,111,110,115, -32,97,114,101,32,109,101,116,58,60,47,112,62,10,60,117,108,62,10,9,60,108,105, -62,82,101,100,105,115,116,114,105,98,117,116,105,111,110,115,32,111,102,32,115, -111,117,114,99,101,32,99,111,100,101,32,109,117,115,116,32,114,101,116,97,105, -110,32,116,104,101,32,97,98,111,118,101,32,99,111,112,121,114,105,103,104,116, -32,110,111,116,105,99,101,44,32,116,104,105,115,32,108,105,115,116,32,111,102, -32,99,111,110,100,105,116,105,111,110,115,32,97,110,100,32,116,104,101,32,102, -111,108,108,111,119,105,110,103,32,100,105,115,99,108,97,105,109,101,114,46,60, -47,108,105,62,10,9,60,108,105,62,82,101,100,105,115,116,114,105,98,117,116,105, -111,110,115,32,105,110,32,98,105,110,97,114,121,32,102,111,114,109,32,109,117, -115,116,32,114,101,112,114,111,100,117,99,101,32,116,104,101,32,97,98,111,118, -101,32,99,111,112,121,114,105,103,104,116,32,110,111,116,105,99,101,44,32,116, -104,105,115,32,108,105,115,116,32,111,102,32,99,111,110,100,105,116,105,111,110, -115,32,97,110,100,32,116,104,101,32,102,111,108,108,111,119,105,110,103,32,100, -105,115,99,108,97,105,109,101,114,32,105,110,32,116,104,101,32,100,111,99,117, -109,101,110,116,97,116,105,111,110,32,97,110,100,47,111,114,32,111,116,104,101, -114,32,109,97,116,101,114,105,97,108,115,32,112,114,111,118,105,100,101,100,32, -119,105,116,104,32,116,104,101,32,100,105,115,116,114,105,98,117,116,105,111, -110,46,60,47,108,105,62,10,9,60,108,105,62,78,101,105,116,104,101,114,32,116, -104,101,32,97,117,116,104,111,114,32,110,111,114,32,116,104,101,32,110,97,109, -101,115,32,111,102,32,97,110,121,32,99,111,110,116,114,105,98,117,116,111,114, -115,32,109,97,121,32,98,101,32,117,115,101,100,32,116,111,32,101,110,100,111, -114,115,101,32,111,114,32,112,114,111,109,111,116,101,32,112,114,111,100,117,99, -116,115,32,100,101,114,105,118,101,100,32,102,114,111,109,32,116,104,105,115,32, -115,111,102,116,119,97,114,101,32,119,105,116,104,111,117,116,32,115,112,101,99, -105,102,105,99,32,112,114,105,111,114,32,119,114,105,116,116,101,110,32,112,101, -114,109,105,115,115,105,111,110,46,60,47,108,105,62,10,60,47,117,108,62,10,60, -112,62,10,84,72,73,83,32,83,79,70,84,87,65,82,69,32,73,83,32,80,82,79,86,73,68, -69,68,32,66,89,32,84,72,69,32,67,79,80,89,82,73,71,72,84,32,72,79,76,68,69,82, -83,32,65,78,68,32,67,79,78,84,82,73,66,85,84,79,82,83,32,34,65,83,32,73,83,34, -32,65,78,68,32,65,78,89,32,69,88,80,82,69,83,83,32,79,82,32,73,77,80,76,73,69, -68,32,87,65,82,82,65,78,84,73,69,83,44,32,73,78,67,76,85,68,73,78,71,44,32,66, -85,84,32,78,79,84,32,76,73,77,73,84,69,68,32,84,79,44,32,84,72,69,32,73,77,80, -76,73,69,68,32,87,65,82,82,65,78,84,73,69,83,32,79,70,32,77,69,82,67,72,65,78, -84,65,66,73,76,73,84,89,32,65,78,68,32,70,73,84,78,69,83,83,32,70,79,82,32,65, -32,80,65,82,84,73,67,85,76,65,82,32,80,85,82,80,79,83,69,32,65,82,69,32,68,73, -83,67,76,65,73,77,69,68,46,32,73,78,32,78,79,32,69,86,69,78,84,32,83,72,65,76, -76,32,84,72,69,32,67,79,80,89,82,73,71,72,84,32,79,87,78,69,82,32,79,82,32,67, -79,78,84,82,73,66,85,84,79,82,83,32,66,69,32,76,73,65,66,76,69,32,70,79,82,32, -65,78,89,32,68,73,82,69,67,84,44,32,73,78,68,73,82,69,67,84,44,32,73,78,67,73, -68,69,78,84,65,76,44,32,83,80,69,67,73,65,76,44,32,69,88,69,77,80,76,65,82,89, -44,32,79,82,32,67,79,78,83,69,81,85,69,78,84,73,65,76,32,68,65,77,65,71,69,83, -32,40,73,78,67,76,85,68,73,78,71,44,32,66,85,84,32,78,79,84,32,76,73,77,73,84, -69,68,32,84,79,44,32,80,82,79,67,85,82,69,77,69,78,84,32,79,70,32,83,85,66,83, -84,73,84,85,84,69,32,71,79,79,68,83,32,79,82,32,83,69,82,86,73,67,69,83,59,32, -76,79,83,83,32,79,70,32,85,83,69,44,32,68,65,84,65,44,32,79,82,32,80,82,79,70, -73,84,83,59,32,79,82,32,66,85,83,73,78,69,83,83,32,73,78,84,69,82,82,85,80,84, -73,79,78,41,32,72,79,87,69,86,69,82,32,67,65,85,83,69,68,32,65,78,68,32,79,78, -32,65,78,89,32,84,72,69,79,82,89,32,79,70,32,76,73,65,66,73,76,73,84,89,44,32, -87,72,69,84,72,69,82,32,73,78,32,67,79,78,84,82,65,67,84,44,32,83,84,82,73,67, -84,32,76,73,65,66,73,76,73,84,89,44,32,79,82,32,84,79,82,84,32,40,73,78,67,76, -85,68,73,78,71,32,78,69,71,76,73,71,69,78,67,69,32,79,82,32,79,84,72,69,82,87, -73,83,69,41,32,65,82,73,83,73,78,71,32,73,78,32,65,78,89,32,87,65,89,32,79,85, -84,32,79,70,32,84,72,69,32,85,83,69,32,79,70,32,84,72,73,83,32,83,79,70,84,87, -65,82,69,44,32,69,86,69,78,32,73,70,32,65,68,86,73,83,69,68,32,79,70,32,84,72, -69,32,80,79,83,83,73,66,73,76,73,84,89,32,79,70,32,83,85,67,72,32,68,65,77,65, -71,69,46,10,60,47,112,62,10}; diff --git a/Sources/Gui/MainWindow.h b/Sources/Gui/MainWindow.h deleted file mode 100644 index fc3b0e5f..00000000 --- a/Sources/Gui/MainWindow.h +++ /dev/null @@ -1,204 +0,0 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0302 - -#ifndef MainWindow_h -#define MainWindow_h -#include -namespace spades { class Serverbrowser; class ServerAddress; }; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class MainWindow : public Fl_Window { - void _MainWindow(); -public: - MainWindow(int X, int Y, int W, int H, const char *L = 0); - MainWindow(int W, int H, const char *L = 0); - MainWindow(); -private: - Fl_Group *quickConnectGroup; - Fl_Input *quickHostInput; - inline void cb_quickHostInput_i(Fl_Input*, void*); - static void cb_quickHostInput(Fl_Input*, void*); -public: - Fl_Choice *versionChoice; -private: - inline void cb_versionChoice_i(Fl_Choice*, void*); - static void cb_versionChoice(Fl_Choice*, void*); - Fl_Return_Button *connectButton; - inline void cb_connectButton_i(Fl_Return_Button*, void*); - static void cb_connectButton(Fl_Return_Button*, void*); - Fl_Group *launchMainScreenGroup; -public: - Fl_Return_Button *startButton; -private: - inline void cb_startButton_i(Fl_Return_Button*, void*); - static void cb_startButton(Fl_Return_Button*, void*); - Fl_Check_Button *bypassStartupCheck; - inline void cb_bypassStartupCheck_i(Fl_Check_Button*, void*); - static void cb_bypassStartupCheck(Fl_Check_Button*, void*); - Fl_Tabs *mainTab; -public: - Fl_Group *groupAbout; - Fl_Help_View *aboutView; -private: - Fl_Check_Button *fullscreenCheck; - inline void cb_fullscreenCheck_i(Fl_Check_Button*, void*); - static void cb_fullscreenCheck(Fl_Check_Button*, void*); - Fl_Input_Choice *modeSelect; - inline void cb_modeSelect_i(Fl_Input_Choice*, void*); - static void cb_modeSelect(Fl_Input_Choice*, void*); -public: - Fl_Check_Button *verticalSyncCheck; -private: - inline void cb_verticalSyncCheck_i(Fl_Check_Button*, void*); - static void cb_verticalSyncCheck(Fl_Check_Button*, void*); -public: - Fl_Choice *rendererSelect; -private: - inline void cb_rendererSelect_i(Fl_Choice*, void*); - static void cb_rendererSelect(Fl_Choice*, void*); - Fl_Spinner *polyInput; - inline void cb_polyInput_i(Fl_Spinner*, void*); - static void cb_polyInput(Fl_Spinner*, void*); -public: - Fl_Choice *audioSelect; -private: - inline void cb_audioSelect_i(Fl_Choice*, void*); - static void cb_audioSelect(Fl_Choice*, void*); - Fl_Group *glRendererGroup; -public: - Fl_Light_Button *radiosityCheck; -private: - inline void cb_radiosityCheck_i(Fl_Light_Button*, void*); - static void cb_radiosityCheck(Fl_Light_Button*, void*); -public: - Fl_Choice *directLightSelect; -private: - inline void cb_directLightSelect_i(Fl_Choice*, void*); - static void cb_directLightSelect(Fl_Choice*, void*); -public: - Fl_Choice *shaderSelect; -private: - inline void cb_shaderSelect_i(Fl_Choice*, void*); - static void cb_shaderSelect(Fl_Choice*, void*); -public: - Fl_Light_Button *bloodCheck; -private: - inline void cb_bloodCheck_i(Fl_Light_Button*, void*); - static void cb_bloodCheck(Fl_Light_Button*, void*); -public: - Fl_Choice *postFilterSelect; -private: - inline void cb_postFilterSelect_i(Fl_Choice*, void*); - static void cb_postFilterSelect(Fl_Choice*, void*); -public: - Fl_Choice *particleSelect; -private: - inline void cb_particleSelect_i(Fl_Choice*, void*); - static void cb_particleSelect(Fl_Choice*, void*); - Fl_Choice *msaaSelect; - inline void cb_msaaSelect_i(Fl_Choice*, void*); - static void cb_msaaSelect(Fl_Choice*, void*); - Fl_Input *playerNameInput; - inline void cb_playerNameInput_i(Fl_Input*, void*); - static void cb_playerNameInput(Fl_Input*, void*); - inline void cb_Advanced_i(Fl_Button*, void*); - static void cb_Advanced(Fl_Button*, void*); -public: - Fl_Group *swRendererGroup; - Fl_Choice *fastModeSelect; -private: - inline void cb_fastModeSelect_i(Fl_Choice*, void*); - static void cb_fastModeSelect(Fl_Choice*, void*); -public: - Fl_Group *groupReport; - Fl_Output *outputGLRenderer; - Fl_Output *outputGLVersion; - Fl_Output *outputGLSLVersion; - Fl_Help_View *glInfoView; - Fl_Tabs *groupServerlist; -protected: - Fl_Browser *serverListbox; -private: - inline void cb_serverListbox_i(Fl_Browser*, void*); - static void cb_serverListbox(Fl_Browser*, void*); -public: - Fl_Check_Button *checkFilterEmpty; -private: - inline void cb_checkFilterEmpty_i(Fl_Check_Button*, void*); - static void cb_checkFilterEmpty(Fl_Check_Button*, void*); -public: - Fl_Check_Button *checkFilterFull; -private: - inline void cb_checkFilterFull_i(Fl_Check_Button*, void*); - static void cb_checkFilterFull(Fl_Check_Button*, void*); -public: - Fl_Check_Button *checkFilterV75; -private: - inline void cb_checkFilterV75_i(Fl_Check_Button*, void*); - static void cb_checkFilterV75(Fl_Check_Button*, void*); -public: - Fl_Check_Button *checkFilterV76; -private: - inline void cb_checkFilterV76_i(Fl_Check_Button*, void*); - static void cb_checkFilterV76(Fl_Check_Button*, void*); -public: - Fl_Check_Button *checkFilterVOther; -private: - inline void cb_checkFilterVOther_i(Fl_Check_Button*, void*); - static void cb_checkFilterVOther(Fl_Check_Button*, void*); - inline void cb_Connect_i(Fl_Button*, void*); - static void cb_Connect(Fl_Button*, void*); - inline void cb_Connect1_i(Fl_Button*, void*); - static void cb_Connect1(Fl_Button*, void*); - Fl_Box *bannerBox; - bool inited; -protected: - spades::Serverbrowser* browser; -private: - bool shaderHighCapable; - bool postFilterHighCapable; - bool particleHighCapable; - bool glCapable; - void QuickConnectPressed(); -public: - void LoadPrefs(); -private: - void SavePrefs(); - void OpenDetailConfig(); -public: - void Init(); -private: - void DisableMSAA(); - void MSAAEnabled(); -public: - void CheckGLCapability(); -private: - void ServerSelectionChanged(); -public: - void updateFilters();; - ~MainWindow(); -protected: - void connectLocal075Pressed(); - void connectLocal076Pressed(); -public: - void versionSelectionChanged(); -private: - void StartGamePressed(); -}; -extern unsigned char aboutText[4673]; -#endif diff --git a/Sources/Gui/MainWindowHandler.cpp b/Sources/Gui/MainWindowHandler.cpp deleted file mode 100644 index 9ef0b0f5..00000000 --- a/Sources/Gui/MainWindowHandler.cpp +++ /dev/null @@ -1,1032 +0,0 @@ -/* - Copyright (c) 2013 yvt - - This file is part of OpenSpades. - - OpenSpades is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenSpades is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OpenSpades. If not, see . - - */ - -#include -#include "MainWindow.h" -#include "Main.h" - -#include "../Core/Debug.h" -#include "SDLRunner.h" -#include -#include "../Core/Settings.h" -#include "../Imports/SDL.h" -#include -#include "../Core/FileManager.h" -#include "../Core/IStream.h" -#include "SDLAsyncRunner.h" -#include "DetailConfigWindow.h" -#include "../Core/Math.h" -#include "Serverbrowser.h" -#include "ErrorDialog.h" - -#include "../Imports/OpenGL.h" //for gpu info - -using namespace spades::gui; - -SPADES_SETTING(cg_smp, "0"); -SPADES_SETTING(cg_blood, "1"); -SPADES_SETTING(cg_lastQuickConnectHost, "127.0.0.1"); -SPADES_SETTING(cg_protocolVersion, ""); -SPADES_SETTING(cg_playerName, "Deuce"); -SPADES_SETTING(r_bloom, "0"); -SPADES_SETTING(r_lens, "1"); -SPADES_SETTING(r_cameraBlur, "1"); -SPADES_SETTING(r_softParticles, "1"); -SPADES_SETTING(r_mapSoftShadow, "0"); -SPADES_SETTING(r_modelShadows, "1"); -SPADES_SETTING(r_radiosity, "0"); -SPADES_SETTING(r_dlights, "1"); -SPADES_SETTING(r_water, "2"); -SPADES_SETTING(r_multisamples, "0"); -SPADES_SETTING(r_fxaa, "1"); -SPADES_SETTING(r_depthBits, ""); -SPADES_SETTING(r_colorBits, ""); -SPADES_SETTING(r_videoWidth, "1024"); -SPADES_SETTING(r_videoHeight, "640"); -SPADES_SETTING(r_fullscreen, "0"); -SPADES_SETTING(r_fogShadow, "0"); -SPADES_SETTING(r_lensFlare, "1"); -SPADES_SETTING(r_lensFlareDynamic, ""); -SPADES_SETTING(r_blitFramebuffer, "1"); -SPADES_SETTING(r_srgb, ""); -SPADES_SETTING(r_shadowMapSize, ""); -SPADES_SETTING(s_maxPolyphonics, "96"); -SPADES_SETTING(s_eax, "1"); -SPADES_SETTING(r_maxAnisotropy, "8"); -SPADES_SETTING(r_colorCorrection, "1"); -SPADES_SETTING(r_physicalLighting, ""); -SPADES_SETTING(r_occlusionQuery, ""); -SPADES_SETTING(r_depthOfField, ""); -SPADES_SETTING(r_vsync, ""); -SPADES_SETTING(r_renderer, ""); -SPADES_SETTING(r_swUndersampling, ""); -SPADES_SETTING(s_audioDriver, ""); - -SPADES_SETTING(cl_showStartupWindow, "-1"); - -static std::vector g_modes; - -MainWindow::~MainWindow() -{ - SPADES_MARK_FUNCTION(); - if( browser ) { - delete browser; - } -} - -void MainWindow::QuickConnectPressed() { - SPADES_MARK_FUNCTION(); - spades::ServerAddress host(quickHostInput->value(), versionChoice->value() == 0 ? spades::ProtocolVersion::v075 : spades::ProtocolVersion::v076); - hide(); - spades::StartClient(host, cg_playerName); -} - -void MainWindow::StartGamePressed() { - SPADES_MARK_FUNCTION(); - - if((int)cl_showStartupWindow == -1){ - SPLog("This seems to be the first launch of the current version (cl_showStartupWindow = -1)."); - switch(fl_choice("Do you want to bypass this startup window the next time you launch OpenSpades?\n\n" - "Note: You can access the startup window again by holding the Shift key.", - "No", "Yes", "Cancel")) { - case 1: - SPLog("User wants to bypass the startup window."); - SPLog("Setting cl_showStartupWindow to 0"); - cl_showStartupWindow = 0; - break; - case 0: - SPLog("User don't want to bypass the startup window."); - SPLog("Setting cl_showStartupWindow to 1"); - cl_showStartupWindow = 1; - break; - case 2: - return; - } - } - - - hide(); - SPLog("Starting main screen"); - spades::StartMainScreen(); -} - -void MainWindow::connectLocal075Pressed() -{ - SPADES_MARK_FUNCTION(); - spades::ServerAddress host("aos://16777343:32887", spades::ProtocolVersion::v075 ); - hide(); - spades::StartClient(host, cg_playerName); -} - -void MainWindow::connectLocal076Pressed() -{ - SPADES_MARK_FUNCTION(); - spades::ServerAddress host("aos://16777343:32887", spades::ProtocolVersion::v076 ); - hide(); - spades::StartClient(host, cg_playerName); -} - -void MainWindow::versionSelectionChanged() -{ - SPADES_MARK_FUNCTION(); - cg_protocolVersion = versionChoice->value() + 3; -} - -#pragma mark - Setup - -void MainWindow::LoadPrefs() { - SPADES_MARK_FUNCTION(); - - SPLog("Loading Preferences to MainWindow"); - - switch((int)cl_showStartupWindow) { - case -1: - case 0: - bypassStartupCheck->value(1); - break; - default: - bypassStartupCheck->value(0); - break; - } - - - // --- video - // add modes - char buf[64]; - modeSelect->clear(); - for(size_t i = 0; i < g_modes.size(); i++){ - spades::IntVector3 mode = g_modes[i]; - sprintf(buf, "%dx%d", mode.x, mode.y); - modeSelect->add(buf); - } - sprintf(buf, "%dx%d", (int)r_videoWidth, (int)r_videoHeight); - modeSelect->value(buf); - - msaaSelect->clear(); - if(r_blitFramebuffer) { - msaaSelect->add("Off"); - msaaSelect->add("MSAA 2x"); - msaaSelect->add("MSAA 4x"); - msaaSelect->add("FXAA"); - msaaSelect->add("Custom"); - if(r_fxaa) { - if(r_multisamples){ - msaaSelect->value(4); - }else{ - msaaSelect->value(3); - } - }else{ - switch((int)r_multisamples){ - case 0: - case 1: - default: - msaaSelect->value(0); - break; - case 2: - msaaSelect->value(1); - break; - case 4: - msaaSelect->value(2); - break; - } - } - }else { - // MSAA is not supported with r_blitFramebuffer = 0 - msaaSelect->add("Off"); - msaaSelect->add("FXAA"); - msaaSelect->add("Custom"); - if(r_fxaa) { - if(r_multisamples){ - msaaSelect->value(2); - }else{ - msaaSelect->value(1); - } - }else{ - switch((int)r_multisamples){ - case 0: - case 1: - default: - msaaSelect->value(0); - break; - case 2: - case 4: - msaaSelect->value(2); - break; - } - } - } - - quickHostInput->value(cg_lastQuickConnectHost.CString()); - int v = (int)cg_protocolVersion; - versionChoice->add( "0.75" ); - versionChoice->add( "0.76" ); - versionChoice->value( v == 3 ? 0 : 1 ); - fullscreenCheck->value(r_fullscreen ? 1 : 0); - verticalSyncCheck->value(r_vsync ? 1 : 0); - - // --- graphics - swRendererGroup->hide(); - glRendererGroup->hide(); - rendererSelect->clear(); - rendererSelect->add("Software"); - if(glCapable) - rendererSelect->add("OpenGL"); - if(spades::EqualsIgnoringCase(r_renderer, "sw")) { - swRendererGroup->show(); - rendererSelect->value(0); - }else if(spades::EqualsIgnoringCase(r_renderer, "gl")) { - glRendererGroup->show(); - rendererSelect->value(1); - } - - // --- GL graphics - postFilterSelect->clear(); - postFilterSelect->add("Low"); - postFilterSelect->add("Medium"); - if(postFilterHighCapable){ - postFilterSelect->add("High"); - } - postFilterSelect->add("Custom"); - if(postFilterHighCapable){ - postFilterSelect->value(3); - }else{ - postFilterSelect->value(2); - } - - if(r_cameraBlur && r_bloom && r_lens && r_lensFlare && r_lensFlareDynamic && - r_colorCorrection && r_depthOfField - && postFilterHighCapable) { - postFilterSelect->value(2); - }else if(r_cameraBlur && (!r_bloom) && r_lens && r_lensFlare && (!r_lensFlareDynamic) && - r_colorCorrection && (!r_depthOfField)) { - postFilterSelect->value(1); - }else if((!r_cameraBlur) && (!r_bloom) && (!r_lens) && (!r_lensFlare) && (!r_lensFlareDynamic) && - (!r_colorCorrection) && (!r_depthOfField)) { - postFilterSelect->value(0); - } - - particleSelect->clear(); - particleSelect->add("Low"); - particleSelect->add("Medium"); - if(particleHighCapable) { - particleSelect->add("High"); - } - particleSelect->add("Custom"); - particleSelect->value(particleHighCapable ? 3 : 2); - if((int)r_softParticles >= 2 && particleHighCapable) { - particleSelect->value(2); - }else if((int)r_softParticles == 1) { - particleSelect->value(1); - }else if((int)r_softParticles == 0){ - particleSelect->value(0); - } - radiosityCheck->value(r_radiosity ? 1 : 0); - bloodCheck->value(cg_blood ? 1 : 0); - - directLightSelect->clear(); - directLightSelect->add("Low"); - directLightSelect->add("Medium"); - directLightSelect->add("High"); - directLightSelect->add("Ultra"); - directLightSelect->add("Custom"); - - if((!r_mapSoftShadow) && (r_dlights) && (!r_modelShadows) && (!r_fogShadow) && (!r_physicalLighting)){ - directLightSelect->value(0); - }else if((!r_mapSoftShadow) && (r_dlights) && (r_modelShadows) && (!r_fogShadow) && (!r_physicalLighting)){ - directLightSelect->value(1); - }else if((r_mapSoftShadow) && (r_dlights) && (r_modelShadows) && (!r_fogShadow) && (r_physicalLighting)){ - directLightSelect->value(2); - }else if((r_mapSoftShadow) && (r_dlights) && (r_modelShadows) && (r_fogShadow) && (r_physicalLighting)){ - directLightSelect->value(3); - }else{ - directLightSelect->value(4); - } - - shaderSelect->clear(); - shaderSelect->add("Low"); - shaderSelect->add("Medium"); - if(shaderHighCapable){ - shaderSelect->add("High"); - } - shaderSelect->add("Custom"); - - if(shaderHighCapable){ - if((!r_water)){ - shaderSelect->value(0); - }else if((int)r_water == 1){ - shaderSelect->value(1); - }else if((int)r_water == 2){ - shaderSelect->value(2); - }else{ - shaderSelect->value(3); - } - }else{ - if((!r_water)){ - shaderSelect->value(0); - }else if((int)r_water == 1){ - shaderSelect->value(1); - }else{ - shaderSelect->value(2); - } - } - - // --- SW graphics - fastModeSelect->clear(); - fastModeSelect->add("1x"); - fastModeSelect->add("2x"); - fastModeSelect->add("4x"); - switch((int)r_swUndersampling) { - case 2: - fastModeSelect->value(1); - break; - case 4: - fastModeSelect->value(2); - break; - default: - fastModeSelect->value(0); - break; - } - - // --- audio - polyInput->step(16.); - polyInput->range(32., 256.); - polyInput->value((int)s_maxPolyphonics); - - audioSelect->clear(); - audioSelect->add("OpenAL"); - audioSelect->add("OpenAL + EAX"); - audioSelect->add("YSR"); - if(spades::EqualsIgnoringCase(s_audioDriver, "ysr")) { - audioSelect->value(2); - }else{ - audioSelect->value(s_eax ? 1 : 0); - } - - // --- game - playerNameInput->value(cg_playerName.CString()); - playerNameInput->maximum_size(15); - -} - -void MainWindow::Init() { - SPADES_MARK_FUNCTION(); - - // banner - std::string data = spades::FileManager::ReadAllBytes("Gfx/Banner.png"); - Fl_PNG_Image *img = new Fl_PNG_Image("Gfx/Banner.png", (const unsigned char *)data.data(), data.size()); - bannerBox->image(img); - - // --- about - std::string text, pkg; - pkg = PACKAGE_STRING; - text = std::string((const char *)aboutText, sizeof(aboutText)); - text = spades::Replace(text, "${PACKAGE_STRING}", pkg); - - aboutView->value(text.c_str()); - - browser = new spades::Serverbrowser( serverListbox ); - spades::ServerFilter::Flags flags = browser->Filter(); - checkFilterEmpty->value( flags & spades::ServerFilter::flt_Empty ); - checkFilterFull->value( flags & spades::ServerFilter::flt_Full ); - checkFilterV75->value( flags & spades::ServerFilter::flt_Ver075 ); - checkFilterV76->value( flags & spades::ServerFilter::flt_Ver076 ); - checkFilterVOther->value( flags & spades::ServerFilter::flt_VerOther ); - //browser->startQuery(); - //mainTab->value(groupServerlist); - //groupServerlist->value(serverListbox); - - mainTab->value(groupAbout); - groupServerlist->hide(); - mainTab->remove(3); -} - -/** This function is called after showing window. - * Creating SDL window before showing MainWindow results in - * internal error on Mac OS X. */ -void MainWindow::CheckGLCapability() { - SPADES_MARK_FUNCTION(); - - // check GL capabilities - - SPLog("Initializing SDL for capability query"); - SDL_Init(SDL_INIT_VIDEO); - - int idDisplay = 0; - - int numDisplayMode = SDL_GetNumDisplayModes(idDisplay); - SDL_DisplayMode mode; - g_modes.clear(); - if(numDisplayMode > 0){ - for(int i = 0; i < numDisplayMode; i++) { - SDL_GetDisplayMode(idDisplay, i, &mode); - if(mode.w < 800 || mode.h < 600) - continue; - g_modes.push_back(spades::IntVector3::Make(mode.w, mode.h, 0)); - SPLog("Video Mode Found: %dx%d", mode.w, mode.h); - } - }else{ - SPLog("Failed to get video mode list. Presetting default list"); - g_modes.push_back(spades::IntVector3::Make(800, 600, 0)); - g_modes.push_back(spades::IntVector3::Make(1024, 768, 0)); - g_modes.push_back(spades::IntVector3::Make(1280, 720, 0)); - g_modes.push_back(spades::IntVector3::Make(1920, 1080, 0)); - } - - - bool capable = true; - std::string msg; - SDL_Window *window = SDL_CreateWindow("Querying OpenGL Capabilities", - 1, 1, 1, 1, - SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); - if(window == nullptr) { - SPLog("Failed to create SDL window: %s", SDL_GetError()); - } - SDL_GLContext context = window ? SDL_GL_CreateContext(window) : nullptr; - if(window != nullptr && context == nullptr) { - SPLog("Failed to create OpenGL context: %s", SDL_GetError()); - } - if(!context){ - // OpenGL initialization failed! - outputGLRenderer->value("N/A"); - outputGLVersion->value("N/A"); - outputGLSLVersion->value("N/A"); - - std::string err = SDL_GetError(); - SPLog("SDL_SetVideoMode failed: %s", err.c_str()); - msg = "OpenGL/SDL couldn't be initialized. " - "Falling back to the software renderer.

" - "Message from SDL
" - + err; - capable = false; - shaderHighCapable = false; - postFilterHighCapable = false; - particleHighCapable = false; - }else{ - - SDL_GL_MakeCurrent(window, context); - - shaderHighCapable = true; - postFilterHighCapable = true; - particleHighCapable = true; - - const char *str; - GLint maxTextureSize; - GLint max3DTextureSize; - GLint maxCombinedTextureUnits; - GLint maxVertexTextureUnits; - GLint maxVaryingComponents; - SPLog("--- OpenGL Renderer Info ---"); - if((str = (const char*)glGetString(GL_VENDOR)) != NULL) { - SPLog("Vendor: %s", str); - } - if((str = (const char *)glGetString(GL_RENDERER)) != NULL) { - outputGLRenderer->value(str); - SPLog("Name: %s", str); - }else{ - outputGLRenderer->value("(unknown)"); - } - if((str = (const char *)glGetString(GL_VERSION)) != NULL) { - double ver = atof(str); - if( ver <= 0.1 ) { //TODO: determine required version! - std::string tmp = str; - tmp += " (too old)"; - outputGLVersion->textcolor( FL_RED ); - outputGLVersion->value( tmp.c_str() ); - capable = false; - }else{ - outputGLVersion->value( str ); - } - SPLog("Version: %s", str); - }else{ - outputGLVersion->value("(unknown)"); - } - if((str = (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION)) != NULL) { - outputGLSLVersion->value(str); - SPLog("Shading Language Version: %s", str); - }else{ - outputGLSLVersion->value("(unknown)"); - } - - maxTextureSize = 0; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); - if(maxTextureSize > 0) { - SPLog("Max Texture Size: %d", (int)maxTextureSize); - } - max3DTextureSize = 0; - glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &max3DTextureSize); - if(max3DTextureSize > 0) { - SPLog("Max 3D Texture Size: %d", (int)max3DTextureSize); - } - - maxCombinedTextureUnits = 0; - glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxCombinedTextureUnits); - if(maxCombinedTextureUnits > 0) { - SPLog("Max Combined Texture Image Units: %d", (int)maxCombinedTextureUnits); - } - - maxVertexTextureUnits = 0; - glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &maxVertexTextureUnits); - if(maxVertexTextureUnits > 0) { - SPLog("Max Vertex Texture Image Units: %d", (int)maxVertexTextureUnits); - } - - maxVaryingComponents = 0; - glGetIntegerv(GL_MAX_VARYING_COMPONENTS, &maxVaryingComponents); - if(maxVaryingComponents > 0) { - SPLog("Max Varying Components: %d", (int)maxVaryingComponents); - } - - str = (const char*)glGetString(GL_EXTENSIONS); - std::string extensions; - if(str) - extensions = str; - const char * const requiredExtensions[] = { - "GL_ARB_multitexture", - "GL_ARB_shader_objects", - "GL_ARB_shading_language_100", - "GL_ARB_texture_non_power_of_two", - "GL_ARB_vertex_buffer_object", - "GL_EXT_framebuffer_object", - NULL - }; - - SPLog("--- Extensions ---"); - std::vector strs = spades::Split(str, " "); - for(size_t i = 0; i < strs.size(); i++) { - SPLog("%s", strs[i].c_str()); - } - SPLog("------------------"); - - for(size_t i = 0; requiredExtensions[i]; i++) { - const char *ex = requiredExtensions[i]; - if(extensions.find(ex) == std::string::npos) { - // extension not found - msg += ""; - msg += ex; - msg += " NOT SUPPORTED!"; - msg += ""; - capable = false; - }else{ - msg += ""; - msg += ex; - msg += " is supported"; - msg += ""; - } - msg += "
"; - } - - msg += "
 
"; - msg += "Other Extensions:
"; - - // non-requred extensions - if(extensions.find("GL_ARB_framebuffer_sRGB") == - std::string::npos) { - if(r_srgb) { - r_srgb = 0; - SPLog("Disabling r_srgb: no GL_ARB_framebuffer_sRGB"); - } - msg += "GL_ARB_framebuffer_sRGB is NOT SUPPORTED
"; - msg += "  r_srgb is disabled.
"; - }else{ - msg += ""; - msg += "GL_ARB_framebuffer_sRGB is supported"; - msg += "
"; - } - if(extensions.find("GL_EXT_framebuffer_blit") == - std::string::npos) { - if(r_blitFramebuffer) { - r_blitFramebuffer = 0; - SPLog("Disabling r_blitFramebuffer: no GL_EXT_framebuffer_blit"); - } - if(r_multisamples) { - r_multisamples = 0; - SPLog("Disabling r_multisamples: no GL_EXT_framebuffer_blit"); - } - msg += "GL_EXT_framebuffer_blit is NOT SUPPORTED
"; - msg += "  MSAA is disabled.
"; - msg += "  r_blitFramebuffer is disabled.
"; - }else{ - msg += ""; - msg += "GL_EXT_framebuffer_blit is supported"; - msg += "
"; - } - if(extensions.find("GL_EXT_texture_filter_anisotropic") == - std::string::npos) { - if((float)r_maxAnisotropy > 1.1f) { - r_maxAnisotropy = 1; - SPLog("Setting r_maxAnisotropy to 1: no GL_EXT_texture_filter_anisotropic"); - } - msg += "GL_EXT_texture_filter_anisotropic is NOT SUPPORTED
"; - msg += "  r_maxAnisotropy is disabled.
"; - }else{ - msg += ""; - msg += "GL_EXT_texture_filter_anisotropic is supported"; - msg += "
"; - } - - if(extensions.find("GL_ARB_occlusion_query") == - std::string::npos) { - if(r_occlusionQuery) { - r_occlusionQuery = 0; - SPLog("Disabling r_occlusionQuery: no GL_ARB_occlusion_query"); - } - msg += "GL_ARB_occlusion_query is NOT SUPPORTED
"; - msg += "  r_occlusionQuery is disabled
"; - }else{ - msg += ""; - msg += "GL_ARB_occlusion_query is supported"; - msg += "
"; - } - - if(extensions.find("GL_NV_conditional_render") == - std::string::npos) { - if(r_occlusionQuery) { - r_occlusionQuery = 0; - SPLog("Disabling r_occlusionQuery: no GL_NV_conditional_render"); - } - msg += "GL_NV_conditional_render is NOT SUPPORTED
"; - msg += "  r_occlusionQuery is disabled
"; - }else{ - msg += ""; - msg += "GL_NV_conditional_render is supported"; - msg += "
"; - } - - msg += "
 
"; - msg += "Miscellaneous:
"; - char buf[256]; - sprintf(buf, "Max Texture Size: %d
", (int)maxTextureSize); - msg += buf; - if(maxTextureSize < 1024) { - capable = false; - msg += ""; - msg += "  TOO SMALL (1024 required)"; - msg += "
"; - } - if((int)r_shadowMapSize > maxTextureSize) { - SPLog("Changed r_shadowMapSize from %d to %d: too small GL_MAX_TEXTURE_SIZE", (int)r_shadowMapSize, maxTextureSize); - - r_shadowMapSize = maxTextureSize; - } - - sprintf(buf, "Max 3D Texture Size: %d
", (int)max3DTextureSize); - msg += buf; - if(max3DTextureSize < 512) { - msg += "  Global Illumation is disabled (512 required)
"; - - if(r_radiosity) { - r_radiosity = 0; - SPLog("Disabling r_radiosity: too small GL_MAX_3D_TEXTURE_SIZE"); - - radiosityCheck->deactivate(); - } - } - - - sprintf(buf, "Max Combined Texture Image Units: %d
", (int)maxCombinedTextureUnits); - msg += buf; - if(maxCombinedTextureUnits < 12) { - msg += "  Global Illumation is disabled (12 required)
"; - - if(r_radiosity) { - r_radiosity = 0; - SPLog("Disabling r_radiosity: too small GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS"); - - radiosityCheck->deactivate(); - } - } - - sprintf(buf, "Max Vertex Texture Image Units: %d
", (int)maxVertexTextureUnits); - msg += buf; - if(maxVertexTextureUnits < 3) { - msg += "  Water 2 is disabled (3 required)
"; - msg += "  (Shader Effects is limited to Medium)
"; - shaderHighCapable = false; - - if((int)r_water >= 2) { - r_water = 1; - SPLog("Disabling Water 2: too small GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS"); - } - } - - sprintf(buf, "Max Varying Components: %d
", (int)maxVaryingComponents); - msg += buf; - if(maxVaryingComponents < 37) { - msg += "  Shaded Particle is disabled (37 required)
"; - msg += "  (Particle is limited to Medium)
"; - particleHighCapable = false; - - if((int)r_softParticles >= 2) { - r_softParticles = 1; - SPLog("Disabling Water 2: too small GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS"); - } - } - - - - if(capable){ - msg = "Your video card supports all " - "required OpenGL extensions/features.
 
" + msg; - }else{ - msg = "Your video card/driver doesn't support " - "at least one of required OpenGL extensions/features." - " Falling back to the software renderer.
 
" + msg; - } - - SDL_GL_DeleteContext(context); - SDL_DestroyWindow(window); - - SPLog("SDL Capability Query Window finalized"); - - } - msg = "" + msg + ""; - - glInfoView->value(msg.c_str()); - - - SPLog("OpenGL driver is OpenSpades capable: %s", - capable ? "YES": "NO"); - glCapable = capable; - if(!glCapable) { - if(spades::EqualsIgnoringCase(r_renderer, "gl")){ - SPLog("Switched to software renderer"); - r_renderer = "sw"; - } - } - - LoadPrefs(); - - inited = true; -} - -void MainWindow::SavePrefs() { - SPADES_MARK_FUNCTION(); - if(!inited) - return; - - std::string modeStr = modeSelect->value(); - size_t pos = modeStr.find('x'); - if(pos != std::string::npos){ - int w = atoi(modeStr.substr(0, pos).c_str()); - int h = atoi(modeStr.substr(pos + 1).c_str()); - if(w >= 256 && h >= 256){ - r_videoWidth = w; - r_videoHeight = h; - } - } - - r_vsync = verticalSyncCheck->value() ? 1 : 0; - - if((int)cl_showStartupWindow == -1){ - if(!bypassStartupCheck->value()) { - cl_showStartupWindow = 1; - } - }else{ - cl_showStartupWindow = bypassStartupCheck->value() ? 0 : 1; - } - - cg_lastQuickConnectHost = quickHostInput->value(); - cg_protocolVersion = versionChoice->value() + 3; //0 = 3 = 0.75, 1 = 4 = 0.76 - r_fullscreen = fullscreenCheck->value() ? 1 : 0; - switch(msaaSelect->value()){ - case 0: r_multisamples = 0; r_fxaa = 0; break; - case 1: r_multisamples = 2; r_fxaa = 0; break; - case 2: r_multisamples = 4; r_fxaa = 0; break; - case 3: r_multisamples = 0; r_fxaa = 1; break; - } - - // --- graphics - switch(rendererSelect->value()) { - case 1: - r_renderer = "gl"; - break; - case 0: - r_renderer = "sw"; - break; - } - cg_blood = bloodCheck->value() ? 1 : 0; - switch(postFilterSelect->value()){ - case 0: - r_bloom = 0; - r_lens = 0; - r_lensFlare = 0; - r_lensFlareDynamic = 0; - r_cameraBlur = 0; - r_colorCorrection = 0; - r_depthOfField = 0; - break; - case 1: - r_bloom = 0; - r_lens = 1; - r_lensFlare = 1; - r_lensFlareDynamic = 0; - r_cameraBlur = 1; - r_colorCorrection = 1; - r_depthOfField = 0; - break; - case 2: - if(postFilterHighCapable){ - r_bloom = 1; - r_lens = 1; - r_lensFlare = 1; - r_lensFlareDynamic = 1; - r_cameraBlur = 1; - r_colorCorrection = 1; - r_depthOfField = 1; - } - break; - } - switch(particleSelect->value()){ - case 0: - r_softParticles = 0; - break; - case 1: - r_softParticles = 1; - break; - case 2: - if(particleHighCapable){ - r_softParticles = 2; - } - break; - } - r_radiosity = radiosityCheck->value() ? 1 : 0; - switch(directLightSelect->value()){ - case 0: - r_modelShadows = 0; - r_dlights = 1; - r_mapSoftShadow = 0; - r_fogShadow = 0; - r_physicalLighting = 0; - break; - case 1: - r_modelShadows = 1; - r_dlights = 1; - r_mapSoftShadow = 0; - r_fogShadow = 0; - r_physicalLighting = 0; - break; - case 2: - r_modelShadows = 1; - r_dlights = 1; - r_mapSoftShadow = 1; - r_fogShadow = 0; - r_physicalLighting = 1; - break; - case 3: - r_modelShadows = 1; - r_dlights = 1; - r_mapSoftShadow = 1; - r_fogShadow = 1; - r_physicalLighting = 1; - break; - } - if(shaderHighCapable){ - switch(shaderSelect->value()){ - case 0: - r_water = 0; - break; - case 1: - r_water = 1; - break; - case 2: - r_water = 2; - break; - } - }else{ - switch(shaderSelect->value()){ - case 0: - r_water = 0; - break; - case 1: - r_water = 1; - break; - } - } - switch(fastModeSelect->value()){ - case 0: - r_swUndersampling = 1; - break; - case 1: - r_swUndersampling = 2; - break; - case 2: - r_swUndersampling = 4; - break; - } - - // --- audio - s_maxPolyphonics = (int)polyInput->value(); - switch(audioSelect->value()){ - case 0: - s_audioDriver = "openal"; - s_eax = 0; - break; - case 1: - s_audioDriver = "openal"; - s_eax = 1; - break; - case 2: - s_audioDriver = "ysr"; - s_eax = 1; - break; - } - - // --- game - cg_playerName = playerNameInput->value(); - - swRendererGroup->hide(); - glRendererGroup->hide(); - if(spades::EqualsIgnoringCase(r_renderer, "sw")) { - swRendererGroup->show(); - rendererSelect->value(0); - }else if(spades::EqualsIgnoringCase(r_renderer, "gl")) { - glRendererGroup->show(); - rendererSelect->value(1); - } -} - -void MainWindow::DisableMSAA() { - if(r_blitFramebuffer){ - if(msaaSelect->value() >= 1 && msaaSelect->value() <= 2) - msaaSelect->value(3); - } -} - -void MainWindow::MSAAEnabled() { - if(msaaSelect->value() >= 1 && - msaaSelect->value() <= 2 && - r_blitFramebuffer){ - if(shaderSelect->value() == 1) - shaderSelect->value(0); - if(directLightSelect->value() == 3) - directLightSelect->value(2); - } -} - -void MainWindow::OpenDetailConfig() { - SPADES_MARK_FUNCTION(); - - DetailConfigWindow cfg; - cfg.icon( icon() ); //use the icon from the main window - cfg.set_modal(); - cfg.show(); - while(cfg.visible()){ - Fl::wait(); - } - LoadPrefs(); -} - -void MainWindow::ServerSelectionChanged() -{ - SPADES_MARK_FUNCTION(); - if( browser ) { - int item = serverListbox->value(); - if( item > 1 ) { - browser->onSelection( serverListbox->data( item ), quickHostInput, versionChoice ); - } else if( item == 1 ) { - browser->onHeaderClick( Fl::event_x() - serverListbox->x() ); - } - } -} - -void MainWindow::updateFilters() -{ - if( browser ) { - spades::ServerFilter::Flags flags = spades::ServerFilter::flt_None; - if( checkFilterEmpty->value() ) { - flags |= spades::ServerFilter::flt_Empty; - } - if( checkFilterFull->value() ) { - flags |= spades::ServerFilter::flt_Full; - } - if( checkFilterV75->value() ) { - flags |= spades::ServerFilter::flt_Ver075; - } - if( checkFilterV76->value() ) { - flags |= spades::ServerFilter::flt_Ver076; - } - if( checkFilterVOther->value() ) { - flags |= spades::ServerFilter::flt_VerOther; - } - browser->setFilter( flags ); - browser->refreshList(); - } -} -