Ticket #377: unkroomfunc3.diff

File unkroomfunc3.diff, 1.9 KB (added by eriktorbjorn, 22 years ago)

Updated (but still not correct) patch

  • scummvm/scummvm.cpp

    diff -ur ScummVM-cvs20020804/scummvm/scummvm.cpp ScummVM-cvs20020804+hack/scummvm/scummvm.cpp
    old new  
    799799        return a;
    800800}
    801801
    802 void Scumm::unkRoomFunc3(int a, int b, int c, int d, int e)
     802void Scumm::unkRoomFunc3(int unk1, int unk2, int rfact, int gfact, int bfact)
    803803{
    804         warning("stub unkRoomFunc3(%d,%d,%d,%d,%d)", a, b, c, d, e);
     804        byte *pal = _currentPalette;
     805        byte *table = _shadowPalette;
     806        int i;
     807
     808        warning("unkRoomFunc3(%d,%d,%d,%d,%d): not fully implemented", unk1, unk2, rfact, gfact, bfact);
     809
     810        // unkRoomFunc3(16, 255, 200, 200, 200)
     811        //
     812        // FOA: Sets up the colors for the boat and submarine shadows in the
     813        // diving scene. Are the shadows too light? Maybe unk1 is used to
     814        // darken the colors?
     815        //
     816        // unkRoomFunc3(0, 255, 700, 700, 700)
     817        //
     818        // FOA: Sets up the colors for the subway car headlight when it first
     819        // goes on. This seems to work ok.
     820        //
     821        // unkRoomFunc3(160, 191, 300, 300, 300)
     822        // unkRoomFunc3(160, 191, 289, 289, 289)
     823        //     ...
     824        // unkRoomFunc3(160, 191, 14, 14, 14)
     825        // unkRoomFunc3(160, 191, 3, 3, 3)
     826        //
     827        // FOA: Sets up the colors for the subway car headlight for the later
     828        // half of the trip, where it fades out. This currently doesn't work
     829        // at all. The colors are too dark to be brightened. At first I thought
     830        // unk1 and unk2 were used to tell which color interval to manipulate,
     831        // but as far as I can tell the colors 160-191 aren't used at all to
     832        // draw the light, that can't be it. Apparently unk1 and/or unk2 are
     833        // used to brighten the colors.
     834       
     835        for (i = 0; i <= 255; i++) {
     836                int r = (int) (*pal++ * rfact) >> 8;
     837                int g = (int) (*pal++ * gfact) >> 8;
     838                int b = (int) (*pal++ * bfact) >> 8;
     839
     840                *table++ = remapPaletteColor(r, g, b, (uint) -1);
     841        }
    805842}