SCI: Add a stub for kFont which calls kSetFontRes as a subop

svn-id: r55755
This commit is contained in:
Matthew Hoops 2011-02-03 18:07:47 +00:00
parent 4d088332a2
commit be1f62af23
3 changed files with 20 additions and 7 deletions

View file

@ -473,6 +473,7 @@ reg_t kCelInfo(EngineState *s, int argc, reg_t *argv);
reg_t kSetLanguage(EngineState *s, int argc, reg_t *argv); reg_t kSetLanguage(EngineState *s, int argc, reg_t *argv);
reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv); reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv);
reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv); reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv);
reg_t kFont(EngineState *s, int argc, reg_t *argv);
#endif #endif
reg_t kDoSoundInit(EngineState *s, int argc, reg_t *argv); reg_t kDoSoundInit(EngineState *s, int argc, reg_t *argv);

View file

@ -548,6 +548,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(SetLanguage), SIG_EVERYWHERE, "r", NULL, NULL }, { MAP_CALL(SetLanguage), SIG_EVERYWHERE, "r", NULL, NULL },
{ MAP_CALL(ScrollWindow), SIG_EVERYWHERE, "(.*)", NULL, NULL }, { MAP_CALL(ScrollWindow), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_CALL(SetFontRes), SIG_EVERYWHERE, "ii", NULL, NULL }, { MAP_CALL(SetFontRes), SIG_EVERYWHERE, "ii", NULL, NULL },
{ MAP_CALL(Font), SIG_EVERYWHERE, "i(.*)", NULL, NULL },
// SCI2.1 Empty Functions // SCI2.1 Empty Functions
@ -590,7 +591,6 @@ static SciKernelMapEntry s_kernelMap[] = {
// Bitmap // Bitmap
// MovePlaneItems - used by SQ6 to scroll through the inventory via the up/down buttons // MovePlaneItems - used by SQ6 to scroll through the inventory via the up/down buttons
// Font
// AddLine - used by Torin's Passage to highlight the chapter buttons // AddLine - used by Torin's Passage to highlight the chapter buttons
// DeleteLine - used by Torin's Passage to delete the highlight from the chapter buttons // DeleteLine - used by Torin's Passage to delete the highlight from the chapter buttons
// UpdateLine - used by LSL6 // UpdateLine - used by LSL6

View file

@ -1625,12 +1625,10 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) {
} }
reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) { reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) {
// This defines the resolution that the fonts are supposed to be displayed in. // TODO: This defines the resolution that the fonts are supposed to be displayed
// This is used in early SCI2.1 games, but doesn't really have a purpose // in. Currently, this is only used for showing high-res fonts in GK1 Mac, but
// except to notify that GK1 Mac is using higher resolution fonts and should // should be extended to handle other font resolutions such as those
// not be scaled. Saying that the GK2 demo and KQ7 v1.4 have 640x480 fonts
// is pretty much a no-brainer. You can see why this was removed for SCI2.1
// middle. This is not called in the low-res SCI2.1 early games either.
int xResolution = argv[0].toUint16(); int xResolution = argv[0].toUint16();
//int yResolution = argv[1].toUint16(); //int yResolution = argv[1].toUint16();
@ -1640,6 +1638,20 @@ reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) {
return s->r_acc; return s->r_acc;
} }
reg_t kFont(EngineState *s, int argc, reg_t *argv) {
// Handle font settings for SCI2.1
switch (argv[0].toUint16()) {
case 1:
// Set font resolution
return kSetFontRes(s, argc - 1, argv + 1);
default:
warning("kFont: unknown subop %d", argv[0].toUint16());
}
return s->r_acc;
}
#endif #endif
} // End of namespace Sci } // End of namespace Sci