aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2007-02-20 09:10:21 +0000
committerNicola Mettifogo2007-02-20 09:10:21 +0000
commit1bd5f9932b45e92dd73097df26acfe127df39c05 (patch)
tree4d2e06325c0664259fb644dd6b0c901be6ae0f79 /engines
parent7f31211e4fcbc905b5818c2766c58e0775438f17 (diff)
downloadscummvm-rg350-1bd5f9932b45e92dd73097df26acfe127df39c05.tar.gz
scummvm-rg350-1bd5f9932b45e92dd73097df26acfe127df39c05.tar.bz2
scummvm-rg350-1bd5f9932b45e92dd73097df26acfe127df39c05.zip
animation scripts are now parsed through the same pipeline used for location scripts. Thus, animation scripts are now cached instead of being read line by line.
svn-id: r25737
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/animation.cpp19
-rw-r--r--engines/parallaction/parser.cpp4
-rw-r--r--engines/parallaction/parser.h4
3 files changed, 19 insertions, 8 deletions
diff --git a/engines/parallaction/animation.cpp b/engines/parallaction/animation.cpp
index 613721cb80..5707d6d367 100644
--- a/engines/parallaction/animation.cpp
+++ b/engines/parallaction/animation.cpp
@@ -259,8 +259,20 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
ArchivedFile *file = openArchivedFile(vC8);
if (!file) errorFileNotFound(vC8);
+ uint32 size = getArchivedFileLength(vC8);
+ char* src = (char*)memAlloc(size+1);
+
+ readArchivedFile(file, src, size);
+ src[size] = '\0';
+
+ closeArchivedFile(file);
+
_numLocals = 0;
- scriptFillBuffers(file);
+
+ LocScript *script = new LocScript(src);
+// scriptFillBuffers(file);
+
+ fillBuffers(*script);
a->_program = (Program*)memAlloc(sizeof(Program));
memset(a->_program, 0, sizeof(Program));
@@ -278,7 +290,8 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
vCC = (Instruction*)memAlloc(sizeof(Instruction));
memset(vCC, 0, sizeof(Instruction));
- scriptFillBuffers(file);
+ fillBuffers(*script);
+ // scriptFillBuffers(file);
}
vCC->_index = INST_END;
@@ -286,8 +299,6 @@ void Parallaction::loadProgram(Animation *a, char *filename) {
a->_program->_ip = (Instruction*)a->_program->_node._next;
- closeArchivedFile(file);
-
return;
}
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index 3237004450..b17b080d5b 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -221,7 +221,7 @@ uint16 tableFillBuffers(Common::SeekableReadStream &stream) {
return fillTokens(line);
}
-*/
+
// FIXME
// this function does the same Job as fillBuffers, except that
@@ -243,5 +243,5 @@ uint16 scriptFillBuffers(ArchivedFile *file) {
return fillTokens(line);
}
-
+*/
} // namespace Parallaction
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index 622d3ec719..ea9b70ee5c 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -36,8 +36,8 @@ char *parseComment(ArchivedFile *file);
uint16 fillBuffers(Common::SeekableReadStream &stream, bool errorOnEOF = false);
char *parseNextToken(char *s, char *tok, uint16 count, const char *brk);
-uint16 tableFillBuffers(Common::SeekableReadStream &stream);
-uint16 scriptFillBuffers(ArchivedFile *file);
+//uint16 tableFillBuffers(Common::SeekableReadStream &stream);
+//uint16 scriptFillBuffers(ArchivedFile *file);
extern char _tokens[][40];