Handle object question

Archives Forums/Blitz3D SDK Programming/Handle object question

H&K(Posted 2007) [#1]
First, I dont know were I am supposed to post Bmax questions about 3DSDK, so if this would be better in Bmax thread, then move it.
Function HandleToObject:Object(obj:Object)
	Return obj
End Function

Function HandleFromObject(obj:Object)
	Local h=HandleToObject(obj)
	Return h
End Function
What is this doing?

HandleToObject is passed an Object, then returns the same Object, which is then allocated to an INT, and returned. So... wouldnt
Function HandleFromObject:int(obj:Object)
	Return Obj
End Function
Do the Same?

Anyway, reason I asked is, I have this
	Function HandleToType:TbbEntity (Comparisonhandle:Int)
		
		For Local Ent:TbbEntity = EachIn TbbEntity.List
			If Ent.handle=Comparisonhandle Then Return Ent
		Next
		
		Return Null
	
	End Function
Which as you can see is to look though a list to find which TbbEntity has a specific Handle. No specific question, if you can see my problem, then you dont really need a question.


skidracer(Posted 2007) [#2]
Eeek, blitzmax now has native HandleToObject function, that version was designed to be called with an integer handle with parameter cast doing the conversion (cludge). Where is it from?


puki(Posted 2007) [#3]
Eeek seconded. It's clear to me the internal structure of what was implemented would be indicating the fact of what we have now noted.


H&K(Posted 2007) [#4]
Its from TBBType in BBType.bmx thats included with (I think), each of the SDK examples


skidracer(Posted 2007) [#5]
Ah OK, thats due to the bb converter showing its age. There are several features in bmx that if used could make the next version produce a lot nicer bmx conversion.