3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Manipulating the function scheduler?
#385382
10/17/11 19:46
10/17/11 19:46
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Hello,
During debugging, I noticed it would be very, very useful if I could call a function between every 2 functions that the Scheduler calls. (That is, between all functions which are in a "wait"-state). Then, I also want this function to be called with the name of the next function in the scheduler as an argument. More precisely, if this is the list of functions in the scheduler: main bot_move ship_move explosionLarge asteroid
Then I want the functions to be called in this order: main debugFct("bot_move"); bot_move debugFct("ship_move"); ship_move debugFct("explosionLarge"); explosionLarge debugFct("asteroid"); asteroid
Then the debugFct would always log the value of a certain pointer so I could see which function changed the pointer (or at least I'd know which function called a function which changed the value - a great step ahead from where I'm at now.)
CSiS is hundreds and hundreds of functions large, and some function randomly changes one of my Text objects. I know what Object it changes, but I can't find which function changes it. The above was my idea of how to do it, if there's a better way to do it, I'm glad to hear about it. So is there any way to manipulate the scheduler?
Thanks, and I hope I was clear... Micha
Edit: I'm using 7.86.6
Last edited by Germanunkol; 10/17/11 19:47.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Manipulating the function scheduler?
[Re: Lukas]
#385474
10/18/11 19:27
10/18/11 19:27
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Thats why i used the C# wrapper without scheduler. Allowed me to setup everything they way i need(and allows much better logging, if this is what you aim for)
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Manipulating the function scheduler?
[Re: Rackscha]
#385513
10/19/11 12:38
10/19/11 12:38
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Wouldn't it be possible to put the debugFct call before each wait(1);? That would basically do what you need. Hm, yeah... it's just that I have about a thousand wait calls. But I guess it'll be the way I have to go, maybe there's some files I can rule out beforehand... Rackscha, I guess that's too late for me. I'm not gonna rewrite CSiS a fourth time... But for any future projects I'll definitely think about the structure beforehand.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Manipulating the function scheduler?
[Re: Germanunkol]
#385515
10/19/11 12:49
10/19/11 12:49
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
it's just that I have about a thousand wait calls. You could write a function, f.i. wait_log(var frames), that uses engine_gettaskinfo, some diag functions and wait(frames). Now press [Ctrl]+[H] in SED and let wait(1) automatically be replaced with wait_log(1). Continue with your other script files.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Manipulating the function scheduler?
[Re: Superku]
#385518
10/19/11 13:45
10/19/11 13:45
|
Joined: Apr 2008
Posts: 650
Sajeth
User
|
User
Joined: Apr 2008
Posts: 650
|
For a coder, it shouldn't be very hard to have another debug function put in front of every wait command... automatically.
Teleschrott-Fan.
|
|
|
Re: Manipulating the function scheduler?
[Re: Superku]
#385523
10/19/11 16:27
10/19/11 16:27
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
I think Sajeth means to code a function which will replace all my wait(1) calls.
But that's essentially what you, Superku, have also suggested, except I don't need to code it myself.
Thank you both, it is pretty embarrassing that I didn't think of the automatic replacing. I guess I hadn't gotten use to the idea of editing _every_ wait call yet...
Will try it.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Manipulating the function scheduler?
[Re: Germanunkol]
#385524
10/19/11 16:45
10/19/11 16:45
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Uhm... just write this macro:
#ifdef NDEBUG
#define wait(i) wait(i)
#else
#define wait(i) do{char *funct; engine_gettaskinfo(0, &funct, NULL); debugFct(funct); wait(i);} while(0)
#endif
A function wouldn't work for obvious reasons...
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|