From 3c23fafba1e34211c9885d71a3ad8430006f2479 Mon Sep 17 00:00:00 2001 From: Erwan Billard <82095453+iacker@users.noreply.github.com> Date: Mon, 13 Jul 2026 22:08:28 +0200 Subject: [PATCH] libopenage: fix typos in code comments Correct spelling mistakes in comments across the renderer, pathfinding, util and input modules (containg->containing, attachements->attachments, neigbouring->neighbouring, etc.). Also fixes two user-facing OpenGL error strings (occured->occurred, non-existant->non-existent). Comment/string changes only, no logic or identifiers touched. Signed-off-by: Erwan Billard <82095453+iacker@users.noreply.github.com> --- libopenage/coord/coord_test.cpp | 2 +- libopenage/input/input_manager.h | 2 +- libopenage/options.h | 2 +- libopenage/pathfinding/demo/demo_0.cpp | 2 +- libopenage/pathfinding/grid.h | 4 ++-- libopenage/pathfinding/integration_field.cpp | 2 +- libopenage/pathfinding/integration_field.h | 2 +- libopenage/pathfinding/pathfinder.h | 2 +- libopenage/pathfinding/portal.h | 4 ++-- libopenage/renderer/camera/camera.cpp | 2 +- libopenage/renderer/demo/demo_6.cpp | 2 +- libopenage/renderer/font/font_manager.cpp | 2 +- libopenage/renderer/gui/gui.h | 2 +- libopenage/renderer/opengl/context.cpp | 2 +- libopenage/renderer/opengl/context.h | 2 +- libopenage/renderer/opengl/framebuffer.h | 2 +- libopenage/renderer/opengl/render_target.h | 4 ++-- libopenage/renderer/opengl/shader.cpp | 2 +- libopenage/renderer/opengl/shader_program.cpp | 2 +- libopenage/renderer/resources/animation/angle_info.h | 4 ++-- libopenage/renderer/stages/hud/render_stage.h | 2 +- libopenage/renderer/stages/screen/render_stage.h | 2 +- libopenage/renderer/stages/screen/screenshot.cpp | 2 +- libopenage/renderer/stages/skybox/render_stage.h | 2 +- libopenage/renderer/stages/terrain/render_entity.cpp | 2 +- libopenage/renderer/stages/terrain/render_stage.h | 2 +- libopenage/renderer/stages/world/render_stage.h | 2 +- libopenage/renderer/window.h | 2 +- libopenage/util/compiler.cpp | 4 ++-- libopenage/util/compress/bitstream.h | 2 +- libopenage/util/compress/lzxd.cpp | 4 ++-- libopenage/util/file.cpp | 2 +- libopenage/util/file.h | 2 +- libopenage/util/strings.cpp | 2 +- libopenage/util/variable.h | 2 +- libopenage/util/vector.h | 2 +- 36 files changed, 42 insertions(+), 42 deletions(-) diff --git a/libopenage/coord/coord_test.cpp b/libopenage/coord/coord_test.cpp index 84960e493e..b7f228a69c 100644 --- a/libopenage/coord/coord_test.cpp +++ b/libopenage/coord/coord_test.cpp @@ -34,7 +34,7 @@ struct TestCoordsRelative : CoordXYRelative> active_contexts; /** - * Map of all available contexts, referencable by an ID. + * Map of all available contexts, referenceable by an ID. * * TODO: Move this to cvar manager? */ diff --git a/libopenage/options.h b/libopenage/options.h index 0798007f7b..64373f78ec 100644 --- a/libopenage/options.h +++ b/libopenage/options.h @@ -259,7 +259,7 @@ class OptionNode { /** * A interaface variable which gets monitored by an * option node allowing reflection, while also - * being directly accessable as a typed member + * being directly accessible as a typed member */ template class Var : public util::Variable { diff --git a/libopenage/pathfinding/demo/demo_0.cpp b/libopenage/pathfinding/demo/demo_0.cpp index 31f66bb51f..043625bd5e 100644 --- a/libopenage/pathfinding/demo/demo_0.cpp +++ b/libopenage/pathfinding/demo/demo_0.cpp @@ -771,7 +771,7 @@ renderer::resources::MeshData RenderManager0::get_flow_field_mesh(const std::sha auto int_flags = int_field->get_cell(i / resolution, (j - 1) / resolution).flags; int_surround.push_back(int_flags); } - // combine the flags of the sorrounding tiles + // combine the flags of the surrounding tiles auto ff_max_flags = 0; for (auto &val : ff_surround) { ff_max_flags |= val & 0xF0; diff --git a/libopenage/pathfinding/grid.h b/libopenage/pathfinding/grid.h index 314d107a2e..1e07f28fc5 100644 --- a/libopenage/pathfinding/grid.h +++ b/libopenage/pathfinding/grid.h @@ -102,7 +102,7 @@ class Grid { const nodemap_t &get_portal_map(); /** - * Initialize the portal nodes of the grid with neigbouring nodes and distance costs. + * Initialize the portal nodes of the grid with neighbouring nodes and distance costs. */ void init_portal_nodes(); @@ -128,7 +128,7 @@ class Grid { std::vector> sectors; /** - * maps portal_ids to portal nodes, which store their neigbouring nodes and associated distance costs + * maps portal_ids to portal nodes, which store their neighbouring nodes and associated distance costs * for pathfinding */ diff --git a/libopenage/pathfinding/integration_field.cpp b/libopenage/pathfinding/integration_field.cpp index 26134506b8..24fbbd6f37 100644 --- a/libopenage/pathfinding/integration_field.cpp +++ b/libopenage/pathfinding/integration_field.cpp @@ -66,7 +66,7 @@ std::vector IntegrationField::integrate_los(const std::shared_ptr min cost // This avoids the bresenham's line algorithm calculations // (which wouldn't return accurate results for blocker == target) - // and makes sure that sorrounding cells that are min cost are considered + // and makes sure that surrounding cells that are min cost are considered // in line-of-sight. this->cells[target_idx].flags |= INTEGRATE_FOUND_MASK; diff --git a/libopenage/pathfinding/integration_field.h b/libopenage/pathfinding/integration_field.h index c9149cc82f..76fd5f0de3 100644 --- a/libopenage/pathfinding/integration_field.h +++ b/libopenage/pathfinding/integration_field.h @@ -176,7 +176,7 @@ class IntegrationField { private: /** - * Update a neigbor cell during the cost integration process. + * Update a neighbor cell during the cost integration process. * * @param idx Index of the neighbor cell that is updated. * @param cell_cost Cost of the neighbor cell from the cost field. diff --git a/libopenage/pathfinding/pathfinder.h b/libopenage/pathfinding/pathfinder.h index 8d569d78d8..74e29aa7e0 100644 --- a/libopenage/pathfinding/pathfinder.h +++ b/libopenage/pathfinding/pathfinder.h @@ -188,7 +188,7 @@ class PortalNode : public std::enable_shared_from_this { /** - * maps node_t of a neigbhour portal to the distance cost to travel between the portals + * maps node_t of a neighbour portal to the distance cost to travel between the portals */ using exits_t = std::map; diff --git a/libopenage/pathfinding/portal.h b/libopenage/pathfinding/portal.h index 6593eea852..a902f6436d 100644 --- a/libopenage/pathfinding/portal.h +++ b/libopenage/pathfinding/portal.h @@ -213,14 +213,14 @@ class Portal { /** * Exits in sector 0 reachable from the portal. * - * TODO: Also store avarage cost to reach each exit. + * TODO: Also store average cost to reach each exit. */ std::vector> sector0_exits; /** * Exits in sector 1 reachable from the portal. * - * TODO: Also store avarage cost to reach each exit. + * TODO: Also store average cost to reach each exit. */ std::vector> sector1_exits; diff --git a/libopenage/renderer/camera/camera.cpp b/libopenage/renderer/camera/camera.cpp index 14504998e0..7880dbcbbf 100644 --- a/libopenage/renderer/camera/camera.cpp +++ b/libopenage/renderer/camera/camera.cpp @@ -289,7 +289,7 @@ Eigen::Vector3f Camera::calc_look_at(Eigen::Vector3f target) { // get x and z offsets // the camera is pointed diagonally to the negative x and z axis // a is the length of the diagonal from camera.xz to scene_pos.xz - // so the x and z offest are sides of a square with the same diagonal + // so the x and z offset are sides of a square with the same diagonal auto side_length = xz_distance / std::numbers::sqrt2; return Eigen::Vector3f( target[0] + side_length, diff --git a/libopenage/renderer/demo/demo_6.cpp b/libopenage/renderer/demo/demo_6.cpp index e8beaafc6c..c121431bd1 100644 --- a/libopenage/renderer/demo/demo_6.cpp +++ b/libopenage/renderer/demo/demo_6.cpp @@ -364,7 +364,7 @@ void RenderManagerDemo6::load_shaders() { frame_fshader_file.read()); frame_fshader_file.close(); - /* Shader for frustrum frame */ + /* Shader for frustum frame */ auto frustum_vshader_file = (shaderdir / "demo_6_2d_frustum_frame.vert.glsl").open(); auto frustum_vshader_src = resources::ShaderSource( resources::shader_lang_t::glsl, diff --git a/libopenage/renderer/font/font_manager.cpp b/libopenage/renderer/font/font_manager.cpp index ed581186ab..6173a8c99c 100644 --- a/libopenage/renderer/font/font_manager.cpp +++ b/libopenage/renderer/font/font_manager.cpp @@ -27,7 +27,7 @@ std::string FontManager::get_font_filename(const char *family, const char *style FcResult font_match_result; FcPattern *font_match = FcFontMatch(nullptr, font_pattern, &font_match_result); - // get attibute FC_FILE (= filename) of best-matched font + // get attribute FC_FILE (= filename) of best-matched font FcChar8 *font_filename_tmp; if (FcPatternGetString(font_match, FC_FILE, 0, &font_filename_tmp) != FcResultMatch) { throw Error(ERR << "Fontconfig could not provide font " << family << " " << style); diff --git a/libopenage/renderer/gui/gui.h b/libopenage/renderer/gui/gui.h index 7baa7306d4..a5d15780f6 100644 --- a/libopenage/renderer/gui/gui.h +++ b/libopenage/renderer/gui/gui.h @@ -76,7 +76,7 @@ class GUI { * * @param width Width of the GUI. * @param height Height of the GUI. - * @param shaderdir Directory containg the shader source files. + * @param shaderdir Directory containing the shader source files. */ void initialize_render_pass(size_t width, size_t height, diff --git a/libopenage/renderer/opengl/context.cpp b/libopenage/renderer/opengl/context.cpp index 59f82339aa..0df868d66c 100644 --- a/libopenage/renderer/opengl/context.cpp +++ b/libopenage/renderer/opengl/context.cpp @@ -212,7 +212,7 @@ void GlContext::check_error() { }(); throw Error( - MSG(err) << "An OpenGL error has occured.\n\t" + MSG(err) << "An OpenGL error has occurred.\n\t" << "(" << error_state << "): " << msg); } } diff --git a/libopenage/renderer/opengl/context.h b/libopenage/renderer/opengl/context.h index d0a3f4352a..cc2f4003d8 100644 --- a/libopenage/renderer/opengl/context.h +++ b/libopenage/renderer/opengl/context.h @@ -116,7 +116,7 @@ class GlContext { * Store the currently active shader program for this context. * * Note that this method does not load the shader in OpenGL. It is merely - * a conveniance function so that the renderer can check which program + * a convenience function so that the renderer can check which program * is currently used. * * @param prog Currently active shader program. diff --git a/libopenage/renderer/opengl/framebuffer.h b/libopenage/renderer/opengl/framebuffer.h index 398f7e81d0..5a54892dd5 100644 --- a/libopenage/renderer/opengl/framebuffer.h +++ b/libopenage/renderer/opengl/framebuffer.h @@ -49,7 +49,7 @@ class GlFramebuffer final : public GlSimpleObject { * * @param context OpenGL context used for drawing. * @param textures Textures targeted by the framebuffer. They are automatically - * attached to the correct attachement points depending on their type. + * attached to the correct attachment points depending on their type. */ GlFramebuffer(const std::shared_ptr &context, std::vector> const &textures); diff --git a/libopenage/renderer/opengl/render_target.h b/libopenage/renderer/opengl/render_target.h index 5c6061e070..5a786c1d7b 100644 --- a/libopenage/renderer/opengl/render_target.h +++ b/libopenage/renderer/opengl/render_target.h @@ -31,7 +31,7 @@ enum class gl_render_target_t { /** * Represents an OpenGL target that can be drawn into. - * It can be either a framebuffer with texture attachements or the display (the window). + * It can be either a framebuffer with texture attachments or the display (the window). */ class GlRenderTarget final : public RenderTarget { public: @@ -52,7 +52,7 @@ class GlRenderTarget final : public RenderTarget { * e.g. a depth texture will be set as the depth target. * * @param context OpenGL context used for drawing. - * @param textures Texture attachements. + * @param textures Texture attachments. */ GlRenderTarget(const std::shared_ptr &context, std::vector> const &textures); diff --git a/libopenage/renderer/opengl/shader.cpp b/libopenage/renderer/opengl/shader.cpp index f10da415d9..251f26303f 100644 --- a/libopenage/renderer/opengl/shader.cpp +++ b/libopenage/renderer/opengl/shader.cpp @@ -36,7 +36,7 @@ GlShader::GlShader(const std::shared_ptr &context, // compile shader source glCompileShader(handle); - // check compiliation result + // check compilation result GLint status; glGetShaderiv(handle, GL_COMPILE_STATUS, &status); diff --git a/libopenage/renderer/opengl/shader_program.cpp b/libopenage/renderer/opengl/shader_program.cpp index 4b46a8263c..bd4d93bc78 100644 --- a/libopenage/renderer/opengl/shader_program.cpp +++ b/libopenage/renderer/opengl/shader_program.cpp @@ -425,7 +425,7 @@ void GlShaderProgram::update_uniforms(std::shared_ptr const &uni // TODO: maybe call this at a more appropriate position glUniform1i(loc, tex_unit_id); ENSURE(tex_unit_id < this->textures_per_texunits.size(), - "Tried to assign texture to non-existant texture unit at index " + "Tried to assign texture to non-existent texture unit at index " << tex_unit_id << " (max: " << this->textures_per_texunits.size() << ")."); this->textures_per_texunits[tex_unit_id] = tex; diff --git a/libopenage/renderer/resources/animation/angle_info.h b/libopenage/renderer/resources/animation/angle_info.h index 3b84e0423d..9f46640f35 100644 --- a/libopenage/renderer/resources/animation/angle_info.h +++ b/libopenage/renderer/resources/animation/angle_info.h @@ -29,7 +29,7 @@ class AngleInfo { /** * Create a 2D Angle Info. * - * @param angle_start Rotation in degress at which the frames are displayed. + * @param angle_start Rotation in degrees at which the frames are displayed. * @param frames Frame information. * @param mirror_from Mirror frames from another angle instead of using uniquely * defined frames. @@ -88,7 +88,7 @@ class AngleInfo { private: /** - * Starting rotation in degress at which the frames are displayed. + * Starting rotation in degrees at which the frames are displayed. */ float angle_start; diff --git a/libopenage/renderer/stages/hud/render_stage.h b/libopenage/renderer/stages/hud/render_stage.h index 047aac6349..0eeef73fca 100644 --- a/libopenage/renderer/stages/hud/render_stage.h +++ b/libopenage/renderer/stages/hud/render_stage.h @@ -102,7 +102,7 @@ class HudRenderStage { * * @param width Width of the FBO. * @param height Height of the FBO. - * @param shaderdir Directory containg the shader source files. + * @param shaderdir Directory containing the shader source files. */ void initialize_render_pass(size_t width, size_t height, diff --git a/libopenage/renderer/stages/screen/render_stage.h b/libopenage/renderer/stages/screen/render_stage.h index 4dc40c0d03..685596ec8c 100644 --- a/libopenage/renderer/stages/screen/render_stage.h +++ b/libopenage/renderer/stages/screen/render_stage.h @@ -63,7 +63,7 @@ class ScreenRenderStage { * * Called during initialization of the screen renderer. * - * @param shaderdir Directory containg the shader source files. + * @param shaderdir Directory containing the shader source files. */ void initialize_render_pass(const util::Path &shaderdir); diff --git a/libopenage/renderer/stages/screen/screenshot.cpp b/libopenage/renderer/stages/screen/screenshot.cpp index 583641b6c0..c088ca114d 100644 --- a/libopenage/renderer/stages/screen/screenshot.cpp +++ b/libopenage/renderer/stages/screen/screenshot.cpp @@ -53,7 +53,7 @@ std::string ScreenshotManager::gen_next_filename() { void ScreenshotManager::save_screenshot() { - // get screenshot image from scren renderer + // get screenshot image from screen renderer auto pass = this->renderer->get_render_pass(); auto target = pass->get_target(); auto image = target->into_data(); diff --git a/libopenage/renderer/stages/skybox/render_stage.h b/libopenage/renderer/stages/skybox/render_stage.h index e6967be901..f997d0195e 100644 --- a/libopenage/renderer/stages/skybox/render_stage.h +++ b/libopenage/renderer/stages/skybox/render_stage.h @@ -80,7 +80,7 @@ class SkyboxRenderStage { * * @param width Width of the FBO. * @param height Height of the FBO. - * @param shaderdir Directory containg the shader source files. + * @param shaderdir Directory containing the shader source files. */ void initialize_render_pass(size_t width, size_t height, diff --git a/libopenage/renderer/stages/terrain/render_entity.cpp b/libopenage/renderer/stages/terrain/render_entity.cpp index 2316f5dab7..8d901f5f65 100644 --- a/libopenage/renderer/stages/terrain/render_entity.cpp +++ b/libopenage/renderer/stages/terrain/render_entity.cpp @@ -28,7 +28,7 @@ void RenderEntity::update_tile(const util::Vector2s size, throw Error(MSG(err) << "Cannot update tile: Vertices have not been initialized yet."); } - // find the postion of the tile in the vertex array + // find the position of the tile in the vertex array auto left_corner = pos.ne * size[0] + pos.se; // update the 4 vertices of the tile diff --git a/libopenage/renderer/stages/terrain/render_stage.h b/libopenage/renderer/stages/terrain/render_stage.h index 6066dc90aa..f407aa9aab 100644 --- a/libopenage/renderer/stages/terrain/render_stage.h +++ b/libopenage/renderer/stages/terrain/render_stage.h @@ -99,7 +99,7 @@ class TerrainRenderStage { * * @param width Width of the FBO. * @param height Height of the FBO. - * @param shaderdir Directory containg the shader source files. + * @param shaderdir Directory containing the shader source files. */ void initialize_render_pass(size_t width, size_t height, diff --git a/libopenage/renderer/stages/world/render_stage.h b/libopenage/renderer/stages/world/render_stage.h index 7a0fe02a4c..c0a3b42e6e 100644 --- a/libopenage/renderer/stages/world/render_stage.h +++ b/libopenage/renderer/stages/world/render_stage.h @@ -98,7 +98,7 @@ class WorldRenderStage { * * @param width Width of the FBO. * @param height Height of the FBO. - * @param shaderdir Directory containg the shader source files. + * @param shaderdir Directory containing the shader source files. */ void initialize_render_pass(size_t width, size_t height, const util::Path &shaderdir); diff --git a/libopenage/renderer/window.h b/libopenage/renderer/window.h index e3465bef4d..15c013c3e1 100644 --- a/libopenage/renderer/window.h +++ b/libopenage/renderer/window.h @@ -138,7 +138,7 @@ class Window { /** * Force this window to the given size. It's generally not a good idea to use this, - * as it makes the window jump around wierdly. + * as it makes the window jump around weirdly. * * @param width Width in pixels. * @param height Height in pixels. diff --git a/libopenage/util/compiler.cpp b/libopenage/util/compiler.cpp index 71100d3f92..1fe7971b33 100644 --- a/libopenage/util/compiler.cpp +++ b/libopenage/util/compiler.cpp @@ -25,7 +25,7 @@ namespace util { std::string demangle(const char *symbol) { #ifdef _WIN32 // MSVC's typeid(T).name() already returns a demangled name - // unlike clang and gcc the MSVC demangled name is prefixed with "class " or "stuct " + // unlike clang and gcc the MSVC demangled name is prefixed with "class " or "struct " // we remove the prefix to match the format of clang and gcc return strchr(symbol, ' ') + 1; #else @@ -65,7 +65,7 @@ std::optional symbol_name_win(const void *addr) { std::lock_guard sym_lock_guard{sym_mutex}; // Initialize symbol handler for process, if it has not yet been initialized - // If we are not succesful on the first try, leave it, since MSDN says that searching for symbol files is very time consuming + // If we are not successful on the first try, leave it, since MSDN says that searching for symbol files is very time consuming if (!initialized_symbol_handler) { initialized_symbol_handler = true; diff --git a/libopenage/util/compress/bitstream.h b/libopenage/util/compress/bitstream.h index 43d6a45c01..afca913e66 100644 --- a/libopenage/util/compress/bitstream.h +++ b/libopenage/util/compress/bitstream.h @@ -420,7 +420,7 @@ class BitStream { } /** - * Aligns the bitstream - that is, _if_ we're currenlty in bitstream mode. + * Aligns the bitstream - that is, _if_ we're currently in bitstream mode. * * Otherwise, a no-op. */ diff --git a/libopenage/util/compress/lzxd.cpp b/libopenage/util/compress/lzxd.cpp index 49100f2bf4..8c4609463d 100644 --- a/libopenage/util/compress/lzxd.cpp +++ b/libopenage/util/compress/lzxd.cpp @@ -170,7 +170,7 @@ class LZXDStream { // IO buffering BitStream<4096> bits; - // huffman code lenghts + // huffman code lengths HuffmanTable htpre; HuffmanTable htmain; HuffmanTable htlength; @@ -879,7 +879,7 @@ void LZXDStream::postprocess_intel_e8(unsigned char *buf, int frame_size) { return; } - // search the block for occurances of '0xe8' + // search the block for occurrences of '0xe8' // the last 10 bytes of the frame are not e8-handled, because reasons. for (int pos = 0; pos < frame_size - 10; pos++) { bool is_e8 = (buf[pos] == 0xe8); diff --git a/libopenage/util/file.cpp b/libopenage/util/file.cpp index d035ee34f2..9f04a91d93 100644 --- a/libopenage/util/file.cpp +++ b/libopenage/util/file.cpp @@ -100,7 +100,7 @@ ssize_t File::size() { std::vector File::get_lines() { - // TODO: relay the get_lines to the underlaying filelike + // TODO: relay the get_lines to the underlying filelike // which may do a better job in getting the lines. // instead, we read everything and then split up into lines. std::vector result = util::split_newline(this->read()); diff --git a/libopenage/util/file.h b/libopenage/util/file.h index e2c9a8a992..306376c56f 100644 --- a/libopenage/util/file.h +++ b/libopenage/util/file.h @@ -23,7 +23,7 @@ class Path; /** * Generic File implementation, used in our filesystem-like and file-like - * abtraction system. Can be created from Python :) + * abstraction system. Can be created from Python :) * * TODO: maybe inherit from std::iostream so we can use it the c++-way * diff --git a/libopenage/util/strings.cpp b/libopenage/util/strings.cpp index 9243992db5..a09200bb32 100644 --- a/libopenage/util/strings.cpp +++ b/libopenage/util/strings.cpp @@ -120,7 +120,7 @@ bool string_matches_pattern(const char *str, const char *pattern) { } if (*pattern == '\0') { - // comparision done + // comparison done return true; } diff --git a/libopenage/util/variable.h b/libopenage/util/variable.h index 0692dc727e..c39f65ab26 100644 --- a/libopenage/util/variable.h +++ b/libopenage/util/variable.h @@ -44,7 +44,7 @@ class Variable : public VariableBase { } /** - * accessable typed value + * accessible typed value */ T value; }; diff --git a/libopenage/util/vector.h b/libopenage/util/vector.h index e79283fb64..b355698d20 100644 --- a/libopenage/util/vector.h +++ b/libopenage/util/vector.h @@ -165,7 +165,7 @@ class Vector : public std::array { } /** - * Euclidian norm aka length + * Euclidean norm aka length */ T norm() const { return std::sqrt(this->dot(*this));