]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Appveyor
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 20 Feb 2016 05:04:48 +0000 (16:04 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 20 Feb 2016 05:36:37 +0000 (16:36 +1100)
16 files changed:
CMakeLists.txt
appveyor.yml [new file with mode: 0644]
libs/gtkutil/filechooser.cpp
libs/l_net/l_net_wins.c
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/console.cpp
radiant/gtkdlgs.cpp
radiant/main.cpp
radiant/patch.h
radiant/preferences.cpp
radiant/qe3.cpp
radiant/texwindow.cpp
radiant/url.cpp
radiant/watchbsp.cpp
radiant/xywindow.cpp

index 74e26787847b9845f08116bf64c1350e737e7c5e..59ea517e83175aae2b5302e308ab43909b1e2c80 100644 (file)
@@ -82,7 +82,8 @@ if (NOT WIN32)
     include_directories(${X11_INCLUDE_DIR})
 else ()
     add_definitions(
-            -D_WIN32
+            -DWIN32=1
+            -D_WIN32=1
     )
 endif ()
 
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644 (file)
index 0000000..dab50ed
--- /dev/null
@@ -0,0 +1,28 @@
+platform: x64
+
+shallow_clone: true
+
+install:
+  - set "PATH=C:\msys64\usr\bin;%PATH%"
+  - bash -lc "pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime msys2-runtime-devel"
+  - ps: >-
+      bash -lc @"
+        exec 0</dev/null 2>&1
+        pacman --noconfirm -Su
+        pacman --noconfirm --needed -S base-devel mingw-w64-x86_64-{toolchain,clang,cmake,gtk2,gtkglext}
+      "@
+
+build_script:
+  - set HOME=.
+  - set MSYSTEM=MINGW64
+  - ps: >-
+      bash -lc @"
+        set -e
+        exec 0</dev/null 2>&1
+        # export CC=clang
+        # export CXX=clang++
+        mkdir build && cd build
+        cmake --version
+        cmake -G 'MSYS Makefiles' .. -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw64/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw64/lib/gtk-2.0/include
+        cmake --build . --target radiant
+      "@
index 177e752eee7a9fb31d6d0d8ef774d7ae14aebaa6..46cc3f8b07cd9eba6b864d0cc1039696f4853dfd 100644 (file)
@@ -263,7 +263,7 @@ const char* file_dialog( ui::Widget parent, bool open, const char* title, const
                if ( open
                         || file == nullptr
                         || !file_exists( file )
-                        || parent.alert("The file specified already exists.\nDo you want to replace it?", title, ui::alert_type::NOYES, ui::alert_icon::QUESTION ) == ui::alert_response::YES ) {
+                        || parent.alert("The file specified already exists.\nDo you want to replace it?", title, ui::alert_type::NOYES, ui::alert_icon::Question ) == ui::alert_response::YES ) {
                        return file;
                }
        }
index c47ff26590378de083882d8b5890d544e10fd62b..436a9929947daf057aa96121847873a2fae2da08 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <windows.h>
 #include <stdio.h>
-#include <cstdlib>
 #include <string.h>
 #include "l_net.h"
 #include "l_net_wins.h"
index a567a531e58e53d8986d0b71c22d29510e2b9ae8..eb49165a8969a7834150db2929ef0eb3c6de289e 100644 (file)
@@ -34,11 +34,11 @@ namespace ui {
                                   type == alert_type::YESNOCANCEL ? eMB_YESNOCANCEL :
                                   type == alert_type::NOYES ? eMB_NOYES :
                                   eMB_OK,
-                                  icon == alert_icon::DEFAULT ? eMB_ICONDEFAULT :
-                                  icon == alert_icon::ERROR ? eMB_ICONERROR :
-                                  icon == alert_icon::WARNING ? eMB_ICONWARNING :
-                                  icon == alert_icon::QUESTION ? eMB_ICONQUESTION :
-                                  icon == alert_icon::ASTERISK ? eMB_ICONASTERISK :
+                                  icon == alert_icon::Default ? eMB_ICONDEFAULT :
+                                  icon == alert_icon::Error ? eMB_ICONERROR :
+                                  icon == alert_icon::Warning ? eMB_ICONWARNING :
+                                  icon == alert_icon::Question ? eMB_ICONQUESTION :
+                                  icon == alert_icon::Asterisk ? eMB_ICONASTERISK :
                                   eMB_ICONDEFAULT
         );
         return
index 96a6ddce257fedfa1d35841127965a9fa7d4237e..562d0b084c15d06c644bc6f8acbf00d6bfe467e6 100644 (file)
@@ -55,11 +55,11 @@ namespace ui {
     };
 
     enum class alert_icon {
-        DEFAULT,
-        ERROR,
-        WARNING,
-        QUESTION,
-        ASTERISK,
+        Default,
+        Error,
+        Warning,
+        Question,
+        Asterisk,
     };
 
     enum class alert_response {
@@ -116,7 +116,7 @@ namespace ui {
         { }
 
         alert_response alert(std::string text, std::string title = "NetRadiant",
-                             alert_type type = alert_type::OK, alert_icon icon = alert_icon::DEFAULT);
+                             alert_type type = alert_type::OK, alert_icon icon = alert_icon::Default);
 
         const char *file_dialog(bool open, const char *title, const char *path = nullptr,
                                 const char *pattern = nullptr, bool want_load = false, bool want_import = false,
index 8ca6f2ef96c61ae981b357bd65aefc28f010b728..34627fd819f5197927bf23b152ae554f540da1e1 100644 (file)
@@ -70,7 +70,7 @@ void Sys_LogFile( bool enable ){
                }
                else{
                        ui::root.alert( "Failed to create log file, check write permissions in Radiant directory.\n",
-                                                       "Console logging", ui::alert_type::OK, ui::alert_icon::ERROR );
+                                                       "Console logging", ui::alert_type::OK, ui::alert_icon::Error );
                }
        }
        else if ( !enable && g_hLogFile != 0 ) {
index be8a56d59560084b643443ef33544924b86b404f..3c5a74b7739bb2255e38a621909f55b85a8ceb80 100644 (file)
@@ -699,7 +699,7 @@ static ui::Widget text_editor;
 static ui::Widget text_widget; // slave, text widget from the gtk editor
 
 static gint editor_delete( ui::Widget widget, gpointer data ){
-       if ( widget.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::QUESTION ) == ui::alert_response::NO ) {
+       if ( widget.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return TRUE;
        }
 
@@ -723,7 +723,7 @@ static void editor_save( ui::Widget widget, gpointer data ){
 }
 
 static void editor_close( ui::Widget widget, gpointer data ){
-       if ( text_editor.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::QUESTION ) == ui::alert_response::NO ) {
+       if ( text_editor.alert( "Close the shader editor ?", "Radiant", ui::alert_type::YESNO, ui::alert_icon::Question ) == ui::alert_response::NO ) {
                return;
        }
 
@@ -1040,7 +1040,7 @@ void DoTextEditor( const char* filename, int cursorpos ){
 #ifdef WIN32
        if ( g_TextEditor_useWin32Editor ) {
                globalOutputStream() << "opening file '" << filename << "' (line " << cursorpos << " info ignored)\n";
-               ShellExecute( (HWND)GDK_WINDOW_HWND( GTK_WIDGET( MainFrame_getWindow() )->window ), "open", filename, 0, 0, SW_SHOW );
+               ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( MainFrame_getWindow() ) ), "open", filename, 0, 0, SW_SHOW );
                return;
        }
 #else
index d7e2d4671f422e168d39dbaa68032a6481e0d272..b28ab9f8398e8ebb5189a4fea97dbd7d9dcffd7f 100644 (file)
@@ -310,12 +310,12 @@ bool handleMessage(){
                ScopedLock lock( m_lock );
 #if defined _DEBUG
                m_buffer << "Break into the debugger?\n";
-               bool handled = ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::YESNO, ui::alert_icon::ERROR ) == ui::alert_response::NO;
+               bool handled = ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::YESNO, ui::alert_icon::Error ) == ui::alert_response::NO;
                m_buffer.clear();
                return handled;
 #else
                m_buffer << "Please report this error to the developers\n";
-               ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::OK, ui::alert_icon::ERROR );
+               ui::root.alert( m_buffer.c_str(), "Radiant - Runtime Error", ui::alert_type::OK, ui::alert_icon::Error );
                m_buffer.clear();
 #endif
        }
@@ -440,7 +440,7 @@ void create_global_pid(){
                if ( remove( g_pidFile.c_str() ) == -1 ) {
                        StringOutputStream msg( 256 );
                        msg << "WARNING: Could not delete " << g_pidFile.c_str();
-                       ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::ERROR );
+                       ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
                }
 
                // in debug, never prompt to clean registry, turn console logging auto after a failed start
@@ -481,7 +481,7 @@ void remove_global_pid(){
        if ( remove( g_pidFile.c_str() ) == -1 ) {
                StringOutputStream msg( 256 );
                msg << "WARNING: Could not delete " << g_pidFile.c_str();
-               ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::ERROR );
+               ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
        }
 }
 
@@ -499,7 +499,7 @@ void create_local_pid(){
                if ( remove( g_pidGameFile.c_str() ) == -1 ) {
                        StringOutputStream msg;
                        msg << "WARNING: Could not delete " << g_pidGameFile.c_str();
-                       ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::ERROR );
+                       ui::root.alert( msg.c_str(), "Radiant", ui::alert_type::OK, ui::alert_icon::Error );
                }
 
                // in debug, never prompt to clean registry, turn console logging auto after a failed start
index 9e1bb16d99f085cf74b131ab63c25898ed5e3fe2..b5c0c480cd6fa66928e09af6e5dbe42d37ed3b77 100644 (file)
@@ -30,6 +30,8 @@
 /// The surface is recursively tesselated until the angle between each triangle
 /// edge is smaller than a specified tolerance.
 
+#define _USE_MATH_DEFINES
+#include <math.h>
 
 #include "nameable.h"
 #include "ifilter.h"
index efb976434759d3ec8119ab5e8bd4ecdb0e656904..3cb542adde27b0fe70f8d4431f1fc2b1d7b11005 100644 (file)
@@ -489,7 +489,7 @@ static void OnButtonClean( ui::Widget widget, gpointer data ){
        // make sure this is what the user wants
        if ( ui::Widget(GTK_WIDGET( g_Preferences.GetWidget() )).alert( "This will close Radiant and clean the corresponding registry entries.\n"
                                                                                                                                  "Next time you start Radiant it will be good as new. Do you wish to continue?",
-                                                "Reset Registry", ui::alert_type::YESNO, ui::alert_icon::ASTERISK ) == ui::alert_response::YES ) {
+                                                "Reset Registry", ui::alert_type::YESNO, ui::alert_icon::Asterisk ) == ui::alert_response::YES ) {
                PrefsDlg *dlg = (PrefsDlg*)data;
                dlg->EndModal( eIDCANCEL );
 
index 02386ca4726ffb969487e065fea1d824ad13460f..5ccc8fde3209b1b351ada26b8659ee3e8e8c1c81 100644 (file)
@@ -141,7 +141,7 @@ bool ConfirmModified( const char* title ){
                return true;
        }
 
-       auto result = MainFrame_getWindow().alert( "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::QUESTION );
+       auto result = MainFrame_getWindow().alert( "The current map has changed since it was last saved.\nDo you want to save the current map before continuing?", title, ui::alert_type::YESNOCANCEL, ui::alert_icon::Question );
        if ( result == ui::alert_response::CANCEL ) {
                return false;
        }
index 2739f866dbcf9ea8b1e1e9a9df3e8da10c04a29d..ce3bf0f8a86aa81276940a0f666e15c2df3372c0 100644 (file)
@@ -2271,7 +2271,7 @@ void TextureBrowser_deleteTag(){
        gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected );
 
        if ( g_slist_length( selected ) == 1 ) { // we only delete a single tag
-               auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::QUESTION );
+               auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "Are you sure you want to delete the selected tag?", "Delete Tag", ui::alert_type::YESNO, ui::alert_icon::Question );
 
                if ( result == ui::alert_response::YES ) {
                        GtkTreeIter iterSelected;
@@ -2392,7 +2392,7 @@ void TextureBrowser_showAll(){
 }
 
 void TextureBrowser_showUntagged(){
-       auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::WARNING );
+       auto result = ui::Widget(GTK_WIDGET( g_TextureBrowser.m_parent )).alert( "WARNING! This function might need a lot of memory and time. Are you sure you want to use it?", "Show Untagged", ui::alert_type::YESNO, ui::alert_icon::Warning );
 
        if ( result == ui::alert_response::YES ) {
                g_TextureBrowser.m_found_shaders.clear();
index 1885f44b8759a267c61b1aadacfe9096cb9ae0ab..5bda229a966e1703d88c96e8d3728bee68aa58b1 100644 (file)
@@ -28,7 +28,7 @@
 #include <gdk/gdkwin32.h>
 #include <shellapi.h>
 bool open_url( const char* url ){
-       return ShellExecute( (HWND)GDK_WINDOW_HWND( GTK_WIDGET( MainFrame_getWindow() )->window ), "open", url, 0, 0, SW_SHOW ) > (HINSTANCE)32;
+       return ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( MainFrame_getWindow() ) ), "open", url, 0, 0, SW_SHOW ) > (HINSTANCE)32;
 }
 #endif
 
index b66a33a82e5d03402cdd34552d14d75890abe58d..1725dc860858b10130e2b838c4f0167529fa27a4 100644 (file)
@@ -520,7 +520,7 @@ void CWatchBSP::DoEBeginStep(){
        if ( SetupListening() == false ) {
                const char* msg = "Failed to get a listening socket on port 39000.\nTry running with Build monitoring disabled if you can't fix this.\n";
                globalOutputStream() << msg;
-               MainFrame_getWindow().alert( msg, "Build monitoring", ui::alert_type::OK, ui::alert_icon::ERROR );
+               MainFrame_getWindow().alert( msg, "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
                return;
        }
        // set the timer for timeouts and step cancellation
@@ -537,7 +537,7 @@ void CWatchBSP::DoEBeginStep(){
                        msg << reinterpret_cast<const char*>( g_ptr_array_index( m_pCmd, m_iCurrentStep ) );
                        msg << "\nCheck that the file exists and that you don't run out of system resources.\n";
                        globalOutputStream() << msg.c_str();
-                       MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::ERROR );
+                       MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
                        return;
                }
                // re-initialise the debug window
@@ -750,7 +750,7 @@ void CWatchBSP::RoutineProcessing(){
                                                        StringOutputStream msg;
                                                        msg << "Failed to execute the following command: " << cmd.c_str() << cmdline.c_str();
                                                        globalOutputStream() << msg.c_str();
-                                                       MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::ERROR );
+                                                       MainFrame_getWindow().alert( msg.c_str(), "Build monitoring", ui::alert_type::OK, ui::alert_icon::Error );
                                                }
                                        }
                                        EndMonitoringLoop();
index abebef5d7435f922ade76a838d09b87b171a2433..528d52ec171264c9a2dc3e0af723d50c42b53420 100644 (file)
@@ -1488,7 +1488,7 @@ void WXY_BackgroundSelect( void ){
        bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0;
        if ( !brushesSelected ) {
                ui::root.alert( "You have to select some brushes to get the bounding box for.\n",
-                                               "No selection", ui::alert_type::OK, ui::alert_icon::ERROR );
+                                               "No selection", ui::alert_type::OK, ui::alert_icon::Error );
                return;
        }