Commits

Ricky Curtice  committed 0095fd3

Registered GetDataLong

This way the script can now read the wparam in a Windows message event!

  • Participants
  • Parent commits 6f62eb5

Comments (0)

Files changed (2)

File src/Envelope.h

 	boost::any     GetData       (int index = 0) const { return this->data.at(index); } // Get the data stored at index i
 	bool           GetDataBool   (int index = 0) { return TGetData<bool>          (index); }
 	int            GetDataInt    (int index = 0) { return TGetData<int>           (index); }
+	long           GetDataLong   (int index = 0) { return TGetData<long>          (index); }
 	unsigned int   GetDataUInt   (int index = 0) { return TGetData<unsigned int>  (index); }
 	float          GetDataFloat  (int index = 0) { return TGetData<float>         (index); }
 	std::string    GetDataString (int index = 0) { return TGetData<std::string>   (index); }

File src/script_core/ScriptCore.h

 		ret = engine->RegisterObjectProperty("Entity", "Vector positionOffset", offsetof(Entity, location)); assert(ret >= 0);
 		ret = engine->RegisterObjectMethod("Entity", "Vector GetWorldPosition()", asMETHOD(Entity, GetWorldPosition), asCALL_THISCALL); assert(ret >= 0);
 		ret = engine->RegisterObjectMethod("Entity", "void SetWorldPosition(float, float, float)", asMETHODPR(Entity, SetWorldPosition, (float, float, float), void), asCALL_THISCALL); assert(ret >= 0);
+		ret = engine->RegisterObjectMethod("Entity", "void ChangePosition(Vector)", asMETHODPR(Entity, ChangePosition, (D3DXVECTOR3), void), asCALL_THISCALL); assert(ret >= 0);
 		
 		ret = engine->RegisterObjectProperty("Entity", "Rotation rotationOffset", offsetof(Entity, rotation)); assert(ret >= 0);
 		ret = engine->RegisterObjectMethod("Entity", "Rotation GetWorldRotation()", asMETHOD(Entity, GetWorldRotation), asCALL_THISCALL); assert(ret >= 0);
 		
 		ret = engine->RegisterObjectMethod("EnvelopeAny", "bool     GetDataBool  (int)", asMETHOD(EnvelopeAny, GetDataBool   ), asCALL_THISCALL); assert(ret >= 0);
 		ret = engine->RegisterObjectMethod("EnvelopeAny", "int      GetDataInt   (int)", asMETHOD(EnvelopeAny, GetDataInt    ), asCALL_THISCALL); assert(ret >= 0);
+		ret = engine->RegisterObjectMethod("EnvelopeAny", "int64    GetDataLong  (int)", asMETHOD(EnvelopeAny, GetDataLong   ), asCALL_THISCALL); assert(ret >= 0);
 		ret = engine->RegisterObjectMethod("EnvelopeAny", "uint     GetDataUInt  (int)", asMETHOD(EnvelopeAny, GetDataUInt   ), asCALL_THISCALL); assert(ret >= 0);
 		ret = engine->RegisterObjectMethod("EnvelopeAny", "float    GetDataFloat (int)", asMETHOD(EnvelopeAny, GetDataFloat  ), asCALL_THISCALL); assert(ret >= 0);
 		ret = engine->RegisterObjectMethod("EnvelopeAny", "string   GetDataString(int)", asMETHOD(EnvelopeAny, GetDataString ), asCALL_THISCALL); assert(ret >= 0);