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/render/render_preview.cc')
-rw-r--r--source/blender/editors/render/render_preview.cc39
1 files changed, 20 insertions, 19 deletions
diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc
index 5aae48b1138..09394ea33be 100644
--- a/source/blender/editors/render/render_preview.cc
+++ b/source/blender/editors/render/render_preview.cc
@@ -104,7 +104,7 @@ static void icon_copy_rect(ImBuf *ibuf, uint w, uint h, uint *rect);
struct ShaderPreview {
/* from wmJob */
void *owner;
- short *stop, *do_update;
+ bool *stop, *do_update;
Scene *scene;
ID *id, *id_copy;
@@ -630,10 +630,10 @@ static bool ed_preview_draw_rect(ScrArea *area, int split, int first, rcti *rect
bool ok = false;
if (!split || first) {
- sprintf(name, "Preview %p", (void *)area);
+ BLI_snprintf(name, sizeof(name), "Preview %p", (void *)area);
}
else {
- sprintf(name, "SecondPreview %p", (void *)area);
+ BLI_snprintf(name, sizeof(name), "SecondPreview %p", (void *)area);
}
if (split) {
@@ -1047,7 +1047,7 @@ static void shader_preview_update(void *spv, RenderResult * /*rr*/, struct rcti
}
/* called by renderer, checks job value */
-static int shader_preview_break(void *spv)
+static bool shader_preview_break(void *spv)
{
ShaderPreview *sp = static_cast<ShaderPreview *>(spv);
@@ -1152,10 +1152,10 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
}
if (!split || first) {
- sprintf(name, "Preview %p", sp->owner);
+ BLI_snprintf(name, sizeof(name), "Preview %p", sp->owner);
}
else {
- sprintf(name, "SecondPreview %p", sp->owner);
+ BLI_snprintf(name, sizeof(name), "SecondPreview %p", sp->owner);
}
re = RE_GetRender(name);
@@ -1223,7 +1223,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
}
/* runs inside thread for material and icons */
-static void shader_preview_startjob(void *customdata, short *stop, short *do_update)
+static void shader_preview_startjob(void *customdata, bool *stop, bool *do_update)
{
ShaderPreview *sp = static_cast<ShaderPreview *>(customdata);
@@ -1408,7 +1408,7 @@ static void set_alpha(char *cp, int sizex, int sizey, char alpha)
}
}
-static void icon_preview_startjob(void *customdata, short *stop, short *do_update)
+static void icon_preview_startjob(void *customdata, bool *stop, bool *do_update)
{
ShaderPreview *sp = static_cast<ShaderPreview *>(customdata);
@@ -1488,8 +1488,8 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
* does not run two of them at the same time. */
static void common_preview_startjob(void *customdata,
- short *stop,
- short *do_update,
+ bool *stop,
+ bool *do_update,
float * /*progress*/)
{
ShaderPreview *sp = static_cast<ShaderPreview *>(customdata);
@@ -1509,8 +1509,8 @@ static void common_preview_startjob(void *customdata,
static void other_id_types_preview_render(IconPreview *ip,
IconPreviewSize *cur_size,
const ePreviewRenderMethod pr_method,
- short *stop,
- short *do_update,
+ bool *stop,
+ bool *do_update,
float *progress)
{
ShaderPreview *sp = MEM_cnew<ShaderPreview>("Icon ShaderPreview");
@@ -1570,8 +1570,8 @@ static int icon_previewimg_size_index_get(const IconPreviewSize *icon_size,
}
static void icon_preview_startjob_all_sizes(void *customdata,
- short *stop,
- short *do_update,
+ bool *stop,
+ bool *do_update,
float *progress)
{
IconPreview *ip = (IconPreview *)customdata;
@@ -1735,7 +1735,7 @@ class PreviewLoadJob {
void push_load_request(PreviewImage *preview, eIconSizes icon_size);
private:
- static void run_fn(void *customdata, short *stop, short *do_update, float *progress);
+ static void run_fn(void *customdata, bool *stop, bool *do_update, float *progress);
static void update_fn(void *customdata);
static void end_fn(void *customdata);
static void free_fn(void *customdata);
@@ -1755,7 +1755,8 @@ PreviewLoadJob::~PreviewLoadJob()
PreviewLoadJob &PreviewLoadJob::ensure_job(wmWindowManager *wm, wmWindow *win)
{
- wmJob *wm_job = WM_jobs_get(wm, win, nullptr, "Load Previews", 0, WM_JOB_TYPE_LOAD_PREVIEW);
+ wmJob *wm_job = WM_jobs_get(
+ wm, win, nullptr, "Load Previews", eWM_JobFlag(0), WM_JOB_TYPE_LOAD_PREVIEW);
if (!WM_jobs_is_running(wm_job)) {
PreviewLoadJob *job_data = MEM_new<PreviewLoadJob>("PreviewLoadJobData");
@@ -1776,7 +1777,7 @@ void PreviewLoadJob::load_jobless(PreviewImage *preview, const eIconSizes icon_s
job_data.push_load_request(preview, icon_size);
- short stop = 0, do_update = 0;
+ bool stop = false, do_update = false;
float progress = 0;
run_fn(&job_data, &stop, &do_update, &progress);
update_fn(&job_data);
@@ -1798,7 +1799,7 @@ void PreviewLoadJob::push_load_request(PreviewImage *preview, const eIconSizes i
BLI_thread_queue_push(todo_queue_, &requested_previews_.back());
}
-void PreviewLoadJob::run_fn(void *customdata, short *stop, short *do_update, float * /*progress*/)
+void PreviewLoadJob::run_fn(void *customdata, bool *stop, bool *do_update, float * /*progress*/)
{
PreviewLoadJob *job_data = static_cast<PreviewLoadJob *>(customdata);
@@ -1936,7 +1937,7 @@ void ED_preview_icon_render(
}
IconPreview ip = {nullptr};
- short stop = false, update = false;
+ bool stop = false, update = false;
float progress = 0.0f;
ED_preview_ensure_dbase();