mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 02:44:56 +00:00
CGE2: More portable way of getting max long value
This commit is contained in:
parent
8a6e5336a6
commit
31514f8164
@ -952,8 +952,9 @@ uint8 Vga::closest(Dac *pal, const uint8 colR, const uint8 colG, const uint8 col
|
||||
}
|
||||
|
||||
uint8 Vga::closest(Dac *pal, Dac x) {
|
||||
int exp = (sizeof(long) * 8 - 1);
|
||||
long D = (1 << exp) - 1; // Maximum value of long.
|
||||
long D = 0;
|
||||
D = ~D;
|
||||
D = (unsigned long)D >> 1; // Maximum value of long.
|
||||
long R = x._r;
|
||||
long G = x._g;
|
||||
long B = x._b;
|
||||
|
Loading…
x
Reference in New Issue
Block a user