Fix: MSVC Type promotion errors
Looks like newer versions of c++ doesn't want to implicitely do type promotions from int to float. The patch fixes them. Also fixed a typo `outter` -> `outer`. Pull Request: https://projects.blender.org/blender/blender/pulls/139435
This commit is contained in:
@@ -352,20 +352,20 @@ static void drawWalkPixel(const bContext * /*C*/, ARegion *region, void *arg)
|
||||
/* Draws an aim/cross in the center. */
|
||||
WalkInfo *walk = static_cast<WalkInfo *>(arg);
|
||||
|
||||
float outter_length = 24;
|
||||
float inner_length = 14;
|
||||
const float outer_length = 24.0f;
|
||||
const float inner_length = 14.0f;
|
||||
float xoff, yoff;
|
||||
rctf viewborder;
|
||||
|
||||
if (ED_view3d_cameracontrol_object_get(walk->v3d_camera_control)) {
|
||||
ED_view3d_calc_camera_border(
|
||||
walk->scene, walk->depsgraph, region, walk->v3d, walk->rv3d, false, &viewborder);
|
||||
xoff = int(viewborder.xmin + BLI_rctf_size_x(&viewborder) * 0.5f);
|
||||
yoff = int(viewborder.ymin + BLI_rctf_size_y(&viewborder) * 0.5f);
|
||||
xoff = viewborder.xmin + BLI_rctf_size_x(&viewborder) * 0.5f;
|
||||
yoff = viewborder.ymin + BLI_rctf_size_y(&viewborder) * 0.5f;
|
||||
}
|
||||
else {
|
||||
xoff = walk->region->winx / 2;
|
||||
yoff = walk->region->winy / 2;
|
||||
xoff = float(walk->region->winx) / 2.0f;
|
||||
yoff = float(walk->region->winy) / 2.0f;
|
||||
}
|
||||
|
||||
GPUVertFormat *format = immVertexFormat();
|
||||
@@ -379,19 +379,19 @@ static void drawWalkPixel(const bContext * /*C*/, ARegion *region, void *arg)
|
||||
|
||||
/* North. */
|
||||
immVertex2f(pos, xoff, yoff + inner_length);
|
||||
immVertex2f(pos, xoff, yoff + outter_length);
|
||||
immVertex2f(pos, xoff, yoff + outer_length);
|
||||
|
||||
/* East. */
|
||||
immVertex2f(pos, xoff + inner_length, yoff);
|
||||
immVertex2f(pos, xoff + outter_length, yoff);
|
||||
immVertex2f(pos, xoff + outer_length, yoff);
|
||||
|
||||
/* South. */
|
||||
immVertex2f(pos, xoff, yoff - inner_length);
|
||||
immVertex2f(pos, xoff, yoff - outter_length);
|
||||
immVertex2f(pos, xoff, yoff - outer_length);
|
||||
|
||||
/* West. */
|
||||
immVertex2f(pos, xoff - inner_length, yoff);
|
||||
immVertex2f(pos, xoff - outter_length, yoff);
|
||||
immVertex2f(pos, xoff - outer_length, yoff);
|
||||
|
||||
immEnd();
|
||||
immUnbindProgram();
|
||||
|
||||
Reference in New Issue
Block a user