Browse Source

Fixed switch statements for pyinvader to match standard invader

David Wimsey 11 years ago
parent
commit
fcbc1b055d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Samples/pyinvaders/src/Invader.cpp

+ 3 - 0
Samples/pyinvaders/src/Invader.cpp

@@ -228,6 +228,7 @@ bool Invader::CheckHit(const Rocket::Core::Vector2f& check_position)
 		int score = 0;
 		int score = 0;
 		switch (type)
 		switch (type)
 		{
 		{
+			ROCKET_UNUSED_SWITCH_ENUM(UNKNOWN);
 			case MOTHERSHIP: score = (Rocket::Core::Math::RandomInteger(6) + 1) * 50; break;	// 50 -> 300
 			case MOTHERSHIP: score = (Rocket::Core::Math::RandomInteger(6) + 1) * 50; break;	// 50 -> 300
 			case RANK3: score = 40; break;
 			case RANK3: score = 40; break;
 			case RANK2: score = 20; break;
 			case RANK2: score = 20; break;
@@ -253,6 +254,8 @@ int Invader::GetSpriteIndex() const
 	int index = animation_frame;
 	int index = animation_frame;
 	switch (type)
 	switch (type)
 	{
 	{
+		ROCKET_UNUSED_SWITCH_ENUM(UNKNOWN);
+		case RANK1: break;	// animation_frame is the right index already
 		case RANK2:	index += 2; break;
 		case RANK2:	index += 2; break;
 		case RANK3:	index += 4; break;
 		case RANK3:	index += 4; break;
 		case MOTHERSHIP: index = 6; break;
 		case MOTHERSHIP: index = 6; break;