Advertisement

passing AS enums into native function

Started by March 28, 2008 04:06 PM
2 comments, last by WitchLord 16 years, 7 months ago
Hi, Andreas First, thank you very much for a new release! Really good job! I have a problem with enums. I'm using asCALL_GENERIC calling convention, how do I get a value of enum variable passed to function via asIScriptEngine interface? Is it just a GetArgDword, or something else? [Edited by - mono2k on March 29, 2008 6:42:39 AM]
Yes, GetArgDWord will work for enums.



[Edited by - WitchLord on March 29, 2008 6:35:09 PM]

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

Advertisement
hmm, looks like a bug

// game_type_t is an enum registered via RegisterEnumgame_type_t random_game_type;void foo(game_type_t game_type){   random_game_type = game_type;};


I'm unable to build this script. Not only AS produce some strange error messages like "Not a valid lvalue at column 19" and "Reference is read-only at column 19", but also the engine crashes somewhere deep in the cleanup code (in my case it is asCString destructor).

Am I doing something wrong?
VS2005 + WinXP, I'm on revision 249.


This is indeed a bug. I've fixed it in revision 254.

Thanks for the clear sample that immediately let me identify the problem.

Regards,
Andreas

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