It is currently Sun Jun 24, 2018 3:34 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Grabbing sprites
PostPosted: Sun Jun 03, 2018 3:19 pm 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
Hello to all,
I noticed that grabbing many sprites (about 300), even if used only a part, the screen refresh slows down. How is it possible?

I have a medium power computer (core i7, HD4000) so I do not understand how it is possible ...

I used sprite as tile to draw the screen, is this approach correct?

Many thank's.


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 03, 2018 3:28 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Apr 30, 2009 5:23 pm
Posts: 251
Location: Côtes d'Azur, France
It has nothing to do with your hardware, grabbing 300 sprites is probably the wrong way to go.

If you use these grabbings to create tiles, you probably should do it before the main loop of your game.
But it's hard to say without any code to know for sure what you are doing wrong...

_________________
There are 2 methods to program bugless.
But only the third works fine.


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Mon Jun 04, 2018 5:03 pm 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
Fig wrote:
It has nothing to do with your hardware, grabbing 300 sprites is probably the wrong way to go.

If you use these grabbings to create tiles, you probably should do it before the main loop of your game.
But it's hard to say without any code to know for sure what you are doing wrong...


Hello,
thank you very much for your reply.
Actually the grab is done outside the main loop, which is why I'm a bit confused.

My game is 3000 lines so it is a bit difficult to extract a piece of code to show the problem, but I will try asap ...


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Tue Jun 05, 2018 7:23 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1394
Location: Germany
Small hint:
Don't call this" outside procedure" in the game loop ;-)

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 10, 2018 9:09 am 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
IceSoft wrote:
Small hint:
Don't call this" outside procedure" in the game loop ;-)


No, I do not call that procedure from within the main loop, it's one of the first things I've checked.

However, I write a very basic example of my loop, grabbing 1000000 (one million) sprite and I have a rock solid 60fps. So, I'm doing something really wrong, that I can not find.

I think I have to start from scratch.


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 10, 2018 5:41 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Apr 30, 2009 5:23 pm
Posts: 251
Location: Côtes d'Azur, France
At less you can conclude: grabbing sprites outside main loop is not the issue you are looking for...

_________________
There are 2 methods to program bugless.
But only the third works fine.


Top
 Profile  
Reply with quote  
 Post subject: Re: Grabbing sprites
PostPosted: Sun Jun 10, 2018 7:53 pm 
Offline
New User
New User

Joined: Sun Aug 27, 2017 12:38 pm
Posts: 7
Fig wrote:
At less you can conclude: grabbing sprites outside main loop is not the issue you are looking for...


The strange things is that more sprite I grab more slower is the refresh, then is somethings sprite related. Main loop is 500 lines, so I I have to work a lot to figure out the bug...... :)

Thanks guys


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye