[Scummvm-cvs-logs] SF.net SVN: scummvm:[55545] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Wed Jan 26 20:02:21 CET 2011


Revision: 55545
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55545&view=rev
Author:   drmccoy
Date:     2011-01-26 19:02:20 +0000 (Wed, 26 Jan 2011)

Log Message:
-----------
GOB: Increase kEnvironmentCount to 20 for Addy

Modified Paths:
--------------
    scummvm/trunk/engines/gob/game.cpp
    scummvm/trunk/engines/gob/game.h

Modified: scummvm/trunk/engines/gob/game.cpp
===================================================================
--- scummvm/trunk/engines/gob/game.cpp	2011-01-26 19:01:42 UTC (rev 55544)
+++ scummvm/trunk/engines/gob/game.cpp	2011-01-26 19:02:20 UTC (rev 55545)
@@ -44,8 +44,6 @@
 namespace Gob {
 
 Environments::Environments(GobEngine *vm) : _vm(vm) {
-	_environments = new Environment[kEnvironmentCount];
-
 	for (uint i = 0; i < kEnvironmentCount; i++) {
 		Environment &e = _environments[i];
 
@@ -60,8 +58,6 @@
 
 Environments::~Environments() {
 	clear();
-
-	delete[] _environments;
 }
 
 void Environments::clear() {
@@ -565,7 +561,7 @@
 		warning("Urban Stub: Game::totSub(), flags == %d", flags);
 
 	if (_numEnvironments >= Environments::kEnvironmentCount)
-		return;
+		error("Game::totSub(): Environments overflow");
 
 	_environments->set(_numEnvironments);
 

Modified: scummvm/trunk/engines/gob/game.h
===================================================================
--- scummvm/trunk/engines/gob/game.h	2011-01-26 19:01:42 UTC (rev 55544)
+++ scummvm/trunk/engines/gob/game.h	2011-01-26 19:02:20 UTC (rev 55545)
@@ -37,7 +37,7 @@
 
 class Environments {
 public:
-	static const uint8 kEnvironmentCount = 5;
+	static const uint8 kEnvironmentCount = 20;
 
 	Environments(GobEngine *vm);
 	~Environments();
@@ -48,7 +48,7 @@
 	const char *getTotFile(uint8 env) const;
 
 	bool has(Variables *variables, uint8 startEnv = 0, int16 except = -1) const;
-	bool has(Script *script      , uint8 startEnv = 0, int16 except = -1) const;
+	bool has(Script    *script   , uint8 startEnv = 0, int16 except = -1) const;
 	bool has(Resources *resources, uint8 startEnv = 0, int16 except = -1) const;
 
 	void clear();
@@ -65,7 +65,7 @@
 
 	GobEngine *_vm;
 
-	Environment *_environments;
+	Environment _environments[kEnvironmentCount];
 };
 
 class Game {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list