TLK and Mac Universal Binaries
by Rubes · in Torque Game Engine · 07/23/2006 (1:59 pm) · 35 replies
Just wondering if anyone has been able to compile TLK with TGE 1.4 on the Mac side while creating a Universal Binary. I was able to do it, and it works fine on my G4 desktop. But it has some pretty weird behavior on my Intel laptop...mostly some rendering issues, where at some angles everything turns green.
Has anyone been successful at getting a UB to run well on an Intel Mac, or is this something being worked on?
Has anyone been successful at getting a UB to run well on an Intel Mac, or is this something being worked on?
#2
Basically, what I did was to take the Xcode project file from the TGE 1.4u release, add in the SynapseGaming folder, and substitute in all of the rest of the .cc and .h files from my TGE/TLK1.4 project.
07/23/2006 (2:46 pm)
Everything except the DTS objects turns green, so the terrain and interiors. I just realized my sound is bad, too, so I'll probably have to go through everything again.Basically, what I did was to take the Xcode project file from the TGE 1.4u release, add in the SynapseGaming folder, and substitute in all of the rest of the .cc and .h files from my TGE/TLK1.4 project.
#3
Unfortunately I don't have an Intel Mac yet to test it here. :/
07/24/2006 (6:27 pm)
I didn't realize there was separate TGE release for the universal binaries. I would try comparing the TGE code between the TLK 1.4 release and the TGE 1.4u, there may be updates put in after the official 1.4 release that fix that problem.Unfortunately I don't have an Intel Mac yet to test it here. :/
#4
07/24/2006 (6:36 pm)
Interesting, I didn't suspect there would be a difference in the code, only in the compiler setup...but perhaps you're right. I'll take a look, but I should maybe try asking Paul...
#5
07/24/2006 (6:42 pm)
I believe a few things in the mac platform layer were changed for UB support, and I think there were also some general fixes made as well. I haven't tried merging the two yet, though when I do (which is probably going to be soon because one of the people I work with just got a new MacBook) I'll put it up as a resource.
#6
07/24/2006 (7:42 pm)
That would be great, thanks!
#7
The code/project file can be downloaded here, and if you prefer, a compiled UB can be downloaded from here. This is just stock TLK with the changes made to the universal binary version of Torque merged in.
07/25/2006 (8:12 pm)
Okay, I think I've got it, but if people could check it over for me before I release it as a resource (I don't have an intel mac either).The code/project file can be downloaded here, and if you prefer, a compiled UB can be downloaded from here. This is just stock TLK with the changes made to the universal binary version of Torque merged in.
#8
07/25/2006 (8:20 pm)
Thanks so much, Alex. If I have time tonight I'll check it out and report back.
#9
07/27/2006 (8:15 am)
Rob Sandbach was kind enough to test the executable on his MacBook Pro, and found a couple of merge issues. The code and executable have been updated with fixes. Rob currently sees no issues with the UB on his MacBook, but I'd still like one or two more people to test it and make sure it all works (especially the code as Rob is not a TLK licensee and cannot test that).
#10
07/27/2006 (3:59 pm)
I promise I'll test it out as soon as I get a few minutes...gotta hit the Utah Indie Dev Night tonight, so hopefully this weekend...it will probably only take me a couple of minutes...
#11
When I merge the TLK in 1.4u, I double checked every line, and I found files that conflict the UB version:
engine/core/bitRender.cc
engine/dgl/gBitmap.cc
If you check, this TLK version of files don't have the UB fix in it, I kept the UB version but not solve this problem.
07/28/2006 (9:02 pm)
I got this issue, but is inverted: my PPC mac turn the orc green and red... But my Intel iMac get the right color.When I merge the TLK in 1.4u, I double checked every line, and I found files that conflict the UB version:
engine/core/bitRender.cc
engine/dgl/gBitmap.cc
If you check, this TLK version of files don't have the UB fix in it, I kept the UB version but not solve this problem.
#12
07/28/2006 (9:08 pm)
@Antonio: Have you tried the merged files from a couple of posts up?
#13
http://homepage.mac.com/itoniogames/orc_green.jpg
http://homepage.mac.com/itoniogames/orc_red.jpg
in intel with this fix the orc looks great, any idea?
07/28/2006 (10:01 pm)
The files in UBTLK.zip are the same of my merge. Its strange, because it seems to be correct but i got this pictures of orc when running in PPC:http://homepage.mac.com/itoniogames/orc_green.jpg
http://homepage.mac.com/itoniogames/orc_red.jpg
in intel with this fix the orc looks great, any idea?
#14
Edit: Wait a minute, they don't. I'll look into it.
07/28/2006 (10:37 pm)
Not a clue, the UBTLK.zip files work fine on my PPC mac.Edit: Wait a minute, they don't. I'll look into it.
#15
07/29/2006 (12:41 am)
Ha! Found the problem. The problem was John already fixed endian issues for GBitmap::getColor() and adding in the UB code from 1.4u actually broke it. I updated the files, and everything checks out fine on my PPC mac. I'll hopefully have this up as a resource tomorrow.
#16
Thanks for helping Alex test his changes, we'll definitely make sure this and the Xcode 2.x project files are working 100% in the next release.
Alex,
As always awesome job! :)
07/29/2006 (4:46 am)
Hi guys,Thanks for helping Alex test his changes, we'll definitely make sure this and the Xcode 2.x project files are working 100% in the next release.
Alex,
As always awesome job! :)
#17
I'm guessing the issue Alex mentioned above is probably accounting for it...at least, that's what I'm hoping.
07/29/2006 (12:43 pm)
I did all of the changes, but I'm still getting the same problem with everything turning green at some viewing angles on the Intel side. However, it did correct the sound problem, and aside from the green thing, everything else is working as it should. Everything works fine on the PPC side.I'm guessing the issue Alex mentioned above is probably accounting for it...at least, that's what I'm hoping.
#18
Normal appearance looking at one angle
The greenies looking slightly to the left
All is not always entirely green
It appears that the things not being rendered properly are interiors and terrain.
07/29/2006 (12:55 pm)
I tried removing the UB code from GBitmap::getColor() but that had no effect for me. To see what I'm talking about, here are some screenshots:Normal appearance looking at one angle
The greenies looking slightly to the left
All is not always entirely green
It appears that the things not being rendered properly are interiors and terrain.
#19
07/29/2006 (1:25 pm)
You may be missing a change, or might have some custom code that's having issues. I haven't seen anything like that on the two MacBook Pros my code has been tested on.
#20
07/29/2006 (2:25 pm)
Try disabling fog in the mission - TGE has had Mac fog issues for some time and this looks very much like one of the problems I've seen before.
Torque Owner John Kabus (BobTheCBuilder)
Does everything turn green or only certain interior edges?
There was an issue with Torque where viewing interior surfaces on a grazing angle would show green and pink lines, but only on certain cards and *usually* only when using anti-aliasing. There is a fix I submitted to TGE 1.3 and up that adds a border to interior light maps to avoid this issue, however if you're using an older map2dif it could be re-introducing the problem.