How can I avoid XCODE transform my PNGs when moved to iPhone?

Member
Posts: 249
Joined: 2008.10
Post: #1
Hi dudes!

How can I avoid XCODE transform my PNGs when moved to iPhone?
I know there is a flag or define or something but I can't find it.
Do you remember it?
Now I rename my PNG to PN2 but I don't like this way.

BTW: I ask this because I use C++ and have a png loader that works perfectly on the simulator, but this loader don't load modify pngs.

Thanks a lot.
Quote this message in a reply
Member
Posts: 36
Joined: 2009.02
Post: #2
Hi riruilo.

What do you mean by transform? I'm using PNGs in the game I'm working on and the only problem I have is that all the textures are rotated 180 degrees, but I think it's OpenGL related and not because of Xcode doing any transformation. Is it what you mean? Other than that, my PNGs look exactly like the original ones.

If you want I can attach the code I'm using to load them -I got it from an example I found on the Internet- although it's Objective-C and not C++.
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #3
The iPhone strips off the header from the PNG files so they arent read correctly

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #4
Read the Xcode documentation that I pointed out in the previous thread on this topic.
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #5
riruilo Wrote:Now I rename my PNG to PN2 but I don't like this way.
Personally I find this to be the easiest and most flexible way. There are times when you want Xcode to mangle your PNGs (e.g. Icon.png and Default.png).
Quote this message in a reply
Member
Posts: 249
Joined: 2008.10
Post: #6
Frank C. Wrote:Personally I find this to be the easiest and most flexible way. There are times when you want Xcode to mangle your PNGs (e.g. Icon.png and Default.png).

Mmm.. I didn't realise about that. Do you know if I will have problems in the case I deactivate PNG transformation?

Thanks for replies.
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #7
riruilo Wrote:Mmm.. I didn't realise about that. Do you know if I will have problems in the case I deactivate PNG transformation?.
I don't think you'll have problems, but Apple has legitimate performance reasons for mangling PNGs so it would make sense to play nice with the springboard when it loads your icon and default image.
Quote this message in a reply
Member
Posts: 32
Joined: 2008.10
Post: #8
Add "IPHONE_OPTIMIZE_OPTIONS=-skip-PNGs" to your project settings.

See http://www.plaidworld.com/iphonefaq.txt for instructions.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  installing app via xcode to iphone 4s, cause iphone to freeze while calling or receiv sefiroths 3 3,969 Feb 11, 2012 12:10 PM
Last Post: sefiroths
  Xcode 4 Build Failure on iPhone target SparkyNZ 2 7,145 Apr 7, 2011 02:48 AM
Last Post: SparkyNZ
  iPhone pre-multiplied alpha (on PNGs) woes.. Jamie W 12 7,663 Feb 22, 2010 02:44 PM
Last Post: Frank C.
  Updating the iPhone SDK/Xcode the_wandering_monster 3 3,585 Dec 12, 2009 06:54 PM
Last Post: Gillissie
  How do you load PNGs on a C++ program? riruilo 8 6,104 Oct 20, 2009 05:20 PM
Last Post: miketucker