summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp6
-rw-r--r--drivers/gles2/rasterizer_gles2.h2
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp2
-rw-r--r--drivers/gles3/shaders/screen_space_reflection.glsl2
-rw-r--r--drivers/unix/packet_peer_udp_posix.cpp36
-rw-r--r--drivers/unix/packet_peer_udp_posix.h2
-rw-r--r--drivers/windows/dir_access_windows.cpp2
7 files changed, 44 insertions, 8 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 5deb78977a..3f54f887da 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -1579,7 +1579,7 @@ Variant RasterizerGLES2::shader_get_default_param(RID p_shader, const StringName
Shader *shader = shader_owner.get(p_shader);
ERR_FAIL_COND_V(!shader, Variant());
- //update shader params if necesary
+ //update shader params if necessary
//make sure the shader is compiled and everything
//so the actual parameters can be properly retrieved!
if (shader->dirty_list.in_list()) {
@@ -1651,7 +1651,7 @@ Variant RasterizerGLES2::material_get_param(RID p_material, const StringName &p_
ERR_FAIL_COND_V(!material, Variant());
if (material->shader.is_valid()) {
- //update shader params if necesary
+ //update shader params if necessary
//make sure the shader is compiled and everything
//so the actual parameters can be properly retrieved!
material->shader_cache = shader_owner.get(material->shader);
@@ -5684,7 +5684,7 @@ void RasterizerGLES2::_render(const Geometry *p_geometry, const Material *p_mate
};
} else if (use_attribute_instancing) {
- //if not, using atributes instead of uniforms can be really fast in forward rendering architectures
+ //if not, using attributes instead of uniforms can be really fast in forward rendering architectures
if (s->index_array_len > 0) {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->index_id);
diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h
index 81e137dffd..9aeb3af61a 100644
--- a/drivers/gles2/rasterizer_gles2.h
+++ b/drivers/gles2/rasterizer_gles2.h
@@ -1661,7 +1661,7 @@ public:
void set_base_framebuffer(GLuint p_id, Vector2 p_size = Vector2(0, 0));
- virtual void flush_frame(); //not necesary in most cases
+ virtual void flush_frame(); //not necessary in most cases
void set_extensions(const char *p_strings);
virtual bool needs_to_draw_next_frame() const;
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 8eaba0b977..4fcd09ed58 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -5886,7 +5886,7 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
} else if (texture_owner.owns(p_rid)) {
// delete the texture
Texture *texture = texture_owner.get(p_rid);
- ERR_FAIL_COND_V(texture->render_target, true); //cant free the render target texture, dude
+ ERR_FAIL_COND_V(texture->render_target, true); //can't free the render target texture, dude
info.texture_mem -= texture->total_data_size;
texture_owner.free(p_rid);
memdelete(texture);
diff --git a/drivers/gles3/shaders/screen_space_reflection.glsl b/drivers/gles3/shaders/screen_space_reflection.glsl
index ec4bdf86c9..e4ba712de6 100644
--- a/drivers/gles3/shaders/screen_space_reflection.glsl
+++ b/drivers/gles3/shaders/screen_space_reflection.glsl
@@ -267,7 +267,7 @@ void main() {
for(int i=0;i<7;i++) {
- float op_len = 2.0 * tan(cone_angle) * cone_len; //oposite side of iso triangle
+ float op_len = 2.0 * tan(cone_angle) * cone_len; //opposite side of iso triangle
float radius;
{
//fit to sphere inside cone (sphere ends at end of cone), something like this:
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp
index 98883f3267..e70e4fc349 100644
--- a/drivers/unix/packet_peer_udp_posix.cpp
+++ b/drivers/unix/packet_peer_udp_posix.cpp
@@ -107,10 +107,14 @@ Error PacketPeerUDPPosix::put_packet(const uint8_t *p_buffer, int p_buffer_size)
errno = 0;
int err;
+ _set_sock_blocking(blocking);
+
while ((err = sendto(sock, p_buffer, p_buffer_size, 0, (struct sockaddr *)&addr, addr_size)) != p_buffer_size) {
if (errno != EAGAIN) {
return FAILED;
+ } else if (!blocking) {
+ return ERR_UNAVAILABLE;
}
}
@@ -173,10 +177,12 @@ Error PacketPeerUDPPosix::_poll(bool p_wait) {
return FAILED;
}
+ _set_sock_blocking(p_wait);
+
struct sockaddr_storage from = { 0 };
socklen_t len = sizeof(struct sockaddr_storage);
int ret;
- while ((ret = recvfrom(sockfd, recv_buffer, MIN((int)sizeof(recv_buffer), MAX(rb.space_left() - 24, 0)), p_wait ? 0 : MSG_DONTWAIT, (struct sockaddr *)&from, &len)) > 0) {
+ while ((ret = recvfrom(sockfd, recv_buffer, MIN((int)sizeof(recv_buffer), MAX(rb.space_left() - 24, 0)), 0, (struct sockaddr *)&from, &len)) > 0) {
uint32_t port = 0;
@@ -243,9 +249,35 @@ int PacketPeerUDPPosix::_get_socket() {
sockfd = _socket_create(sock_type, SOCK_DGRAM, IPPROTO_UDP);
+ if (sockfd != -1)
+ _set_sock_blocking(false);
+
return sockfd;
}
+void PacketPeerUDPPosix::_set_sock_blocking(bool p_blocking) {
+
+ if (sock_blocking == p_blocking)
+ return;
+
+ sock_blocking = p_blocking;
+
+#ifndef NO_FCNTL
+ int opts = fcntl(sockfd, F_GETFL);
+ int ret = 0;
+ if (sock_blocking)
+ ret = fcntl(sockfd, F_SETFL, opts & ~O_NONBLOCK);
+ else
+ ret = fcntl(sockfd, F_SETFL, opts | O_NONBLOCK);
+ if (ret == -1)
+ perror("setting non-block mode");
+#else
+ int bval = sock_blocking ? 0 : 1;
+ if (ioctl(sockfd, FIONBIO, &bval) == -1)
+ perror("setting non-block mode");
+#endif
+}
+
void PacketPeerUDPPosix::set_dest_address(const IP_Address &p_address, int p_port) {
peer_addr = p_address;
@@ -264,6 +296,8 @@ void PacketPeerUDPPosix::make_default() {
PacketPeerUDPPosix::PacketPeerUDPPosix() {
+ blocking = true;
+ sock_blocking = true;
sockfd = -1;
packet_port = 0;
queue_count = 0;
diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h
index b44ef49f2c..60d5bf6580 100644
--- a/drivers/unix/packet_peer_udp_posix.h
+++ b/drivers/unix/packet_peer_udp_posix.h
@@ -47,6 +47,7 @@ class PacketPeerUDPPosix : public PacketPeerUDP {
mutable int packet_port;
mutable int queue_count;
int sockfd;
+ bool sock_blocking;
IP::Type sock_type;
IP_Address peer_addr;
@@ -55,6 +56,7 @@ class PacketPeerUDPPosix : public PacketPeerUDP {
_FORCE_INLINE_ int _get_socket();
static PacketPeerUDP *_create();
+ void _set_sock_blocking(bool p_blocking);
virtual Error _poll(bool p_block);
public:
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp
index bb5ab02d8c..b0710b2c36 100644
--- a/drivers/windows/dir_access_windows.cpp
+++ b/drivers/windows/dir_access_windows.cpp
@@ -39,7 +39,7 @@
/*
-[03:57] <reduz> yessopie, so i dont havemak to rely on unicows
+[03:57] <reduz> yessopie, so i don't havemak to rely on unicows
[03:58] <yessopie> reduz- yeah, all of the functions fail, and then you can call GetLastError () which will return 120
[03:58] <drumstick> CategoryApl, hehe, what? :)
[03:59] <CategoryApl> didn't Verona lead to some trouble