Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 5af3a3f4241..db7de01bee5 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -100,8 +100,6 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
-#include "GPU_draw.h"
-
#include "IMB_colormanagement.h"
//#include "bmesh_tools.h"
@@ -1385,7 +1383,7 @@ static void insert_seam_vert_array(const ProjPaintState *ps,
const int fidx[2] = {fidx1, ((fidx1 + 1) % 3)};
float vec[2];
- VertSeam *vseam = BLI_memarena_alloc(arena, sizeof(VertSeam) * 2);
+ VertSeam *vseam = BLI_memarena_alloc(arena, sizeof(VertSeam[2]));
vseam->prev = NULL;
vseam->next = NULL;
@@ -2787,10 +2785,10 @@ static void project_bucket_clip_face(const bool is_ortho,
}
if (flip) {
- qsort(isectVCosSS, *tot, sizeof(float) * 3, float_z_sort_flip);
+ qsort(isectVCosSS, *tot, sizeof(float[3]), float_z_sort_flip);
}
else {
- qsort(isectVCosSS, *tot, sizeof(float) * 3, float_z_sort);
+ qsort(isectVCosSS, *tot, sizeof(float[3]), float_z_sort);
}
doubles = true;
@@ -2930,7 +2928,7 @@ static void project_bucket_clip_face(const bool is_ortho,
/* checks if pt is inside a convex 2D polyline, the polyline must be ordered rotating clockwise
* otherwise it would have to test for mixed (line_point_side_v2 > 0.0f) cases */
-static bool IsectPoly2Df(const float pt[2], float uv[][2], const int tot)
+static bool IsectPoly2Df(const float pt[2], const float uv[][2], const int tot)
{
int i;
if (line_point_side_v2(uv[tot - 1], uv[0], pt) < 0.0f) {
@@ -2945,7 +2943,7 @@ static bool IsectPoly2Df(const float pt[2], float uv[][2], const int tot)
return true;
}
-static bool IsectPoly2Df_twoside(const float pt[2], float uv[][2], const int tot)
+static bool IsectPoly2Df_twoside(const float pt[2], const float uv[][2], const int tot)
{
const bool side = (line_point_side_v2(uv[tot - 1], uv[0], pt) > 0.0f);
@@ -3311,7 +3309,7 @@ static void project_paint_face_init(const ProjPaintState *ps,
has_x_isect = 0;
for (x = bounds_px.xmin; x < bounds_px.xmax; x++) {
- float puv[2] = {(float)x, (float)y};
+ const float puv[2] = {(float)x, (float)y};
bool in_bounds;
// uv[0] = (((float)x) + 0.5f) / (float)ibuf->x;
/* use offset uvs instead */
@@ -3874,7 +3872,7 @@ static void proj_paint_state_cavity_init(ProjPaintState *ps)
if (ps->do_mask_cavity) {
int *counter = MEM_callocN(sizeof(int) * ps->totvert_eval, "counter");
- float(*edges)[3] = MEM_callocN(sizeof(float) * 3 * ps->totvert_eval, "edges");
+ float(*edges)[3] = MEM_callocN(sizeof(float[3]) * ps->totvert_eval, "edges");
ps->cavities = MEM_mallocN(sizeof(float) * ps->totvert_eval, "ProjectPaint Cavities");
cavities = ps->cavities;
@@ -5758,7 +5756,7 @@ void paint_proj_stroke(const bContext *C,
View3D *v3d = CTX_wm_view3d(C);
ARegion *region = CTX_wm_region(C);
float *cursor = scene->cursor.location;
- int mval_i[2] = {(int)pos[0], (int)pos[1]};
+ const int mval_i[2] = {(int)pos[0], (int)pos[1]};
view3d_operator_needs_opengl(C);
@@ -6125,8 +6123,8 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- float pos[2] = {0.0, 0.0};
- float lastpos[2] = {0.0, 0.0};
+ const float pos[2] = {0.0, 0.0};
+ const float lastpos[2] = {0.0, 0.0};
int a;
project_paint_op(&ps, lastpos, pos);
@@ -6134,7 +6132,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
project_image_refresh_tagged(&ps);
for (a = 0; a < ps.image_tot; a++) {
- GPU_free_image(ps.projImages[a].ima);
+ BKE_image_free_gputextures(ps.projImages[a].ima);
WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ps.projImages[a].ima);
}
@@ -6175,7 +6173,7 @@ static bool texture_paint_image_from_view_poll(bContext *C)
CTX_wm_operator_poll_msg_set(C, "No 3D viewport found to create image from");
return false;
}
- if (G.background || !GPU_is_initialized()) {
+ if (G.background || !GPU_is_init()) {
return false;
}
return true;