diff options
author | Vincent Hamm | 2007-12-25 20:16:59 +0000 |
---|---|---|
committer | Vincent Hamm | 2007-12-25 20:16:59 +0000 |
commit | b2ab69f455978a4dffc4fcb8cd6148edbb886327 (patch) | |
tree | 46cb912f296bbe687f13343af8e692fe35aeaab8 /engines/cruise/cruise_main.cpp | |
parent | a3f1767009a692d1edaa3d1f0fd29c0de455a95c (diff) | |
download | scummvm-rg350-b2ab69f455978a4dffc4fcb8cd6148edbb886327.tar.gz scummvm-rg350-b2ab69f455978a4dffc4fcb8cd6148edbb886327.tar.bz2 scummvm-rg350-b2ab69f455978a4dffc4fcb8cd6148edbb886327.zip |
Fix palette issues
svn-id: r29989
Diffstat (limited to 'engines/cruise/cruise_main.cpp')
-rw-r--r-- | engines/cruise/cruise_main.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 61bfa3f2e0..4f7f11fd2e 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1174,8 +1174,18 @@ void callSubRelation(menuElementSubStruct *pMenuElement, int nOvl, int nObj) { } int findHighColor() { - printf("Unimplemented findHighColor\n"); - return 1; + int bestColorResult = -1; + int bestColorIdx = -1; + + for(unsigned long int i=0; i<256; i++) { + int colorResult = (workpal[i*3+0] + workpal[i*3+1] + workpal[i*3+2]) / 256; + + if(colorResult > bestColorResult) { + bestColorIdx = i; + bestColorResult = colorResult; + } + } + return bestColorIdx; } void callRelation(menuElementSubStruct *pMenuElement, int nObj2) { |