iT2D 1.4.1 - Xcode 4.1 - TGB Build Errors
by Alex Green · in iTorque 2D · 09/12/2011 (9:45 pm) · 16 replies
Hey,
Build: 1.4.1 Release
Platform: OS X 10.7.1
Target: Editor (Torque Game Build > My Mac 32-bit)
I'm pretty new to iTorque 2D (and Torque for that matter), but have managed to get a small test game up and running. The approach I've taken is to mix some stuff written in C++ with some stuff written in Torque script, to get a feel for what might best be done where.
As a result of the C++ changes, the version that's run from within TGB doesn't match the version that's launched when Xcode is launched from TGB. I'd like to have the best of both worlds - make tweaking changes to various parameters when running within TGB (via script/data blocks) and to do a lot of the heavy lifting in C++.
My approach to solving this was to try to build TGB with the provided code and include my relevant C++ code. Is this the correct/recommended approach? If not, what is the best approach? And if it is the proper approach, am I the only one seeing these errors?
Note that the game itself builds fine from Xcode, just not TGB.
One final question: will the compilation warnings be cleaned up in the next release? It makes it really hard to determine what warnings/errors are related to my code.
Cheers,
Alex.
*Edited to conform to bug reporting format.
Build: 1.4.1 Release
Platform: OS X 10.7.1
Target: Editor (Torque Game Build > My Mac 32-bit)
I'm pretty new to iTorque 2D (and Torque for that matter), but have managed to get a small test game up and running. The approach I've taken is to mix some stuff written in C++ with some stuff written in Torque script, to get a feel for what might best be done where.
As a result of the C++ changes, the version that's run from within TGB doesn't match the version that's launched when Xcode is launched from TGB. I'd like to have the best of both worlds - make tweaking changes to various parameters when running within TGB (via script/data blocks) and to do a lot of the heavy lifting in C++.
My approach to solving this was to try to build TGB with the provided code and include my relevant C++ code. Is this the correct/recommended approach? If not, what is the best approach? And if it is the proper approach, am I the only one seeing these errors?
Quote:
'FMGetFontFromATSFontRef' was not declared in this scope
'DMGetFirstScreenDevice' was not declared in this scope
'DMGetNextScreenDevice' was not declared in this scope
'GetMainDevice' was not declared in this scope
'DMGetFirstScreenDevice' was not declared in this scope
'DMGetNextScreenDevice' was not declared in this scope
Note that the game itself builds fine from Xcode, just not TGB.
One final question: will the compilation warnings be cleaned up in the next release? It makes it really hard to determine what warnings/errors are related to my code.
Cheers,
Alex.
*Edited to conform to bug reporting format.
#2
1. Yeah, that's what I figured. Glad to hear it'll be addressed.
2. Interesting - I didn't realize that it ran the generated app. I now wonder if it has to do with me putting the project under a different directory - I moved it from iTorque2D\MyProjects\Your_Game to iTorque2D\Projects\Your_Game. That said, when I compiled RainyDay which is still under MyProjects, I didn't see the .app update. Any idea where the step to put it in the correct directory is (a cursory look through the Xcode project settings doesn't seem to show anything)?
Cheers,
Alex.
09/13/2011 (10:53 am)
Thanks for the response, Michael.1. Yeah, that's what I figured. Glad to hear it'll be addressed.
2. Interesting - I didn't realize that it ran the generated app. I now wonder if it has to do with me putting the project under a different directory - I moved it from iTorque2D\MyProjects\Your_Game to iTorque2D\Projects\Your_Game. That said, when I compiled RainyDay which is still under MyProjects, I didn't see the .app update. Any idea where the step to put it in the correct directory is (a cursory look through the Xcode project settings doesn't seem to show anything)?
Cheers,
Alex.
#3
09/26/2011 (6:01 am)
We're trying to export a build to our iPad and have also come across this error, is there a way we can get around this to build to our iPad device.
#4
atsuFontID = FMGetFontFromATSFontRef( atsFontRef);
It goes on to show the rest of the error listed above.
We're running a mac running Lion 10.7
We're using the 1.5 first preview as this is what we've been working with on our windows computers and have now just installed the OS version to our mac.
So when building we get these errors.
We're really just trying to get a test version up so even I quick work around would do for now.
09/26/2011 (6:11 am)
the line generating the first error is found in the MacCarbFont.cc file on the line:atsuFontID = FMGetFontFromATSFontRef( atsFontRef);
It goes on to show the rest of the error listed above.
We're running a mac running Lion 10.7
We're using the 1.5 first preview as this is what we've been working with on our windows computers and have now just installed the OS version to our mac.
So when building we get these errors.
We're really just trying to get a test version up so even I quick work around would do for now.
#5
09/26/2011 (10:09 am)
1.5 final will contain the Lion compatibility fixes.
#6
We're really trying to get something tested on the device itself.
Thanks for any help you can give.
09/26/2011 (10:11 am)
Is there no known work around at the moment? and when will 1.5 be released?We're really trying to get something tested on the device itself.
Thanks for any help you can give.
#7
09/26/2011 (10:44 am)
Your more likely to know exactly what's wrong and so perhaps you'd know if it's possible to change or ignore certain functions so we could get something tested by the end of this week.
#8
I ran in to the errors above when I was trying to build the TGB itself (for Mac) so that it would include my custom game code, which it turns out (as Michael points out above) should be unnecessary if the .app is built so that the TGB can launch that within the simulator. I never managed to figure out why that wasn't working - was going to wait for 1.5 final before upgrading from 1.4 and see if anything sorted itself out.
09/26/2011 (10:59 am)
Interesting. I actually had no problem building the project for my device (using the project found under MyProjects/GameName/buildFiles/XCode_iPhone/iTorque2D.xcodeproj) - this is the one that opens under Xcode when you open the project from within TGB. This was under 1.4 so I can't speak to the behavior under 1.5.I ran in to the errors above when I was trying to build the TGB itself (for Mac) so that it would include my custom game code, which it turns out (as Michael points out above) should be unnecessary if the .app is built so that the TGB can launch that within the simulator. I never managed to figure out why that wasn't working - was going to wait for 1.5 final before upgrading from 1.4 and see if anything sorted itself out.
#9
09/26/2011 (11:05 am)
We are building for an iPad and so I thought we'd be using the project found in the Xcode folder, should we be using the one found in the Xcode_iPhone folder you think?
#10
I haven't built my test game for anything but the iPhone, though, so I can't confirm that that is the correct (final) approach.
09/26/2011 (11:21 am)
It seems like the Mac is the only valid target in the Xcode folder project. iPad is a valid target in the XCode_iPhone project - I'd definitely try that one.I haven't built my test game for anything but the iPhone, though, so I can't confirm that that is the correct (final) approach.
#11
09/26/2011 (11:26 am)
Thanks for the quick response dude i'll try that out now and get back to you asap with some results.
#12
09/26/2011 (11:53 am)
Thanks dude it building in some form on our iPad but it looks like it stuck in iPhone size for some reason.
#13
In the Xcode project, under Summary, set the devices to iPad.
If that doesn't do it (which it didn't for me), I tried the following, before it finally worked and this is where mine got messy. Perhaps it's improved in 1.5, or perhaps it's something messed up in my setup...
- in common/defaultPrefs.cs, change $pref::iDevice::DeviceType = $iDevice::constant::iPad;
- in common/defaultPrefs.cs change $pref::iDevice::ScreenResolution = $iDevice::constant::ResolutionFull;
- in common/defaultPrefs.cs change $Game::Resolution = "1024 768 32";
This caused it to work in TGB, but not in the simulator in Xcode. It seemed like Xcode was reading a different instance of the commonConfig.xml which I couldn't find. As a work-around, I changed the following lines in _loadGameConfigurationData in common/properties.cs:
$pref::iDevice::DeviceType = 1;
$pref::iDevice::ScreenResolution = 0;
Hopefully that's enough to get it working until someone that knows better gives you a proper solution.
09/26/2011 (10:15 pm)
In TGB on the Project tab, set the Target Platform to iPad, and the resolution to Full.In the Xcode project, under Summary, set the devices to iPad.
If that doesn't do it (which it didn't for me), I tried the following, before it finally worked and this is where mine got messy. Perhaps it's improved in 1.5, or perhaps it's something messed up in my setup...
- in common/defaultPrefs.cs, change $pref::iDevice::DeviceType = $iDevice::constant::iPad;
- in common/defaultPrefs.cs change $pref::iDevice::ScreenResolution = $iDevice::constant::ResolutionFull;
- in common/defaultPrefs.cs change $Game::Resolution = "1024 768 32";
This caused it to work in TGB, but not in the simulator in Xcode. It seemed like Xcode was reading a different instance of the commonConfig.xml which I couldn't find. As a work-around, I changed the following lines in _loadGameConfigurationData in common/properties.cs:
$pref::iDevice::DeviceType = 1;
$pref::iDevice::ScreenResolution = 0;
Hopefully that's enough to get it working until someone that knows better gives you a proper solution.
#14
The build file still shows this and it doesn't even appear to be trying to display in full screen.
set screen mode 480 x 320 x 32, fullscreen, force it, dont repaint
Cleaning up the display device...
>> Attempting to change display settings to fullscreen 480x320x32...
The settings in torque are setup but there must be a config somewhere overruling it. I was sure to delete any .dso files of the ones I changed but all i'm getting on the iPad is the top right corner of my program displayed in the bottom left corner of my screen.
09/27/2011 (2:49 am)
Ahh after everything i change Torque still seems to be trying to open in 480 x 320The build file still shows this and it doesn't even appear to be trying to display in full screen.
set screen mode 480 x 320 x 32, fullscreen, force it, dont repaint
Cleaning up the display device...
>> Attempting to change display settings to fullscreen 480x320x32...
The settings in torque are setup but there must be a config somewhere overruling it. I was sure to delete any .dso files of the ones I changed but all i'm getting on the iPad is the top right corner of my program displayed in the bottom left corner of my screen.
#15
Once that's working, and if it's still not working in Xcode, I'd start sprinkling echoes around the scripts to see where $pref::iDevice::DeviceType and $pref::iDevice::ScreenResolution are getting set (you want DeviceType to be 1 and ScreenResolution to be 0). It may be getting set correctly, and then overridden (like you mention) with other prefs at a later point.
I'm probably not much more help at this point, as I'm not all that familiar with the relationship between commonConfig.xml, defaultPrefs.cs, prefs.cs, etc. and how that is stored/interacted with in Xcode.
09/27/2011 (8:44 am)
Is it at least showing up correctly in TGB? If not, that should be your first focus.Once that's working, and if it's still not working in Xcode, I'd start sprinkling echoes around the scripts to see where $pref::iDevice::DeviceType and $pref::iDevice::ScreenResolution are getting set (you want DeviceType to be 1 and ScreenResolution to be 0). It may be getting set correctly, and then overridden (like you mention) with other prefs at a later point.
I'm probably not much more help at this point, as I'm not all that familiar with the relationship between commonConfig.xml, defaultPrefs.cs, prefs.cs, etc. and how that is stored/interacted with in Xcode.
#16
09/27/2011 (8:57 am)
Ok dude thanks a million you've been a great help so far thanks for the assistance. It's definitely given me directions to of which files to look around in.
Employee Michael Perry
ZombieShortbus
1. A certain amount of code was deprecated from the Mac Carbon SDK when 0S X 10.7 (Lion was released). This is being fixed for the 1.5 final of iTorque 2D.
2. I'm not sure what's going on, but the editor should ALWAYS play Your_Game/projectFiles/iTorque2DGame.app. If that's what you compiled previously, that is what should run.