diff --git a/headers/enduro2d/base/main.hpp b/headers/enduro2d/base/main.hpp index 3f1ec0f5..2cdf2acd 100644 --- a/headers/enduro2d/base/main.hpp +++ b/headers/enduro2d/base/main.hpp @@ -6,6 +6,4 @@ #pragma once -#include "types.hpp" - -e2d::i32 e2d_main(int argc, char *argv[]); +int e2d_main(int argc, char *argv[]); diff --git a/sources/enduro2d/core/render_impl/render_opengl.cpp b/sources/enduro2d/core/render_impl/render_opengl.cpp index 2a1a57e0..3a4e4715 100644 --- a/sources/enduro2d/core/render_impl/render_opengl.cpp +++ b/sources/enduro2d/core/render_impl/render_opengl.cpp @@ -802,12 +802,12 @@ namespace e2d } bool need_color = - utils::enum_to_underlying(external_texture) - & utils::enum_to_underlying(render_target::external_texture::color); + !!(utils::enum_to_underlying(external_texture) + & utils::enum_to_underlying(render_target::external_texture::color)); bool need_depth = - utils::enum_to_underlying(external_texture) - & utils::enum_to_underlying(render_target::external_texture::depth); + !!(utils::enum_to_underlying(external_texture) + & utils::enum_to_underlying(render_target::external_texture::depth)); texture_ptr color; texture_ptr depth; @@ -925,14 +925,14 @@ namespace e2d E2D_ASSERT(is_in_main_thread()); bool clear_color = - utils::enum_to_underlying(command.clear_buffer()) - & utils::enum_to_underlying(clear_command::buffer::color); + !!(utils::enum_to_underlying(command.clear_buffer()) + & utils::enum_to_underlying(clear_command::buffer::color)); bool clear_depth = - utils::enum_to_underlying(command.clear_buffer()) - & utils::enum_to_underlying(clear_command::buffer::depth); + !!(utils::enum_to_underlying(command.clear_buffer()) + & utils::enum_to_underlying(clear_command::buffer::depth)); bool clear_stencil = - utils::enum_to_underlying(command.clear_buffer()) - & utils::enum_to_underlying(clear_command::buffer::stencil); + !!(utils::enum_to_underlying(command.clear_buffer()) + & utils::enum_to_underlying(clear_command::buffer::stencil)); const render_target_ptr& rt = state_->render_target(); bool has_color = !rt || rt->state().color() || !rt->state().color_rb().empty(); @@ -1012,9 +1012,9 @@ namespace e2d case pixel_declaration::pixel_type::depth16: return true; case pixel_declaration::pixel_type::depth24: - return GLEW_OES_depth24; + return !!GLEW_OES_depth24; case pixel_declaration::pixel_type::depth32: - return GLEW_OES_depth32; + return !!GLEW_OES_depth32; case pixel_declaration::pixel_type::depth24_stencil8: return GLEW_OES_packed_depth_stencil || GLEW_EXT_packed_depth_stencil; @@ -1039,10 +1039,10 @@ namespace e2d case pixel_declaration::pixel_type::rgb_pvrtc4: case pixel_declaration::pixel_type::rgba_pvrtc2: case pixel_declaration::pixel_type::rgba_pvrtc4: - return GLEW_IMG_texture_compression_pvrtc; + return !!GLEW_IMG_texture_compression_pvrtc; case pixel_declaration::pixel_type::rgba_pvrtc2_v2: case pixel_declaration::pixel_type::rgba_pvrtc4_v2: - return GLEW_IMG_texture_compression_pvrtc2; + return !!GLEW_IMG_texture_compression_pvrtc2; default: E2D_ASSERT_MSG(false, "unexpected pixel type"); return false; diff --git a/sources/enduro2d/core/vfs.cpp b/sources/enduro2d/core/vfs.cpp index 5c2ed82c..69a75e1c 100644 --- a/sources/enduro2d/core/vfs.cpp +++ b/sources/enduro2d/core/vfs.cpp @@ -327,7 +327,7 @@ namespace e2d if ( mz_zip_reader_file_stat(state_->archive.get(), i, &file_stat) ) { const str_view filename{file_stat.m_filename}; if ( filename.length() > parent.length() && filename.starts_with(parent) ) { - func(file_stat.m_filename, file_stat.m_is_directory); + func(file_stat.m_filename, !!file_stat.m_is_directory); } } } diff --git a/sources/enduro2d/core/window_impl/window_glfw.cpp b/sources/enduro2d/core/window_impl/window_glfw.cpp index 3330b1d7..3c15cbe7 100644 --- a/sources/enduro2d/core/window_impl/window_glfw.cpp +++ b/sources/enduro2d/core/window_impl/window_glfw.cpp @@ -445,7 +445,7 @@ namespace e2d if ( self ) { self->for_all_listeners( &event_listener::on_window_focus, - focused); + !!focused); } } @@ -454,7 +454,7 @@ namespace e2d if ( self ) { self->for_all_listeners( &event_listener::on_window_minimize, - minimized); + !!minimized); } } };