Commit Graph

15 Commits

Author SHA1 Message Date
Michael Fitzmayer
b53b31b74a [N-Gage] Add various micro-optimizations to rendering back-end
- Add reusable line points buffer to eliminate per-call heap allocations in DrawLines.
- Cache last draw color to skip redundant SetPenColor/SetBrushColor calls.
- Pre-compute cardinal angle constants (0°, 90°, 180°, 270°) for CopyEx fast-path.
- Cache color modulation state to avoid redundant LUT rebuilds.
- Add missing break statement in HandleEvent.
- Initialize previously uninitialized lastTime variable in UpdateFPS.
2026-04-16 21:38:07 +02:00
Michael Fitzmayer
30522e8598 [N-Gage] Optimize renderer even further
- Replace FixDiv with inverse scale factors in ApplyScale
- Improve incremental DDA in ApplyRotation
- Optimize ApplyColorMod bit manipulation and LUT addressing
- Batch color changes in DrawPoints and FillRects to reduce API overhead
- Add early-exit optimizations to Copy/CopyEx for common cases
- Streamline Flip function by removing unnecessary API calls
- Fix vertex indexing bug in FillRects
2026-04-15 21:46:56 +02:00
Michael Fitzmayer
5bd1a65e6f [N-Gage] Add LUT color mod, cardinal rotation cache and loop unrolling
- Implement lookup tables for faster color modulation
- Cache 0°/90°/180°/270° rotations for speedup on common angles
- Add dirty rectangle tracking infrastructure
- Process 4 pixels at a time in all transform operations
2026-04-15 20:36:42 +02:00
Michael Fitzmayer
e5c8523b36 [N-Gage] Preserve source textures and optimize rotation with DDA
- Add temporary render bitmap to avoid destroying source texture data
- Implement incremental DDA algorithm for rotation
- Replaces per-pixel FixMul operations with simple additions and preserves
  textures for reuse.
2026-04-15 20:36:41 +02:00
Michael Fitzmayer
4870f81d9c [N-Gage] Optimize rendering back-end
- Remove SDL_Surface member from NGAGE_TextureData structure and update all functions that currently use
  surface->pixels to instead access bitmap->DataAddress() directly. This eliminates the intermediate copy
  step (Mem::Copy from surface to bitmap) in rendering operations.

- Eliminate per-frame allocations in Copy/CopyEx methods. These buffers are now allocated once and resized
  only when needed.
2026-04-15 20:36:41 +02:00
Sam Lantinga
5f086e7623 Updated copyright for 2026 2026-01-01 09:40:08 -08:00
Sam Lantinga
513de0f0ec Don't allow SDL_TEXTURE_ADDRESS_WRAP if it's not supported
Fixes https://github.com/libsdl-org/SDL/issues/13908
2025-10-12 10:46:48 -07:00
Michael Fitzmayer
03489e249a [Nokia N-Gage] Re-enable FPS counter, fix link in README.
- Re-enable FPS counter, which is hidden by default anyway - but essential while working on an actual project.
- Fix link in the platform's README.
- Re-order list of supported platforms (alphabetical order to maintain consistency).
2025-07-02 21:27:24 +02:00
Sam Lantinga
d7939abf42 Use consistent style for pointer declarations and casts 2025-06-18 10:03:44 -07:00
Cameron Cawley
f2bcfe3dd2 Correct the texture format used for the N-Gage (#13192) 2025-06-08 18:56:24 +02:00
Michael Fitzmayer
685f1720fe Revert "[Nokia N-Gage] Fix alpha transparency in 4K color mode using BitBltMasked"
This reverts commit 2ef7944170 due to unbearable performance issues.
2025-06-07 22:45:54 +02:00
Michael Fitzmayer
cbc9d662ea [Nokia N-Gage] Add define to disable FPS counter by default. 2025-06-07 15:40:53 +02:00
Michael Fitzmayer
2ef7944170 [Nokia N-Gage] Fix alpha transparency in 4K color mode using BitBltMasked
Previously, all transparent pixels were rendered as opaque due to the limitations of the 4K color mode. Replaced Gc()->BitBlt() with Gc()->BitBltMasked() and updated the mask during copy operations to correctly respect the alpha channel of textures, while maintaining good performance.
2025-06-04 21:05:29 +02:00
Michael Fitzmayer
b61586b492 [Nokia N-Gage] Increase max. texture size from 256 to 1024; the previous setting was chosen at random and does not necessarily make sense in practice. 2025-05-31 14:07:49 +02:00
Michael Fitzmayer
7ae64592c9 Restore support for the Nokia N-Gage (#12148) 2025-05-22 11:07:22 -07:00