Skip to content

Commit 6cc42f7

Browse files
committed
render/render_opengl: Ignore missing scene objects
1 parent 46b4bc0 commit 6cc42f7

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

engine/modules/render/src/util/object_processing.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ fn process_render_group_2d<S>(
9393

9494
for child_obj_handle in child_objects {
9595
let (obj_transform, obj_anchor, child_version) = {
96-
let mut child_object = get_render_context_2d()
96+
//TODO: stopgap until render graph buffering is properly implemented
97+
let Some(mut child_object) = get_render_context_2d()
9798
.get_object_mut(child_obj_handle)
98-
.unwrap();
99+
else { continue; };
99100

100101
(
101102
child_object.get_transform().value,

engine/modules/render_opengl/src/shaders.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn compile_shaders(shaders: &Vec<Resource>) -> (Vec<GlShaderHandle>, ShaderRefle
158158
let entry_point_c = CString::new("main").unwrap();
159159
glSpecializeShaderARB(
160160
shader_handle,
161-
entry_point_c.as_ptr(),
161+
entry_point_c.as_ptr().cast(),
162162
0,
163163
ptr::null(),
164164
ptr::null(),
@@ -179,7 +179,7 @@ fn compile_shaders(shaders: &Vec<Resource>) -> (Vec<GlShaderHandle>, ShaderRefle
179179
debug!(LOGGER, "GLSL source:\n{}", glsl_src);
180180

181181
let glsl_src_len = glsl_src.len() as GLint;
182-
glShaderSource(shader_handle, 1, &glsl_src_c.as_ptr(), &glsl_src_len);
182+
glShaderSource(shader_handle, 1, &glsl_src_c.as_ptr().cast(), &glsl_src_len);
183183
glCompileShader(shader_handle);
184184
}
185185

@@ -270,8 +270,8 @@ pub(crate) fn link_program(shader_uids: impl IntoIterator<Item = impl AsRef<str>
270270

271271
let out_color_name_c = CString::new(SHADER_OUT_COLOR).unwrap();
272272
let out_light_opac_name_c = CString::new(SHADER_OUT_LIGHT_OPACITY).unwrap();
273-
glBindFragDataLocation(program_handle, 0, out_color_name_c.as_ptr());
274-
glBindFragDataLocation(program_handle, 1, out_light_opac_name_c.as_ptr());
273+
glBindFragDataLocation(program_handle, 0, out_color_name_c.as_ptr().cast());
274+
glBindFragDataLocation(program_handle, 1, out_light_opac_name_c.as_ptr().cast());
275275

276276
glLinkProgram(program_handle);
277277

engine/modules/render_opengl/src/twod/object_proc_impl.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ pub(crate) fn process_object(
4242
is_transform_dirty: bool,
4343
state: &mut RendererState,
4444
) {
45-
let mut object = get_render_context_2d().get_object_mut(object_handle).unwrap();
45+
//TODO: stopgap until render graph buffering is properly implemented
46+
let Some(mut object) = get_render_context_2d().get_object_mut(object_handle) else { return; };
4647

4748
let existing_obj = {
4849
let scene_state = state.scene_states_2d.entry(scene_id.to_string()).or_insert_with(|| {

engine/modules/render_opengl/src/util/gl_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub(crate) unsafe extern "C" fn gl_debug_callback(
8686
_ => LogLevel::Debug, // shouldn't happen
8787
};
8888

89-
GL_LOGGER.log(level, CStr::from_ptr(message).to_string_lossy());
89+
GL_LOGGER.log(level, CStr::from_ptr(message.cast()).to_string_lossy());
9090
}
9191

9292
pub(crate) fn set_attrib_pointer(

0 commit comments

Comments
 (0)