diff options
author | Eugene Sandulenko | 2016-07-01 10:56:02 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 8cc88b6fcad2195883f058a2cd0cb3f7c2414acd (patch) | |
tree | 8c17e67c28aafbd6445a05ec4dd02f5aab962d35 /engines/director/lingo/lingo.cpp | |
parent | 061f868d7917f3104c294041ab51ac08f1fd0e38 (diff) | |
download | scummvm-rg350-8cc88b6fcad2195883f058a2cd0cb3f7c2414acd.tar.gz scummvm-rg350-8cc88b6fcad2195883f058a2cd0cb3f7c2414acd.tar.bz2 scummvm-rg350-8cc88b6fcad2195883f058a2cd0cb3f7c2414acd.zip |
DIRECTOR: Lingo: Initial code for built-in functions
Diffstat (limited to 'engines/director/lingo/lingo.cpp')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index e584ac02b9..d8c3bdfad1 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -81,6 +81,8 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) { for (const EventHandlerType *t = &eventHanlerDescs[0]; t->handler != kEventNone; ++t) _eventHandlerTypes[t->handler] = t->name; + initBuiltIns(); + _currentScript = 0; _currentScriptType = kMovieScript; _pc = 0; @@ -93,23 +95,6 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) { Lingo::~Lingo() { } -int Lingo::codeString(const char *str) { - int numInsts = calcStringAlignment(str); - - // Where we copy the string over - int pos = _currentScript->size(); - - // Allocate needed space in script - for (int i = 0; i < numInsts; i++) - _currentScript->push_back(0); - - byte *dst = (byte *)&_currentScript->front() + pos * sizeof(inst); - - memcpy(dst, str, strlen(str) + 1); - - return _currentScript->size(); -} - void Lingo::addCode(Common::String code, ScriptType type, uint16 id) { code += '\n'; |