Agustus 28, 2012
By
Firman
mkdir android cd androidrepo init -u git://android.git.kernel.org/platform/manifest.git repo syncmake
http://twitter.com/Arubin/status/27808662429
Agustus 27, 2012
By
Firman
So....
I have this project in which I use @vladubogdan's Level Helper and Sprite Helper. Then I get this extremely annoying bug that I can't figure out the root:
If I run it on device the first time, the pictures are showing. Second time, not showing, third time showing, etc. WHAT HAS GONE WRONG?
Then I tried to clear the project and re build and I got this:
CopyPNGFile /Users/firman/Library/Developer/Xcode/DerivedData/Dotugov2-fhgqwfonumwjtachcdehbmsgrfdu/Build/Products/Debug-iphoneos/Dotugov2.app/timeselect-hd.png Dotugov2/Resources/Images/timeselect-hd.png
cd /Users/firman/Documents/ios-project/Dotugov2
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng" -compress "" /Users/firman/Documents/ios-project/Dotugov2/Dotugov2/Resources/Images/timeselect-hd.png /Users/firman/Library/Developer/Xcode/DerivedData/Dotugov2-fhgqwfonumwjtachcdehbmsgrfdu/Build/Products/Debug-iphoneos/Dotugov2.app/timeselect-hd.png
While reading /Users/firman/Documents/ios-project/Dotugov2/Dotugov2/Resources/Images/timeselect-hd.png pngcrush caught libpng error:
\341\217
While reading /Users/firman/Documents/ios-project/Dotugov2/Dotugov2/Resources/Images/timeselect-hd.png pngcrush caught libpng error:
I googled and arrived here:
It says that the such error is caused by interlaced PNG images. I tried to resave the PNG images to non interlaced but to no avail. I don't know what to do next...
Agustus 09, 2012
By
Firman
Some lessons I learnt the past few days:
Cocos2D: Don't load heavy resources in the init method. This will crash the app. Instead, load them in a scheduled method.
Box2D: Don't change scene while world is locked (when detecting and responding to touch). This will cause a memory leak. Instead, change the scene in an scheduled method.
Android: The method insert in SQLiteDatabase doesn't throw exception. It does throw exception and print the stack trace but it's internally handled by that method and the exception won't by caught by the try catch block. If you need to catch exception, use insertOrThrow instead.
Code snippet to pad numbers with zero:
NSString *paddingFormat = [[NSString stringWithFormat:@"time\n%%0%dd:%%0%dd", 2, 2] retain];
NSString *paddedNumber = [NSString stringWithFormat:paddingFormat, 0, 0];
Result:
time
00:00
Agustus 06, 2012
By
Firman
So I needed bitmap font atlas for my game. Bitmap font atlas is something similar to Image Atlas, only for font.
There's an open source code for it. The Slick project http://slick.cokeandcode.com/ The bitmap font tool is part of the project, which is located in the Hiero directory.
To correctly set it up as Eclipse project:
1. Create new Eclipse project. Copy the Hiero directory of the Slick project into the source directory of the new project.
2. Copy the lwgl.jar and lwgl-util.jar and slick.jar into the lib directory.
3. Copy the native (platform dependent) binary into some directory in the project structure.
4. Properties -> Java build path -> libraries then click on lwgl.jar and double click on native library location and in the resulting dialog, navigate to the directory where you saved the native binaries of lwgl for your platform.
5. Run the Hiero.java as Java application.
Or, if you still get errors or those steps are too much hassle, you can buy Glyphdesigner for USD 30. Glyphdesigner is better (not much better, just better) than Hiero, and it's easy to run and understand.