FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Load a texture directly from a .sio2 file

2 posters

Go down

Load a texture directly from a .sio2 file Empty Load a texture directly from a .sio2 file

Post  mterlecki Sun May 17, 2009 3:36 pm

I am building a 2D game that uses many textures to hold sprites. I would like store my "sprite textures" along with all of the other images, i.e. in the "image" directory.

When I add my textures to the image directory they end up in the .sio2 file, but I can't not figure out how to load them from the game. The tutorial05 does not load textures from the .sio2 file - but rather adds the font textures directly to the resources folder.

If I add my texture to the resource folder of the xcode project - then I can load the texture like so:
waterTexture = sio2ImageInit( "water.JPG" );

How would I load this texture from the resource file (.sio2)

mterlecki

Posts : 5
Join date : 2009-05-17

Back to top Go down

Load a texture directly from a .sio2 file Empty Re: Load a texture directly from a .sio2 file

Post  sio2interactive Sun May 17, 2009 4:02 pm

sio2ResourceExtractFile( _UDgamecontrol->_SIO2resource, _SIO2stream, "gamepad_frame.tga", UD_GAME_PASSWORD );

sio2ImageLoad( _SIO2image, _SIO2stream );
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Load a texture directly from a .sio2 file Empty Doesn''t seem to work

Post  mterlecki Fri May 22, 2009 6:02 pm

The call to sio2ResourceExtractFile fails - I have opened up the .sio2 file with a zip viewer to verify that the water.JPG file is in the image directory - but the call still fails.

By the way - how come image is not automatically added when the dictionary is created?

mterlecki

Posts : 5
Join date : 2009-05-17

Back to top Go down

Load a texture directly from a .sio2 file Empty Re: Load a texture directly from a .sio2 file

Post  sio2interactive Fri May 22, 2009 6:16 pm

The call to sio2ResourceExtractFile fails - I have opened up the .sio2 file with a zip viewer to verify that the water.JPG file is in the image directory - but the call still fails.

>> Are you calling:

sio2ResourceExtractFile( sio2->_SIO2resource, _SIO2stream, "image/water.JPG", NULL );


By the way - how come image is not automatically added when the dictionary is created?

>> Are you loading the .sio2? If yes it will be available in the SIO2resource, simply call sio2ResourceGetImage( "image/water.JPG" );
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Load a texture directly from a .sio2 file Empty Re: Load a texture directly from a .sio2 file

Post  mterlecki Fri May 22, 2009 6:25 pm

Actually it turns out that the main ".sio2" file is failing to load - I don't know why.

mterlecki

Posts : 5
Join date : 2009-05-17

Back to top Go down

Load a texture directly from a .sio2 file Empty Re: Load a texture directly from a .sio2 file

Post  mterlecki Fri May 22, 2009 6:38 pm

How exactly are you adding the .sio2 files to a project? What are the check box setting etc.

mterlecki

Posts : 5
Join date : 2009-05-17

Back to top Go down

Load a texture directly from a .sio2 file Empty Re: Load a texture directly from a .sio2 file

Post  sio2interactive Fri May 22, 2009 6:50 pm

Check the video tutorials...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 44
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Load a texture directly from a .sio2 file Empty Re: Load a texture directly from a .sio2 file

Post  mterlecki Sat May 23, 2009 10:45 am

OK I found the problem. The tool that I was using to create my zip file was actually creating a ".rar" file. I changed the options to make sure it produced a ".zip" file and now it loads just fine.

Thanks

mterlecki

Posts : 5
Join date : 2009-05-17

Back to top Go down

Load a texture directly from a .sio2 file Empty Re: Load a texture directly from a .sio2 file

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum