summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp8
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp6
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp24
-rw-r--r--drivers/unix/os_unix.cpp2
4 files changed, 20 insertions, 20 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index b08202ae45..c591db4f3d 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -807,7 +807,7 @@ Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, int p_layer)
}
}
- wb = PoolVector<uint8_t>::Write();
+ wb.release();
data.resize(data_size);
@@ -871,7 +871,7 @@ Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, int p_layer)
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glDeleteFramebuffers(1, &temp_framebuffer);
- wb = PoolVector<uint8_t>::Write();
+ wb.release();
data.resize(data_size);
@@ -2155,8 +2155,8 @@ static PoolVector<uint8_t> _unpack_half_floats(const PoolVector<uint8_t> &array,
dst_offset += dst_size[i];
}
- r = PoolVector<uint8_t>::Read();
- w = PoolVector<uint8_t>::Write();
+ r.release();
+ w.release();
return ret;
}
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index c2fde148e2..fb3d154a7a 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1459,8 +1459,8 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transfo
#else
PoolVector<RasterizerGLES3Particle> particle_vector;
particle_vector.resize(particles->amount);
- PoolVector<RasterizerGLES3Particle>::Write w = particle_vector.write();
- particle_array = w.ptr();
+ PoolVector<RasterizerGLES3Particle>::Write particle_writer = particle_vector.write();
+ particle_array = particle_writer.ptr();
glGetBufferSubData(GL_ARRAY_BUFFER, 0, particles->amount * sizeof(RasterizerGLES3Particle), particle_array);
#endif
@@ -1477,7 +1477,7 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transfo
#ifndef __EMSCRIPTEN__
glUnmapBuffer(GL_ARRAY_BUFFER);
#else
- w = PoolVector<RasterizerGLES3Particle>::Write();
+ particle_writer.release();
particle_array = NULL;
{
PoolVector<RasterizerGLES3Particle>::Read r = particle_vector.read();
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index b280898188..c4cfd1e765 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -1173,7 +1173,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
glDeleteFramebuffers(1, &tmp_fbo);
}
- wb = PoolVector<uint8_t>::Write();
+ wb.release();
data.resize(data_size);
@@ -1248,7 +1248,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
img_format = real_format;
}
- wb = PoolVector<uint8_t>::Write();
+ wb.release();
data.resize(data_size);
@@ -1316,7 +1316,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glDeleteFramebuffers(1, &temp_framebuffer);
- wb = PoolVector<uint8_t>::Write();
+ wb.release();
data.resize(data_size);
@@ -2526,19 +2526,19 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy
int v = value;
GLuint *gui = (GLuint *)data;
- gui[0] = v & 1 ? GL_TRUE : GL_FALSE;
- gui[1] = v & 2 ? GL_TRUE : GL_FALSE;
- gui[2] = v & 4 ? GL_TRUE : GL_FALSE;
+ gui[0] = (v & 1) ? GL_TRUE : GL_FALSE;
+ gui[1] = (v & 2) ? GL_TRUE : GL_FALSE;
+ gui[2] = (v & 4) ? GL_TRUE : GL_FALSE;
} break;
case ShaderLanguage::TYPE_BVEC4: {
int v = value;
GLuint *gui = (GLuint *)data;
- gui[0] = v & 1 ? GL_TRUE : GL_FALSE;
- gui[1] = v & 2 ? GL_TRUE : GL_FALSE;
- gui[2] = v & 4 ? GL_TRUE : GL_FALSE;
- gui[3] = v & 8 ? GL_TRUE : GL_FALSE;
+ gui[0] = (v & 1) ? GL_TRUE : GL_FALSE;
+ gui[1] = (v & 2) ? GL_TRUE : GL_FALSE;
+ gui[2] = (v & 4) ? GL_TRUE : GL_FALSE;
+ gui[3] = (v & 8) ? GL_TRUE : GL_FALSE;
} break;
case ShaderLanguage::TYPE_INT: {
@@ -3441,7 +3441,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
glGenBuffers(1, &surface->vertex_id);
glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id);
- glBufferData(GL_ARRAY_BUFFER, array_size, vr.ptr(), p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, array_size, vr.ptr(), (p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE) ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
if (p_format & VS::ARRAY_FORMAT_INDEX) {
@@ -6337,7 +6337,7 @@ AABB RasterizerStorageGLES3::particles_get_current_aabb(RID p_particles) {
}
#if defined(GLES_OVER_GL) || defined(__EMSCRIPTEN__)
- r = PoolVector<uint8_t>::Read();
+ r.release();
vector = PoolVector<uint8_t>();
#else
glUnmapBuffer(GL_ARRAY_BUFFER);
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 4de910ee1c..aa61cf5dcc 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -256,7 +256,7 @@ OS::TimeZoneInfo OS_Unix::get_time_zone_info() const {
void OS_Unix::delay_usec(uint32_t p_usec) const {
- struct timespec rem = { static_cast<time_t>(p_usec / 1000000), static_cast<long>((p_usec % 1000000) * 1000) };
+ struct timespec rem = { static_cast<time_t>(p_usec / 1000000), (static_cast<long>(p_usec) % 1000000) * 1000 };
while (nanosleep(&rem, &rem) == EINTR) {
}
}