Pages: [1] 2
|
|
|
Author
|
Topic: iPhone port almost complete, some Q's maybe someone can help with... (Read 9719 times)
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
Hi all,
Through more effort than I expected, I have UQM running on an iPhone 3G OS 2.2.1 at full speed 95% correctly... there are some minor issues that are really nagging me. I'm wondering if anyone has an ideas.
-The planets in solar system view are all blue. When you enter planetary orbit, the planets all render correctly. The colormaps are loading, I verified this... -The probe that comes to you when you first enter earth orbit never comes
There are also a miriad of other minor graphical problems I havn't been able to check out yet...
Here's a screenshot of what I'm looking at... does anyone know where I should be looking in the code to diagnose this?
http://lh6.ggpht.com/_k-wHEeIeuS4/Sty7EgPfQCI/AAAAAAAAAFI/N_-Y7O9upSQ/Picture%204.png
|
|
|
Logged
|
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
Thanks for the reply... The content pack is unmodified I'm using the 0.6.0 content pack... The source is 0.6.2 and I downloaded it from the web site, not SVN.
The "inner" orbit you speak of, actually renders correctly. For earth, the moon is grey, the station is there, and the earth is red. Any more zoomed out views result in all the planets being blue. Like the screenshot I posted.
The hyperspace encounters work perfectly.
As for the probe, there is an exception during it's load, but I don't know why it happens. Here's the output:
'probe.lst' -- 47 bytes 'probe/promicon.ani' -- 24 bytes 'probe/probe.cod' -- 1 bytes Trying to get undefined resource 00000000
This occurs because the load_ship function is passing in a 0 for load resource. The 0 comes from the ship pointer->ship_info->ship_icons which is always 0. However the rest of the "race data" appears to be there... I just assumed this was normal. The texture: probe/promicon.0.png is loading correctly.
|
|
|
Logged
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
UPDATE: I ran a build in windows, and that unable to load resource problem occurs there too. That can't be the problem.
It is important to note that none of the ogg files are working currently due to libogg for iphone being completely unusable. All other sounds are ok. I wonder if the timing is based on the audio?
|
|
|
Logged
|
|
|
|
Angelfish
Enlightened
Offline
Posts: 568
|
I'm wondering.. What happens when you enter another system instead of Sol? Could you try planetary orbit in a few of the planets in other systems aswell?
|
|
|
Logged
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
Other systems same deal, all the planets are blue
|
|
|
Logged
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
UPDATE:
Turns out the planet color bugs was a problem with the implementation of SDL_Image on iPhone. In short, the implementation of SDL_Image on iPhone was shortsighted and the images were loaded without palettes. I fixed this bug and tons of graphical problems went away. Fonts now draw correctly etc...
The only two problems left now that i can see are the Ur-Quan probe encounter in the beginning of the game, it still doesn't occur. And the "sound waves" that draw in the purple grid when aliens talk to you aren't drawing.
|
|
|
Logged
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
Everything is fixed and working now.
My only problem is the Ur-Quan probe not coming out... it's frustrating... everything is loading and setting up correctly, it just never happens.
|
|
|
Logged
|
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
First of all congrats on getting a MacOS build to at least get to that point, I can't even get one to successfully compile :-)
There were two problems with the planets being cyan, the first was the colormaps not loading correctly. If you see this in your output: "BUG: XFormPLUT(): no current map" you have that problem.
This is because the BYTE type in the source is loosely defined. It has to be unsigned, or the colormap indicies passed into the SetColormap() function will be negative numbers most of the time. Setting BYTE to unsigned causes a ton of compiler warnings because the code also treats strings and characters as BYTEs, and you shouldn't pass unsigned bytes into string functions typically. But for the most part it seems to be working anyway for me.
The second problem was in the SDL_Image source, there were two LoadPNG functions, one was overwriting the other. The one in question was using Objective-C to load the PNG into a CGImage and then converting that CGImage into a SDL surface. However the CGImage had no palette as the iPhone objective-c load routines remove it.
I removed this load function, and compiled in libpng, this caused the LoadPNG function to actually load it correctly (Even if a bit slower) and the planets all became the right color.
I hope this helps.
|
|
|
Logged
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
Update I have the probe working now!!! Hooray!
The iPhone project will enter final testing now, get a few more optimizations (Although it seems to be running very close to full speed to me). I'll then submit it to the App store for the general public, and release the source for the iPhone developers amongst you.
|
|
|
Logged
|
|
|
|
superbutcherx
*Many bubbles*
Offline
Posts: 116
|
Great job! I got to tell my Iphone-wielding friends right away.
I, on the other hand, have not been as successful.
I figure my problems aren't caused by the BYTE problem since there is no XformPLUT... output in the debug information printed during game (and neither in compilation messages).
So it should be that SDL_image then. I found the two functions, other was in IMG_imageIO.c and the other in IMG_png.c. After deleting the Objective-C style loadPNG code in IMG_imageIO.c I had to add libpng source files and headers to the xcode project as well as zlib sources and headers (libpng seems to want something from there). Then the whole thing would compile into a SDL_image_framework.
But it doesn't work... After flashing the screen and changing to lower resolution the whole shebang crashes with "We've loaded the Kernel VideoDecoder_Load: Unknown file type 'lbm/title.ani' -- 20 bytes Bus error"
First of all, there was that #ifdef LOAD_PNG in the IMG_png.c that prevents compiling the file... I found no way to circumvent it so I just defined LOAD_PNG before that. I guess it would be actually defined if the libpng was correctly included?
Which brings me to my second point: I included pretty much all the c- and h-files from the libpng source into the SDL_image xcode project. (and after that, the zlib ones). Would there be a smarter way to do this with fewer included files?
I also tried without adding anything from libpng but it would not show any graphics then (error messages about trying to draw NULL frame or something)
So, it seems the loadPNG isn't functioning correctly. Any ideas? (Sorry for this thread hijacking novella...)
|
|
|
Logged
|
|
|
|
Cupcakus
Zebranky food
Offline
Posts: 12
|
Make sure you put InitPNG() somewhere... my guess is that is what is missing. If you don't the structure that holds all the function pointers for loading a PNG never gets filled, and the app will crash on the first PNG it tries to load. I think I haphazardly just stuck it as the first line in LoadPNG() but it probably should be put somewhere better.
|
|
|
Logged
|
|
|
|
superbutcherx
*Many bubbles*
Offline
Posts: 116
|
Oh boy... oh wow... WOW!
Man! You're the Man!!!
That really did the trick! Gone is the bad old cyan, I'm gazing at a sparkling plethora of small spheres in colors, colors, colors! (And haven't even taken my medication yet...)
I put the initPNG in the same spot. Not gonna move it if it doesn't give any trouble.
I reckon this epic battle could be worth writing a howto about.
|
|
|
Logged
|
|
|
|
Angelfish
Enlightened
Offline
Posts: 568
|
Nice to see this, the iPhone port if it appears in the apple store might attract a lot of new players to UQM and the Star Control Universe
|
|
|
Logged
|
|
|
|
Pages: [1] 2
|
|
|
|
|