How to upgrade your game from 0.7.1 to 0.7.2

1. all platforms

1.1 keep CocosDenshion APIs the same as cocos2d-iphone.org

  • make the initial lower-case in SimpleAudioEngine methods, e.g.
    1. SetEffectsVolume -> setEffectsVolume
    2. SetBackgroundMusicVolume -> setBackgroundMusicVolume
  • the range of the volume param in SimpleAudioEngine is float 0.0~1.0, instead of int 0~100
  • SimpleAudioEngine::preloadEffect will not return int. If you preload a sound file using "MyEffect.wav", then play it with SimpleAudioEngine::playEffect("MyEffect.wav"). SimpleAudioEngine will find the mem data with the hash code of string "MyEffect.wav"
  • CocosDenshion::SimpleAudioEngine::release() to
    CocosDenshion::SimpleAudioEngine::end(), keep the same method name with cocos2d-iphone

1.2 rename the API to follow with cocos2d-iphone 0.99.5

2. WoPhone

  • You don't need to care about the absolute path now.
    • CCFileUtils::setResourceZipFile("AbsolutePath/MyResource.zip") -> CCFileUtils::setResource("MyResource.zip")
    • SimpleAudioEngine::setResourceZipFile("AbsolutePath/MyResource.zip") -> SimpleAudioEngine::setResource("MyResource.zip");
    • put these 2 lines after the declaration of "AppDelegate app", for example:
      Int32 TG3AppMain(const TUChar * pAppID, UInt32 nCmd, void * pCmdParam)
      {
          AppDelegate app;
          cocos2d::CCFileUtils::setResource("MyResource.zip");
          CocosDenshion::SimpleAudioEngine::setResource("MyResource.zip");
      
          app.Run();
      
          return 1;
      }
      
    • On WoPhone emulator, you must copy MyResource.zip into the Work7/NEWPLUS/TG3/APP folder. On WoPhone device, you must install the zip file into the same folder as MyGame.so
  • The way which read image file by TResource is deleted.
    • Delete the file Resource.h,and update the files which have included it.