🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Issues with SetLineCallback

Started by
3 comments, last by WitchLord 19 years, 2 months ago
Has anyone had any issues using line callbacks in release mode? I'm assuming the correct way to emulate ExecuteNext() is by having a line callback such as the following: void LineCallback(asIScriptContext *pContext) { pContext->Suspend(); } This works fine in a debug build, but seems to fall over in release mode. It appears that the whole script is getting executed in release mode instead of just a single line. Any thoughts? Regards, Wumpee.
Advertisement
It works fine for me.

Similar code to this:

void ASLineCallback(void *nothing){	while(ScriptPlayInfo.PauseScript && !ScriptPlayInfo.Stop)		Sleep(10);	if(ScriptPlayInfo.Stop)	{		TerminateThread(VariableThread, 0);		ScriptPlayInfo.AngelScriptContext->Abort();	}	return;}
Verify that the library isn't built with the preprocessor flag BUILD_WITHOUT_LINE_CUES set in release mode (check project settings). If this flag is set then the line callback is only called once per loop, instead of for each statement.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

It turns out that it was building with BUILD_WITHOUT_LINE_CUES set in release mode. I don't remember changing anything, so maybe AS 2.1.0 Wip 6 was released with this set.

Awesome work by the way =)

Regards,
Wumpee.
Yes, I released the library with this flag set by default. This was an error, and future versions should be corrected.

I'm happy that you like my work :D

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement