Skip to content

Game Tutorial original PR comments tracking issue #269

@gpx1000

Description

@gpx1000

This is a list of all completed comments from the original PR that was merged #119

I'll keep updating them as I go; all changes will be in #253

NB: in the below the numbers at left indicate the PR comment number. 439 total comments were in that PR. might take a bit to get through all of them still.

Code Quality & Best Practices

  • 1, 78: Platform defines (PLATFORM_ANDROID/PLATFORM_DESKTOP) - CMakeLists.txt:77-86
  • 2, 79: std::clamp parameter order fixed - audio_system.cpp:422, 672
  • 5, 81: Renamed to StopMeasurement (matching StartMeasurement) - debug_system.h:233
  • 6, 80: Changed warning to error for stopping unmeasured timer - debug_system.h:248
  • 8, 43: Using try_emplace for efficient map insertion - descriptor_manager.cpp:70, memory_pool.cpp:243
  • 9: Added assertions for uniformBuffers validation - descriptor_manager.cpp:102, 204-205
  • 46: Removed impossible error check in deallocate() - memory_pool.cpp:372
  • 62: Use try_emplace instead of manual check - model_loader.cpp:1319
  • 67: Move materialMesh instead of copy - model_loader.cpp:1540
  • 68: Reserve space for vectors before insertion - model_loader.cpp:1537
  • 97, 98: Added bounds checking assertions - mesh_component.h:508, 523-524
  • 131: Fixed logic issue - only map buffers when data exists - imgui_system.cpp:1087
  • 170: Consolidated duplicate shader loading - physics_system.cpp:716
  • 179: Renamed RemoveRigidBody to DestroyRigidBody for API consistency - physics_system.h:259, physics_system.cpp:344
  • 217: Added Vulkan feature support checking before requesting - renderer_core.cpp:934
  • 235: Added error messages for fence timeouts - renderer_rendering.cpp (5 locations)
  • 237: Fixed inconsistent entityIt checking - eliminated redundant lookups - renderer_rendering.cpp:2549, 2565, 2660
  • 203: Async texture loading already implemented - uses std::future<bool> - renderer.h:454, 469
  • 246: Removed redundant eErrorOutOfDateKHR checks (handled by exceptions) - renderer_rendering.cpp:1673, 2997
  • 298: Removed 8 redundant renderer null checks after validation - scene_loading.cpp:220, 229, 317, 426, 542, 578, 592, 656
  • 48, 49: Replaced manual loop with std::accumulate using structured bindings - memory_pool.cpp:568-576
  • 193: Use [[maybe_unused]] instead of (void) casts - platform.cpp:158, renderer_core.cpp:37,39,54,56, audio_system.cpp:1163
  • 180: Removed empty destructor (RAII handles cleanup) - pipeline.h:70, pipeline.cpp:28-32
  • 185, 189: Removed unnecessary viewport/scissor initialization for dynamic states - pipeline.cpp:182-198, 377-393, 551-567 (3 pipelines)
  • 200: Removed unnecessary single-element vector copy in descriptor binding - renderer_compute.cpp:532-535
  • 255: Use std::tie instead of temporary variables with move - renderer_resources.cpp:53-62
  • 260, 261: Replace manual string checks with ends_with() for file extensions - renderer_resources.cpp:170, 193, 250, 725 (4 locations)
  • 123: Renamed MEASURE_END to MEASURE_STOP for consistency - debug_system.h:290
  • 127: Removed single-element arrays, use single values directly - imgui_system.cpp:519-521
  • 167: Removed unnecessary manual clear in destructor (automatic cleanup) - physics_system.cpp:226
  • 191: Consolidated duplicate Android window event handlers - platform.cpp:36-67
  • 211: Use StructureChain for timeline semaphore creation - renderer_core.cpp:1220-1223
  • 222, 223: Removed unnecessary .pNext = nullptr and explicit .sType assignments - renderer_core.cpp:1128-1159 (7 locations), renderer_ray_query.cpp:653, 1177 (2 locations)
  • 267: Fixed alpha value for 50% translucency (125 → 128) - renderer_resources.cpp:527
  • 270: Use ArrayProxy instead of vector for single regions - renderer.h:1907, 1912, renderer_resources.cpp:616, 932, 2490, 3799
  • 305: Use StructureChain for device feature chain - vulkan_device.cpp:142-152
  • 96: Removed redundant isInstances flag - now computed via IsInstanced() method - mesh_component.h:482-485 (already done)
  • 214: Added consistent error messages to all initialization steps - renderer_core.cpp (15+ locations)
  • 251, 422, 423: Fixed error handling - eErrorOutOfDateKHR properly handled as exception - renderer_rendering.cpp:1653 (already done)
  • 431: Added camera null check assertions - renderer_rendering.cpp:842, 867
  • 230, 231: Changed C-style array to std::array for queue family indices - renderer_rendering.cpp:625-632
  • 232: Moved ImageViewCreateInfo out of loop for efficiency - renderer_rendering.cpp:233-244
  • 233: Moved fenceInfo declaration closer to usage - renderer_rendering.cpp:641-643
  • 426: CRITICAL - Fixed semaphore count from swapChainImages.size() to MAX_FRAMES_IN_FLIGHT - renderer_rendering.cpp:625-638
  • 263: Removed dead code - !isKtx2 check at line 420 unreachable after early return - renderer_resources.cpp:417-419
  • 264: Removed redundant isKtx2 checks and simplified mipmap generation logic - renderer_resources.cpp:417-464
  • 72: Used std::accumulate for avgNormal calculation instead of manual loop - model_loader.cpp:1984-1989
  • 149: Added reserve() calls for combinedVertices and combinedIndices to avoid reallocations - model_loader.cpp:1547-1557
  • 25: Using std::chrono::milliseconds (TimeDelta) for deltaTime - engine.h:47 (already done)
  • 28: Height != 0 check already present before division - engine.cpp:584, 589 (already done)
  • 29: Using std::ranges::find_if for Ball_ entity search - engine.cpp:620-623 (already done)
  • 175: Replaced VK_NULL_HANDLE comparisons with RAII bool checks - physics_system.cpp:1146-1148, 1302, 1393-1396 (3 locations)
  • 177: Extracted hardcoded 0.0335f to TENNIS_BALL_RADIUS constexpr - physics_system.cpp:32, 423, 1192

Const Correctness

  • 14, 15: Return const references in getEntityResources - descriptor_manager.h:117-130
  • 22: GetEntities() returns const reference - engine.h:96-99
  • 33: GetActiveCamera() is const - engine.h:125
  • 152: GetMaterial() returns const Material * (updated 6 files)

Architecture Improvements

  • 34: Removed redundant componentMap - entity.h:39
  • 36: Simplified HasComponent() implementation - entity.h:175-179
  • 44, 47: No hard limits on memory blocks, rendering state flag informational only - memory_pool.cpp:293-300, memory_pool.h:98
  • 56, 87: Proper RAII handling, explicit clear with comment - memory_pool.cpp:31
  • 411, 414, 416, 417: Made Initialize() methods private - constructor-only initialization pattern implemented for AudioSystem, PhysicsSystem, ModelLoader, ImGuiSystem

Vulkan Code Cleanup

  • 222: Removed unnecessary .sType and .pNext = nullptr (13 instances) - renderer_pipelines.cpp

RenderDoc & Debug System

  • 84: RenderDoc integration implemented - debug_system.h
  • 99, 100: Debug system lock handling fixed - debug_system.h:262

General already fixed.

  • 118-121: Author confirmed "Done, Thanks!" / "Fixed"
  • 128, 171, 173, 184: Designated initializers adopted (C++20)
  • 135: try_emplace pattern used throughout
  • 141, 216, 219: std::ranges functions adopted
  • 239, 292, 295: std::ranges::find_if pattern found in codebase

Metadata

Metadata

Assignees

No one assigned

    Labels

    Game EngineSpecific to the Simple Game Engine tutorial

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions