xuncl / cocos2d-android

Automatically exported from code.google.com/p/cocos2d-android
Other
0 stars 0 forks source link

CCMacros.CC_SWAP has no effect #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
These two methods change nothing because it is copy by value.

   public static void CC_SWAP(int x, int y ) {
        int temp  = x;
    x = y; y = temp;
    }

    public static void CC_SWAP(float x, float y ) {
        float temp  = x;
    x = y; y = temp;
    }  

Original issue reported on code.google.com by christop...@gmail.com on 4 Apr 2010 at 10:27

GoogleCodeExporter commented 9 years ago
Simply removed this method call and inlined the code in the only one place it 
was used. Java is frugly when it comes to passing refs to native types.

Original comment by ldese...@gmail.com on 14 Nov 2010 at 8:02