/* attempt to deal with prototype, bootstrap, jquery conflicts */ /* for dropdown menus */

Jump to content

Image of the Day

Day 17 -- a bunch more tools join the table :) #blender3d #screenshotsaturday #itssaturdaysomewhere #lowpoly #3D https://t.co/CYJucn0Lfv
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now
- - - - -

Comparing primitive types?

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
1 reply to this topic

#1 ninvertigo   Members   

127
Like
0Likes
Like

Posted 07 December 2012 - 03:05 PM

I am using a primitive type as follows:

engine->RegisterObjectType("myInt", sizeof(int), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_PRIMITIVE ); assert( err >= 0 );

The Application can modify and use operators on this value, however the script cannot. Something as simple as the following will fail.

myInt test;
test = 0;

I receive the error "Can't implicitly convert from 'const uint' to 'myInt'." Since this is a primitive datatype I was under the assumption that I did not need to do anything specific to use these. What am I doing wrong?

#2 Andreas Jonsson   Moderators   

4551
Like
0Likes
Like

Posted 07 December 2012 - 05:11 PM

asOBJ_APP_PRIMITIVE just tells AngelScript that it can treat the type as a primitive in native calling conventions, i.e. when passing the type to application registered functions.

In order to support assignment or comparisons with this type against other types you need to register the appropriate methods, for example, opAssign, and opCmp.

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




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.