//FLASH: C memory init function static AS3_Val initByteArray(void* self, AS3_Val args) { //read buffer size as int from input AS3_ArrayValue (args, "IntType", &bufferSize); //allocate buffer size buffer = new char[bufferSize]; //return ptr to buffer location in memory return AS3_Ptr(buffer); }
AS3_Val initializeBitmap( void* self, AS3_Val args ) { Bitmap * bitmap; int width, height; LPBYTE data; AS3_ArrayValue( args, "IntType, IntType, PtrType", &width, &height, &data ); bitmap = newBitmap( width, height, data ); return AS3_Ptr( bitmap ); }
AS3_Val applyForTmpBuffer( void* self, AS3_Val args ) { int len; void * tmpBuff; AS3_ArrayValue( args, "IntType", &len ); if( ( tmpBuff = calloc( len, 1 ) ) == NULL ) { exit( TRUE ); } return AS3_Ptr( tmpBuff ); }
AS3_Val initializeTerrain( void * self, AS3_Val args ) { Entity * entity; Material * material; Texture * texture; Bitmap * map; double width, height, maxHeight; int addressMode; DWORD render_mode; Terrain* terrain; AS3_ArrayValue( args, "PtrType, PtrType, PtrType, PtrType, DoubleType, DoubleType, DoubleType, IntType, IntType", & entity, & map, & material, & texture, & width, & height, & maxHeight, & render_mode, & addressMode ); terrain = newTerrain( entity, map, ( float )width, ( float )height, ( float )maxHeight, material, texture, render_mode, addressMode ); return AS3_Ptr(terrain); }
AS3_Val initializeSkeletalChannel( void* self, AS3_Val args ) { int channelType; int length; Animation* animation; float* times; float** param; Matrix4x4* matrices; float* interpolations; Vector* inTangent; Vector* outTangent; SkeletalChannel* channel; AS3_ArrayValue(args, "IntType, IntType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType", &channelType, &length, &animation, ×, ¶m, &matrices,&interpolations, &inTangent, &outTangent); channel = newSkeletalChannel(animation, length, channelType, times, param, matrices, interpolations, inTangent, outTangent); return AS3_Ptr(channel); }
AS3_Val testFunction(void* data, AS3_Val args) { AS3_Val test; AS3_ArrayValue(args, "AS3ValType", &test); return AS3_Ptr(test); }
AS3_Val getDisplayPointer() { return AS3_Ptr(GL_FRONT); return 0; }