diff options
author | Rayyan Ansari <rayyan@ansari.sh> | 2024-04-16 23:06:44 +0100 |
---|---|---|
committer | Rayyan Ansari <rayyan@ansari.sh> | 2024-04-16 23:39:22 +0100 |
commit | 5a852cb00d56342f7e013d0ca6e14b10a9c4b84c (patch) | |
tree | cfb3e0920f98a90988156e33d970b7f4bec45e7d /src/NDS_Header.h | |
parent | 95adc87f6d32b83ab8f242d1278b8d1fd7d85624 (diff) |
ROMManager: optimise ROMIcon function
Precompute all 16 5-bit RGB palette colours into 8-bit RGBA to avoid
repeated and superfluous calculation within the nested loop at the
point of index lookup.
A speedup was observed, from ~7ms, to a consistent 1ms
(i.e. now practically instantaneous) through timing with
std::chrono::high_resolution_clock.
Also improve comprehensibility, by using meaningful names, where
appropriate, for loop counter variables.
Diffstat (limited to 'src/NDS_Header.h')
0 files changed, 0 insertions, 0 deletions