diff options
| author | Treeki <treeki@gmail.com> | 2013-05-20 16:44:45 +0200 | 
|---|---|---|
| committer | Treeki <treeki@gmail.com> | 2013-05-20 16:44:45 +0200 | 
| commit | 7d7fd4eb64f562978dbc001bffb53482af747a0b (patch) | |
| tree | 4755419d695c8009228caf42828357acf7193146 /src | |
| parent | ca6c32d2a070f2813c926b307fb4e9ce5e96f448 (diff) | |
| download | kamek-7d7fd4eb64f562978dbc001bffb53482af747a0b.tar.gz kamek-7d7fd4eb64f562978dbc001bffb53482af747a0b.zip  | |
magic platform collision changes
Diffstat (limited to '')
| -rw-r--r-- | src/magicplatform.cpp | 30 | 
1 files changed, 27 insertions, 3 deletions
diff --git a/src/magicplatform.cpp b/src/magicplatform.cpp index 3b2475b..d1ef28c 100644 --- a/src/magicplatform.cpp +++ b/src/magicplatform.cpp @@ -12,7 +12,12 @@ class daEnMagicPlatform_c : public dEn_c {  		enum CollisionType {  			Solid = 0,  			SolidOnTop = 1, -			None = 2 +			None = 2, +			ThinLineRight = 3, +			ThinLineLeft = 4, +			ThinLineTop = 5, +			ThinLineBottom = 6, +			NoneWithZ500 = 7  		};  		// Settings @@ -137,7 +142,7 @@ int daEnMagicPlatform_c::onCreate() {  	moveDelay = ((settings & 0xF00000) >> 20) * 6; -	collisionType = (CollisionType)((settings & 0x3000000) >> 24); +	collisionType = (CollisionType)((settings & 0xF000000) >> 24);  	doesMoveInfinitely = (settings & 0x10000000); @@ -145,7 +150,7 @@ int daEnMagicPlatform_c::onCreate() {  		int putItBehind = settings >> 29;  		pos.z = -3600.0f - (putItBehind * 16);  	} -	if (settings & 0x4000000) +	if (collisionType == NoneWithZ500)  		pos.z = 500.0f;  	setupMovement(); @@ -183,6 +188,21 @@ int daEnMagicPlatform_c::onCreate() {  			sotCollider.addToList();  			break; +		case ThinLineLeft: case ThinLineRight: +		case ThinLineTop: case ThinLineBottom: +			physics.setup(this, +				fWidth * (collisionType == ThinLineRight ? 0.875f : 0.0f), +				fHeight * (collisionType == ThinLineBottom ? -0.75f : 0.0f), +				fWidth * (collisionType == ThinLineLeft ? 0.125f : 1.0f), +				fHeight * (collisionType == ThinLineTop ? -0.25f : -1.0f), +				(void*)&PhysCB1, (void*)&PhysCB2, (void*)&PhysCB3, 1, 0, 0); + +			physics.callback1 = (void*)&PhysCB4; +			physics.callback2 = (void*)&PhysCB5; +			physics.callback3 = (void*)&PhysCB6; + +			physics.addToList(); +			break;  	}  	return 1; @@ -192,6 +212,8 @@ int daEnMagicPlatform_c::onDelete() {  	deleteTiles();  	switch (collisionType) { +		case ThinLineLeft: case ThinLineRight: +		case ThinLineTop: case ThinLineBottom:  		case Solid: physics.removeFromList(); break;  	} @@ -206,6 +228,8 @@ int daEnMagicPlatform_c::onExecute() {  	updateTilePositions();  	switch (collisionType) { +		case ThinLineLeft: case ThinLineRight: +		case ThinLineTop: case ThinLineBottom:  		case Solid: physics.update(); break;  		case SolidOnTop: sotCollider.update(); break;  	}  | 
