Cleanup GP: Change playing field to boolean
This commit is contained in:
parent
b274a01e58
commit
d04e8f41ae
|
@ -754,7 +754,7 @@ static void gpencil_draw_strokes(
|
|||
DRWShadingGroup *strokegrp;
|
||||
float viewmatrix[4][4];
|
||||
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
|
||||
const bool playing = (bool)stl->storage->playing;
|
||||
const bool playing = stl->storage->is_playing;
|
||||
const bool is_render = (bool)stl->storage->is_render;
|
||||
const bool is_mat_preview = (bool)stl->storage->is_mat_preview;
|
||||
const bool overlay_multiedit = v3d != NULL ? (v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES) : true;
|
||||
|
@ -1141,7 +1141,7 @@ void DRW_gpencil_populate_multiedit(GPENCIL_e_data *e_data, void *vedata, Scene
|
|||
cache->cache_idx = 0;
|
||||
|
||||
/* check if playing animation */
|
||||
bool playing = (bool)stl->storage->playing;
|
||||
bool playing = stl->storage->is_playing;
|
||||
|
||||
/* draw strokes */
|
||||
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
|
||||
|
@ -1187,7 +1187,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene
|
|||
const bool overlay = v3d != NULL ? (bool)((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) : true;
|
||||
|
||||
/* check if playing animation */
|
||||
bool playing = (bool)stl->storage->playing;
|
||||
bool playing = stl->storage->is_playing;
|
||||
|
||||
GpencilBatchCache *cache = gpencil_batch_cache_get(ob, cfra_eval);
|
||||
cache->cache_idx = 0;
|
||||
|
|
|
@ -327,9 +327,9 @@ void GPENCIL_cache_init(void *vedata)
|
|||
DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND);
|
||||
|
||||
/* detect if playing animation */
|
||||
stl->storage->playing = 0;
|
||||
stl->storage->is_playing = false;
|
||||
if (draw_ctx->evil_C) {
|
||||
stl->storage->playing = ED_screen_animation_playing(CTX_wm_manager(draw_ctx->evil_C)) != NULL ? 1 : 0;
|
||||
stl->storage->is_playing = ED_screen_animation_playing(CTX_wm_manager(draw_ctx->evil_C)) != NULL ? true : false;
|
||||
}
|
||||
|
||||
if (obact_gpd) {
|
||||
|
@ -337,7 +337,7 @@ void GPENCIL_cache_init(void *vedata)
|
|||
* and this produces errors. To be sure, we set cache as dirty because the frame
|
||||
* is changing.
|
||||
*/
|
||||
if (stl->storage->playing == 1) {
|
||||
if (stl->storage->is_playing == true) {
|
||||
obact_gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
|
||||
}
|
||||
/* if render, set as dirty to update all data */
|
||||
|
@ -351,9 +351,9 @@ void GPENCIL_cache_init(void *vedata)
|
|||
stl->storage->is_mat_preview = (bool)stl->storage->is_render && STREQ(scene->id.name + 2, "preview");
|
||||
|
||||
/* save simplify flags (can change while drawing, so it's better to save) */
|
||||
stl->storage->simplify_fill = GP_SIMPLIFY_FILL(scene, stl->storage->playing);
|
||||
stl->storage->simplify_modif = GP_SIMPLIFY_MODIF(scene, stl->storage->playing);
|
||||
stl->storage->simplify_fx = GP_SIMPLIFY_FX(scene, stl->storage->playing);
|
||||
stl->storage->simplify_fill = GP_SIMPLIFY_FILL(scene, stl->storage->is_playing);
|
||||
stl->storage->simplify_modif = GP_SIMPLIFY_MODIF(scene, stl->storage->is_playing);
|
||||
stl->storage->simplify_fx = GP_SIMPLIFY_FX(scene, stl->storage->is_playing);
|
||||
|
||||
/* save pixsize */
|
||||
stl->storage->pixsize = DRW_viewport_pixelsize_get();
|
||||
|
@ -364,7 +364,7 @@ void GPENCIL_cache_init(void *vedata)
|
|||
/* detect if painting session */
|
||||
if ((obact_gpd) &&
|
||||
(obact_gpd->flag & GP_DATA_STROKE_PAINTMODE) &&
|
||||
(stl->storage->playing == 0))
|
||||
(stl->storage->is_playing == false))
|
||||
{
|
||||
if (((obact_gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) &&
|
||||
(obact_gpd->runtime.sbuffer_size > 1))
|
||||
|
@ -637,7 +637,7 @@ void GPENCIL_draw_scene(void *ved)
|
|||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
View3D *v3d = draw_ctx->v3d;
|
||||
Object *obact = draw_ctx->obact;
|
||||
const bool playing = (bool)stl->storage->playing;
|
||||
const bool playing = stl->storage->is_playing;
|
||||
const bool is_render = stl->storage->is_render;
|
||||
|
||||
/* paper pass to display a confortable area to draw over complex scenes with geometry */
|
||||
|
|
|
@ -105,7 +105,7 @@ typedef struct GPENCIL_Storage {
|
|||
int keep_size;
|
||||
float obj_scale;
|
||||
float pixfactor;
|
||||
int playing;
|
||||
bool is_playing;
|
||||
bool is_render;
|
||||
bool is_mat_preview;
|
||||
const float *pixsize;
|
||||
|
|
Loading…
Reference in New Issue