diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-10 13:37:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-10 13:37:04 +0400 |
commit | 1c6956a4d6b15ddca3588f1838d3b9903e7239af (patch) | |
tree | c8aee4e95b584f4c6f5a46a8a44d1ebcd491ab6b /source/blender/editors/space_file/file_draw.c | |
parent | 2d677efb3b52814d5b96f1aa496d75083187b3fe (diff) |
quiet msvc/mingw compiler warnings.
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 22bf99053e8..bf7501ae5ce 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -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); } - |