Skip to content

Commit

Permalink
Update for latest master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinou committed Oct 10, 2021
1 parent 0bd6f51 commit 77968a3
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 110 deletions.
6 changes: 3 additions & 3 deletions drivers/opengl/rasterizer_canvas_base_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ RasterizerStorageOpenGL::Texture *RasterizerCanvasBaseOpenGL::_bind_canvas_textu
RasterizerStorageOpenGL::Texture *tex_return = NULL;

if (p_texture.is_valid()) {
RasterizerStorageOpenGL::Texture *texture = storage->texture_owner.getornull(p_texture);
RasterizerStorageOpenGL::Texture *texture = storage->texture_owner.get_or_null(p_texture);

if (!texture) {
state.current_tex = RID();
Expand Down Expand Up @@ -305,7 +305,7 @@ RasterizerStorageOpenGL::Texture *RasterizerCanvasBaseOpenGL::_bind_canvas_textu
state.canvas_shader.set_uniform(CanvasShaderOpenGL::USE_DEFAULT_NORMAL, state.current_normal.is_valid());

} else if (p_normal_map.is_valid()) {
RasterizerStorageOpenGL::Texture *normal_map = storage->texture_owner.getornull(p_normal_map);
RasterizerStorageOpenGL::Texture *normal_map = storage->texture_owner.get_or_null(p_normal_map);

if (!normal_map) {
state.current_normal = RID();
Expand Down Expand Up @@ -1008,7 +1008,7 @@ void RasterizerCanvasBaseOpenGL::canvas_light_shadow_buffer_update(RID p_buffer,
LightOccluderInstance *instance = p_occluders;

while (instance) {
RasterizerStorageOpenGL::CanvasOccluder *cc = storage->canvas_occluder_owner.getornull(instance->polygon_buffer);
RasterizerStorageOpenGL::CanvasOccluder *cc = storage->canvas_occluder_owner.get_or_null(instance->polygon_buffer);
if (!cc || cc->len == 0 || !(p_light_mask & instance->light_mask)) {
instance = instance->next;
continue;
Expand Down
2 changes: 1 addition & 1 deletion drivers/opengl/rasterizer_canvas_batcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ class RasterizerCanvasBatcher {

typename T_STORAGE::Texture *_get_canvas_texture(const RID &p_texture) const {
if (p_texture.is_valid()) {
typename T_STORAGE::Texture *texture = get_storage()->texture_owner.getornull(p_texture);
typename T_STORAGE::Texture *texture = get_storage()->texture_owner.get_or_null(p_texture);

if (texture) {
return texture->get_ptr();
Expand Down
16 changes: 8 additions & 8 deletions drivers/opengl/rasterizer_canvas_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ void RasterizerCanvasOpenGL::render_batches(Item::Command *const *p_commands, It

// very inefficient, improve this
if (r->texture.is_valid()) {
RasterizerStorageOpenGL::Texture *texture = storage->texture_owner.getornull(r->texture);
RasterizerStorageOpenGL::Texture *texture = storage->texture_owner.get_or_null(r->texture);

if (texture) {
if (texture->is_upside_down())
Expand All @@ -424,7 +424,7 @@ void RasterizerCanvasOpenGL::render_batches(Item::Command *const *p_commands, It
if (r->texture.is_valid() && r->flags & CANVAS_RECT_TILE && !storage->config.support_npot_repeat_mipmap) {
// workaround for when setting tiling does not work due to hardware limitation

RasterizerStorageOpenGL::Texture *texture = storage->texture_owner.getornull(r->texture);
RasterizerStorageOpenGL::Texture *texture = storage->texture_owner.get_or_null(r->texture);

if (texture) {
texture = texture->get_ptr();
Expand Down Expand Up @@ -883,7 +883,7 @@ void RasterizerCanvasOpenGL::render_batches(Item::Command *const *p_commands, It
state.canvas_shader.set_uniform(CanvasShaderOpenGL::COLOR_TEXPIXEL_SIZE, texpixel_size);
}

RasterizerStorageOpenGL::Mesh *mesh_data = storage->mesh_owner.getornull(mesh->mesh);
RasterizerStorageOpenGL::Mesh *mesh_data = storage->mesh_owner.get_or_null(mesh->mesh);
if (mesh_data) {
for (int j = 0; j < mesh_data->surfaces.size(); j++) {
RasterizerStorageOpenGL::Surface *s = mesh_data->surfaces[j];
Expand Down Expand Up @@ -932,12 +932,12 @@ void RasterizerCanvasOpenGL::render_batches(Item::Command *const *p_commands, It
case Item::Command::TYPE_MULTIMESH: {
Item::CommandMultiMesh *mmesh = static_cast<Item::CommandMultiMesh *>(command);

RasterizerStorageOpenGL::MultiMesh *multi_mesh = storage->multimesh_owner.getornull(mmesh->multimesh);
RasterizerStorageOpenGL::MultiMesh *multi_mesh = storage->multimesh_owner.get_or_null(mmesh->multimesh);

if (!multi_mesh)
break;

RasterizerStorageOpenGL::Mesh *mesh_data = storage->mesh_owner.getornull(multi_mesh->mesh);
RasterizerStorageOpenGL::Mesh *mesh_data = storage->mesh_owner.get_or_null(multi_mesh->mesh);

if (!mesh_data)
break;
Expand Down Expand Up @@ -1360,7 +1360,7 @@ void RasterizerCanvasOpenGL::_legacy_canvas_render_item(Item *p_ci, RenderItemSt
Item *material_owner = p_ci->material_owner ? p_ci->material_owner : p_ci;

RID material = material_owner->material;
RasterizerStorageOpenGL::Material *material_ptr = storage->material_owner.getornull(material);
RasterizerStorageOpenGL::Material *material_ptr = storage->material_owner.get_or_null(material);

if (material != r_ris.canvas_last_material || r_ris.rebind_shader) {
RasterizerStorageOpenGL::Shader *shader_ptr = NULL;
Expand Down Expand Up @@ -1406,7 +1406,7 @@ void RasterizerCanvasOpenGL::_legacy_canvas_render_item(Item *p_ci, RenderItemSt
for (int i = 0; i < tc; i++) {
glActiveTexture(GL_TEXTURE0 + i);

RasterizerStorageOpenGL::Texture *t = storage->texture_owner.getornull(textures[i].second);
RasterizerStorageOpenGL::Texture *t = storage->texture_owner.get_or_null(textures[i].second);

if (!t) {
switch (texture_hints[i]) {
Expand Down Expand Up @@ -1587,7 +1587,7 @@ void RasterizerCanvasOpenGL::_legacy_canvas_render_item(Item *p_ci, RenderItemSt
state.canvas_shader.use_material((void *)material_ptr);

glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 6);
RasterizerStorageOpenGL::Texture *t = storage->texture_owner.getornull(light->texture);
RasterizerStorageOpenGL::Texture *t = storage->texture_owner.get_or_null(light->texture);
if (!t) {
glBindTexture(GL_TEXTURE_2D, storage->resources.white_tex);
} else {
Expand Down
4 changes: 2 additions & 2 deletions drivers/opengl/rasterizer_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void RasterizerOpenGL::_blit_render_target_to_screen(RID p_render_target, const

// print_line("_blit_render_target_to_screen " + itos (p_screen) + ", rect " + String(Variant(p_screen_rect)));

RasterizerStorageOpenGL::RenderTarget *rt = storage.render_target_owner.getornull(p_render_target);
RasterizerStorageOpenGL::RenderTarget *rt = storage.render_target_owner.get_or_null(p_render_target);
ERR_FAIL_COND(!rt);

canvas._set_texture_rect_mode(true);
Expand Down Expand Up @@ -362,7 +362,7 @@ void RasterizerOpenGL::set_boot_image(const Ref<Image> &p_image, const Color &p_
screenrect.position += ((Size2(window_w, window_h) - screenrect.size) / 2.0).floor();
}

RasterizerStorageOpenGL::Texture *t = storage.texture_owner.getornull(texture);
RasterizerStorageOpenGL::Texture *t = storage.texture_owner.get_or_null(texture);
glActiveTexture(GL_TEXTURE0 + storage.config.max_texture_image_units - 1);
glBindTexture(GL_TEXTURE_2D, t->tex_id);
canvas.draw_generic_textured_rect(screenrect, Rect2(0, 0, 1, 1));
Expand Down
2 changes: 1 addition & 1 deletion drivers/opengl/rasterizer_scene_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void RasterizerSceneOpenGL::environment_set_bg_energy(RID p_env, float p_energy)
void RasterizerSceneOpenGL::environment_set_canvas_max_layer(RID p_env, int p_max_layer) {
}

void RasterizerSceneOpenGL::environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient, float p_energy, float p_sky_contribution, RS::EnvironmentReflectionSource p_reflection_source, const Color &p_ao_color) {
void RasterizerSceneOpenGL::environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient, float p_energy, float p_sky_contribution, RS::EnvironmentReflectionSource p_reflection_source) {
}

void RasterizerSceneOpenGL::environment_set_glow(RID p_env, bool p_enable, Vector<float> p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/opengl/rasterizer_scene_opengl.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class RasterizerSceneOpenGL : public RendererSceneRender {
void environment_set_bg_color(RID p_env, const Color &p_color) override;
void environment_set_bg_energy(RID p_env, float p_energy) override;
void environment_set_canvas_max_layer(RID p_env, int p_max_layer) override;
void environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient = RS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, RS::EnvironmentReflectionSource p_reflection_source = RS::ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color()) override;
void environment_set_ambient_light(RID p_env, const Color &p_color, RS::EnvironmentAmbientSource p_ambient = RS::ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, RS::EnvironmentReflectionSource p_reflection_source = RS::ENV_REFLECTION_SOURCE_BG) override;

void environment_set_glow(RID p_env, bool p_enable, Vector<float> p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap) override;
void environment_glow_set_use_bicubic_upscale(bool p_enable) override;
Expand Down
Loading

0 comments on commit 77968a3

Please sign in to comment.