Hello,
My name is Eddie and I am the new guy. I was invited by Mog to join the USDX team to create an OS X port of UltraStar Deluxe. A few days ago I released a proof-of-concept OS X port of the UltraStar version 0.5.3: http://sourceforge.net/projects/ultrastar-mac/.
I will delete that project, once an official USDX OS X port is available.
Yesterday I downloaded the current trunk, and I have some questions and suggestions. Before I make any changes to the repository I want to discuss, what's the best way to introduce the Mac specific parts.
1. Lazarus vs XCode
A stable build of Lazarus is not available for Mac OS (Intel). Also, Lazarus requires X11 and half a Linux system to be installed through Fink, if I understood the Lazarus for Mac page correctly.
So, I will use XCode for the OS X port. This creates a real native Mac application that uses the installed Frameworks that are available on the Mac (on the mac DLLs are bundled with header files to Frameworks).
2. IFDEFs and switches.inc
For the Mac port we have to change the way compiler defines are used.
The current code uses the define FPC for two things: For FPC specific things like "mode delphi", but also for Linux/Lazarus sepecific code parts. Since the mac port also uses FPC, but not Lazarus this will not work.
For Linux we should use the define "LINUX", and for OS X the define "DARWIN". Both are builtin.
I also found some parts with {$IFDEF FPC} ... {$ELSE} ... {$ENDIF}. This could lead to problems, but I am not 100% sure now, how to do the OS X port. If I use the same way as for the 0.5.3 port, the mac port will define "WIN32" and emulate all missing functions through mac-only wrapper files. But we would have to change FPC to LINUX anyway.
My todo would then be:
a. Add a DARWIN part to swicthes.inc
b. Replace all FPC with LINUX where needed (maybe jaybinks can help me at this point or just do a code review after the change).
c. [optional] Include swicthes.inc in all U*.pas files and move the "MODE DELPHI" to switches.inc
3. General crossplatform development
In the long term, I would prefer that we eliminate all or most platform specific code from the U*.pas files that is duplicated for each platform. For example the resource loading will be implemented seperately for all platforms: The windows port uses Windows resources, the linux port uses Lazarus resources and the mac port will use normal files, because I don't know how to port this resource.
To solve the resources problem we could use MD5 to avoid changes to files or maybe we can embed the resources as Base64 encoded Strings in the source code? Just an idea...
Best regards,
Eddie
