diff options
author | Eugene Sandulenko | 2016-05-02 17:50:15 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-02 17:50:15 +0200 |
commit | 31514f8164c525f3ecaa8962e440e20e985d2f33 (patch) | |
tree | 641b3a141f1b9f27b58b89a318804a560d9bb3de /engines/cge2 | |
parent | 8a6e5336a684a99efcb872e4ed92104d856f6e62 (diff) | |
download | scummvm-rg350-31514f8164c525f3ecaa8962e440e20e985d2f33.tar.gz scummvm-rg350-31514f8164c525f3ecaa8962e440e20e985d2f33.tar.bz2 scummvm-rg350-31514f8164c525f3ecaa8962e440e20e985d2f33.zip |
CGE2: More portable way of getting max long value
Diffstat (limited to 'engines/cge2')
-rw-r--r-- | engines/cge2/vga13h.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index 54f5c00d93..8b0d8b6c77 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -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; |