Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've got a best/common practice question about cross platform development. We're developing a Unity game and we've got a custom data format (a modified jpeg) that a C# tool we developed pumps out and gets loaded into unity using a dll. We use some nice gdi+ tricks on Windows with this file format, however when we move this to the Mac, we're running into issues that we think is the mono implementation of gdi+ is missing something.

That aside we're not sure what the best practice moving forward is. Should we develop a new file format that works cross platform and is loaded the same on both systems, or should we use a platform specific data format that allows for the use of the C# tricks on Windows and maybe a different trick on Mac?

share|improve this question
1  
A couple of questions... 1) Your new format stores and image? Since you're using a modified JPEG I'm guessing so. 2) What is different between your format and a standard JPEG? –  Tim Holt Dec 14 '10 at 14:26
    
Our file format stores 2 photos and information about the differences between them. So 2.) We put the 2nd photo and the difference data into the PropertyItem list. The Mac however doesn't see these new items. 1.) We would make a new format that the Mac could read. –  Matt Brenner Dec 14 '10 at 14:37
1  
Why not just store the two images in two standard image format files and the difference in a third? –  Tim Holt Dec 14 '10 at 14:51
    
How are you loading it on the mac? Are you unable to read the PropertyItem list on mac? –  stonemetal Dec 16 '10 at 15:30
add comment

1 Answer

up vote 3 down vote accepted

Best practise is definitely to define your data format independent from any tools you use to read or write it, so if best practice is your criterion you should probably design a new format. But practically, if you can reasonably hack a way to get the format working on Mono that may be an okay solution.

Different formats for different platforms? I really wouldn't want to go there, that's bona fide technical debt.

Edit:
I'd suggest that you simply store multiple files in a container format, if you got tools available for handling it you could use a zip file, otherwise a simple custom format with length prefixed blocks may be optimal.

share|improve this answer
    
We're going to go with re-developing the format and use one that is cross-platform ready. It blows to have to throw out some awesome C# code and start from scratch but it will ease headaches down the road. –  Matt Brenner Dec 14 '10 at 15:06
    
I like the zip file idea to bundle multiple images. –  Tim Holt Dec 14 '10 at 16:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.