- Added some TODOs

- Disabled the kGraph case used in KQ6 Windows for now, as it's problematic and crashes the game
- Added extra param to kDrawCel(), used in KQ6 Windows

The icon bar in KQ6 Windows is shown a bit better now

svn-id: r45567
This commit is contained in:
Filippos Karapetis 2009-10-31 17:54:28 +00:00
parent 2b29b53b47
commit c64fa600b7
9 changed files with 37 additions and 17 deletions

View File

@ -274,9 +274,14 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) {
break;
case K_GRAPH_SAVE_UPSCALEDHIRES_BOX:
warning("kGraph case 15 (%d, %d, %d, %d)", x, y, x1, y1);
// TODO: implement this properly. The code below crashes KQ6
// Save an area given in upscaled-hires coordinates, so that a hires control will be drawn over it
kGraphCreateRect(x, y, x1, y1, &rect);
return s->_gui->graphSaveUpscaledHiresBox(rect);
//kGraphCreateRect(x, y, x1, y1, &rect);
//return s->_gui->graphSaveUpscaledHiresBox(rect);
break;
default:
error("Unsupported kGraph() operation %04x", argv[0].toSint16());
@ -624,6 +629,8 @@ reg_t kPalVary(EngineState *s, int argc, reg_t *argv) {
reg_t kAssertPalette(EngineState *s, int argc, reg_t *argv) {
GuiResourceId viewId = argv[1].toUint16();
// TODO: implement this
warning("kAssertPalette() called with viewId = %d", viewId);
return s->r_acc;
}
@ -636,6 +643,9 @@ reg_t kPortrait(EngineState *s, int argc, reg_t *argv) {
case 0: { // load resource (the corresponding .BIN file from the ACTORS directory)
if (argc == 2) {
Common::String resourceName = s->_segMan->getString(argv[1]);
// TODO: implement this
} else {
warning("kPortrait(loadResource) called with unsupported argc %d", argc);
}
@ -651,6 +661,9 @@ reg_t kPortrait(EngineState *s, int argc, reg_t *argv) {
uint cond = argv[7].toUint16() & 0xff;
uint seq = argv[8].toUint16() & 0xff;
// argv[9] is usually 0??!!
// TODO: implement this. Looks to be a modified version of kDoSync
warning("kPortrait(show) %s at %d, %d", resourceName.c_str(), portraitPos.x, portraitPos.y);
} else {
warning("kPortrait(show) called with unsupported argc %d", argc);
@ -660,6 +673,9 @@ reg_t kPortrait(EngineState *s, int argc, reg_t *argv) {
case 2: { // unload resource
if (argc == 2) {
uint16 portraitId = argv[1].toUint16();
// TODO: implement this
} else {
warning("kPortrait(unload) called with unsupported argc %d", argc);
}
@ -669,7 +685,7 @@ reg_t kPortrait(EngineState *s, int argc, reg_t *argv) {
warning("kPortrait(%d), not implemented (argc = %d)", operation, argc);
}
return NULL_REG;
return s->r_acc;
}
void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
@ -896,10 +912,9 @@ reg_t kDrawCel(EngineState *s, int argc, reg_t *argv) {
uint16 y = argv[4].toUint16();
int16 priority = (argc > 5) ? argv[5].toSint16() : -1;
uint16 paletteNo = (argc > 6) ? argv[6].toUint16() : 0;
// Unknown seems to be scaling related?!?
int16 unknown = (argc > 7) ? argv[7].toSint16() : -1;
int16 origHeight = (argc > 7) ? argv[7].toSint16() : -1;
s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo);
s->_gui->drawCel(viewId, loopNo, celNo, x, y, priority, paletteNo, origHeight);
return s->r_acc;
}

View File

@ -325,8 +325,8 @@ void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animat
_gfx->SetPort(oldPort);
}
void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) {
_gfx->drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo);
void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
_gfx->drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, origHeight);
_palette->setOnScreen();
}
@ -456,6 +456,8 @@ reg_t SciGui::graphSaveBox(Common::Rect rect, uint16 screenMask) {
}
reg_t SciGui::graphSaveUpscaledHiresBox(Common::Rect rect) {
rect.right *= 2;
rect.bottom *= 2;
return _gfx->BitsSave(rect, SCI_SCREEN_MASK_DISPLAY);
}

View File

@ -82,7 +82,7 @@ public:
virtual void drawMenuBar();
virtual void clearMenuBar();
virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
virtual void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo);
virtual void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
virtual void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite);
virtual void drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite);

View File

@ -329,7 +329,7 @@ void SciGuiGfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mir
}
// This one is the only one that updates screen!
void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo) {
void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight) {
SciGuiView *view = getView(viewId);
Common::Rect rect;
Common::Rect clipRect;
@ -346,7 +346,7 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo
Common::Rect clipRectTranslated = clipRect;
OffsetRect(clipRectTranslated);
view->draw(rect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
view->draw(rect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, origHeight);
if (!_screen->_picNotValid)
BitsShow(rect);
}

View File

@ -87,7 +87,7 @@ public:
void BitsFree(GuiMemoryHandle memoryHandle);
void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo);
void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight = -1);
void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
void drawCel(SciGuiView *view, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);

View File

@ -451,7 +451,7 @@ void SciGuiView::unditherBitmap(byte *bitmapPtr, int16 width, int16 height, byte
}
}
void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr) {
void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight) {
GuiPalette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
sciViewCelInfo *celInfo = getCelInfo(loopNo, celNo);
byte *bitmap = getBitmap(loopNo, celNo);
@ -477,7 +477,10 @@ void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect cli
for (x = 0; x < width; x++) {
color = bitmap[x];
if (color != clearKey && priority >= _screen->getPriority(clipRectTranslated.left + x, y))
_screen->putPixel(clipRectTranslated.left + x, y, drawMask, palette->mapping[color], priority, 0);
if (origHeight == -1)
_screen->putPixel(clipRectTranslated.left + x, y, drawMask, palette->mapping[color], priority, 0);
else
_screen->putPixelOnDisplay(clipRectTranslated.left + x, y, palette->mapping[color]);
}
}
} else {

View File

@ -60,7 +60,7 @@ public:
sciViewLoopInfo *getLoopInfo(GuiViewLoopNo loopNo);
void getCelRect(GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
byte *getBitmap(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr);
void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight = -1);
uint16 getLoopCount() const { return _loopCount; }
uint16 getCelCount(GuiViewLoopNo loopNo) { return _loop[loopNo].celCount; }
GuiPalette *getPalette();

View File

@ -883,7 +883,7 @@ void SciGui32::drawPicture(GuiResourceId pictureId, int16 animationNr, bool anim
_s->pic_is_new = 1;
}
void SciGui32::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo) {
void SciGui32::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
int loop = loopNo;
int cel = celNo;
GfxView *new_view;

View File

@ -62,7 +62,7 @@ public:
void drawMenuBar();
void clearMenuBar();
void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo);
void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite);
void drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite);