aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/script_lol.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-23 00:05:16 +0000
committerJohannes Schickel2009-05-23 00:05:16 +0000
commitc87f3199f82c5166a680f1ce9952777e8b4a6068 (patch)
treef24f0226bf6485c755af8a0470281273a3e7f76e /engines/kyra/script_lol.cpp
parent9e000c662b8645257f2fbd66c072ea54ee7786bb (diff)
downloadscummvm-rg350-c87f3199f82c5166a680f1ce9952777e8b4a6068.tar.gz
scummvm-rg350-c87f3199f82c5166a680f1ce9952777e8b4a6068.tar.bz2
scummvm-rg350-c87f3199f82c5166a680f1ce9952777e8b4a6068.zip
Reserve opcode array entries beforehand, should save some reallocation and copying.
svn-id: r40798
Diffstat (limited to 'engines/kyra/script_lol.cpp')
-rw-r--r--engines/kyra/script_lol.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index 886869fb79..a7b3d573b2 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -2250,6 +2250,7 @@ typedef Common::Functor2Mem<const TIM *, const uint16 *, int, LoLEngine> TIMOpco
void LoLEngine::setupOpcodeTable() {
Common::Array<const Opcode*> *table = 0;
+ _opcodes.reserve(192);
SetOpcodeTable(_opcodes);
// 0x00
Opcode(olol_setWallType);
@@ -2540,6 +2541,8 @@ void LoLEngine::setupOpcodeTable() {
OpcodeUnImpl();
Common::Array<const TIMOpcode*> *timTable = 0;
+
+ _timIntroOpcodes.reserve(8);
SetTimOpcodeTable(_timIntroOpcodes);
// 0x00
@@ -2554,6 +2557,7 @@ void LoLEngine::setupOpcodeTable() {
OpcodeTimUnImpl();
OpcodeTimUnImpl();
+ _timIngameOpcodes.reserve(17);
SetTimOpcodeTable(_timIngameOpcodes);
// 0x00