From 634fadcf33b2dfe38a678f6c946cfbb35c87214d Mon Sep 17 00:00:00 2001 From: puugz Date: Sat, 19 Nov 2022 15:29:18 +0100 Subject: [PATCH] fix typos --- include/blah_app.h | 2 +- include/blah_batch.h | 1 - include/blah_color.h | 10 +++++----- include/blah_graphics.h | 8 ++++---- include/blah_packer.h | 2 +- src/blah_app.cpp | 2 +- src/blah_aseprite.cpp | 10 +++++----- src/blah_font.cpp | 2 +- src/blah_graphics.cpp | 1 - src/blah_image.cpp | 2 +- src/blah_input.cpp | 1 - src/internal/blah_platform.h | 2 +- src/internal/blah_platform_sdl2.cpp | 2 +- src/internal/blah_renderer.h | 2 +- src/internal/blah_renderer_d3d11.cpp | 4 ++-- src/internal/blah_renderer_opengl.cpp | 2 +- 16 files changed, 25 insertions(+), 28 deletions(-) diff --git a/include/blah_app.h b/include/blah_app.h index 27b370a..3ebbf7a 100644 --- a/include/blah_app.h +++ b/include/blah_app.h @@ -63,7 +63,7 @@ namespace Blah AppEventFn on_render = nullptr; // Callback when the user has requested the application close. - // For example, pressing the Close button, ALT+F4, etc + // For example, pressing the Close button, ALT+F4, etc. // By default this calls `App::exit()` AppEventFn on_exit_request = nullptr; diff --git a/include/blah_batch.h b/include/blah_batch.h index 5874101..3af8609 100644 --- a/include/blah_batch.h +++ b/include/blah_batch.h @@ -9,7 +9,6 @@ namespace Blah { - // A 2D sprite batcher, used for drawing shapes and textures class Batch { diff --git a/include/blah_color.h b/include/blah_color.h index 0b82d1a..b3e1691 100644 --- a/include/blah_color.h +++ b/include/blah_color.h @@ -135,7 +135,7 @@ namespace Blah return Vec4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f); } - // Convers the Color to a u32 + // Converts the Color to a u32 constexpr u32 to_rgba() const { return @@ -145,7 +145,7 @@ namespace Blah (u32)a; } - // Convers the Color to a u32 + // Converts the Color to a u32 constexpr u32 to_rgb() const { return @@ -154,7 +154,7 @@ namespace Blah (u32)b; } - // Returns a RGBA Color representation of the integer value + // Returns an RGBA Color representation of the integer value static constexpr Color from_rgba(u32 value) { return @@ -166,7 +166,7 @@ namespace Blah }; } - // Returns a RGB Color representation of the integer value, with Alpha = 255 + // Returns an RGB Color representation of the integer value, with Alpha = 255 static constexpr Color from_rgb(u32 value) { return @@ -191,7 +191,7 @@ namespace Blah ); } - // Mutliplties the Color + // Multiples the Color constexpr Color operator*(float multiply) const { return Color( diff --git a/include/blah_graphics.h b/include/blah_graphics.h index 7514be9..33999ca 100644 --- a/include/blah_graphics.h +++ b/include/blah_graphics.h @@ -52,7 +52,7 @@ namespace Blah LessOrEqual, Greater, NotEqual, - GreatorOrEqual + GreaterOrEqual }; // Cull mode during a draw call @@ -210,7 +210,7 @@ namespace Blah enum class TextureFormat { None, // Invalid Format - R, // Single 8-bit channe; + R, // Single 8-bit channel RG, // 2 8-bit channels RGBA, // 4 8-bit channels DepthStencil, // Depth 24, Stencil 8 @@ -317,10 +317,10 @@ namespace Blah // Supported Vertex Index formats enum class IndexFormat { - // Indices are 16 bit unsigned integers + // Indices are 16-bit unsigned integers UInt16, - // Indices are 32 bit unsigned integers + // Indices are 32-bit unsigned integers UInt32 }; diff --git a/include/blah_packer.h b/include/blah_packer.h index 6e57c40..cc7cc77 100644 --- a/include/blah_packer.h +++ b/include/blah_packer.h @@ -65,7 +65,7 @@ namespace Blah int padding; // generated textures. There can be more than one if the packer was - // unable to fit all of the provided subtextures into the max_size. + // unable to fit all the provided subtextures into the max_size. Vector pages; Packer(); diff --git a/src/blah_app.cpp b/src/blah_app.cpp index 04f814b..7649645 100644 --- a/src/blah_app.cpp +++ b/src/blah_app.cpp @@ -14,7 +14,7 @@ using namespace Blah; #define BLAH_ASSERT_RUNNING() BLAH_ASSERT(app_is_running, "The App is not running (call App::run)") -// Interal Platform Pointer +// Internal Platform Pointer Platform* App::Internal::platform = nullptr; // Internal Renderer Pointer diff --git a/src/blah_aseprite.cpp b/src/blah_aseprite.cpp index f6f5012..96a4695 100644 --- a/src/blah_aseprite.cpp +++ b/src/blah_aseprite.cpp @@ -53,12 +53,12 @@ void Aseprite::parse(Stream& stream) stream.read_u16(Endian::Little); // Speed (deprecated) stream.read_u32(Endian::Little); // Should be 0 stream.read_u32(Endian::Little); // Should be 0 - stream.read_u8(Endian::Little); // Palette entry - stream.seek(stream.position() + 3); // Ignore these bytes + stream.read_u8(Endian::Little); // Palette entry + stream.seek(stream.position() + 3); // Ignore these bytes stream.read_u16(Endian::Little); // Number of colors (0 means 256 for old sprites) - stream.read_i8(Endian::Little); // Pixel width - stream.read_i8(Endian::Little); // Pixel height - stream.seek(stream.position() + 92); // For Future + stream.read_i8(Endian::Little); // Pixel width + stream.read_i8(Endian::Little); // Pixel height + stream.seek(stream.position() + 92); // For Future } frames.resize(frame_count); diff --git a/src/blah_font.cpp b/src/blah_font.cpp index 138ad0f..f1acde8 100644 --- a/src/blah_font.cpp +++ b/src/blah_font.cpp @@ -160,7 +160,7 @@ bool Font::get_image(const Font::Character& ch, Color* pixels) const if (ch.has_glyph) { // we actually use the image buffer as our temporary buffer, and fill the pixels out backwards after - // kinda weird but it works & saves creating more memory + // kinda weird, but it works & saves creating more memory auto* src = (unsigned char*)pixels; stbtt_MakeGlyphBitmap((stbtt_fontinfo*)m_font.get(), src, ch.width, ch.height, ch.width, ch.scale, ch.scale, ch.glyph); diff --git a/src/blah_graphics.cpp b/src/blah_graphics.cpp index 8eda5bb..9dcca30 100644 --- a/src/blah_graphics.cpp +++ b/src/blah_graphics.cpp @@ -230,7 +230,6 @@ MeshRef Mesh::create() return MeshRef(); } - namespace { int blah_calc_uniform_size(const UniformInfo& uniform) diff --git a/src/blah_image.cpp b/src/blah_image.cpp index 30bf35c..4e42f56 100644 --- a/src/blah_image.cpp +++ b/src/blah_image.cpp @@ -256,7 +256,7 @@ bool Image::save_jpg(Stream& stream, int quality) const void Image::get_pixels(Color* dest, const Point& dest_pos, const Point& dest_size, Recti source_rect) const { - // can't be outside of the source image + // can't be outside the source image if (source_rect.x < 0) source_rect.x = 0; if (source_rect.y < 0) source_rect.y = 0; if (source_rect.x + source_rect.w > width) source_rect.w = width - source_rect.x; diff --git a/src/blah_input.cpp b/src/blah_input.cpp index af47e6e..6fe2909 100644 --- a/src/blah_input.cpp +++ b/src/blah_input.cpp @@ -423,7 +423,6 @@ StickBindingRef Input::register_binding(const StickBinding& binding_data) return result; } - ButtonBinding::TriggerBind::TriggerBind(Axis axis) : axis(axis) { diff --git a/src/internal/blah_platform.h b/src/internal/blah_platform.h index e57279c..845fefc 100644 --- a/src/internal/blah_platform.h +++ b/src/internal/blah_platform.h @@ -65,7 +65,7 @@ namespace Blah // Gets the Desktop Content Scale. Gui should be scaled by this value virtual float get_content_scale() = 0; - // Returns the absoluate path to the directory that the application was started from + // Returns the absolute path to the directory that the application was started from virtual const char* app_path() = 0; // Returns the absolute path to the user directory where save data and settings should be stored diff --git a/src/internal/blah_platform_sdl2.cpp b/src/internal/blah_platform_sdl2.cpp index 440e354..5ef7b9f 100644 --- a/src/internal/blah_platform_sdl2.cpp +++ b/src/internal/blah_platform_sdl2.cpp @@ -439,7 +439,7 @@ void SDL2_Platform::present() SDL_GL_SwapWindow(window); // display the window - // this avoids a short black screen on macoS + // this avoids a short black screen on macOS if (!displayed) { SDL_ShowWindow(window); diff --git a/src/internal/blah_renderer.h b/src/internal/blah_renderer.h index 84e5f92..edc0b8b 100644 --- a/src/internal/blah_renderer.h +++ b/src/internal/blah_renderer.h @@ -36,7 +36,7 @@ namespace Blah virtual void set_app_flags(u32 flags) { } // Optional implementation to get the drawable backbuffer size in pixels. - // Not all implementations will use this so it can be up to the Platform. + // Not all implementations will use this, so it can be up to the Platform. virtual bool get_draw_size(int* w, int* h) { return false; } // Performs a draw call diff --git a/src/internal/blah_renderer_d3d11.cpp b/src/internal/blah_renderer_d3d11.cpp index d6c7ac2..7fdc6ae 100644 --- a/src/internal/blah_renderer_d3d11.cpp +++ b/src/internal/blah_renderer_d3d11.cpp @@ -785,7 +785,7 @@ namespace Blah flags |= D3D11_CREATE_DEVICE_DEBUG; #endif - // Create D3D device & context & swap cahin + // Create D3D device & context & swap chain D3D_FEATURE_LEVEL feature_level; HRESULT hr = D3D11CreateDeviceAndSwapChain( NULL, @@ -1625,7 +1625,7 @@ namespace Blah case Compare::LessOrEqual: desc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL; break; case Compare::Greater: desc.DepthFunc = D3D11_COMPARISON_GREATER; break; case Compare::NotEqual: desc.DepthFunc = D3D11_COMPARISON_NOT_EQUAL; break; - case Compare::GreatorOrEqual: desc.DepthFunc = D3D11_COMPARISON_GREATER_EQUAL; break; + case Compare::GreaterOrEqual: desc.DepthFunc = D3D11_COMPARISON_GREATER_EQUAL; break; } ID3D11DepthStencilState* result; diff --git a/src/internal/blah_renderer_opengl.cpp b/src/internal/blah_renderer_opengl.cpp index f2966c3..04f4427 100644 --- a/src/internal/blah_renderer_opengl.cpp +++ b/src/internal/blah_renderer_opengl.cpp @@ -1448,7 +1448,7 @@ namespace Blah case Compare::Greater: renderer->gl.DepthFunc(GL_GREATER); break; - case Compare::GreatorOrEqual: + case Compare::GreaterOrEqual: renderer->gl.DepthFunc(GL_GEQUAL); break; case Compare::Less: