Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Compiling for iOS  (Read 8435 times)

0 Members and 1 Guest are viewing this topic.

Dan Peach

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 100
    • View Profile
    • Viperante - Game Development
Compiling for iOS
« on: April 13, 2012, 11:58:03 PM »

Ok, so I have my Mac and I have my xcode.....I don't understand what to do now. I'm starting right at the bottom with this iOS development, having not used a Mac ever before today.  :(

I'm supposed to download the "sources", but where exactly can I find those? And once I have downloaded them, what do I do with them? And what are the "dependencies"...?

A little nudge in the right direction to get me on my way would be most helpful.  :)

joaomesq

  • Teacher / Game Designer
  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 44
    • View Profile
    • Nó Górdio
Re: Compiling for iOS
« Reply #1 on: April 15, 2012, 02:17:00 PM »

Sources - the software - can be downloaded from http://code.google.com/p/wmelite/downloads/list

Like most software nowadays, WME uses libraries provided by the operating system and third parties that are responsible for low-level functionality that would be very tedious for the software writer to do them himself. Sometimes, these are called "dependencies". In the link above, you will also find all the dependencies you will need.

cheers.
Logged
Crisis is just another word for opportunity

Dan Peach

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 100
    • View Profile
    • Viperante - Game Development
Re: Compiling for iOS
« Reply #2 on: April 15, 2012, 03:38:05 PM »

Thanks.  :)

Which is the "source" download in that list? In the WME Lite documentation it says I should get the sources from the SVN repository, but I don't know how to do that.

And then, once I have these sources, what do I do with them?

I'm porting my current game from Windows to iOS just as a test, so I've changed all my WME scripts to take into account the iOS touchscreen, removed the video files, removed the rotating sprites etc., so I'm all ready to compile, but I don't know where to start with that as I've never used a Mac or Xcode before in my life. :)
« Last Edit: April 15, 2012, 03:44:57 PM by Dan Peach »
Logged

MaaS

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Compiling for iOS
« Reply #3 on: April 19, 2012, 05:45:54 PM »

Hi there... just a question  ;D

Where should I put the data.dcp? In the wme lite documentation It says that I should put it inside "xcode-ios/wmelite" ... and there it is... (the compiled data.dcp from the wme  touch demo)... When you open the project it appears inside the Resources folder.

The dcp runs on windows and mac, so I suposse I'm doing something wrong.

PS. Xcode debugger stops at class directory_iterator of operations.hpp, line "{ detail::directory_iterator_construct(*this, p, 0); }" with a EXC_BAD_ACCESS... with i suposse its "i dont find the file" sort of thing hehe :P

Thankss!!
« Last Edit: April 19, 2012, 05:52:12 PM by MaaS »
Logged

MaaS

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Compiling for iOS
« Reply #4 on: April 19, 2012, 06:21:11 PM »

A few more info... it stops when scanning packages... there are 4 paths, but it stops a the first one on "for (directory_iterator dit(absPath); dit != endIter; ++dit)"

Paths:

Code: [Select]
/private/var/mobile/Applications/68DABE61-187F-4CEF-9CF4-85FE1875291F/wmelite.app/./
/var/mobile/Applications/68DABE61-187F-4CEF-9CF4-85FE1875291F/wmelite.app/../
/var/mobile/Applications/68DABE61-187F-4CEF-9CF4-85FE1875291F/wmelite.app/Contents/Resources/
/private/var/mobile/Applications/68DABE61-187F-4CEF-9CF4-85FE1875291F/wmelite.app/data\

EDIT: More on that... when running on emulator it seems to pass the package checking... LOG:

Code: [Select]
12:17:32: Scanning: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./
12:24:11: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./data.dcp
12:24:18: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Default.png
12:24:20: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Icon-72.png
12:24:23: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Icon-Small-50.png
12:24:33: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Icon-Small.png
12:24:35: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Icon-Small@2x.png
12:24:37: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Icon.png
12:24:38: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Icon@2x.png
12:24:40: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./Info.plist
12:24:41: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./PkgInfo
12:24:42: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/./wmelite

12:25:44: Scanning: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/../
12:25:46: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/../.DS_Store

12:25:55: Scanning: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/Contents/Resources/

12:25:56: Scanning: /Users/MaaS/Library/Application Support/iPhone Simulator/5.0/Applications/58979FF0-943E-4C6B-806C-645B4694BAEA/wmelite.app/data\

12:26:01:   Registered 1063 files in 1 package(s)

But when running on the device it breaks... if debugging you got "path absPath = system_complete(m_PackagePaths);" with the path "/private/var/mobile/Applications/68DABE61-187F-4CEF-9CF4-85FE1875291F/wmelite.app/./" inside but when you do "!exists(auxpath)" the path inside turns nil... :?:?:?

Is there any settings that could be preventing the app to access the directory?
« Last Edit: April 21, 2012, 01:04:29 PM by MaaS »
Logged

MaaS

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Compiling for iOS
« Reply #5 on: April 21, 2012, 11:47:09 PM »

Ok... I couldnt fix it hehe... not so used to xcode... so I just changed all the RegisterPackages() method looking for dcp files... to directly register the files.

:P
Logged

genuinefafa

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 5
  • Reversion - "It's your change to revert history"
    • View Profile
    • 3f
Re: Compiling for iOS
« Reply #6 on: July 06, 2012, 12:50:17 AM »

@MaaS:

I am having the same problem here...  ???

[EDIT] I can probably do this, but, but, but, ... http://forum.dead-code.org/index.php?topic=5182.0

But I was unable to apply your solution. I mean...
1. operations.hpp [check]
2. directory_iterator class [check]
3. Apply RegisterPackages() [wrong]

Maybe you can share a .diff file trought pastebin or something for people like me to figure it out?

I really apreciate it.
Logged
FD @ 3f interactivo
Reversion franchise builders - 100% built on top of WinterMute :).

ps: If you care about point-and-click adventures, you can vote for Reversion Chapter 2 on Greenlight - https://bitly.com/Swgnys

MaaS

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: Compiling for iOS
« Reply #7 on: October 21, 2012, 11:55:44 AM »

Oh my, sorry...

I have to put that project on pause so I didnt come here for a while :/

What I did was to comment the part where the engine looks for any dcp file and register the package myself. It's just a patch...

The file is BFileManager.cpp, I changed the method HRESULT CBFileManager::RegisterPackages() for this thing :

Code: [Select]
//////////////////////////////////////////////////////////////////////////
HRESULT CBFileManager::RegisterPackages()
{
RestoreCurrentDir();

Game->LOG(0, "Scanning packages...");


/*AnsiString extension = AnsiString(".") + AnsiString(PACKAGE_EXTENSION);
   
    Game->LOG(0, "Total Paths: %i", m_PackagePaths.GetSize());
for(int i=0; i<m_PackagePaths.GetSize(); i++)
{
path absPath = system_complete(m_PackagePaths[i]);
Game->LOG(0, "Paths: %s", absPath.string().c_str());
    }
   
for(int i=0; i<m_PackagePaths.GetSize(); i++)
{
path absPath = system_complete(m_PackagePaths[i]);
        //path auxpath = system_complete(m_PackagePaths[i]);

Game->LOG(0, "Scanning: %s", absPath.string().c_str());
//printf("Scanning: %s\n", absPath.string().c_str());

if (!exists(absPath)) continue;

// scan files
directory_iterator endIter;
        //directory_iterator aux(absPath);
for (directory_iterator dit(absPath); dit != endIter; ++dit)
{
if (!is_directory((*dit).status()))
{
AnsiString fileName = (*dit).path().string();
                Game->LOG(0, fileName.c_str());
               
if (!IsValidPackage(fileName)) continue;

//printf("%s\n", fileName.c_str());

if (!StringUtil::CompareNoCase(extension, PathUtil::GetExtension(fileName))) continue;
                Game->LOG(0, "REGISTRANDO: %s -> %s",absPath.string().c_str(),dit->path().filename().string().c_str());
RegisterPackage(absPath.string().c_str(), dit->path().filename().string().c_str());
}
}
}*/
   
   
    path absPath = system_complete(m_PackagePaths[0]);
                                   
    RegisterPackage(absPath.string().c_str(), "data.dcp");


Game->LOG(0, "  Registered %d files in %d package(s)", m_Files.size(), m_Packages.GetSize());

return S_OK;
}

As you see, everything is commented and I just did a

path absPath = system_complete(m_PackagePaths[0]);
RegisterPackage(absPath.string().c_str(), "data.dcp");

... And the file data.dcp is inside the resource folder of the project. I hope this helps and it's not too late :)
Logged

genuinefafa

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 5
  • Reversion - "It's your change to revert history"
    • View Profile
    • 3f
Re: Compiling for iOS
« Reply #8 on: November 20, 2012, 08:14:40 PM »

@MaaS:

I have more info on that matter. I know where is our problem, now. :)
It's in the boost library. WME uses many differents external dependencies, in particular
libboost_filesystem.a
libboost_system.a

Both of them must be compiled for the specific arquitecture/compiler/technology. I cannot be of more help, yet.
I'll create a new post on the forum regarding this specific issue.

Anyways, answering the former question, packages can be added wherever you want to, the important thing is that they reside inside the build.

See this screenshot of our build, for example, http://snag.gy/34ct9.jpg

ps: If you care about point-and-click adventures, you can vote for Reversion Chapter 2 on Greenlight - https://bitly.com/Swgnys
Logged
FD @ 3f interactivo
Reversion franchise builders - 100% built on top of WinterMute :).

ps: If you care about point-and-click adventures, you can vote for Reversion Chapter 2 on Greenlight - https://bitly.com/Swgnys
 

Page created in 0.019 seconds with 23 queries.