include_directories(${X11_INCLUDE_DIR})
else ()
add_definitions(
- -D_WIN32
+ -DWIN32=1
+ -D_WIN32=1
)
endif ()
--- /dev/null
+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
+ "@
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;
}
}
#include <windows.h>
#include <stdio.h>
-#include <cstdlib>
#include <string.h>
#include "l_net.h"
#include "l_net_wins.h"
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
};
enum class alert_icon {
- DEFAULT,
- ERROR,
- WARNING,
- QUESTION,
- ASTERISK,
+ Default,
+ Error,
+ Warning,
+ Question,
+ Asterisk,
};
enum class alert_response {
{ }
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,
}
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 ) {
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;
}
}
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;
}
#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
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
}
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
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 );
}
}
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
/// 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"
// 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 );
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;
}
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;
}
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();
#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
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
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
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();
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;
}