Cleanup: various non-functional C++ changes

This commit is contained in:
Campbell Barton 2023-08-04 08:39:44 +10:00
parent 67bc7f9477
commit 7afd938dde
4 changed files with 7 additions and 7 deletions

View File

@ -354,7 +354,7 @@ void IrradianceCache::debug_pass_draw(View &view, GPUFrameBuffer *view_fb)
debug_ps_.framebuffer_set(&view_fb);
debug_ps_.shader_set(inst_.shaders.static_shader_get(DEBUG_SURFELS));
debug_ps_.push_constant("surfel_radius", 0.5f / grid.surfel_density);
debug_ps_.push_constant("debug_mode", static_cast<int>(inst_.debug_mode));
debug_ps_.push_constant("debug_mode", int(inst_.debug_mode));
debug_surfels_buf_.resize(cache->surfels_len);
/* TODO(fclem): Cleanup: Could have a function in draw::StorageArrayBuffer that takes an
@ -380,7 +380,7 @@ void IrradianceCache::debug_pass_draw(View &view, GPUFrameBuffer *view_fb)
DRW_STATE_DEPTH_LESS_EQUAL);
debug_ps_.framebuffer_set(&view_fb);
debug_ps_.shader_set(inst_.shaders.static_shader_get(DEBUG_IRRADIANCE_GRID));
debug_ps_.push_constant("debug_mode", static_cast<int>(inst_.debug_mode));
debug_ps_.push_constant("debug_mode", int(inst_.debug_mode));
debug_ps_.push_constant("grid_mat", grid.object_to_world);
float4 *data = (float4 *)cache->baking.virtual_offset;

View File

@ -419,7 +419,7 @@ void foreach_hair_particle_handle(Object *ob, ObjectHandle ob_handle, HairHandle
continue;
}
ObjectHandle particle_sys_handle = {0};
ObjectHandle particle_sys_handle = {nullptr};
particle_sys_handle.object_key = ObjectKey(ob_handle.object_key.ob, sub_key++);
particle_sys_handle.recalc = particle_sys->recalc;

View File

@ -865,14 +865,14 @@ static int calculate_bezt_draw_resolution(BezTriple *bezt,
BezTriple *prevbezt,
const blender::float2 resolution_scale)
{
const int resolution_x = (int)((bezt->vec[1][0] - prevbezt->vec[1][0]) * resolution_scale[0]);
const int resolution_x = int((bezt->vec[1][0] - prevbezt->vec[1][0]) * resolution_scale[0]);
/* Include the handles in the resolution calculation to cover the case where keys have the same
* y-value, but their handles are offset to create an arc. */
const float min_y = min_ffff(
bezt->vec[1][1], bezt->vec[2][1], prevbezt->vec[1][1], prevbezt->vec[0][1]);
const float max_y = max_ffff(
bezt->vec[1][1], bezt->vec[2][1], prevbezt->vec[1][1], prevbezt->vec[0][1]);
const int resolution_y = (int)((max_y - min_y) * resolution_scale[1]);
const int resolution_y = int((max_y - min_y) * resolution_scale[1]);
/* Using a simple sum instead of calculating the diagonal. This gives a slightly higher
* resolution but it does compensate for the fact that bezier curves can create long arcs between
* keys. */

View File

@ -13,8 +13,8 @@
#endif
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include <webp/decode.h>
#include <webp/encode.h>