Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

asIScriptModule == asIScriptModule

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 ccvca   Members   

112
Like
0Likes
Like

Posted 14 February 2014 - 08:23 AM

Hi,

 

I want to compare if a asIScriptFunction* containes to a stored module.

//c++
asIScriptModule *myModule;


void setCallback(asIScriptFunction * func){
   //compare if func contains to the module myModule
   
   // bad way
   if(std::string(func->getModule()->getName()) == myModule->getName()){
      
   } 

   ///... do something else
}

//AngelScript

void callback(){
   //some code
}

void main(){
   setCallback(@callback);

}

Using the name of the module is possible, but it's not a fast solution.

Is there any 'ID' like the Index in "asIScriptEngine::GetModuleByIndex()" stored inside a module?

 

Thanks for every answer
ccvca


Edited by ccvca, 14 February 2014 - 08:24 AM.


#2 Andreas Jonsson   Moderators   

4629
Like
1Likes
Like

Posted 14 February 2014 - 10:01 AM

You can compare the asIScriptModule pointers directly. There is no need for an additional id.


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

#3 ccvca   Members   

112
Like
0Likes
Like

Posted 14 February 2014 - 10:25 AM

You can compare the asIScriptModule pointers directly. There is no need for an additional id.

Thank you. That's all I need to know.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.