DM: Add partial fix of color palette
This commit is contained in:
parent
37db95c336
commit
94ba2fdb2b
3 changed files with 34 additions and 11 deletions
|
@ -246,10 +246,9 @@ uint16 DMEngine::f30_getScaledProduct(uint16 val, uint16 scale, uint16 vale2) {
|
|||
}
|
||||
|
||||
void DMEngine::f463_initializeGame() {
|
||||
f448_initMemoryManager();
|
||||
_displayMan->f479_loadGraphics();
|
||||
_displayMan->f460_initializeGraphicData();
|
||||
warning(false, "Dummy code in f463_initializeGame, setting palette");
|
||||
_displayMan->loadPalette(g21_PalDungeonView[0]);
|
||||
_displayMan->f94_loadFloorSet(k0_FloorSetStone);
|
||||
_displayMan->f95_loadWallSet(k0_WallSetStone);
|
||||
|
||||
|
@ -279,6 +278,7 @@ void DMEngine::f463_initializeGame() {
|
|||
|
||||
void DMEngine::f448_initMemoryManager() {
|
||||
warning(false, "STUB METHOD: f448_initMemoryManager");
|
||||
_displayMan->f508_buildPaletteChangeCopperList(gK57_PalSwoosh, gK57_PalSwoosh);
|
||||
for (uint16 i = 0; i < 16; ++i)
|
||||
_displayMan->_g347_paletteTopAndBottomScreen[i] = g21_PalDungeonView[0][i];
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ void DMEngine::f462_startGame() {
|
|||
_displayMan->D24_fillScreenBox(boxScreenBottom, k0_ColorBlack);
|
||||
}
|
||||
|
||||
warning(false, "TODO: build copper");
|
||||
_displayMan->f508_buildPaletteChangeCopperList(g21_PalDungeonView[0], _displayMan->_g347_paletteTopAndBottomScreen);
|
||||
_menuMan->f395_drawMovementArrows();
|
||||
_championMan->f278_resetDataToStartGame();
|
||||
_g301_gameTimeTicking = true;
|
||||
|
|
|
@ -728,6 +728,10 @@ DisplayMan::DisplayMan(DMEngine *dmEngine) : _vm(dmEngine) {
|
|||
|
||||
for (uint16 i = 0; i < 32; i++)
|
||||
_g345_aui_BlankBuffer[i] = 0;
|
||||
|
||||
// HACK
|
||||
memcpy(_g346_paletteMiddleScreen, g20_PalEntrance, sizeof(uint16) * 16);
|
||||
memcpy(_g347_paletteTopAndBottomScreen, g20_PalEntrance, sizeof(uint16) * 16);
|
||||
}
|
||||
|
||||
DisplayMan::~DisplayMan() {
|
||||
|
@ -1210,7 +1214,13 @@ byte* DisplayMan::f114_getExplosionBitmap(uint16 explosionAspIndex, uint16 scale
|
|||
|
||||
|
||||
void DisplayMan::updateScreen() {
|
||||
// apply copper
|
||||
warning(false, "Top of the screen color is offset as well"); // loop should start from 320 * 30
|
||||
for (uint32 i = 0; i < 320 * 170; ++i)
|
||||
_g348_bitmapScreen[i] += 16;
|
||||
_vm->_system->copyRectToScreen(_g348_bitmapScreen, _screenWidth, 0, 0, _screenWidth, _screenHeight);
|
||||
for (uint32 i = 0; i < 320 * 170; ++i) // loop should start from 320 * 30
|
||||
_g348_bitmapScreen[i] -= 16;
|
||||
_vm->_console->onFrame();
|
||||
_vm->_system->updateScreen();
|
||||
}
|
||||
|
@ -2157,9 +2167,6 @@ void DisplayMan::f127_drawSquareD0C(Direction dir, int16 posX, int16 posY) {
|
|||
}
|
||||
|
||||
void DisplayMan::f128_drawDungeon(Direction dir, int16 posX, int16 posY) {
|
||||
loadPalette(g20_PalEntrance); // dummy code
|
||||
|
||||
|
||||
if (_g297_drawFloorAndCeilingRequested)
|
||||
f98_drawFloorAndCeiling();
|
||||
_g578_useByteBoxCoordinates = true;
|
||||
|
@ -3675,4 +3682,21 @@ uint16 DisplayMan::f431_getDarkenedColor(uint16 RGBcolor) {
|
|||
return RGBcolor;
|
||||
}
|
||||
|
||||
void DisplayMan::f508_buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom) {
|
||||
// memcpy(_g347_paletteTopAndBottomScreen, topAndBottom, sizeof(uint16) * 16);
|
||||
// memcpy(_g346_paletteMiddleScreen, middleScreen, sizeof(uint16) * 16);
|
||||
byte colorPalette[32 * 3];
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
colorPalette[i * 3] = (topAndBottom[i] >> 8) * (256 / 16);
|
||||
colorPalette[i * 3 + 1] = (topAndBottom[i] >> 4) * (256 / 16);
|
||||
colorPalette[i * 3 + 2] = topAndBottom[i] * (256 / 16);
|
||||
}
|
||||
for (int i = 16; i < 32; ++i) {
|
||||
colorPalette[i * 3] = (middleScreen[i] >> 8) * (256 / 16);
|
||||
colorPalette[i * 3 + 1] = (middleScreen[i] >> 4) * (256 / 16);
|
||||
colorPalette[i * 3 + 2] = middleScreen[i] * (256 / 16);
|
||||
}
|
||||
_vm->_system->getPaletteManager()->setPalette(colorPalette, 0, 32);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -526,7 +526,6 @@ class DisplayMan {
|
|||
|
||||
DMEngine *_vm;
|
||||
|
||||
/// Related to graphics.dat file
|
||||
uint16 _grapItemCount; // @ G0632_ui_GraphicCount
|
||||
uint32 *_packedItemPos;
|
||||
byte *_packedBitmaps;
|
||||
|
@ -751,7 +750,7 @@ public:
|
|||
void f480_releaseBlock(uint16 index); // @ F0480_CACHE_ReleaseBlock
|
||||
uint16 f431_getDarkenedColor(uint16 RGBcolor);
|
||||
void f436_STARTEND_FadeToPalette(uint16 *P0849_pui_Palette) { warning(false, "STUB METHOD: f436_STARTEND_FadeToPalette"); }
|
||||
void f508_buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom) { warning(false, "STUB METHOD: f508_buildPaletteChangeCopperList"); }// @ F0508_AMIGA_BuildPaletteChangeCopperList
|
||||
void f508_buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom);
|
||||
void f136_shadeScreenBox(Box* box, Color color) { warning(false, "STUB METHOD: f136_shadeScreenBox"); } // @ F0136_VIDEO_ShadeScreenBox
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue