~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to engines/parallaction/parser_ns.cpp

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2011-11-05 10:29:43 UTC
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20111105102943-zfm3dhlvy5b01u7v
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
20
 *
21
 
 * $URL$
22
 
 * $Id$
23
 
 *
24
21
 */
25
22
 
26
23
#include "common/textconsole.h"
537
534
 
538
535
void ProgramParser_ns::parseRValue(ScriptVar &v, const char *str) {
539
536
 
540
 
        if (isdigit(str[0]) || str[0] == '-') {
 
537
        if (isdigit(static_cast<unsigned char>(str[0])) || str[0] == '-') {
541
538
                v.setImmediate(atoi(str));
542
539
                return;
543
540
        }
1337
1334
                obj->x = z->getX();
1338
1335
                obj->y = z->getY();
1339
1336
                obj->_prog = _zoneProg;
 
1337
 
 
1338
                // WORKAROUND for script bug #2969913
 
1339
                // The katana object has the same default z index (kGfxObjGetZ or -100)
 
1340
                // as the cripta object (the safe) - a script bug.
 
1341
                // Game scripts do not set an explicit z for the katana (as it isn't an
 
1342
                // animation), but rather rely on the draw order to draw it over the
 
1343
                // safe. In this particular case, the safe is added to the scene after
 
1344
                // the katana, thus it is drawn over the katana. We explicitly set the
 
1345
                // z index of the katana to be higher than the safe, so that the katana
 
1346
                // is drawn correctly over it.
 
1347
                // This is a regression from the graphics rewrite (commits be2c5d3,
 
1348
                // 3c2c16c and 44906f5).
 
1349
                if (!scumm_stricmp(obj->getName(), "katana"))
 
1350
                        obj->z = 0;
 
1351
 
1340
1352
                bool visible = (z->_flags & kFlagsRemove) == 0;
1341
1353
                _vm->_gfx->showGfxObj(obj, visible);
1342
1354
                data->_gfxobj = obj;
1415
1427
}
1416
1428
 
1417
1429
void LocationParser_ns::parseNoneData(ZonePtr z) {
1418
 
        // "None" zones should have no content, but some 
1419
 
        // inconsistently define their command list after 
1420
 
        // the TYPE marker. This routine catches these 
 
1430
        // "None" zones should have no content, but some
 
1431
        // inconsistently define their command list after
 
1432
        // the TYPE marker. This routine catches these
1421
1433
        // command lists that would be lost otherwise.
1422
1434
        if (!scumm_stricmp(_tokens[0], "commands")) {
1423
1435
                parseCommands(z->_commands);
1426
1438
                        _script->readLineToken(true);
1427
1439
                        _parser->parseStatement();
1428
1440
                } while (!ctxt.endcommands);
1429
 
                
 
1441
 
1430
1442
                // no need to parse one more line here, as
1431
1443
                // it is done by the caller
1432
1444
        }