diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-20 21:10:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-20 21:10:10 +0200 |
commit | 5c66771e3ebccdfec55bb94ea521d2f24cb6200a (patch) | |
tree | 80bea3ee8792cb19e719221987faf1a2bf1e88a3 /drivers | |
parent | 7b88ac08437d3bd062efcbdd40c215b533032412 (diff) | |
parent | 072e40368e19e0f88ec1fbb61fe463a6fffcca36 (diff) |
Merge pull request #29283 from qarmin/fix_some_always_same_values
Remove always true/false values
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 11 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 3 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 2 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 11 | ||||
-rw-r--r-- | drivers/unix/net_socket_posix.cpp | 2 |
5 files changed, 6 insertions, 23 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 418be136b8..9fe7e43b43 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -4526,9 +4526,7 @@ void RasterizerStorageGLES2::instance_add_dependency(RID p_base, RasterizerScene ERR_FAIL_COND(!inst); } break; default: { - if (!inst) { - ERR_FAIL(); - } + ERR_FAIL(); } } @@ -4573,15 +4571,10 @@ void RasterizerStorageGLES2::instance_remove_dependency(RID p_base, RasterizerSc ERR_FAIL_COND(!inst); } break; default: { - - if (!inst) { - ERR_FAIL(); - } + ERR_FAIL(); } } - ERR_FAIL_COND(!inst); - inst->instance_list.remove(&p_instance->dependency_item); } diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 30aa22732c..1f3af2f885 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -327,9 +327,6 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun uint32_t buffer_ofs = 0; //vertex -#ifdef DEBUG_ENABLED - ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size); -#endif glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_vertices); glEnableVertexAttribArray(VS::ARRAY_VERTEX); glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), CAST_INT_TO_UCHAR_PTR(buffer_ofs)); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index c7ef5cded4..b3a1d32bf4 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -4297,7 +4297,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const use_mrt = use_mrt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]; use_mrt = use_mrt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_NO_3D_EFFECTS]; use_mrt = use_mrt && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW; - use_mrt = use_mrt && env && (env->bg_mode != VS::ENV_BG_KEEP && env->bg_mode != VS::ENV_BG_CANVAS); + use_mrt = use_mrt && (env->bg_mode != VS::ENV_BG_KEEP && env->bg_mode != VS::ENV_BG_CANVAS); glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height); diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index f8a3283869..0840717d68 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -6713,9 +6713,7 @@ void RasterizerStorageGLES3::instance_add_dependency(RID p_base, RasterizerScene ERR_FAIL_COND(!inst); } break; default: { - if (!inst) { - ERR_FAIL(); - } + ERR_FAIL(); } } @@ -6760,15 +6758,10 @@ void RasterizerStorageGLES3::instance_remove_dependency(RID p_base, RasterizerSc ERR_FAIL_COND(!inst); } break; default: { - - if (!inst) { - ERR_FAIL(); - } + ERR_FAIL(); } } - ERR_FAIL_COND(!inst); - inst->instance_list.remove(&p_instance->dependency_item); } diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index 75d51c8503..fcd1c3be4b 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -421,7 +421,7 @@ Error NetSocketPosix::poll(PollType p_type, int p_timeout) const { pfd.events = POLLOUT; break; case POLL_TYPE_IN_OUT: - pfd.events = POLLOUT || POLLIN; + pfd.events = POLLOUT | POLLIN; } int ret = ::poll(&pfd, 1, p_timeout); |