Fixed Linux compiler errors.

This commit is contained in:
nobody 2012-02-02 01:04:24 +00:00
parent 07b2322d17
commit 724fd9a889
7 changed files with 10 additions and 57 deletions

View file

@ -1486,7 +1486,7 @@ bool PiecesLibrary::ImportLDrawPiece(const char* Filename, File* NewIdxFile, Fil
if (!strchr(Moved, '\\') && !strchr(Moved, '/'))
{
Moved += strlen("~Moved to ");
_strupr(Moved);
strupr(Moved);
char* Dst = NULL;
for (int i = 0; i < Count; i++)
@ -2510,7 +2510,6 @@ bool SaveLDrawPiece(LC_LDRAW_PIECE* piece, File* NewIdxFile, File* NewBinFile, F
lcuint32 i, j, cs, binoff = 0, delta;
void* membuf;
lcuint16 scale, sb[6];
PiecesLibrary *pLib = lcGetPiecesLibrary();
File& NewIdx = *NewIdxFile;
File& NewBin = *NewBinFile;

View file

@ -1609,9 +1609,8 @@ int povraydlg_execute(void* param)
typedef struct
{
void* data;
GtkWidget *det_edges, *det_dither, *det_lighting, *det_smooth;
GtkWidget *det_antialias, *det_linear, *det_fast;
GtkWidget *det_solid, *det_hidden, *det_background, *det_width;
GtkWidget *det_edges, *det_lighting, *det_smooth;
GtkWidget *det_antialias, *det_fast, *det_width;
GtkWidget *draw_grid, *draw_gridunits, *draw_axis;
GtkWidget *draw_snapx, *draw_snapy, *draw_snapz, *draw_angle;
GtkWidget *draw_anglesnap, *draw_centimeter, *draw_relative;
@ -1630,15 +1629,10 @@ static void preferencesdlg_ok (GtkWidget *widget, gpointer data)
unsigned long detail = 0;
float line_width;
if (GTK_TOGGLE_BUTTON (s->det_edges)->active) detail |= LC_DET_BRICKEDGES;
if (GTK_TOGGLE_BUTTON (s->det_dither)->active) detail |= LC_DET_DITHER;
if (GTK_TOGGLE_BUTTON (s->det_lighting)->active) detail |= LC_DET_LIGHTING;
if (GTK_TOGGLE_BUTTON (s->det_smooth)->active) detail |= LC_DET_SMOOTH;
if (GTK_TOGGLE_BUTTON (s->det_antialias)->active) detail |= LC_DET_ANTIALIAS;
if (GTK_TOGGLE_BUTTON (s->det_linear)->active) detail |= LC_DET_LINEAR;
if (GTK_TOGGLE_BUTTON (s->det_fast)->active) detail |= LC_DET_FAST;
if (GTK_TOGGLE_BUTTON (s->det_solid)->active) detail |= LC_DET_BOX_FILL;
if (GTK_TOGGLE_BUTTON (s->det_hidden)->active) detail |= LC_DET_HIDDEN_LINE;
if (GTK_TOGGLE_BUTTON (s->det_background)->active) detail |= LC_DET_BACKGROUND;
if (!read_float(s->det_width, &line_width, 0.5f, 5.0f)) return;
unsigned long snap = 0;
@ -1692,15 +1686,10 @@ static void preferencesdlg_default (GtkWidget *widget, gpointer data)
unsigned long detail = 0;
float line_width;
if (GTK_TOGGLE_BUTTON (s->det_edges)->active) detail |= LC_DET_BRICKEDGES;
if (GTK_TOGGLE_BUTTON (s->det_dither)->active) detail |= LC_DET_DITHER;
if (GTK_TOGGLE_BUTTON (s->det_lighting)->active) detail |= LC_DET_LIGHTING;
if (GTK_TOGGLE_BUTTON (s->det_smooth)->active) detail |= LC_DET_SMOOTH;
if (GTK_TOGGLE_BUTTON (s->det_antialias)->active) detail |= LC_DET_ANTIALIAS;
if (GTK_TOGGLE_BUTTON (s->det_linear)->active) detail |= LC_DET_LINEAR;
if (GTK_TOGGLE_BUTTON (s->det_fast)->active) detail |= LC_DET_FAST;
if (GTK_TOGGLE_BUTTON (s->det_solid)->active) detail |= LC_DET_BOX_FILL;
if (GTK_TOGGLE_BUTTON (s->det_hidden)->active) detail |= LC_DET_HIDDEN_LINE;
if (GTK_TOGGLE_BUTTON (s->det_background)->active) detail |= LC_DET_BACKGROUND;
if (!read_float(s->det_width, &line_width, 0.5f, 5.0f)) return;
unsigned long snap = 0;
@ -1810,11 +1799,6 @@ int preferencesdlg_execute(void* param)
gtk_table_attach (GTK_TABLE (table), s.det_edges, 0, 1, 0, 1,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
s.det_dither = gtk_check_button_new_with_label ("Dithering");
gtk_widget_show (s.det_dither);
gtk_table_attach (GTK_TABLE (table), s.det_dither, 0, 1, 1, 2,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
s.det_lighting = gtk_check_button_new_with_label ("Lighting");
gtk_widget_show (s.det_lighting);
gtk_table_attach (GTK_TABLE (table), s.det_lighting, 0, 1, 2, 3,
@ -1830,31 +1814,11 @@ int preferencesdlg_execute(void* param)
gtk_table_attach (GTK_TABLE (table), s.det_antialias, 0, 1, 4, 5,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
s.det_linear = gtk_check_button_new_with_label ("Linear filtering");
gtk_widget_show (s.det_linear);
gtk_table_attach (GTK_TABLE (table), s.det_linear, 0, 1, 5, 6,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
s.det_fast = gtk_check_button_new_with_label ("Fast rendering");
gtk_widget_show (s.det_fast);
gtk_table_attach (GTK_TABLE (table), s.det_fast, 1, 2, 0, 1,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
s.det_solid = gtk_check_button_new_with_label ("Draw solid boxes");
gtk_widget_show (s.det_solid);
gtk_table_attach (GTK_TABLE (table), s.det_solid, 1, 2, 1, 2,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
s.det_hidden = gtk_check_button_new_with_label ("Remove hidden lines");
gtk_widget_show (s.det_hidden);
gtk_table_attach (GTK_TABLE (table), s.det_hidden, 1, 2, 2, 3,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
s.det_background = gtk_check_button_new_with_label ("Background rendering");
gtk_widget_show (s.det_background);
gtk_table_attach (GTK_TABLE (table), s.det_background, 1, 2, 3, 4,
(GtkAttachOptions)(GTK_EXPAND|GTK_FILL), (GtkAttachOptions)(GTK_EXPAND|GTK_FILL), 0, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_widget_show (hbox);
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 4, 5,
@ -2165,24 +2129,14 @@ int preferencesdlg_execute(void* param)
// Set initial values
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_edges),
(opts->nDetail & LC_DET_BRICKEDGES) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_dither),
(opts->nDetail & LC_DET_DITHER) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_lighting),
(opts->nDetail & LC_DET_LIGHTING) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_smooth),
(opts->nDetail & LC_DET_SMOOTH) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_antialias),
(opts->nDetail & LC_DET_ANTIALIAS) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_linear),
(opts->nDetail & LC_DET_LINEAR) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_fast),
(opts->nDetail & LC_DET_FAST) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_solid),
(opts->nDetail & LC_DET_BOX_FILL) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_hidden),
(opts->nDetail & LC_DET_HIDDEN_LINE) ? TRUE : FALSE);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.det_background),
(opts->nDetail & LC_DET_BACKGROUND) ? TRUE : FALSE);
write_float(s.det_width, opts->fLineWidth);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (s.draw_grid),

View file

@ -303,7 +303,7 @@ int minifigdlg_execute (void* param)
minifigdlg_createpair (&s, 6, LC_MFW_RIGHT_LEG, table);
minifigdlg_createpair (&s, 7, LC_MFW_RIGHT_SHOE, table);
s.wizard->Create (&s.preview);
s.wizard->CreateFromWindow (&s.preview);
frame = gtk_frame_new (NULL);
gtk_widget_show (frame);

View file

@ -146,7 +146,7 @@ GLWindow::~GLWindow ()
g_free (m_pData);
}
bool GLWindow::Create (void *data)
bool GLWindow::CreateFromWindow (void *data)
{
int attrlist[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, 0 };
GLWindowPrivate *prv = (GLWindowPrivate*)m_pData;
@ -264,7 +264,7 @@ void GLWindow::SwapBuffers ()
pfnglXSwapBuffers (GDK_WINDOW_XDISPLAY (prv->widget->window), GDK_WINDOW_XWINDOW (prv->widget->window));
}
void GLWindow::Redraw ()
void GLWindow::Redraw (bool ForceRedraw)
{
GLWindowPrivate *prv = (GLWindowPrivate*)m_pData;

View file

@ -249,7 +249,7 @@ void OnCommand(GtkWidget* widget, gpointer data)
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
View *v = new View (project, view);
v->Create (&w);
v->CreateFromWindow (&w);
gtk_container_add (GTK_CONTAINER (frame), w);
gtk_widget_show (w);
@ -486,7 +486,7 @@ static void update_window_layout ()
// first thing we need to create the widgets
if (drawing_area == NULL)
{
view->Create (&drawing_area);
view->CreateFromWindow (&drawing_area);
gtk_widget_set_events (GTK_WIDGET (drawing_area), GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |

View file

@ -314,7 +314,7 @@ void SystemUpdateColorList(int new_color)
colorlist_set(new_color);
}
void SystemUpdateRenderingMode(bool bBackground, bool bFast)
void SystemUpdateRenderingMode(bool bFast)
{
if (!main_toolbar.fast)
return;

View file

@ -757,7 +757,7 @@ GtkWidget* create_piecebar (GtkWidget *window, GLWindow *share)
GtkWidget *w;
preview = new PiecePreview (share);
preview->Create (&w);
preview->CreateFromWindow (&w);
gtk_widget_set_usize (w, 100, 100);
gtk_widget_show (w);
gtk_container_add (GTK_CONTAINER (vpan), w);