This commit is contained in:
Timothee "TTimo" Besset 2013-07-07 14:13:17 -05:00
commit 0389190dce
20 changed files with 50 additions and 83 deletions

View File

@ -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 ){

View File

@ -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 ){

View File

@ -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

View File

@ -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. */

View File

@ -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 ) ) );
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -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 */

View File

@ -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

View File

@ -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 );

View File

@ -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 ) );

View File

@ -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<GtkWidget*>( 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";

View File

@ -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;
}
}

View File

@ -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);
int fclose_ql (FILE* stream);

View File

@ -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;
}
}

View File

@ -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");

View File

@ -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

View File

@ -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: {

View File

@ -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

View File

@ -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<brush_t*>( g_ptrSelectedFaceBrushes.GetAt( 0 ) );
//brush_t *b = reinterpret_cast<brush_t*>( g_ptrSelectedFaceBrushes.GetAt( 0 ) );
face_t *selFace = reinterpret_cast<face_t*>( g_ptrSelectedFaces.GetAt( 0 ) );
// get the ST axis base for the face
vec3_t texS,texT;

View File

@ -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++;