diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 7e4ac81a..768190ec 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -82,7 +82,7 @@ static void dialog_button_callback( GtkWidget *widget, gpointer data ){ ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" ); *loop = 0; - *ret = (int)data; + *ret = (intptr_t)data; } static gint dialog_delete_callback( GtkWidget *widget, GdkEvent* event, gpointer data ){ diff --git a/contrib/bobtoolz/shapes.cpp b/contrib/bobtoolz/shapes.cpp index e7e2de32..6609058e 100644 --- a/contrib/bobtoolz/shapes.cpp +++ b/contrib/bobtoolz/shapes.cpp @@ -621,7 +621,7 @@ void MakeBevel( vec3_t vMin, vec3_t vMax ){ } - g_FuncTable.m_pfnCommitPatchHandleToMap( nIndex, pm, "textures/common/caulk" ); + g_FuncTable.m_pfnCommitPatchHandleToMap( nIndex, pm, (char *)"textures/common/caulk" ); } void BuildCornerStairs( vec3_t vMin, vec3_t vMax, int nSteps, const char* mainTexture, const char* riserTex ){ diff --git a/contrib/camera/misc.h b/contrib/camera/misc.h index 6dee0b25..8a53fce3 100644 --- a/contrib/camera/misc.h +++ b/contrib/camera/misc.h @@ -31,7 +31,7 @@ const char* ExtractFilename( const char* path ); bool FileExists( const char *filename ); int Q_stricmp( const char *s1, const char *s2 ); -typedef int fileHandle_t; +typedef void * fileHandle_t; #define qfalse false #define qtrue true diff --git a/contrib/gtkgensurf/triangle.c b/contrib/gtkgensurf/triangle.c index 8d4e0c98..5bf1a1db 100644 --- a/contrib/gtkgensurf/triangle.c +++ b/contrib/gtkgensurf/triangle.c @@ -622,8 +622,8 @@ static struct memorypool splaynodes; /* Variables that maintain the bad triangle queues. The tails are pointers */ /* to the pointers that have to be filled in to enqueue an item. */ -static struct badface *queuefront[64]; -static struct badface **queuetail[64]; +//static struct badface *queuefront[64]; +//static struct badface **queuetail[64]; static REAL xmin, xmax, ymin, ymax; /* x and y bounds. */ static REAL xminextreme; /* Nonexistent x value used as a flag in sweepline. */ diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index bd0439e3..4b25ce50 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -37,7 +37,7 @@ static void dialog_button_callback( GtkWidget *widget, gpointer data ){ ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" ); *loop = 0; - *ret = (int)data; + *ret = (intptr_t)data; } static gint dialog_delete_callback( GtkWidget *widget, GdkEvent* event, gpointer data ){ @@ -60,7 +60,7 @@ static void file_sel_callback( GtkWidget *widget, gpointer data ){ filename = (char**)g_object_get_data( G_OBJECT( parent ), "filename" ); *loop = 0; - if ( (int)data == IDOK ) { + if ( (intptr_t)data == IDOK ) { *filename = g_strdup( gtk_file_selection_get_filename( GTK_FILE_SELECTION( parent ) ) ); } } diff --git a/install/bitmaps/icon.png b/install/bitmaps/icon.png index b42e1c9a..88fdea55 100644 Binary files a/install/bitmaps/icon.png and b/install/bitmaps/icon.png differ diff --git a/libs/picomodel/picointernal.c b/libs/picomodel/picointernal.c index d8d316a0..d4fd8b44 100644 --- a/libs/picomodel/picointernal.c +++ b/libs/picomodel/picointernal.c @@ -761,8 +761,8 @@ picoParser_t *_pico_new_parser( picoByte_t *buffer, int bufSize ){ return NULL; } /* setup */ - p->buffer = buffer; - p->cursor = buffer; + p->buffer = (char *)buffer; + p->cursor = p->buffer; p->bufSize = bufSize; p->max = p->buffer + bufSize; p->curLine = 1; /* sea: new */ diff --git a/libs/splines/q_shared.h b/libs/splines/q_shared.h index d194615d..9805fa8e 100644 --- a/libs/splines/q_shared.h +++ b/libs/splines/q_shared.h @@ -212,10 +212,7 @@ typedef unsigned char byte; #define EQUAL_EPSILON 0.001 -typedef int qhandle_t; -typedef int sfxHandle_t; -typedef int fileHandle_t; -typedef int clipHandle_t; +typedef void * fileHandle_t; typedef enum { INVALID_JOINT = -1 diff --git a/libs/splines/splines.h b/libs/splines/splines.h index f55525b8..6a395e73 100644 --- a/libs/splines/splines.h +++ b/libs/splines/splines.h @@ -35,8 +35,6 @@ #include "util_str.h" #include "math_vector.h" -typedef int fileHandle_t; - extern void glBox( idVec3 &color, idVec3 &point, float size ); extern void glLabeledPoint( idVec3 &color, idVec3 &point, float size, const char *label ); diff --git a/plugins/spritemodel/plugin.cpp b/plugins/spritemodel/plugin.cpp index 5d7766dd..e73fd988 100644 --- a/plugins/spritemodel/plugin.cpp +++ b/plugins/spritemodel/plugin.cpp @@ -153,10 +153,10 @@ static const char *PLUGIN_COMMANDS = "About..."; static const char *PLUGIN_ABOUT = "Sprite Model loading module v0.2 for GTKRadiant\n\n" "By Hydra!"; -char *supportedmodelformats[] = {"spr","bmp","tga","jpg","hlw",NULL}; // NULL is list delimiter +const char *supportedmodelformats[] = {"spr","bmp","tga","jpg","hlw",NULL}; // NULL is list delimiter static void add_model_apis( CSynapseClient& client ){ - char **ext; + const char **ext; for ( ext = supportedmodelformats; *ext != NULL; ext++ ) { client.AddAPI( MODEL_MAJOR, *ext, sizeof( _QERPlugModelTable ) ); @@ -164,7 +164,7 @@ static void add_model_apis( CSynapseClient& client ){ } static bool model_is_supported( const char* extension ){ - char **ext; + const char **ext; for ( ext = supportedmodelformats; *ext != NULL; ext++ ) { if ( stricmp( extension,*ext ) == 0 ) { @@ -175,7 +175,7 @@ static bool model_is_supported( const char* extension ){ } void init_filetypes(){ - char **ext; + const char **ext; for ( ext = supportedmodelformats; *ext != NULL; ext++ ) { GetFileTypeRegistry()->addType( MODEL_MAJOR, filetype_t( "sprite", *ext ) ); diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index c173c2fc..ed478628 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -37,7 +37,7 @@ static void dialog_button_callback( GtkWidget *widget, gpointer data ){ ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" ); *loop = 0; - *ret = (int)data; + *ret = (intptr_t) data; } static gint dialog_delete_callback( GtkWidget *widget, GdkEvent* event, gpointer data ){ @@ -243,7 +243,7 @@ const char* QERPlug_Init( void* hApp, void *pWidget ){ GtkWidget* pMainWidget = static_cast( pWidget ); g_pMainWnd = pMainWidget; - size = (int)( (winding_t *)0 )->points[MAX_POINTS_ON_WINDING]; + size = (intptr_t)( (winding_t *)0 )->points[MAX_POINTS_ON_WINDING]; g_pSelectedFaceWinding = (winding_t *)malloc( size ); memset( g_pSelectedFaceWinding, 0, size ); return "Texture tools for Radiant"; diff --git a/plugins/vfsqlpk3/qlvfs.cpp b/plugins/vfsqlpk3/qlvfs.cpp index 6ce6eaf8..fb0a3fd4 100644 --- a/plugins/vfsqlpk3/qlvfs.cpp +++ b/plugins/vfsqlpk3/qlvfs.cpp @@ -9,6 +9,9 @@ #include "stdio.h" #include "qlvfs.h" +static FILE *xored_open_files[MAX_FILE_HANDLES]; +static int xor_max_pos = 0; + /* Luigi Auriemma's quakelivedec.c */ static unsigned char quakelive_xor[] = "\xcf\x8e\x8e\x4c\xd0\xd9\x30\xce\x07\x32\x27\x64\xed\x16\x06\x12" @@ -175,4 +178,4 @@ int fclose_ql (FILE* stream) { ret = fclose((FILE *)stream); return ret; -} \ No newline at end of file +} diff --git a/plugins/vfsqlpk3/qlvfs.h b/plugins/vfsqlpk3/qlvfs.h index 58555c3b..80cdbaf7 100644 --- a/plugins/vfsqlpk3/qlvfs.h +++ b/plugins/vfsqlpk3/qlvfs.h @@ -1,7 +1,5 @@ #define MAX_FILE_HANDLES 8192 //64 // qcommon.h -static FILE *xored_open_files[MAX_FILE_HANDLES]; -static int xor_max_pos = 0; FILE* fopen_ql (const char* filename, const char* mode); size_t fread_ql (void *ptr, size_t size, size_t nmeb, FILE *stream); -int fclose_ql (FILE* stream); \ No newline at end of file +int fclose_ql (FILE* stream); diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index 8217b00b..6259d14b 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -671,10 +671,9 @@ void load_pixmap( const char* filename, GtkWidget* widget, GdkPixmap **gdkpixmap bmp_to_pixmap( str.GetBuffer(), gdkpixmap, mask ); if ( *gdkpixmap == NULL ) { - printf( "gdkpixmap was null\n" ); - gchar *dummy[] = { "1 1 1 1", " c None", " " }; - printf( "calling gdk_pixmap_create_from_xpm_d\n" ); - *gdkpixmap = gdk_pixmap_create_from_xpm_d( gdk_get_default_root_window(), mask, NULL, dummy ); + Sys_Printf( "Failed to load_pixmap %s, creating default pixmap\n", str.GetBuffer() ); + const gchar *dummy[] = { "1 1 1 1", " c None", " " }; + *gdkpixmap = gdk_pixmap_create_from_xpm_d( gdk_get_default_root_window(), mask, NULL, (gchar **)dummy ); } } @@ -707,8 +706,8 @@ bool WINAPI load_plugin_bitmap( const char* filename, void **gdkpixmap, void **m bmp_to_pixmap( str.GetBuffer(), (GdkPixmap **)gdkpixmap, (GdkBitmap **)mask ); if ( *gdkpixmap == NULL ) { - gchar *dummy[] = { "1 1 1 1", " c None", " " }; - *gdkpixmap = gdk_pixmap_create_from_xpm_d( gdk_get_default_root_window(), (GdkBitmap **)mask, NULL, dummy ); + const gchar *dummy[] = { "1 1 1 1", " c None", " " }; + *gdkpixmap = gdk_pixmap_create_from_xpm_d( gdk_get_default_root_window(), (GdkBitmap **)mask, NULL, (gchar **)dummy ); return false; } } diff --git a/radiant/main.cpp b/radiant/main.cpp index 96eb5f12..720ef62f 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -92,6 +92,7 @@ gint try_destroy_splash( gpointer data ){ return FALSE; } +#ifndef SKIP_SPLASH static void create_splash() { splash_screen = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(splash_screen), "Splash Screen"); @@ -111,6 +112,7 @@ static void create_splash() { while(gtk_events_pending()) gtk_main_iteration(); } +#endif // ============================================================================= // Loki stuff @@ -413,10 +415,8 @@ void error_redirect( const gchar *domain, GLogLevelFlags log_level, const gchar int main( int argc, char* argv[] ) { const char *libgl; - char *ptr; int i, j, k; - /* Rambetter on Sat Nov 13, 2010: @@ -461,7 +461,7 @@ int main( int argc, char* argv[] ) { _after_ gtk_init(), I chose to fix this problem via environment variable. I think it's cleaner that way. */ - putenv( "LC_NUMERIC=C" ); + putenv( (char *)"LC_NUMERIC=C" ); // Use the same environment variable for resolving libGL as libgtkglext does. libgl = getenv("GDK_GL_LIBGL_PATH"); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 4f163fea..805bc6e8 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -2088,7 +2088,7 @@ enum }; static const GtkTargetEntry clipboard_targets[] = { - { "RADIANT_CLIPPINGS", 0, RADIANT_CLIPPINGS, }, + { (gchar *)"RADIANT_CLIPPINGS", 0, RADIANT_CLIPPINGS, }, }; static void clipboard_get( GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer user_data_or_owner ){ @@ -2499,10 +2499,16 @@ void MainFrame::Create(){ // not needed on win32, it's in the .rc #ifndef _WIN32 { - GdkPixmap *pixmap; - GdkBitmap *mask; - load_pixmap( "icon.bmp", window, &pixmap, &mask ); - gdk_window_set_icon( window->window, NULL, pixmap, mask ); + CString icon = g_strBitmapsPath; + icon += "icon.png"; + + GError *error = NULL; + + gtk_window_set_icon_from_file( GTK_WINDOW( window ), icon.GetBuffer(), &error ); + if ( error != NULL ) { + Sys_Printf( "Failed to load icon: %s\n", error->message ); + g_error_free( error ); + } } #endif diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 31b6603c..3645a3ed 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -514,6 +514,8 @@ static void OnBtnBrowseEditor( GtkWidget *widget, gpointer data ){ } #endif +#define PREFERENCES_HAVE_PREFAB_PATH 0 +#if PREFERENCES_HAVE_PREFAB_PATH static void OnBtnBrowseprefab( GtkWidget *widget, gpointer data ){ PrefsDlg *dlg = (PrefsDlg*)data; char *path = dlg->m_strPrefabPath; @@ -532,6 +534,7 @@ static void OnBtnBrowseprefab( GtkWidget *widget, gpointer data ){ free( dir ); } } +#endif static void OnBtnBrowseuserini( GtkWidget *widget, gpointer data ){ PrefsDlg *dlg = (PrefsDlg*)data; @@ -2503,7 +2506,7 @@ void PrefsDlg::BuildDialog(){ (GtkAttachOptions) ( 0 ), 1, 0 ); AddDialogData( entry, &m_strPrefabPath, DLG_ENTRY_TEXT ); -#if 0 +#if PREFERENCES_HAVE_PREFAB_PATH // browse button button = gtk_button_new_with_label( "..." ); gtk_widget_show( button ); @@ -3604,6 +3607,7 @@ void CGameInstall::Run() { case GAME_Q2: { fprintf( fg, " prefix=\".quake2\"\n" ); fprintf( fg, " basegame=\"baseq2\"\n" ); + fprintf( fg, " no_patch=\"true\"\n" ); break; } case GAME_Q3: { @@ -3627,12 +3631,14 @@ void CGameInstall::Run() { case GAME_UFOAI: { fprintf( fg, " prefix=\".ufoai\"\n" ); fprintf( fg, " basegame=\"base\"\n" ); + fprintf( fg, " no_patch=\"true\"\n" ); break; } case GAME_Q2W: { fprintf( fg, " prefix=\".quake2world\"\n" ); fprintf( fg, " prefix_win32=\"Quake2World\"\n"); fprintf( fg, " basegame=\"default\"\n" ); + fprintf( fg, " no_patch=\"true\"\n" ); break; } case GAME_WARSOW: { diff --git a/radiant/qgl.c b/radiant/qgl.c index 881e616e..cc502621 100644 --- a/radiant/qgl.c +++ b/radiant/qgl.c @@ -1054,46 +1054,6 @@ void WINAPI gluPerspective2( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLd qglFrustum( -y * aspect, y * aspect, -y, y, zNear, zFar ); } -static void* WINAPI ResizeImage( GLubyte* old_image, int srcw, int srch, int destw, int desth ){ - int i, j; - float sx, sy; - GLubyte* new_image = (GLubyte *)malloc( destw * desth * 4 * sizeof( GLubyte ) ); - if ( new_image == NULL ) { - return NULL; - } - - if ( destw > 1 ) { - sx = (GLfloat) ( srcw - 1 ) / (GLfloat) ( destw - 1 ); - } - else{ - sx = (GLfloat) ( srcw - 1 ); - } - if ( desth > 1 ) { - sy = (GLfloat) ( srch - 1 ) / (GLfloat) ( desth - 1 ); - } - else{ - sy = (GLfloat) ( srch - 1 ); - } - - for ( i = 0; i < desth; i++ ) - { - GLint ii = (GLint)( i * sy ); - for ( j = 0; j < destw; j++ ) - { - GLint jj = (GLint)( j * sx ); - GLubyte *src = old_image + ( ii * srcw + jj ) * 4; - GLubyte *dst = new_image + ( i * destw + j ) * 4; - - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - *dst++ = *src++; - } - } - - return new_image; -} - #define CEILING( A, B ) ( ( A ) % ( B ) == 0 ? ( A ) / ( B ) : ( A ) / (B)+1 ) typedef struct glu_error_struct diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 83c2e93a..9161e6c5 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -67,7 +67,7 @@ static void OnTest( GtkWidget *widget, gpointer data ){ Sys_FPrintf( SYS_WRN, "Expected single face selection\n" ); return; } - brush_t *b = reinterpret_cast( g_ptrSelectedFaceBrushes.GetAt( 0 ) ); + //brush_t *b = reinterpret_cast( g_ptrSelectedFaceBrushes.GetAt( 0 ) ); face_t *selFace = reinterpret_cast( g_ptrSelectedFaces.GetAt( 0 ) ); // get the ST axis base for the face vec3_t texS,texT; diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 55b4ae96..3a0812b7 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -1810,7 +1810,7 @@ void XYWnd::DropClipPoint( guint32 nFlags, int pointx, int pointy ){ // g_pParentWnd->ActiveXY()->GetViewType() // cf VIEWTYPE defintion: enum VIEWTYPE {YZ, XZ, XY}; int nViewType = g_pParentWnd->ActiveXY()->GetViewType(); - int nDim = ( nViewType == YZ ) ? nDim = 0 : ( ( nViewType == XZ ) ? nDim = 1 : nDim = 2 ); + int nDim = ( nViewType == YZ ) ? 0 : ( ( nViewType == XZ ) ? 1 : 2 ); //(*pPt)[nDim] = g_qeglobals.d_work_max[nDim]; vec3_t mid; Select_GetMid( mid ); @@ -1834,7 +1834,7 @@ void XYWnd::DropPathPoint( guint32 nFlags, int pointx, int pointy ){ // g_pParentWnd->ActiveXY()->GetViewType() // cf VIEWTYPE definition: enum VIEWTYPE {YZ, XZ, XY}; int nViewType = g_pParentWnd->ActiveXY()->GetViewType(); - int nDim = ( nViewType == YZ ) ? nDim = 0 : ( ( nViewType == XZ ) ? nDim = 1 : nDim = 2 ); + int nDim = ( nViewType == YZ ) ? 0 : ( ( nViewType == XZ ) ? 1 : 2 ); g_PathPoints[g_nPathCount].m_ptClip[nDim] = g_qeglobals.d_work_max[nDim]; g_nPathCount++;