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.

loading more than once scene

2 posters

Go down

loading more than once scene Empty loading more than once scene

Post  sodapunk Mon Sep 29, 2008 2:18 pm

the normal code for opening a scene and extracting all its resources works fine. I want to add another object in though, so I want to open another scene file.
I added the same open/extract code into the templateRender() function, but it doesn't seem to work. I think it might be replacing the first scene with the second one.

What's the correct procedure for this?

here's my code
Code:

sio2ResourceOpen( sio2->_SIO2resource,
                "Scene1.sio2", 1 );
   while( i != sio2->_SIO2resource->gi.number_entry )
   {
      sio2ResourceExtract( sio2->_SIO2resource );
      ++i;
   }
   sio2ResourceClose( sio2->_SIO2resource );

sio2ResourceOpen( sio2->_SIO2resource,
                "Scene2.sio2", 1 );
   while( i != sio2->_SIO2resource->gi.number_entry )
   {
      sio2ResourceExtract( sio2->_SIO2resource );
      ++i;
   }
   sio2ResourceClose( sio2->_SIO2resource );

cheers

sodapunk

Posts : 7
Join date : 2008-09-28

Back to top Go down

loading more than once scene Empty Re: loading more than once scene

Post  sio2interactive Mon Sep 29, 2008 4:37 pm

Hummmm not sure what can be wrong in your case but this is the code that I test to check if it work fine and it did:


sio2ResourceOpen( sio2->_SIO2resource,
"the_clearing.sio2", 1 );


while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}

sio2ResourceClose( sio2->_SIO2resource );


sio2ResourceOpen( sio2->_SIO2resource,
"tutorial08.sio2", 1 );

// In your code I don't see that you reset i to 0 maybe that's the problem?
i = 0;
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}

sio2ResourceClose( sio2->_SIO2resource );



sio2ResourceBindAllImages( sio2->_SIO2resource );

sio2ResourceBindAllSoundBuffers( sio2->_SIO2resource );

sio2ResourceBindAllMaterials( sio2->_SIO2resource );

sio2ResourceBindAllInstances( sio2->_SIO2resource );

sio2ResourceBindAllPhysicObjects( sio2->_SIO2resource,
sio2->_SIO2physic );

sio2ResourceGenId( sio2->_SIO2resource );

sio2PhysicPlay( sio2->_SIO2physic );
sio2->_SIO2window->fps = 20;

// Set my rendering loop callback
sio2->_SIO2window->_SIO2windowrender = kmHomeScreenRender;
sio2interactive
sio2interactive

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

http://sio2interactive.com

Back to top Go down

loading more than once scene Empty Re: loading more than once scene

Post  sodapunk Mon Sep 29, 2008 10:08 pm

yeah I messed up and didn't put i=0;

thanks for that

sodapunk

Posts : 7
Join date : 2008-09-28

Back to top Go down

loading more than once scene Empty Re: loading more than once scene

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