Cleanup: use const pointer for view access API
This commit is contained in:
@@ -340,7 +340,7 @@ static void CLAY_engine_init(void *vedata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
float *viewport_size = DRW_viewport_size_get();
|
const float *viewport_size = DRW_viewport_size_get();
|
||||||
DRWFboTexture tex = {&txl->depth_dup, DRW_BUF_DEPTH_24, 0};
|
DRWFboTexture tex = {&txl->depth_dup, DRW_BUF_DEPTH_24, 0};
|
||||||
DRW_framebuffer_init(&fbl->dupli_depth,
|
DRW_framebuffer_init(&fbl->dupli_depth,
|
||||||
(int)viewport_size[0], (int)viewport_size[1],
|
(int)viewport_size[0], (int)viewport_size[1],
|
||||||
@@ -360,7 +360,7 @@ static void CLAY_engine_init(void *vedata)
|
|||||||
{-1.0f, 1.0f, -1.0f, 1.0f}
|
{-1.0f, 1.0f, -1.0f, 1.0f}
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
float *size = DRW_viewport_size_get();
|
const float *size = DRW_viewport_size_get();
|
||||||
|
|
||||||
DRW_get_dfdy_factors(dfdyfacs);
|
DRW_get_dfdy_factors(dfdyfacs);
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ static void EEVEE_engine_init(void *vedata)
|
|||||||
|
|
||||||
DRWFboTexture tex = {&txl->color, DRW_BUF_RGBA_16, DRW_TEX_FILTER};
|
DRWFboTexture tex = {&txl->color, DRW_BUF_RGBA_16, DRW_TEX_FILTER};
|
||||||
|
|
||||||
float *viewport_size = DRW_viewport_size_get();
|
const float *viewport_size = DRW_viewport_size_get();
|
||||||
DRW_framebuffer_init(&fbl->main,
|
DRW_framebuffer_init(&fbl->main,
|
||||||
(int)viewport_size[0], (int)viewport_size[1],
|
(int)viewport_size[0], (int)viewport_size[1],
|
||||||
&tex, 1);
|
&tex, 1);
|
||||||
|
@@ -248,9 +248,9 @@ typedef enum {
|
|||||||
|
|
||||||
void DRW_viewport_init(const bContext *C);
|
void DRW_viewport_init(const bContext *C);
|
||||||
void DRW_viewport_matrix_get(float mat[4][4], DRWViewportMatrixType type);
|
void DRW_viewport_matrix_get(float mat[4][4], DRWViewportMatrixType type);
|
||||||
float *DRW_viewport_size_get(void);
|
const float *DRW_viewport_size_get(void);
|
||||||
float *DRW_viewport_screenvecs_get(void);
|
const float *DRW_viewport_screenvecs_get(void);
|
||||||
float *DRW_viewport_pixelsize_get(void);
|
const float *DRW_viewport_pixelsize_get(void);
|
||||||
bool DRW_viewport_is_persp_get(void);
|
bool DRW_viewport_is_persp_get(void);
|
||||||
bool DRW_viewport_cache_is_dirty(void);
|
bool DRW_viewport_cache_is_dirty(void);
|
||||||
|
|
||||||
|
@@ -1318,17 +1318,17 @@ static void *DRW_viewport_engine_data_get(void *engine_type)
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
float *DRW_viewport_size_get(void)
|
const float *DRW_viewport_size_get(void)
|
||||||
{
|
{
|
||||||
return &DST.size[0];
|
return &DST.size[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
float *DRW_viewport_screenvecs_get(void)
|
const float *DRW_viewport_screenvecs_get(void)
|
||||||
{
|
{
|
||||||
return &DST.screenvecs[0][0];
|
return &DST.screenvecs[0][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
float *DRW_viewport_pixelsize_get(void)
|
const float *DRW_viewport_pixelsize_get(void)
|
||||||
{
|
{
|
||||||
return &DST.pixsize;
|
return &DST.pixsize;
|
||||||
}
|
}
|
||||||
|
@@ -133,7 +133,7 @@ static void EDIT_MESH_engine_init(void *vedata)
|
|||||||
EDIT_MESH_TextureList *txl = ((EDIT_MESH_Data *)vedata)->txl;
|
EDIT_MESH_TextureList *txl = ((EDIT_MESH_Data *)vedata)->txl;
|
||||||
EDIT_MESH_FramebufferList *fbl = ((EDIT_MESH_Data *)vedata)->fbl;
|
EDIT_MESH_FramebufferList *fbl = ((EDIT_MESH_Data *)vedata)->fbl;
|
||||||
|
|
||||||
float *viewport_size = DRW_viewport_size_get();
|
const float *viewport_size = DRW_viewport_size_get();
|
||||||
|
|
||||||
DRWFboTexture tex[2] = {{
|
DRWFboTexture tex[2] = {{
|
||||||
&txl->occlude_wire_depth_tx, DRW_BUF_DEPTH_24, 0},
|
&txl->occlude_wire_depth_tx, DRW_BUF_DEPTH_24, 0},
|
||||||
|
@@ -209,7 +209,7 @@ static void OBJECT_engine_init(void *vedata)
|
|||||||
OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl;
|
OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl;
|
||||||
OBJECT_FramebufferList *fbl = ((OBJECT_Data *)vedata)->fbl;
|
OBJECT_FramebufferList *fbl = ((OBJECT_Data *)vedata)->fbl;
|
||||||
|
|
||||||
float *viewport_size = DRW_viewport_size_get();
|
const float *viewport_size = DRW_viewport_size_get();
|
||||||
|
|
||||||
DRWFboTexture tex[2] = {{&txl->outlines_depth_tx, DRW_BUF_DEPTH_24, 0},
|
DRWFboTexture tex[2] = {{&txl->outlines_depth_tx, DRW_BUF_DEPTH_24, 0},
|
||||||
{&txl->outlines_color_tx, DRW_BUF_RGBA_8, DRW_TEX_FILTER}};
|
{&txl->outlines_color_tx, DRW_BUF_RGBA_8, DRW_TEX_FILTER}};
|
||||||
|
Reference in New Issue
Block a user