Skip to content

Conversation

Copy link

Copilot AI commented Jan 25, 2026

Checklist

Links to issue(s) this pull request concerns (if applicable)

N/A

Pull request description

Converts the flyby camera system from using static arrays with a hardcoded limit to dynamic std::vector allocation, removing all hardcoded limits on flyby cameras.

Changes

  • TombEngine/Game/spotcam.h:

    • Removed MAX_SPOTCAMS constant (was 1024)
    • Added SPOTCAM_MAX_SEQUENCE_ID constant (256) for sequence number indexing
    • Changed SpotCam, SpotCamRemap, and CameraCnt from static arrays to std::vector
  • TombEngine/Game/spotcam.cpp:

    • Updated variable declarations to use std::vector
    • Modified ClearSpotCamSequences() to use clear() method
    • Updated bounds check in GetCameraTransform() to use SPOTCAM_MAX_SEQUENCE_ID
  • TombEngine/Specific/level.cpp:

    • Added vector initialization when loading cameras from level data
    • SpotCam is sized to actual camera count from level data
    • SpotCamRemap and CameraCnt are sized to 256 and zero-initialized (indexed by sequence number, unsigned char range 0-255)

Impact

  • No hardcoded limit on flyby cameras - supports unlimited cameras
  • Memory is allocated dynamically based on actual camera count
  • Reduces memory footprint when fewer cameras are used
  • Vectors properly initialized with zero values to match original static array behavior
  • Maintains backward compatibility with existing level files and save games
Original prompt

There is a limitation on flyby cameras being restricted to 256 count. Please increase this limit to 1024.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Copilot AI changed the title [WIP] Increase limit on flyby cameras to 1024 Increase flyby camera limit from 256 to 1024 Jan 25, 2026
Copilot AI requested a review from TrainWrack January 25, 2026 17:36
@TrainWrack
Copy link
Owner

@copilot Can we update the SptCams structure so that it doesn't use a static array?

Copilot AI and others added 5 commits January 25, 2026 19:12
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 25, 2026

@copilot Can we update the SptCams structure so that it doesn't use a static array?

Done. The SpotCam structure now uses std::vector instead of static arrays. Changes include:

  • Removed MAX_SPOTCAMS constant
  • SpotCam, SpotCamRemap, and CameraCnt are now std::vector
  • Memory allocated dynamically based on actual camera count
  • No hardcoded limit on flyby cameras

See commits d947271, 9416c6a, 22a1fdf, 2079407, and 8c7fc7c.

Copilot AI changed the title Increase flyby camera limit from 256 to 1024 Convert flyby camera system to use dynamic allocation with std::vector Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants