Gamestudio Links
Zorro Links
Newest Posts
3D Game-Studio on Android!!!
by ratz. 09/26/26 20:56
Bug in train mode, or it seem to me
by mistery. 09/24/26 17:34
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 09/22/26 12:21
Capital slider is not saving in Z12
by Petra. 09/22/26 06:49
Parent/child object
by VoroneTZ. 09/22/26 05:52
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (ratz), 9,295 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Knull, Opus, Jubilee, lopezsergio07, mistery
19240 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Repeating Function #130050
05/15/07 19:05
05/15/07 19:05
Joined: Nov 2006
Posts: 141
South Africa
quasarchangel Offline OP
Member
quasarchangel  Offline OP
Member

Joined: Nov 2006
Posts: 141
South Africa
I have a function that calls itself a few times over and over to get a certain result. Everything in it works, but sometimes it goes into too many functions (of itself) and causes a frame rate spike. So, I want to pause all the current functions for a frame, and then resume.

Now I thought that if I use sleep() at the beginning of the function it would work but its not working. I have a counter which checks how many times the function has been called, my.cur_depth, and I use this to pause it: if(my.cur_depth % 20==0){sleep(1);}
But its not working the same as when it is without the above. Anyone have any ideas of what I could do?


God DID give us a manual on how to change this world...
Re: Repeating Function [Re: quasarchangel] #130051
05/15/07 19:13
05/15/07 19:13
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Well, that's of course as returns do not return anything at all with a wait in front of them. Pass an extra argument as a vector and give the value back with the vector.


Always learn from history, to be sure you make the same mistakes again...
Re: Repeating Function [Re: Uhrwerk] #130052
05/15/07 19:30
05/15/07 19:30
Joined: Nov 2006
Posts: 141
South Africa
quasarchangel Offline OP
Member
quasarchangel  Offline OP
Member

Joined: Nov 2006
Posts: 141
South Africa
Ok, well, I have tried that, or something similar.

It seems that it will be impossible for me to use a function, I'll have to convert it to a loop, and that I really don't feel like doing.

Any idea how much speed gain I would get if I wrote the function in c++ and put it in a dll?


God DID give us a manual on how to change this world...
Re: Repeating Function [Re: quasarchangel] #130053
05/15/07 21:52
05/15/07 21:52
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Totally depends on the function. What about telling us what you exactly want to do?


Always learn from history, to be sure you make the same mistakes again...

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1