quiet msvc/mingw compiler warnings.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Apr 2011 09:37:04 +0000 (09:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Apr 2011 09:37:04 +0000 (09:37 +0000)
17 files changed:
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/winstuff.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filesel.c
source/blender/render/intern/raytrace/reorganize.h
source/blender/windowmanager/intern/wm_operators.c
source/creator/CMakeLists.txt
source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/icons/winblender.rc

index 41e784a..8e46afd 100644 (file)
@@ -115,7 +115,7 @@ void BLI_getlastdir(const char* dir, char *last, int maxlen);
 int BLI_testextensie(const char *str, const char *ext);
 int BLI_testextensie_array(const char *str, const char **ext_array);
 int BLI_testextensie_glob(const char *str, const char *ext_fnmatch);
-int BLI_replace_extension(char *path, int maxlen, const char *ext);
+int BLI_replace_extension(char *path, size_t maxlen, const char *ext);
 void BLI_uniquename(struct ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short len);
 int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len);
 void BLI_newname(char * name, int add);
index bf73f2a..2407078 100644 (file)
@@ -225,7 +225,8 @@ int BLI_copy_fileops(const char *file, const char *to) {
 
 int BLI_link(const char *file, const char *to) {
        callLocalErrorCallBack("Linking files is unsupported on Windows");
-       
+       (void)file;
+       (void)to;
        return 1;
 }
 
index 0d3b17a..06dc510 100644 (file)
@@ -1353,9 +1353,9 @@ int BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
 }
 
 
-int BLI_replace_extension(char *path, int maxlen, const char *ext)
+int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
 {
-       unsigned int a;
+       size_t a;
 
        for(a=strlen(path); a>0; a--) {
                if(path[a-1] == '.' || path[a-1] == '/' || path[a-1] == '\\') {
index f39cfe1..90754e7 100644 (file)
@@ -68,7 +68,7 @@ int BLI_getInstallationDir( char * str ) {
 
 int IsConsoleEmpty(void)
 {
-       CONSOLE_SCREEN_BUFFER_INFO csbi = {0};
+       CONSOLE_SCREEN_BUFFER_INFO csbi = {{0}};
        HANDLE hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
 
        return GetConsoleScreenBufferInfo(hStdOutput, &csbi) && csbi.dwCursorPosition.X == 0 && csbi.dwCursorPosition.Y == 0;
@@ -95,7 +95,7 @@ void RegisterBlendExtension(void) {
        char BlPath[MAX_PATH];
        char InstallDir[FILE_MAXDIR];
        char SysDir[FILE_MAXDIR];
-       char* ThumbHandlerDLL;
+       const char* ThumbHandlerDLL;
        char RegCmd[MAX_PATH*2];
        char MBox[256];
        BOOL IsWOW64;
index 22bf990..bf7501a 100644 (file)
@@ -243,8 +243,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
 static void draw_tile(int sx, int sy, int width, int height, int colorid, int shade)
 {      
        UI_ThemeColorShade(colorid, shade);
-       uiSetRoundBox(15);      
-       uiRoundBox(sx, sy - height, sx + width, sy, 5);
+       uiSetRoundBox(15);
+       uiRoundBox((float)sx, (float)(sy - height), (float)(sx + width), (float)sy, 5.0f);
 }
 
 
@@ -286,15 +286,15 @@ static int get_file_icon(struct direntry *file)
 static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, int width, int height)
 {
        uiBut *but;
-       float x,y;
+       int x,y;
        /*float alpha=1.0f;*/
        
-       x = (float)(sx);
-       y = (float)(sy-height);
+       x = sx;
+       y = sy-height;
        
        /*if (icon == ICON_FILE_BLANK) alpha = 0.375f;*/
-               
-       but= uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0, 0.0, 0, 0, "");
+
+       but= uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0f, 0.0f, 0.0f, 0.0f, "");
        uiButSetDragPath(but, path);
 }
 
@@ -313,7 +313,7 @@ static void file_draw_string(int sx, int sy, const char* string, float width, in
 
        /* no text clipping needed, uiStyleFontDraw does it but is a bit too strict (for buttons it works) */
        rect.xmin = sx;
-       rect.xmax = sx + ceil(width+4.0f);
+       rect.xmax = (int)(sx + ceil(width+4.0f));
        rect.ymin = sy - height;
        rect.ymax = sy;
        
@@ -363,25 +363,25 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
                fy = ((float)layout->prv_h - (float)ey)/2.0f;
                dx = (fx + 0.5f + layout->prv_border_x);
                dy = (fy + 0.5f - layout->prv_border_y);
-               xco = (float)sx + dx;
-               yco = (float)sy - layout->prv_h + dy;
+               xco = sx + (int)dx;
+               yco = sy - layout->prv_h + (int)dy;
                
                glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA);
                
                /* shadow */
                if (dropshadow)
-                       uiDrawBoxShadow(220, xco, yco, xco + ex, yco + ey);
-               
+                       uiDrawBoxShadow(220, (float)xco, (float)yco, (float)(xco + ex), (float)(yco + ey));
+
                glEnable(GL_BLEND);
                
                /* the image */
                glColor4f(1.0, 1.0, 1.0, 1.0);
-               glaDrawPixelsTexScaled(xco, yco, imb->x, imb->y, GL_UNSIGNED_BYTE, imb->rect, scale, scale);
+               glaDrawPixelsTexScaled((float)xco, (float)yco, imb->x, imb->y, GL_UNSIGNED_BYTE, imb->rect, scale, scale);
                
                /* border */
                if (dropshadow) {
                        glColor4f(0.0f, 0.0f, 0.0f, 0.4f);
-                       fdrawbox(xco, yco, xco + ex, yco + ey);
+                       fdrawbox((float)xco, (float)yco, (float)(xco + ex), (float)(yco + ey));
                }
                
                /* dragregion */
@@ -425,10 +425,10 @@ static void draw_background(FileLayout *layout, View2D *v2d)
        /* alternating flat shade background */
        for (i=0; (i <= layout->rows); i+=2)
        {
-               sy = v2d->cur.ymax - i*(layout->tile_h+2*layout->tile_border_y) - layout->tile_border_y;
+               sy = (int)v2d->cur.ymax - i*(layout->tile_h+2*layout->tile_border_y) - layout->tile_border_y;
 
                UI_ThemeColorShade(TH_BACK, -7);
-               glRectf(v2d->cur.xmin, sy, v2d->cur.xmax, sy+layout->tile_h+2*layout->tile_border_y);
+               glRectf(v2d->cur.xmin, (float)sy, v2d->cur.xmax, (float)(sy+layout->tile_h+2*layout->tile_border_y));
                
        }
 }
@@ -438,14 +438,14 @@ static void draw_dividers(FileLayout *layout, View2D *v2d)
        int sx;
 
        /* vertical column dividers */
-       sx = v2d->tot.xmin;
+       sx = (int)v2d->tot.xmin;
        while (sx < v2d->cur.xmax) {
                sx += (layout->tile_w+2*layout->tile_border_x);
                
                UI_ThemeColorShade(TH_BACK, 30);
-               sdrawline(sx+1,  v2d->cur.ymax - layout->tile_border_y ,  sx+1,  v2d->cur.ymin); 
+               sdrawline(sx+1, (short)(v2d->cur.ymax - layout->tile_border_y),  sx+1,  (short)v2d->cur.ymin); 
                UI_ThemeColorShade(TH_BACK, -30);
-               sdrawline(sx,  v2d->cur.ymax - layout->tile_border_y ,  sx,  v2d->cur.ymin); 
+               sdrawline(sx, (short)(v2d->cur.ymax - layout->tile_border_y),  sx,  (short)v2d->cur.ymin); 
        }
 }
 
@@ -478,7 +478,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
                draw_dividers(layout, v2d);
        }
 
-       offset = ED_fileselect_layout_offset(layout, ar->v2d.cur.xmin, -ar->v2d.cur.ymax);
+       offset = ED_fileselect_layout_offset(layout, (int)ar->v2d.cur.xmin, (int)-ar->v2d.cur.ymax);
        if (offset<0) offset=0;
 
        numfiles_layout = ED_fileselect_layout_numfiles(layout, ar);
@@ -490,16 +490,16 @@ void file_draw_list(const bContext *C, ARegion *ar)
                numfiles_layout += layout->columns;
        }
 
-       textwidth =( FILE_IMGDISPLAY == params->display) ? layout->tile_w : layout->column_widths[COLUMN_NAME];
-       textheight = layout->textheight*3.0/2.0 + 0.5;
+       textwidth =( FILE_IMGDISPLAY == params->display) ? layout->tile_w : (int)layout->column_widths[COLUMN_NAME];
+       textheight = (int)(layout->textheight*3.0/2.0 + 0.5);
 
        align = ( FILE_IMGDISPLAY == params->display) ? UI_STYLE_TEXT_CENTER : UI_STYLE_TEXT_LEFT;
 
        for (i=offset; (i < numfiles) && (i<offset+numfiles_layout); ++i)
        {
                ED_fileselect_layout_tilepos(layout, i, &sx, &sy);
-               sx += v2d->tot.xmin+2;
-               sy = v2d->tot.ymax - sy;
+               sx += (int)(v2d->tot.xmin+2.0f);
+               sy = (int)(v2d->tot.ymax - sy);
 
                file = filelist_file(files, i); 
                
@@ -543,17 +543,17 @@ void file_draw_list(const bContext *C, ARegion *ar)
 
                if (!(file->selflag & EDITING_FILE))  {
                        int tpos = (FILE_IMGDISPLAY == params->display) ? sy - layout->tile_h + layout->textheight : sy;
-                       file_draw_string(sx+1, tpos, file->relname, textwidth, textheight, align);
+                       file_draw_string(sx+1, tpos, file->relname, (float)textwidth, textheight, align);
                }
 
                if (params->display == FILE_SHORTDISPLAY) {
-                       sx += layout->column_widths[COLUMN_NAME] + 12;
+                       sx += (int)layout->column_widths[COLUMN_NAME] + 12;
                        if (!(file->type & S_IFDIR)) {
                                file_draw_string(sx, sy, file->size, layout->column_widths[COLUMN_SIZE], layout->tile_h, align);        
-                               sx += layout->column_widths[COLUMN_SIZE] + 12;
+                               sx += (int)layout->column_widths[COLUMN_SIZE] + 12;
                        }
                } else if (params->display == FILE_LONGDISPLAY) {
-                       sx += layout->column_widths[COLUMN_NAME] + 12;
+                       sx += (int)layout->column_widths[COLUMN_NAME] + 12;
 
 #ifndef WIN32
                        /* rwx rwx rwx */
@@ -571,14 +571,14 @@ void file_draw_list(const bContext *C, ARegion *ar)
 #endif
 
                        file_draw_string(sx, sy, file->date, layout->column_widths[COLUMN_DATE], layout->tile_h, align);
-                       sx += layout->column_widths[COLUMN_DATE] + 12;
+                       sx += (int)layout->column_widths[COLUMN_DATE] + 12;
 
                        file_draw_string(sx, sy, file->time, layout->column_widths[COLUMN_TIME] , layout->tile_h, align); 
-                       sx += layout->column_widths[COLUMN_TIME] + 12;
+                       sx += (int)layout->column_widths[COLUMN_TIME] + 12;
 
                        if (!(file->type & S_IFDIR)) {
                                file_draw_string(sx, sy, file->size, layout->column_widths[COLUMN_SIZE], layout->tile_h, align);
-                               sx += layout->column_widths[COLUMN_SIZE] + 12;
+                               sx += (int)layout->column_widths[COLUMN_SIZE] + 12;
                        }
                }
        }
@@ -587,4 +587,3 @@ void file_draw_list(const bContext *C, ARegion *ar)
        uiDrawBlock(C, block);
 
 }
-
index 36738e4..775f06e 100644 (file)
@@ -523,7 +523,7 @@ int file_hilight_set(SpaceFile *sfile, ARegion *ar, int mx, int my)
 
                UI_view2d_region_to_view(v2d, mx, my, &fx, &fy);
 
-               active_file = ED_fileselect_layout_offset(sfile->layout, v2d->tot.xmin + fx, v2d->tot.ymax - fy);
+               active_file = ED_fileselect_layout_offset(sfile->layout, (int)(v2d->tot.xmin + fx), (int)(v2d->tot.ymax - fy));
 
                if((active_file >= 0) && (active_file < numfiles))
                        params->active_file=active_file;
@@ -906,7 +906,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent
                return OPERATOR_PASS_THROUGH;
        }
 
-       offset = ED_fileselect_layout_offset(sfile->layout, ar->v2d.cur.xmin, -ar->v2d.cur.ymax);
+       offset = ED_fileselect_layout_offset(sfile->layout, (int)ar->v2d.cur.xmin, (int)-ar->v2d.cur.ymax);
        if (offset<0) offset=0;
 
        /* scroll offset is the first file in the row/column we are editing in */
index d0cae13..ea3512b 100644 (file)
@@ -248,11 +248,11 @@ int ED_fileselect_layout_numfiles(FileLayout* layout, struct ARegion *ar)
 
        if (layout->flag & FILE_LAYOUT_HOR) {
                int width = (int)(ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*layout->tile_border_x);
-               numfiles = (float)width/(float)layout->tile_w + 0.5f;
+               numfiles = (int)((float)width / (float)layout->tile_w + 0.5f);
                return numfiles*layout->rows;
        } else {
-               int height = ar->v2d.cur.ymax - ar->v2d.cur.ymin - 2*layout->tile_border_y;
-               numfiles = (float)height/(float)layout->tile_h + 0.5f;
+               int height = (int)(ar->v2d.cur.ymax - ar->v2d.cur.ymin - 2*layout->tile_border_y);
+               numfiles = (int)((float)height/(float)layout->tile_h + 0.5f);
                return numfiles*layout->columns;
        }
 }
@@ -423,7 +423,7 @@ static void column_widths(struct FileList* files, struct FileLayout* layout)
        {
                struct direntry* file = filelist_file(files, i);        
                if (file) {
-                       int len;
+                       float len;
                        len = file_string_width(file->relname);
                        if (len > layout->column_widths[COLUMN_NAME]) layout->column_widths[COLUMN_NAME] = len;
                        len = file_string_width(file->date);
@@ -460,7 +460,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
        if (!sfile->layout->dirty) return;
 
        numfiles = filelist_numfiles(sfile->files);
-       textheight = file_font_pointsize();
+       textheight = (int)file_font_pointsize();
        layout = sfile->layout;
        layout->textheight = textheight;
 
@@ -473,7 +473,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
                layout->prv_border_y = 6;
                layout->tile_w = layout->prv_w + 2*layout->prv_border_x;
                layout->tile_h = layout->prv_h + 2*layout->prv_border_y + textheight;
-               layout->width= (v2d->cur.xmax - v2d->cur.xmin - 2*layout->tile_border_x);
+               layout->width= (int)(v2d->cur.xmax - v2d->cur.xmin - 2*layout->tile_border_x);
                layout->columns= layout->width / (layout->tile_w + 2*layout->tile_border_x);
                if(layout->columns > 0)
                        layout->rows= numfiles/layout->columns + 1; // XXX dirty, modulo is zero
@@ -491,27 +491,27 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
                layout->prv_border_x = 0;
                layout->prv_border_y = 0;
                layout->tile_h = textheight*3/2;
-               layout->height= v2d->cur.ymax - v2d->cur.ymin - 2*layout->tile_border_y;
+               layout->height= (int)(v2d->cur.ymax - v2d->cur.ymin - 2*layout->tile_border_y);
                layout->rows = layout->height / (layout->tile_h + 2*layout->tile_border_y);
         
                column_widths(sfile->files, layout);
 
                if (params->display == FILE_SHORTDISPLAY) {
                        maxlen = ICON_DEFAULT_WIDTH + 4 +
-                                        layout->column_widths[COLUMN_NAME] + 12 +
-                                        layout->column_widths[COLUMN_SIZE] + 12;
+                                        (int)layout->column_widths[COLUMN_NAME] + 12 +
+                                        (int)layout->column_widths[COLUMN_SIZE] + 12;
                } else {
                        maxlen = ICON_DEFAULT_WIDTH + 4 +
-                                        layout->column_widths[COLUMN_NAME] + 12 +
+                                        (int)layout->column_widths[COLUMN_NAME] + 12 +
 #ifndef WIN32
-                                        layout->column_widths[COLUMN_MODE1] + 12 +
-                                        layout->column_widths[COLUMN_MODE2] + 12 +
-                                        layout->column_widths[COLUMN_MODE3] + 12 +
-                                        layout->column_widths[COLUMN_OWNER] + 12 +
+                                        (int)layout->column_widths[COLUMN_MODE1] + 12 +
+                                        (int)layout->column_widths[COLUMN_MODE2] + 12 +
+                                        (int)layout->column_widths[COLUMN_MODE3] + 12 +
+                                        (int)layout->column_widths[COLUMN_OWNER] + 12 +
 #endif
-                                        layout->column_widths[COLUMN_DATE] + 12 +
-                                        layout->column_widths[COLUMN_TIME] + 12 +
-                                        layout->column_widths[COLUMN_SIZE] + 12;
+                                        (int)layout->column_widths[COLUMN_DATE] + 12 +
+                                        (int)layout->column_widths[COLUMN_TIME] + 12 +
+                                        (int)layout->column_widths[COLUMN_SIZE] + 12;
 
                }
                layout->tile_w = maxlen;
index 09df74f..856df6b 100644 (file)
 #include "BKE_global.h"
 
 #ifdef _WIN32
-#define INFINITY FLT_MAX // in mingw math.h: (1.0F/0.0F). This generates compile error, though.
+#  ifdef INFINITY
+#    undef INFINITY
+#  endif
+#  define INFINITY FLT_MAX // in mingw math.h: (1.0F/0.0F). This generates compile error, though.
 #endif
 
 extern int tot_pushup;
index 2bbb6ce..fa4c245 100644 (file)
@@ -1187,7 +1187,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
        uiItemO(col, NULL, ICON_RECOVER_LAST, "WM_OT_recover_last_session");
        uiItemL(col, "", ICON_NONE);
        
-       uiCenteredBoundsBlock(block, 0.0f);
+       uiCenteredBoundsBlock(block, 0);
        uiEndBlock(C, block);
        
        return block;
@@ -2678,9 +2678,9 @@ static void wm_radial_control_paint(bContext *C, int x, int y, void *customdata)
                r3= r1;
        } else if(rc->mode == WM_RADIALCONTROL_STRENGTH) {
                r1= (1 - rc->value) * WM_RADIAL_CONTROL_DISPLAY_SIZE;
-               r2= r3= WM_RADIAL_CONTROL_DISPLAY_SIZE;
+               r2= r3= (float)WM_RADIAL_CONTROL_DISPLAY_SIZE;
        } else if(rc->mode == WM_RADIALCONTROL_ANGLE) {
-               r1= r2= r3= WM_RADIAL_CONTROL_DISPLAY_SIZE;
+               r1= r2= r3= (float)WM_RADIAL_CONTROL_DISPLAY_SIZE;
                angle = rc->value;
        }
 
@@ -2721,9 +2721,9 @@ static void wm_radial_control_paint(bContext *C, int x, int y, void *customdata)
                glColor4f(rc->col[0], rc->col[1], rc->col[2], rc->col[3]);
                glEnable(GL_LINE_SMOOTH);
                glRotatef(-angle, 0, 0, 1);
-               fdrawline(0, 0, WM_RADIAL_CONTROL_DISPLAY_SIZE, 0);
+               fdrawline(0.0f, 0.0f, (float)WM_RADIAL_CONTROL_DISPLAY_SIZE, 0.0f);
                glRotatef(angle, 0, 0, 1);
-               fdrawline(0, 0, WM_RADIAL_CONTROL_DISPLAY_SIZE, 0);
+               fdrawline(0.0f, 0.0f, (float)WM_RADIAL_CONTROL_DISPLAY_SIZE, 0.0f);
                glDisable(GL_LINE_SMOOTH);
        }
 
@@ -2759,7 +2759,7 @@ int WM_radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
                //      delta[1]+= WM_RADIAL_CONTROL_DISPLAY_SIZE * sin(initial_value*M_PI/180.0f);
                //}
 
-               dist= sqrt(delta[0]*delta[0]+delta[1]*delta[1]);
+               dist= sqrtf(delta[0]*delta[0]+delta[1]*delta[1]);
 
                if(mode == WM_RADIALCONTROL_SIZE)
                        new_value = dist;
@@ -2794,9 +2794,9 @@ int WM_radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
                new_value = 0;
 
        /* Update paint data */
-       rc->value = new_value;
+       rc->value = (float)new_value;
 
-       RNA_float_set(op->ptr, "new_value", new_value);
+       RNA_float_set(op->ptr, "new_value", rc->value);
 
        if(ret != OPERATOR_RUNNING_MODAL) {
                WM_paint_cursor_end(CTX_wm_manager(C), rc->cursor);
@@ -2831,16 +2831,16 @@ int WM_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
        if(mode == WM_RADIALCONTROL_SIZE) {
                rc->max_value = 200;
-               mouse[0]-= initial_value;
+               mouse[0]-= (int)initial_value;
        }
        else if(mode == WM_RADIALCONTROL_STRENGTH) {
                rc->max_value = 1;
-               mouse[0]-= WM_RADIAL_CONTROL_DISPLAY_SIZE * (1 - initial_value);
+               mouse[0]-= (int)(WM_RADIAL_CONTROL_DISPLAY_SIZE * (1.0f - initial_value));
        }
        else if(mode == WM_RADIALCONTROL_ANGLE) {
                rc->max_value = 360;
-               mouse[0]-= WM_RADIAL_CONTROL_DISPLAY_SIZE * cos(initial_value);
-               mouse[1]-= WM_RADIAL_CONTROL_DISPLAY_SIZE * sin(initial_value);
+               mouse[0]-= (int)(WM_RADIAL_CONTROL_DISPLAY_SIZE * cos(initial_value));
+               mouse[1]-= (int)(WM_RADIAL_CONTROL_DISPLAY_SIZE * sin(initial_value));
                initial_value *= 180.0f/(float)M_PI;
        }
 
@@ -3029,7 +3029,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
                }
        }
        
-       time= ((PIL_check_seconds_timer()-stime)*1000);
+       time= (float)((PIL_check_seconds_timer()-stime)*1000);
 
        RNA_enum_description(redraw_timer_type_items, type, &infostr);
 
index 90723f1..9a05096 100644 (file)
@@ -101,7 +101,7 @@ set(SRC
 )
 
 # MSVC 2010 gives linking errors with the manifest
-if(WIN32 AND NOT UNIX AND NOT MSVC10)
+if(WIN32 AND NOT UNIX)
        string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
        string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
        string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
index 92cb016..edf9d24 100644 (file)
@@ -171,7 +171,7 @@ void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int
 
        /* the actual drawing */
        glColor3ub(255, 255, 255);
-       BLF_draw_default(xco, height-yco, 0.0f, (char *)text, 65535); /* XXX, use real len */
+       BLF_draw_default((float)xco, (float)(height-yco), 0.0f, (char *)text, 65535); /* XXX, use real len */
 
        glMatrixMode(GL_PROJECTION);
        glPopMatrix();
@@ -200,9 +200,9 @@ void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int widt
 
        /* draw in black first*/
        glColor3ub(0, 0, 0);
-       BLF_draw_default(xco+2, height-yco-2, 0.0f, text, 65535); /* XXX, use real len */
+       BLF_draw_default((float)(xco+2), (float)(height-yco-2), 0.0f, text, 65535); /* XXX, use real len */
        glColor3ub(255, 255, 255);
-       BLF_draw_default(xco, height-yco, 0.0f, text, 65535); /* XXX, use real len */
+       BLF_draw_default((float)xco, (float)(height-yco), 0.0f, text, 65535); /* XXX, use real len */
 
        glMatrixMode(GL_PROJECTION);
        glPopMatrix();
index 494d285..34b4172 100644 (file)
@@ -964,7 +964,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, KX_Scene* scene,
        
                                if (ma) {
                                        polymat->m_specular = MT_Vector3(ma->specr, ma->specg, ma->specb)*ma->spec;
-                                       polymat->m_shininess = (float)ma->har/4.0; // 0 < ma->har <= 512
+                                       polymat->m_shininess = (float)ma->har/4.0f; // 0 < ma->har <= 512
                                        polymat->m_diffuse = MT_Vector3(ma->r, ma->g, ma->b)*(ma->emit + ma->ref);
                                }
                                else {
@@ -1135,7 +1135,7 @@ static float my_boundbox_mesh(Mesh *me, float *loc, float *size)
 {
        MVert *mvert;
        BoundBox *bb;
-       MT_Point3 min, max;
+       float min[3], max[3];
        float mloc[3], msize[3];
        float radius=0.0f, vert_radius, *co;
        int a;
@@ -1162,17 +1162,17 @@ static float my_boundbox_mesh(Mesh *me, float *loc, float *size)
        }
                
        if(me->totvert) {
-               loc[0]= (min[0]+max[0])/2.0;
-               loc[1]= (min[1]+max[1])/2.0;
-               loc[2]= (min[2]+max[2])/2.0;
+               loc[0]= (min[0]+max[0])/2.0f;
+               loc[1]= (min[1]+max[1])/2.0f;
+               loc[2]= (min[2]+max[2])/2.0f;
                
-               size[0]= (max[0]-min[0])/2.0;
-               size[1]= (max[1]-min[1])/2.0;
-               size[2]= (max[2]-min[2])/2.0;
+               size[0]= (max[0]-min[0])/2.0f;
+               size[1]= (max[1]-min[1])/2.0f;
+               size[2]= (max[2]-min[2])/2.0f;
        }
        else {
-               loc[0]= loc[1]= loc[2]= 0.0;
-               size[0]= size[1]= size[2]= 0.0;
+               loc[0]= loc[1]= loc[2]= 0.0f;
+               size[0]= size[1]= size[2]= 0.0f;
        }
                
        bb->vec[0][0]=bb->vec[1][0]=bb->vec[2][0]=bb->vec[3][0]= loc[0]-size[0];
@@ -1210,8 +1210,8 @@ static void my_tex_space_mesh(Mesh *me)
                                        DO_MINMAX(fp, min, max);
                                }
                                if(kb->totelem) {
-                                       loc[0]= (min[0]+max[0])/2.0; loc[1]= (min[1]+max[1])/2.0; loc[2]= (min[2]+max[2])/2.0;
-                                       size[0]= (max[0]-min[0])/2.0; size[1]= (max[1]-min[1])/2.0; size[2]= (max[2]-min[2])/2.0;
+                                       loc[0]= (min[0]+max[0])/2.0f; loc[1]= (min[1]+max[1])/2.0f; loc[2]= (min[2]+max[2])/2.0f;
+                                       size[0]= (max[0]-min[0])/2.0f; size[1]= (max[1]-min[1])/2.0f; size[2]= (max[2]-min[2])/2.0f;
        } 
        else {
                                        loc[0]= loc[1]= loc[2]= 0.0;
@@ -1223,19 +1223,19 @@ static void my_tex_space_mesh(Mesh *me)
        
                VECCOPY(me->loc, loc);
                VECCOPY(me->size, size);
-               me->rot[0]= me->rot[1]= me->rot[2]= 0.0;
+               me->rot[0]= me->rot[1]= me->rot[2]= 0.0f;
        
-               if(me->size[0]==0.0) me->size[0]= 1.0;
-               else if(me->size[0]>0.0 && me->size[0]<0.00001) me->size[0]= 0.00001;
-               else if(me->size[0]<0.0 && me->size[0]> -0.00001) me->size[0]= -0.00001;
+               if(me->size[0]==0.0) me->size[0]= 1.0f;
+               else if(me->size[0]>0.0 && me->size[0]< 0.00001f) me->size[0]= 0.00001f;
+               else if(me->size[0]<0.0 && me->size[0]> -0.00001f) me->size[0]= -0.00001f;
        
-               if(me->size[1]==0.0) me->size[1]= 1.0;
-               else if(me->size[1]>0.0 && me->size[1]<0.00001) me->size[1]= 0.00001;
-               else if(me->size[1]<0.0 && me->size[1]> -0.00001) me->size[1]= -0.00001;
+               if(me->size[1]==0.0) me->size[1]= 1.0f;
+               else if(me->size[1]>0.0 && me->size[1]< 0.00001f) me->size[1]= 0.00001f;
+               else if(me->size[1]<0.0 && me->size[1]> -0.00001f) me->size[1]= -0.00001f;
                                                
-               if(me->size[2]==0.0) me->size[2]= 1.0;
-               else if(me->size[2]>0.0 && me->size[2]<0.00001) me->size[2]= 0.00001;
-               else if(me->size[2]<0.0 && me->size[2]> -0.00001) me->size[2]= -0.00001;
+               if(me->size[2]==0.0) me->size[2]= 1.0f;
+               else if(me->size[2]>0.0 && me->size[2]< 0.00001f) me->size[2]= 0.00001f;
+               else if(me->size[2]<0.0 && me->size[2]> -0.00001f) me->size[2]= -0.00001f;
        }
        
 }
@@ -1252,13 +1252,13 @@ static void my_get_local_bounds(Object *ob, DerivedMesh *dm, float *center, floa
                                float min_r[3], max_r[3];
                                INIT_MINMAX(min_r, max_r);
                                dm->getMinMax(dm, min_r, max_r);
-                               size[0]= 0.5*fabs(max_r[0] - min_r[0]);
-                               size[1]= 0.5*fabs(max_r[1] - min_r[1]);
-                               size[2]= 0.5*fabs(max_r[2] - min_r[2]);
+                               size[0]= 0.5f*fabsf(max_r[0] - min_r[0]);
+                               size[1]= 0.5f*fabsf(max_r[1] - min_r[1]);
+                               size[2]= 0.5f*fabsf(max_r[2] - min_r[2]);
                                        
-                               center[0]= 0.5*(max_r[0] + min_r[0]);
-                               center[1]= 0.5*(max_r[1] + min_r[1]);
-                               center[2]= 0.5*(max_r[2] + min_r[2]);
+                               center[0]= 0.5f*(max_r[0] + min_r[0]);
+                               center[1]= 0.5f*(max_r[1] + min_r[1]);
+                               center[2]= 0.5f*(max_r[2] + min_r[2]);
                                return;
                        } else
                        {
@@ -1291,13 +1291,13 @@ static void my_get_local_bounds(Object *ob, DerivedMesh *dm, float *center, floa
        }
        else 
        {
-               size[0]= 0.5*fabs(bb->vec[0][0] - bb->vec[4][0]);
-               size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]);
-               size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]);
+               size[0]= 0.5f*fabs(bb->vec[0][0] - bb->vec[4][0]);
+               size[1]= 0.5f*fabs(bb->vec[0][1] - bb->vec[2][1]);
+               size[2]= 0.5f*fabs(bb->vec[0][2] - bb->vec[1][2]);
                                        
-               center[0]= 0.5*(bb->vec[0][0] + bb->vec[4][0]);
-               center[1]= 0.5*(bb->vec[0][1] + bb->vec[2][1]);
-               center[2]= 0.5*(bb->vec[0][2] + bb->vec[1][2]);
+               center[0]= 0.5f*(bb->vec[0][0] + bb->vec[4][0]);
+               center[1]= 0.5f*(bb->vec[0][1] + bb->vec[2][1]);
+               center[2]= 0.5f*(bb->vec[0][2] + bb->vec[1][2]);
        }
 }
        
@@ -1638,7 +1638,7 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l
        KX_LightObject *gamelight;
        
        lightobj.m_att1 = la->att1;
-       lightobj.m_att2 = (la->mode & LA_QUAD)?la->att2:0.0;
+       lightobj.m_att2 = (la->mode & LA_QUAD) ? la->att2 : 0.0f;
        lightobj.m_red = la->r;
        lightobj.m_green = la->g;
        lightobj.m_blue = la->b;
index 0af6470..a0d58ec 100644 (file)
@@ -778,12 +778,12 @@ void      KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber)
                                        float tmat[3][3];
                                        for (int r=0;r<3;r++)
                                                for (int c=0;c<3;c++)
-                                                       tmat[r][c] = orn[c][r];
+                                                       tmat[r][c] = (float)orn[c][r];
 
                                        mat3_to_compatible_eul(blenderObject->rot, blenderObject->rot, tmat);
 
-                                       insert_keyframe(NULL, &blenderObject->id, NULL, NULL, "location", -1, frameNumber, INSERTKEY_FAST);
-                                       insert_keyframe(NULL, &blenderObject->id, NULL, NULL, "rotation_euler", -1, frameNumber, INSERTKEY_FAST);
+                                       insert_keyframe(NULL, &blenderObject->id, NULL, NULL, "location", -1, (float)frameNumber, INSERTKEY_FAST);
+                                       insert_keyframe(NULL, &blenderObject->id, NULL, NULL, "rotation_euler", -1, (float)frameNumber, INSERTKEY_FAST);
 
 #if 0
                                        const MT_Point3& position = gameObj->NodeGetWorldPosition();
@@ -1195,7 +1195,7 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
                                                }
 
                                                /* make sure action actuators are not referencing tagged actions */
-                                               for (int act_idx=0; act_idx<gameobj->GetActuators().size(); act_idx++)
+                                               for (unsigned int act_idx=0; act_idx<gameobj->GetActuators().size(); act_idx++)
                                                {
                                                        if (gameobj->GetActuators()[act_idx]->IsType(SCA_IActuator::KX_ACT_ACTION))
                                                        {
index b9e41d5..01516a2 100644 (file)
@@ -37,6 +37,8 @@
 #pragma warning (disable : 4786) 
 #endif //WIN32
 
+#include <math.h>
+
 #include "MEM_guardedalloc.h"
 
 #include "KX_BlenderSceneConverter.h"
@@ -395,7 +397,7 @@ void BL_ConvertActuators(char* maggiename,
                                                new KX_SoundActuator(gameobj,
                                                snd_sound,
                                                soundact->volume,
-                                               exp((soundact->pitch / 12.0) * log(2.0)),
+                                               (float)(exp((soundact->pitch / 12.0) * log(2.0))),
                                                is3d,
                                                settings,
                                                soundActuatorType);
@@ -542,8 +544,8 @@ void BL_ConvertActuators(char* maggiename,
                                /* convert settings... degrees in the ui become radians  */ 
                                /* internally                                            */ 
                                if (conact->type == ACT_CONST_TYPE_ORI) {
-                                       min = (MT_2_PI * conact->minloc[0])/360.0;
-                                       max = (MT_2_PI * conact->maxloc[0])/360.0;
+                                       min = (float)((MT_2_PI * conact->minloc[0])/360.0);
+                                       max = (float)((MT_2_PI * conact->maxloc[0])/360.0);
                                        switch (conact->mode) {
                                        case ACT_CONST_DIRPX:
                                                locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX;
@@ -642,18 +644,18 @@ void BL_ConvertActuators(char* maggiename,
                                                break;
                                        case ACT_CONST_ROTX:
                                                locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTX;
-                                               min = MT_2_PI * conact->minrot[0] / 360.0;
-                                               max = MT_2_PI * conact->maxrot[0] / 360.0;
+                                               min = conact->minrot[0] * (float)MT_RADS_PER_DEG;
+                                               max = conact->maxrot[0] * (float)MT_RADS_PER_DEG;
                                                break;
                                        case ACT_CONST_ROTY:
                                                locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTY;
-                                               min = MT_2_PI * conact->minrot[1] / 360.0;
-                                               max = MT_2_PI * conact->maxrot[1] / 360.0;
+                                               min = conact->minrot[1] * (float)MT_RADS_PER_DEG;
+                                               max = conact->maxrot[1] * (float)MT_RADS_PER_DEG;
                                                break;
                                        case ACT_CONST_ROTZ:
                                                locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ;
-                                               min = MT_2_PI * conact->minrot[2] / 360.0;
-                                               max = MT_2_PI * conact->maxrot[2] / 360.0;
+                                               min = conact->minrot[2] * (float)MT_RADS_PER_DEG;
+                                               max = conact->maxrot[2] * (float)MT_RADS_PER_DEG;
                                                break;
                                        default:
                                                ; /* error */ 
index d0984c1..ad6941d 100644 (file)
@@ -438,9 +438,9 @@ void BL_ConvertSensors(struct Object* blenderobject,
                                        float radius = blendernearsensor->dist;
                                        PHY__Vector3 pos;
                                        const MT_Vector3& wpos = gameobj->NodeGetWorldPosition();
-                                       pos[0] = wpos[0];
-                                       pos[1] = wpos[1];
-                                       pos[2] = wpos[2];
+                                       pos[0] = (float)wpos[0];
+                                       pos[1] = (float)wpos[1];
+                                       pos[2] = (float)wpos[2];
                                        pos[3] = 0.f;
                                        bool bFindMaterial = false;
                                        PHY_IPhysicsController* physCtrl = kxscene->GetPhysicsEnvironment()->CreateSphereController(radius,pos);
@@ -662,7 +662,7 @@ void BL_ConvertSensors(struct Object* blenderobject,
                                        MT_Scalar largemargin = 0.0;
                                        
                                        bool bFindMaterial = false;
-                                       PHY_IPhysicsController* ctrl = kxscene->GetPhysicsEnvironment()->CreateConeController(coneradius,coneheight);
+                                       PHY_IPhysicsController* ctrl = kxscene->GetPhysicsEnvironment()->CreateConeController((float)coneradius, (float)coneheight);
 
                                        gamesensor = new KX_RadarSensor(
                                                eventmgr,
index 946d2b3..ba698d7 100644 (file)
@@ -943,12 +943,12 @@ static PyObject* gPySetBackgroundColor(PyObject*, PyObject* value)
        
        if (gp_Canvas)
        {
-               gp_Rasterizer->SetBackColor(vec[0], vec[1], vec[2], vec[3]);
+               gp_Rasterizer->SetBackColor((float)vec[0], (float)vec[1], (float)vec[2], (float)vec[3]);
        }
 
        KX_WorldInfo *wi = gp_KetsjiScene->GetWorldInfo();
        if (wi->hasWorld())
-               wi->setBackColor(vec[0], vec[1], vec[2]);
+               wi->setBackColor((float)vec[0], (float)vec[1], (float)vec[2]);
 
        Py_RETURN_NONE;
 }
@@ -966,7 +966,7 @@ static PyObject* gPySetMistColor(PyObject*, PyObject* value)
                PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setMistColor(color), Rasterizer not available");
                return NULL;
        }       
-       gp_Rasterizer->SetFogColor(vec[0], vec[1], vec[2]);
+       gp_Rasterizer->SetFogColor((float)vec[0], (float)vec[1], (float)vec[2]);
        
        Py_RETURN_NONE;
 }
@@ -1031,7 +1031,7 @@ static PyObject* gPySetAmbientColor(PyObject*, PyObject* value)
                PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setAmbientColor(color), Rasterizer not available");
                return NULL;
        }       
-       gp_Rasterizer->SetAmbientColor(vec[0], vec[1], vec[2]);
+       gp_Rasterizer->SetAmbientColor((float)vec[0], (float)vec[1], (float)vec[2]);
        
        Py_RETURN_NONE;
 }
index 316786c..244c2cb 100644 (file)
@@ -23,13 +23,8 @@ BEGIN
   BEGIN
     BLOCK "04090000"
     BEGIN
-#ifdef WINDRES // this doesnt work for mingw.
       VALUE "FileVersion", BLEN_VER_RC_STR
       VALUE "ProductVersion", BLEN_VER_RC_STR
-#else
-      VALUE "FileVersion", "Unknown"
-      VALUE "ProductVersion", "Unknown"
-#endif
       VALUE "CompanyName", "Blender Foundation"
       VALUE "FileDescription", "Blender"
       VALUE "LegalCopyright", "GPLv2 (Blender Foundation)"