]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Cmake cleanup
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 19 Feb 2016 05:48:54 +0000 (16:48 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 19 Feb 2016 05:48:54 +0000 (16:48 +1100)
28 files changed:
CMakeLists.txt
README.md
libs/CMakeLists.txt
libs/_.cpp [new file with mode: 0644]
libs/container/hashfunc.h
libs/gtkutil/image.cpp
libs/l_net/l_net.c
libs/math/CMakeLists.txt
libs/math/_.cpp [new file with mode: 0644]
libs/os/CMakeLists.txt
libs/os/_.cpp [new file with mode: 0644]
libs/picomodel/pm_fm.c
libs/picomodel/pm_md2.c
libs/script/CMakeLists.txt
libs/script/_.cpp [new file with mode: 0644]
libs/splines/math_quaternion.h
libs/stream/CMakeLists.txt
libs/stream/_.cpp [new file with mode: 0644]
radiant/CMakeLists.txt
radiant/build.cpp
radiant/console.cpp
radiant/entitylist.cpp
radiant/groupdialog.cpp
radiant/mainframe.cpp
radiant/patchdialog.cpp
radiant/qgl.cpp
radiant/scenegraph.h
radiant/server.cpp

index edd4f254c0d906a8545709e38657404d4f27fe64..74e26787847b9845f08116bf64c1350e737e7c5e 100644 (file)
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
 
 project(NetRadiant C CXX)
 
index c0fb8671e4543815dd1ef3157d40f6a2f85f5a08..ff836cc363ba5ca6790006ae740285110d4df23d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ See also https://gitlab.com/xonotic/netradiant/ for a source browser, issues and
 
 This project uses the usual CMake workflow:
 
-    mkdir build && cd build && cmake .. && make
+    mkdir build && cd build && cmake .. && cmake --build .
 
 ## linux
 
@@ -44,13 +44,12 @@ cmake --build . -- -j$(nproc)
 
 ## msys2
 
-`base-devel`
+`pacman -S --needed base-devel`
 
 ### 32 bit:
 
 ```
-pacman -S mingw-w64-i686-{toolchain,cmake}
-pacman -S mingw-w64-i686-{gtk2,gtkglext}
+pacman -S --needed mingw-w64-i686-{toolchain,cmake,gtk2,gtkglext}
 mkdir build && cd build
 cmake -G "MSYS Makefiles" .. -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw32/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw32/lib/gtk-2.0/include
 cmake --build . -- -j$(nproc)
@@ -59,8 +58,7 @@ cmake --build . -- -j$(nproc)
 ### 64 bit:
 
 ```
-pacman -S mingw-w64-x86_64-{toolchain,cmake}
-pacman -S mingw-w64-x86_64-{gtk2,gtkglext}
+pacman -S mingw-w64-x86_64-{toolchain,cmake,gtk2,gtkglext}
 mkdir build && cd build
 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 . -- -j$(nproc)
@@ -77,13 +75,13 @@ options:
 
 targets:
  * `radiant`    Compiles the radiant core binary
- * `plugins`    Compiles all plugins (each plugin has its own target as well)
  * `modules`    Compiles all modules (each module has its own target as well)
+ * `plugins`    Compiles all plugins (each plugin has its own target as well)
  * `game_packs` Downloads the game pack data
  * `quake3`     Compiles all the Quake3 tools
-   - `q3map2`    Quake3 map compiler
+   - `q3map2`     Quake3 map compiler
    - `q3data`
  * `quake2`     Compiles all the Quake2 tools (Note: needs to be compiled explicitly)
-   - `q2map`     Quake2 map compiler
+   - `q2map`      Quake2 map compiler
    - `q2data`
    - `h2data`
index cb751a0f2db9f15b15bcc4816d34156251f3971b..c5434fc8607f26ac1253fb05a5dc3938c67d6a73 100644 (file)
@@ -29,6 +29,7 @@ add_subdirectory(uilib)
 add_subdirectory(xml)
 
 add_library(libs
+        _.cpp
         archivelib.h
         bytebool.h
         bytestreamutils.h
@@ -44,7 +45,6 @@ add_library(libs
         instancelib.h
         maplib.h
         moduleobservers.h
-        picomodel/picomodel.h
         pivot.h
         render.h
         scenelib.h
@@ -60,7 +60,6 @@ add_library(libs
         uniquenames.h
         versionlib.h
         )
-set_target_properties(libs PROPERTIES LINKER_LANGUAGE CXX)
 
 find_package(GLIB REQUIRED)
 target_include_directories(libs PRIVATE ${GLIB_INCLUDE_DIRS})
diff --git a/libs/_.cpp b/libs/_.cpp
new file mode 100644 (file)
index 0000000..e69de29
index 59a34c7d991c6e3e7ad417cde501147c2a6ecf2c..a9790b49a59239299d95e2ad97feba68c955daf2 100644 (file)
@@ -182,7 +182,7 @@ inline ub4 hash(
        const UB1Traits& ub1traits,
        const UB4x1Traits& ub4x1traits
        ){
-       register ub4 a,b,c,len;
+       ub4 a,b,c,len;
 
        /* Set up the internal state */
        len = length;
@@ -240,7 +240,7 @@ inline ub4 hash2(
        ub4 initval, /* the previous hash, or an arbitrary value */
        const UB4Traits& ub4traits
        ){
-       register ub4 a,b,c,len;
+       ub4 a,b,c,len;
 
        /* Set up the internal state */
        len = length;
index dd723bfe2fbfbfb00e0049114a45aace05078b8d..f1f9b8b1efebfa981d98ee5ccdf6f4dc144eb13b 100644 (file)
@@ -45,7 +45,7 @@ GdkPixbuf* pixbuf_new_from_file_with_mask( const char* filename ){
        else
        {
                GdkPixbuf* rgba = gdk_pixbuf_add_alpha( rgb, FALSE, 255, 0, 255 );
-               gdk_pixbuf_unref( rgb );
+               g_object_unref( rgb );
                return rgba;
        }
 }
@@ -58,7 +58,7 @@ GtkImage* image_new_from_file_with_mask( const char* filename ){
        else
        {
                GtkImage* image = GTK_IMAGE( gtk_image_new_from_pixbuf( rgba ) );
-               gdk_pixbuf_unref( rgba );
+               g_object_unref( rgba );
                return image;
        }
 }
index caf6c4228d9aff64d892d2d21779ca61b1f2516c..7f50d054b94a1f0d10c8b6e14ea5881c011f6700 100644 (file)
@@ -51,7 +51,7 @@ void WinPrint( const char *str, ... ){
        vsprintf( text, str, argptr );
        va_end( argptr );
 
-       printf( text );
+       printf( "%s", text );
 }
 #else
 void WinPrint( const char *str, ... ){
index 1520e48b323e8647539d21e9bdb0d33978ebbac7..d070db1b92a7905c3a6ee6f237fca53b7414d24e 100644 (file)
@@ -1,4 +1,5 @@
 add_library(math
+        _.cpp
         aabb.h
         curve.h
 #        expression.cpp expression.h
@@ -10,4 +11,3 @@ add_library(math
         quaternion.h
         vector.h
         )
-set_target_properties(math PROPERTIES LINKER_LANGUAGE CXX)
diff --git a/libs/math/_.cpp b/libs/math/_.cpp
new file mode 100644 (file)
index 0000000..e69de29
index 5978d980ea97eee5eb3a7c2b7e9c646ef989386e..cba5ec01e061e010757b7f60c480ffbb6e2d15ea 100644 (file)
@@ -1,10 +1,9 @@
 add_library(os
+        _.cpp
         dir.h
         file.h
         path.h
         )
-set_target_properties(os PROPERTIES LINKER_LANGUAGE CXX)
 
 find_package(GLIB REQUIRED)
 target_include_directories(os PRIVATE ${GLIB_INCLUDE_DIRS})
-
diff --git a/libs/os/_.cpp b/libs/os/_.cpp
new file mode 100644 (file)
index 0000000..e69de29
index eefee2e7d64f38377d3b714fbe7afbfc2809c8d4..2d6e3e8e805fcc0a7b2cf60de1e48a408341fd53 100644 (file)
@@ -447,7 +447,7 @@ static picoModel_t *_fm_load( PM_PARAMS_LOAD ){
 #endif
                                continue;
                        }
-                       else if ( ( p_index_LUT[triangle->index_xyz[j]].next == NULL ) ) { // Not equal to Main entry, and no LL entry
+                       else if ( p_index_LUT[triangle->index_xyz[j]].next == NULL ) { // Not equal to Main entry, and no LL entry
                                // Add first entry of LL from Main
                                p_index_LUT2 = (index_LUT_t *)_pico_alloc( sizeof( index_LUT_t ) );
                                if ( p_index_LUT2 == NULL ) {
index 28cf384e965c918366e0e749fe0f25d3e97cad66..e6459914cd398626dd0773c0bb7617c9603cb04c 100644 (file)
@@ -499,7 +499,7 @@ static picoModel_t *_md2_load( PM_PARAMS_LOAD ){
                                continue;
                        }
 
-                       else if ( ( p_index_LUT[p_md2Triangle->index_xyz[j]].next == NULL ) ) { // Not equal to Main entry, and no LL entry
+                       else if ( p_index_LUT[p_md2Triangle->index_xyz[j]].next == NULL ) { // Not equal to Main entry, and no LL entry
                                // Add first entry of LL from Main
                                p_index_LUT2 = (index_LUT_t *)_pico_alloc( sizeof( index_LUT_t ) );
                                if ( p_index_LUT2 == NULL ) {
index b3fd71409fb132616843226230ddb6195a122a87..6e49527df0766e53fe87b3bddc694067ecb5c91d 100644 (file)
@@ -1,5 +1,5 @@
 add_library(script
+        _.cpp
         scripttokeniser.h
         scripttokenwriter.h
         )
-set_target_properties(script PROPERTIES LINKER_LANGUAGE CXX)
diff --git a/libs/script/_.cpp b/libs/script/_.cpp
new file mode 100644 (file)
index 0000000..e69de29
index 8632661df914fbfb622b63ce134ee416ddb1eef9..b33f4425d28c2b6b660df07058c1ff1d56cd480b 100644 (file)
@@ -157,7 +157,7 @@ inline int operator==( quat_t a, quat_t b ) {
 }
 
 inline int operator!=( quat_t a, quat_t b ) {
-       return ( ( a.x != b.x ) || ( a.y != b.y ) || ( a.z != b.z ) && ( a.w != b.w ) );
+       return ( ( a.x != b.x ) || ( a.y != b.y ) || (( a.z != b.z ) && ( a.w != b.w )) );
 }
 
 inline float quat_t::Length( void ) {
index a37c45914f1f5be031fdea5caa4d769975f78dc5..6ce79395bbb02937f8eab135bab9a1ab38f10738 100644 (file)
@@ -1,8 +1,8 @@
 add_library(stream
+        _.cpp
         filestream.h
         memstream.h
         stringstream.h
         textfilestream.h
         textstream.h
         )
-set_target_properties(stream PROPERTIES LINKER_LANGUAGE CXX)
diff --git a/libs/stream/_.cpp b/libs/stream/_.cpp
new file mode 100644 (file)
index 0000000..e69de29
index 452407e1f07eab0850aabb8ced4f01decbd3d964..b0032207d175cc5168e3a45a10690654b95034a4 100644 (file)
@@ -189,6 +189,7 @@ target_link_libraries(radiant
     ${LIBXML2_LIBRARIES}
     ${OPENGL_gl_LIBRARY}
     ${GTK2_LIBRARIES}
+    ${GTK2_PANGO_LIBRARY}
     ${GTKGL_LIBRARIES}
     includes
     cmdlib
@@ -216,3 +217,6 @@ target_link_libraries(radiant
     uilib
     xmllib
 )
+if (X11_LIBRARIES)
+    target_link_libraries(radiant ${X11_LIBRARIES})
+endif ()
index 0e85d94286958319d42fe92c27d67e3e9aa07e65..f6826353ba8aab3910d8a576fff5d5ccb7003c18 100644 (file)
@@ -877,7 +877,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
 
                                        auto renderer = ui::CellRendererText();
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
-                                       g_signal_connect( renderer, "edited", G_CALLBACK( project_cell_edited ), &projectList );
+                                       g_signal_connect( G_OBJECT(renderer), "edited", G_CALLBACK( project_cell_edited ), &projectList );
 
                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
                                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
@@ -914,7 +914,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
 
                                        auto renderer = ui::CellRendererText();
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
-                                       g_signal_connect( renderer, "edited", G_CALLBACK( commands_cell_edited ), store );
+                                       g_signal_connect( G_OBJECT(renderer), "edited", G_CALLBACK( commands_cell_edited ), store );
 
                                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
                                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
index ad169054100d48e0947597ceed1888a44c8ed41d..8ca6f2ef96c61ae981b357bd65aefc28f010b728 100644 (file)
@@ -145,7 +145,7 @@ public:
 GtkTextBufferOutputStream( GtkTextBuffer* textBuffer, GtkTextIter* iter, GtkTextTag* tag ) : textBuffer( textBuffer ), iter( iter ), tag( tag ){
 }
 std::size_t write( const char* buffer, std::size_t length ){
-       gtk_text_buffer_insert_with_tags( textBuffer, iter, buffer, gint( length ), tag, 0 );
+       gtk_text_buffer_insert_with_tags( textBuffer, iter, buffer, gint( length ), tag, nullptr );
        return length;
 }
 };
index a9b9a6681b0b918b5838fd3f53bf2d14ee409109..60b3e3575e4a0b598012b97e6a18794526cf6c9f 100644 (file)
@@ -116,22 +116,22 @@ void entitylist_treeviewcolumn_celldatafunc( GtkTreeViewColumn* column, GtkCellR
        if ( node != 0 ) {
                gtk_cell_renderer_set_fixed_size( renderer, -1, -1 );
                char* name = const_cast<char*>( node_get_name( *node ) );
-               g_object_set( G_OBJECT( renderer ), "text", name, "visible", TRUE, 0 );
+               g_object_set( G_OBJECT( renderer ), "text", name, "visible", TRUE, nullptr );
 
                //globalOutputStream() << "rendering cell " << makeQuoted(name) << "\n";
                GtkStyle* style = gtk_widget_get_style( GTK_WIDGET( getEntityList().m_tree_view ) );
                if ( instance->childSelected() ) {
-                       g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], 0 );
+                       g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], nullptr );
                }
                else
                {
-                       g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_NORMAL], 0 );
+                       g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_NORMAL], nullptr );
                }
        }
        else
        {
                gtk_cell_renderer_set_fixed_size( renderer, -1, 0 );
-               g_object_set( G_OBJECT( renderer ), "text", "", "visible", FALSE, 0 );
+               g_object_set( G_OBJECT( renderer ), "text", "", "visible", FALSE, nullptr );
        }
 }
 
index f6e1d28b1c6e3e82ac3d87cc3058cb07ae56fd82..7b954535adc1c9a0cb064930f142b226aff3df19 100644 (file)
@@ -118,7 +118,7 @@ void GroupDlg::Create( ui::Window parent ){
                gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_BOTTOM );
                m_pNotebook = notebook;
 
-               g_signal_connect( notebook, "switch_page", G_CALLBACK( switch_page ), window );
+               g_signal_connect( G_OBJECT(notebook), "switch_page", G_CALLBACK( switch_page ), (gpointer) window );
        }
 }
 
index 9b7ac01f81e8bd848b37cdf69cb5e79b3c37a252..a8e1e22a719f399a71904ed76f1a318b7081b481 100644 (file)
@@ -2714,7 +2714,7 @@ void MainFrame::Create(){
                GdkPixbuf* pixbuf = pixbuf_new_from_file_with_mask( "bitmaps/icon.png" );
                if ( pixbuf != 0 ) {
                        gtk_window_set_icon( window, pixbuf );
-                       gdk_pixbuf_unref( pixbuf );
+                       g_object_unref( pixbuf );
                }
        }
 #endif
index 660face4b1f240269a548cea277e95686ee56c3f..3e49e81879064c1ef9c579c62095f66b9ac3c9bc 100644 (file)
@@ -895,8 +895,8 @@ ui::Window PatchInspector::BuildDialog(){
                                                        entry_set_float( entry, g_pi_globals.shift[0] );
 
                                                        auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
-                                                       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
-                                                       g_object_set_data( G_OBJECT( window ), "hshift_adj", adj );
+                                                       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), (gpointer) entry );
+                                                       g_object_set_data( G_OBJECT( window ), "hshift_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
@@ -917,7 +917,7 @@ ui::Window PatchInspector::BuildDialog(){
 
                                                        auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
-                                                       g_object_set_data( G_OBJECT( window ), "vshift_adj", adj );
+                                                       g_object_set_data( G_OBJECT( window ), "vshift_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
@@ -938,7 +938,7 @@ ui::Window PatchInspector::BuildDialog(){
 
                                                        auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
-                                                       g_object_set_data( G_OBJECT( window ), "hscale_adj", adj );
+                                                       g_object_set_data( G_OBJECT( window ), "hscale_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
@@ -959,7 +959,7 @@ ui::Window PatchInspector::BuildDialog(){
 
                                                        auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
-                                                       g_object_set_data( G_OBJECT( window ), "vscale_adj", adj );
+                                                       g_object_set_data( G_OBJECT( window ), "vscale_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
@@ -980,7 +980,7 @@ ui::Window PatchInspector::BuildDialog(){
 
                                                        auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
-                                                       g_object_set_data( G_OBJECT( window ), "rotate_adj", adj );
+                                                       g_object_set_data( G_OBJECT( window ), "rotate_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
index 645af34dde3dd2e464e50204f288f4b94f617394..6d4e248c5061705c191e57a78103915272d3594d 100644 (file)
@@ -71,7 +71,9 @@ void QGL_Shutdown( OpenGLBinding& table ){
 #if defined( WIN32 )
        qwglGetProcAddress           = 0;
 #elif defined( XWINDOWS )
+       #ifndef __APPLE__
        qglXQueryExtension           = glXQueryExtension;
+    #endif
        qglXGetProcAddressARB        = 0;
 #else
 #error "unsupported platform"
index 48fb08b31caac7d6676c2e2c434ff812005bf363..759c34c08db1285d1b67cd4a16784543d88ac1bf 100644 (file)
@@ -19,7 +19,7 @@
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#if !defined( INCLUDEDE_SCENEGRAPH_H )
+#if !defined( INCLUDED_SCENEGRAPH_H )
 #define INCLUDED_SCENEGRAPH_H
 
 #endif
index c9f0e7c69a4d7bc0c50b6d0b7739f58888b5ee00..4f83e0aca29b60cee3a9b5bf25c32a1b4c1294bc 100644 (file)
@@ -24,6 +24,7 @@
 #include "debugging/debugging.h"
 
 #include <map>
+#include <vector>
 #include "os/path.h"
 
 #include "modulesystem.h"