SCI: Added skeleton code for kEditText (still not working)

This commit is contained in:
Filippos Karapetis 2011-10-28 22:19:52 +03:00
parent d8db7b11c1
commit 4ac2940bc5
6 changed files with 24 additions and 7 deletions

View File

@ -457,6 +457,7 @@ reg_t kListFirstTrue(EngineState *s, int argc, reg_t *argv);
reg_t kListAllTrue(EngineState *s, int argc, reg_t *argv); reg_t kListAllTrue(EngineState *s, int argc, reg_t *argv);
reg_t kInPolygon(EngineState *s, int argc, reg_t *argv); reg_t kInPolygon(EngineState *s, int argc, reg_t *argv);
reg_t kObjectIntersect(EngineState *s, int argc, reg_t *argv); reg_t kObjectIntersect(EngineState *s, int argc, reg_t *argv);
reg_t kEditText(EngineState *s, int argc, reg_t *argv);
// SCI2.1 Kernel Functions // SCI2.1 Kernel Functions
reg_t kText(EngineState *s, int argc, reg_t *argv); reg_t kText(EngineState *s, int argc, reg_t *argv);

View File

@ -499,6 +499,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(UpdatePlane), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(UpdatePlane), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(UpdateScreenItem), SIG_EVERYWHERE, "o", NULL, NULL }, { MAP_CALL(UpdateScreenItem), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(ObjectIntersect), SIG_EVERYWHERE, "oo", NULL, NULL }, { MAP_CALL(ObjectIntersect), SIG_EVERYWHERE, "oo", NULL, NULL },
{ MAP_CALL(EditText), SIG_EVERYWHERE, "o", NULL, NULL },
// SCI2 unmapped functions - TODO! // SCI2 unmapped functions - TODO!
@ -523,13 +524,6 @@ static SciKernelMapEntry s_kernelMap[] = {
// TODO: Implement once the original save/load menus are implemented. // TODO: Implement once the original save/load menus are implemented.
{ MAP_DUMMY(MakeSaveFileName), SIG_EVERYWHERE, "(.*)", NULL, NULL }, { MAP_DUMMY(MakeSaveFileName), SIG_EVERYWHERE, "(.*)", NULL, NULL },
// Used for edit boxes in save/load dialogs. It's a rewritten version of kEditControl,
// but it handles events on its own, using an internal loop, instead of using SCI
// scripts for event management like kEditControl does. Called by script 64914,
// DEdit::hilite().
// TODO: Implement once the original save/load menus are implemented.
{ MAP_DUMMY(EditText), SIG_EVERYWHERE, "o", NULL, NULL },
// Unused / debug SCI2 unused functions, always mapped to kDummy // Unused / debug SCI2 unused functions, always mapped to kDummy
// AddMagnify/DeleteMagnify are both called by script 64979 (the Magnifier // AddMagnify/DeleteMagnify are both called by script 64979 (the Magnifier

View File

@ -49,6 +49,7 @@
#include "sci/graphics/text16.h" #include "sci/graphics/text16.h"
#include "sci/graphics/view.h" #include "sci/graphics/view.h"
#ifdef ENABLE_SCI32 #ifdef ENABLE_SCI32
#include "sci/graphics/controls32.h"
#include "sci/graphics/font.h" // TODO: remove once kBitmap is moved in a separate class #include "sci/graphics/font.h" // TODO: remove once kBitmap is moved in a separate class
#include "sci/graphics/text32.h" #include "sci/graphics/text32.h"
#include "sci/graphics/frameout.h" #include "sci/graphics/frameout.h"
@ -1798,6 +1799,20 @@ reg_t kBitmap(EngineState *s, int argc, reg_t *argv) {
return s->r_acc; return s->r_acc;
} }
// Used for edit boxes in save/load dialogs. It's a rewritten version of kEditControl,
// but it handles events on its own, using an internal loop, instead of using SCI
// scripts for event management like kEditControl does. Called by script 64914,
// DEdit::hilite().
reg_t kEditText(EngineState *s, int argc, reg_t *argv) {
reg_t controlObject = argv[0];
if (!controlObject.isNull()) {
g_sci->_gfxControls32->kernelTexteditChange(controlObject);
}
return s->r_acc;
}
#endif #endif
} // End of namespace Sci } // End of namespace Sci

View File

@ -78,6 +78,7 @@ MODULE_OBJS := \
ifdef ENABLE_SCI32 ifdef ENABLE_SCI32
MODULE_OBJS += \ MODULE_OBJS += \
graphics/controls32.o \
graphics/frameout.o \ graphics/frameout.o \
graphics/paint32.o \ graphics/paint32.o \
graphics/text32.o \ graphics/text32.o \

View File

@ -47,6 +47,7 @@
#include "sci/graphics/cache.h" #include "sci/graphics/cache.h"
#include "sci/graphics/compare.h" #include "sci/graphics/compare.h"
#include "sci/graphics/controls16.h" #include "sci/graphics/controls16.h"
#include "sci/graphics/controls32.h"
#include "sci/graphics/coordadjuster.h" #include "sci/graphics/coordadjuster.h"
#include "sci/graphics/cursor.h" #include "sci/graphics/cursor.h"
#include "sci/graphics/maciconbar.h" #include "sci/graphics/maciconbar.h"
@ -147,6 +148,7 @@ SciEngine::~SciEngine() {
DebugMan.clearAllDebugChannels(); DebugMan.clearAllDebugChannels();
#ifdef ENABLE_SCI32 #ifdef ENABLE_SCI32
delete _gfxControls32;
delete _gfxText32; delete _gfxText32;
delete _robotDecoder; delete _robotDecoder;
delete _gfxFrameout; delete _gfxFrameout;
@ -600,6 +602,7 @@ void SciEngine::initGraphics() {
_gfxText16 = 0; _gfxText16 = 0;
_gfxTransitions = 0; _gfxTransitions = 0;
#ifdef ENABLE_SCI32 #ifdef ENABLE_SCI32
_gfxControls32 = 0;
_gfxText32 = 0; _gfxText32 = 0;
_robotDecoder = 0; _robotDecoder = 0;
_gfxFrameout = 0; _gfxFrameout = 0;
@ -622,6 +625,7 @@ void SciEngine::initGraphics() {
_gfxPaint32 = new GfxPaint32(_resMan, _gamestate->_segMan, _kernel, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette); _gfxPaint32 = new GfxPaint32(_resMan, _gamestate->_segMan, _kernel, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette);
_gfxPaint = _gfxPaint32; _gfxPaint = _gfxPaint32;
_gfxText32 = new GfxText32(_gamestate->_segMan, _gfxCache, _gfxScreen); _gfxText32 = new GfxText32(_gamestate->_segMan, _gfxCache, _gfxScreen);
_gfxControls32 = new GfxControls32(_gamestate->_segMan, _gfxCache, _gfxScreen);
_robotDecoder = new RobotDecoder(g_system->getMixer(), getPlatform() == Common::kPlatformMacintosh); _robotDecoder = new RobotDecoder(g_system->getMixer(), getPlatform() == Common::kPlatformMacintosh);
_gfxFrameout = new GfxFrameout(_gamestate->_segMan, _resMan, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette, _gfxPaint32); _gfxFrameout = new GfxFrameout(_gamestate->_segMan, _resMan, _gfxCoordAdjuster, _gfxCache, _gfxScreen, _gfxPalette, _gfxPaint32);
} else { } else {

View File

@ -60,6 +60,7 @@ class GfxAnimate;
class GfxCache; class GfxCache;
class GfxCompare; class GfxCompare;
class GfxControls16; class GfxControls16;
class GfxControls32;
class GfxCoordAdjuster; class GfxCoordAdjuster;
class GfxCursor; class GfxCursor;
class GfxMacIconBar; class GfxMacIconBar;
@ -304,6 +305,7 @@ public:
GfxCache *_gfxCache; GfxCache *_gfxCache;
GfxCompare *_gfxCompare; GfxCompare *_gfxCompare;
GfxControls16 *_gfxControls16; // Controls for 16-bit gfx GfxControls16 *_gfxControls16; // Controls for 16-bit gfx
GfxControls32 *_gfxControls32; // Controls for 32-bit gfx
GfxCoordAdjuster *_gfxCoordAdjuster; GfxCoordAdjuster *_gfxCoordAdjuster;
GfxCursor *_gfxCursor; GfxCursor *_gfxCursor;
GfxMenu *_gfxMenu; // Menu for 16-bit gfx GfxMenu *_gfxMenu; // Menu for 16-bit gfx