-cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project(NetRadiant C CXX)
This project uses the usual CMake workflow:
- mkdir build && cd build && cmake .. && make
+ mkdir build && cd build && cmake .. && cmake --build .
## linux
## 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)
### 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)
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`
add_subdirectory(xml)
add_library(libs
+ _.cpp
archivelib.h
bytebool.h
bytestreamutils.h
instancelib.h
maplib.h
moduleobservers.h
- picomodel/picomodel.h
pivot.h
render.h
scenelib.h
uniquenames.h
versionlib.h
)
-set_target_properties(libs PROPERTIES LINKER_LANGUAGE CXX)
find_package(GLIB REQUIRED)
target_include_directories(libs PRIVATE ${GLIB_INCLUDE_DIRS})
const UB1Traits& ub1traits,
const UB4x1Traits& ub4x1traits
){
- register ub4 a,b,c,len;
+ ub4 a,b,c,len;
/* Set up the internal state */
len = length;
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;
else
{
GdkPixbuf* rgba = gdk_pixbuf_add_alpha( rgb, FALSE, 255, 0, 255 );
- gdk_pixbuf_unref( rgb );
+ g_object_unref( rgb );
return rgba;
}
}
else
{
GtkImage* image = GTK_IMAGE( gtk_image_new_from_pixbuf( rgba ) );
- gdk_pixbuf_unref( rgba );
+ g_object_unref( rgba );
return image;
}
}
vsprintf( text, str, argptr );
va_end( argptr );
- printf( text );
+ printf( "%s", text );
}
#else
void WinPrint( const char *str, ... ){
add_library(math
+ _.cpp
aabb.h
curve.h
# expression.cpp expression.h
quaternion.h
vector.h
)
-set_target_properties(math PROPERTIES LINKER_LANGUAGE CXX)
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})
-
#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 ) {
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 ) {
add_library(script
+ _.cpp
scripttokeniser.h
scripttokenwriter.h
)
-set_target_properties(script PROPERTIES LINKER_LANGUAGE CXX)
}
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 ) {
add_library(stream
+ _.cpp
filestream.h
memstream.h
stringstream.h
textfilestream.h
textstream.h
)
-set_target_properties(stream PROPERTIES LINKER_LANGUAGE CXX)
${LIBXML2_LIBRARIES}
${OPENGL_gl_LIBRARY}
${GTK2_LIBRARIES}
+ ${GTK2_PANGO_LIBRARY}
${GTKGL_LIBRARIES}
includes
cmdlib
uilib
xmllib
)
+if (X11_LIBRARIES)
+ target_link_libraries(radiant ${X11_LIBRARIES})
+endif ()
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 );
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 );
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;
}
};
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 );
}
}
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 );
}
}
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
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 ) );
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 ) );
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 ) );
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 ) );
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 ) );
#if defined( WIN32 )
qwglGetProcAddress = 0;
#elif defined( XWINDOWS )
+ #ifndef __APPLE__
qglXQueryExtension = glXQueryExtension;
+ #endif
qglXGetProcAddressARB = 0;
#else
#error "unsupported platform"
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
#include "debugging/debugging.h"
#include <map>
+#include <vector>
#include "os/path.h"
#include "modulesystem.h"