Script fix. Magnifier, Memory and Save/Load, while still not working correctly, don't crash the game anymore

svn-id: r35385
This commit is contained in:
Sven Hesse 2008-12-15 16:01:39 +00:00
parent 513aeee844
commit f825ccd63f
8 changed files with 15 additions and 27 deletions

View file

@ -388,7 +388,6 @@ protected:
bool o2_addCollision(OpFuncParams &params);
bool o2_freeCollision(OpFuncParams &params);
bool o2_goblinFunc(OpFuncParams &params);
bool o2_createSprite(OpFuncParams &params);
bool o2_stopSound(OpFuncParams &params);
bool o2_loadSound(OpFuncParams &params);
bool o2_getFreeMem(OpFuncParams &params);

View file

@ -492,7 +492,7 @@ void Inter_Bargon::setupOpcodes() {
/* 24 */
OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc),
OPCODE(o2_createSprite),
OPCODE(o1_createSprite),
OPCODE(o1_freeSprite),
/* 28 */
{NULL, ""},

View file

@ -1821,9 +1821,15 @@ bool Inter_v1::o1_createSprite(OpFuncParams &params) {
int16 width, height;
int16 flag;
if (_vm->_global->_inter_execPtr[1] == 0) {
index = load16();
width = load16();
height = load16();
} else {
index = _vm->_parse->parseValExpr();
width = _vm->_parse->parseValExpr();
height = _vm->_parse->parseValExpr();
}
flag = load16();
_vm->_draw->initSpriteSurf(index, width, height, flag ? 2 : 0);

View file

@ -500,7 +500,7 @@ void Inter_v2::setupOpcodes() {
/* 24 */
OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc),
OPCODE(o2_createSprite),
OPCODE(o1_createSprite),
OPCODE(o1_freeSprite),
/* 28 */
{NULL, ""},
@ -1852,23 +1852,6 @@ bool Inter_v2::o2_goblinFunc(OpFuncParams &params) {
return false;
}
bool Inter_v2::o2_createSprite(OpFuncParams &params) {
int16 index;
int16 width, height;
int16 flag;
index = load16();
width = load16();
height = load16();
_vm->_draw->adjustCoords(0, &width, &height);
flag = load16();
_vm->_draw->initSpriteSurf(index, width, height, flag);
return false;
}
bool Inter_v2::o2_stopSound(OpFuncParams &params) {
int16 expr;

View file

@ -489,7 +489,7 @@ void Inter_v3::setupOpcodes() {
/* 24 */
OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc),
OPCODE(o2_createSprite),
OPCODE(o1_createSprite),
OPCODE(o1_freeSprite),
/* 28 */
{NULL, ""},

View file

@ -490,7 +490,7 @@ void Inter_v4::setupOpcodes() {
/* 24 */
OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc),
OPCODE(o2_createSprite),
OPCODE(o1_createSprite),
OPCODE(o1_freeSprite),
/* 28 */
{NULL, ""},

View file

@ -444,7 +444,7 @@ void Inter_v5::setupOpcodes() {
/* 24 */
OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc),
OPCODE(o2_createSprite),
OPCODE(o1_createSprite),
OPCODE(o1_freeSprite),
/* 28 */
{NULL, ""},

View file

@ -423,7 +423,7 @@ void Inter_v6::setupOpcodes() {
/* 24 */
OPCODE(o1_putPixel),
OPCODE(o2_goblinFunc),
OPCODE(o2_createSprite),
OPCODE(o1_createSprite),
OPCODE(o1_freeSprite),
/* 28 */
{NULL, ""},