int main() { AS3_Val initparamMethod = AS3_Function( NULL, initparam ); AS3_Val choosemodelMethod = AS3_Function( NULL, choosemodel ); AS3_Val predictionMethod = AS3_FunctionAsync( NULL, prediction ); AS3_Val result = AS3_Object( "initparam: AS3ValType, choosemodel: AS3ValType, prediction: AS3ValType", initparamMethod, choosemodelMethod, predictionMethod ); AS3_Release( initparamMethod ); AS3_Release( choosemodelMethod ); AS3_Release( predictionMethod ); AS3_LibInit( result ); return 0; }
AS3_Val setup_callback(lua_State * L, int index) { LCALL(L, stack); SPAM(("setup_callback() : begin")); AS3_Val as3Function; int ref = 0; LuaFunctionCallbackData ** pUserdata = NULL; /* NOTE: Can't do lua_newuserdata() immediately since it would be deleted by Lua on lua_close() */ /* TODO: Free this somewhere! When freeing, remove pData->ref from the state */ LuaFunctionCallbackData * pData = malloc(sizeof(LuaFunctionCallbackData)); index = LABSIDX(L, stack, index); /* Normalize index */ /* TODO: Cache that with lua_ref, it is faster */ lua_getfield(L, LUA_REGISTRYINDEX, AS3LUA_CALLBACKS); /* TODO: Assert this is a table */ lua_newtable(L); LCHECK(L, stack, 2); lua_pushvalue(L, index); /* Store function */ lua_rawseti(L, -2, AS3LUA_CBFNINDEX); LCHECK(L, stack, 2); pUserdata = lua_newuserdata(L, sizeof(LuaFunctionCallbackData *)); *pUserdata = pData; luaL_getmetatable(L, AS3LUA_CALLBACKMT); lua_setmetatable(L, -2); lua_rawseti(L, -2, AS3LUA_CBSDATAINDEX); LCHECK(L, stack, 2); ref = luaL_ref(L, -2); LCHECK(L, stack, 1); lua_pop(L, 1); /* Pop AS3LUA_CALLBACKS */ as3Function = AS3_Function(pData, as3_lua_callback); pData->ref = ref; pData->L = L; pData->as3Function = as3Function; LCHECK(L, stack, 0); SPAM(("setup_callback() : end")); return as3Function; }
int main() { AS3_Val method = AS3_Function(NULL, call); AS3_Val result = AS3_Object("call: AS3ValType", method); AS3_Release(method); AS3_LibInit(result); return 0; }
int main(int argc, char **argv) { print_header(); // set convert & update methods visible to flash AS3_Val convertMethod = AS3_Function( NULL, init ); AS3_Val updateMethod = AS3_Function( NULL, update ); AS3_Val result = AS3_Object( "init:AS3ValType, update: AS3ValType", convertMethod, updateMethod ); AS3_Release( convertMethod ); AS3_Release( updateMethod ); // notify that we initialized -- THIS DOES NOT RETURN! AS3_LibInit( result ); return 0; }
int main (int argc, char **argv) { AS3_Val initMethod = AS3_Function(NULL, flash_init); AS3_Val tickMethod = AS3_Function(NULL, flash_tick); AS3_Val resetMethod = AS3_Function(NULL, flash_reset); AS3_Val vecxemu = AS3_Object( "init:AS3ValType, tick:AS3ValType, reset:AS3ValType", initMethod, tickMethod, resetMethod ); AS3_Release( initMethod ); AS3_Release( tickMethod ); AS3_Release( resetMethod ); AS3_LibInit(vecxemu); return 0; }
int main(int argc, char **argv) { // Create callbacks AS3_Val setupMethod = AS3_Function(NULL, f_setup); AS3_Val tickMethod = AS3_Function(NULL, f_tick); AS3_Val quitApplicationMethod = AS3_Function(NULL, f_teardown); AS3_Val libPDF = AS3_Object( "setup:AS3ValType, tick:AS3ValType, quit:AS3ValType", setupMethod, tickMethod, quitApplicationMethod ); AS3_Release( setupMethod ); AS3_Release( tickMethod ); AS3_Release( quitApplicationMethod ); AS3_LibInit(libPDF); return (0); }
//entry point for code int main() { AS3_Val echoMethod = AS3_Function(NULL, echo); AS3_Val result = AS3_Object("echo: AS3ValType", echoMethod); AS3_Release(echoMethod); AS3_LibInit(result); // should never get here! return 0; }
/* * CLib Setup */ int main(int argc, char **argv) { // Build CLib and return control to Flash AS3_Val setupMethod = AS3_Function(NULL, setup); AS3_Val tickMethod = AS3_Function(NULL, tick); AS3_Val getDisplayPointerMethod = AS3_Function(NULL, getDisplayPointer); AS3_Val cleanupMethod = AS3_Function(NULL, cleanup); AS3_Val libGL = AS3_Object( "setup:AS3ValType, tick:AS3ValType, getDisplayPointer:AS3ValType, cleanup:AS3ValType", setupMethod, tickMethod, getDisplayPointerMethod, cleanupMethod ); AS3_Release( setupMethod ); AS3_Release( tickMethod ); AS3_Release( getDisplayPointerMethod ); AS3_Release( cleanupMethod ); AS3_LibInit(libGL); return 0; }
int main(int argc, char *argv[]) { // regular function AS3_Val doAesVal = AS3_Function(NULL, doAes); // async function AS3_Val doUnAesVal = AS3_Function(NULL, doUnAes); AS3_Val doDecodeVal = AS3_Function(NULL,doDecode); // construct an object that holds refereces to the 2 functions AS3_Val result = AS3_Object("doAes: AS3ValType, doUnAes: AS3ValType,doDecode:AS3ValType", doAesVal, doUnAesVal,doDecodeVal); AS3_Release(doAesVal); AS3_Release(doUnAesVal); AS3_Release(doDecodeVal); // notify that we initialized -- THIS DOES NOT RETURN! AS3_LibInit(result); return 0; }
//entry point for code int main() { //define the methods exposed to ActionScript //typed as an ActionScript Function instance AS3_Val benchmarkMethod = AS3_Function( NULL, benchmark ); // construct an object that holds references to the functions AS3_Val result = AS3_Object("benchmark: AS3ValType", benchmarkMethod); // Release AS3_Release( benchmarkMethod ); // notify that we initialized AS3_LibInit(result); // AS3_LibInit does not return so we wont get here... return 0; }
int main() { //define the methods exposed to ActionScript //typed as an ActionScript Function instance AS3_Val echoMethod = AS3_Function( NULL, echo ); // construct an object that holds references to the functions AS3_Val result = AS3_Object( "echo: AS3ValType", echoMethod ); // Release AS3_Release( echoMethod ); // notify that we initialized -- THIS DOES NOT RETURN! AS3_LibInit( result ); // should never get here! return 0; }
//entry point int main() { AS3_Val initByteArrayMethod = AS3_Function(NULL, initByteArray); AS3_Val freeByteArrayMethod = AS3_Function(NULL, freeByteArray); AS3_Val setFrameParamsMethod = AS3_Function(NULL, setFrameParams); AS3_Val loadCascadeMethod = AS3_Function(NULL, loadCascade); AS3_Val detectAndDrawMethod = AS3_Function(NULL, detectAndDraw); AS3_Val applyFilterMethod = AS3_Function(NULL, applyFilter); AS3_Val setFilterTypeMethod = AS3_Function(NULL, setFilterType); AS3_Val result = AS3_Object("initByteArray: AS3ValType,\ freeByteArray: AS3ValType,\ setFrameParams: AS3ValType,\ loadCascade: AS3ValType,\ detectAndDraw: AS3ValType,\ applyFilter: AS3ValType,\ setFilterType: AS3ValType", initByteArrayMethod, freeByteArrayMethod, setFrameParamsMethod, loadCascadeMethod, detectAndDrawMethod, applyFilterMethod, setFilterTypeMethod); AS3_Release (initByteArrayMethod); AS3_Release (freeByteArrayMethod); AS3_Release (setFrameParamsMethod); AS3_Release (loadCascadeMethod); AS3_Release (detectAndDrawMethod); AS3_Release (applyFilterMethod); AS3_Release (setFilterTypeMethod); AS3_LibInit (result); return 0; }
//Èë¿Ú int main() { log2base_Table_Builder(logbase2ofx); //alpha_Table_Builder(NUM_ALPHA_LEVELS, alpha_table); //multiply256_Table_Builder(multiply256_table); //multiply256FIXP8_Table_Builder(multiply256FIXP8_table); dot5miplevel_Table_Builder(dot5miplevel_table); //buildAlphaTable(alphaTable); AS3_Val initializeCameraMethod = AS3_Function( NULL, initializeCamera ); AS3_Val destroyCameraMethod = AS3_Function( NULL, destroyCamera ); AS3_Val attachCameraMethod = AS3_Function( NULL, attachCamera ); AS3_Val initializeSceneMethod = AS3_Function( NULL, initializeScene ); AS3_Val destroySceneMethod = AS3_Function( NULL, destroyScene ); AS3_Val attachSceneMethod = AS3_Function( NULL, attachScene ); AS3_Val initializeViewportMethod = AS3_Function( NULL, initializeViewport ); AS3_Val destroyViewportMethod = AS3_Function( NULL, destroyViewport ); AS3_Val getWorldPositionFromSreenMethod = AS3_Function( NULL, getWorldPositionFromSreen ); AS3_Val initializeMaterialMethod = AS3_Function( NULL, initializeMaterial ); AS3_Val destroyMaterialMethod = AS3_Function( NULL, destroyMaterial ); AS3_Val initializeBitmapMethod = AS3_Function( NULL, initializeBitmap ); AS3_Val initializeTextureMethod = AS3_Function( NULL, initializeTexture ); AS3_Val destroyTextureMethod = AS3_Function( NULL, destroyTexture ); AS3_Val setMipmapMethod = AS3_Function( NULL, setMipmap ); AS3_Val getTextureLevelDescMethod = AS3_Function( NULL, getTextureLevelDesc ); AS3_Val swapTextureEndianMethod = AS3_Function( NULL, swapTextureEndian ); AS3_Val initializeLightMethod = AS3_Function( NULL, initializeLight ); AS3_Val addLightMethod = AS3_Function( NULL, addLight ); AS3_Val removeLightMethod = AS3_Function( NULL, removeLight ); AS3_Val initializeFogMethod = AS3_Function( NULL, initializeFog ); AS3_Val addFogMethod = AS3_Function( NULL, addFog ); AS3_Val removeFogMethod = AS3_Function( NULL, removeFog ); AS3_Val initializePrimitivesMethod = AS3_Function( NULL, initializePrimitives ); AS3_Val initializeTerrainMethod = AS3_Function( NULL, initializeTerrain ); AS3_Val initializeMeshMethod = AS3_Function( NULL, initializeMesh ); AS3_Val destroyMeshMethod = AS3_Function( NULL, destroyMesh ); AS3_Val cloneMeshMethod = AS3_Function( NULL, cloneMesh ); AS3_Val initializeSkinMeshControllerMethod = AS3_Function( NULL, initializeSkinMeshController ); AS3_Val destroySkinMeshControllerMethod = AS3_Function( NULL, destroySkinMeshController ); AS3_Val setMeshAttributeMethod = AS3_Function( NULL, setMeshAttribute ); AS3_Val initializeEntityMethod = AS3_Function( NULL, initializeEntity ); AS3_Val destroyEntityMethod = AS3_Function( NULL, destroyEntity ); AS3_Val decomposeEntityMethod = AS3_Function( NULL, decomposeEntity ); AS3_Val addEntityMethod = AS3_Function( NULL, addEntity ); AS3_Val removeEntityMethod = AS3_Function( NULL, removeEntity ); AS3_Val initializeAnimationMethod = AS3_Function( NULL, initializeAnimation); AS3_Val destroyAnimationMethod = AS3_Function( NULL, destroyAnimation ); AS3_Val initializeSkeletalChannelMethod = AS3_Function( NULL, initializeSkeletalChannel ); AS3_Val destroySkeletalChannelMethod = AS3_Function( NULL, destroySkeletalChannel ); AS3_Val initializeMorphChannelMethod = AS3_Function( NULL, initializeMorphChannel ); AS3_Val initialize3DSMethod = AS3_Function( NULL, initialize3DS ); AS3_Val loadComplete3DSMethod = AS3_Function( NULL, loadComplete3DS ); AS3_Val applyForTmpBufferMethod = AS3_Function( NULL, applyForTmpBuffer ); AS3_Val freeTmpBufferMethod = AS3_Function( NULL, freeTmpBuffer ); AS3_Val renderMethod = AS3_Function( NULL, render ); AS3_Val initializeMD2Method = AS3_Function( NULL, initializeMD2 ); AS3_Val testMethod = AS3_Function( NULL, test ); AS3_Val test2Method = AS3_Function( NULL, test2 ); AS3_Val result = AS3_Object( "initializeCamera:AS3ValType,\ destroyCamera:AS3ValType,\ attachCamera:AS3ValType,\ initializeScene:AS3ValType,\ destroyScene:AS3ValType,\ attachScene:AS3ValType,\ initializeViewport:AS3ValType,\ destroyViewport:AS3ValType,\ getWorldPositionFromSreen:AS3ValType,\ initializeMaterial:AS3ValType,\ destroyMaterial:AS3ValType,\ initializeBitmap:AS3ValType,\ initializeTexture:AS3ValType,\ destroyTexture:AS3ValType,\ setMipmap:AS3ValType,\ getTextureLevelDesc:AS3ValType,\ swapTextureEndian:AS3ValType,\ initializeLight:AS3ValType,\ addLight:AS3ValType,\ removeLight:AS3ValType,\ initializeFog:AS3ValType,\ addFog:AS3ValType,\ removeFog:AS3ValType,\ initializePrimitives:AS3ValType,\ initializeTerrain:AS3ValType,\ initializeMesh:AS3ValType,\ destroyMesh:AS3ValType,\ cloneMesh:AS3ValType,\ initializeSkinMeshController:AS3ValType,\ destroySkinMeshController:AS3ValType,\ setMeshAttribute:AS3ValType,\ initializeEntity:AS3ValType,\ destroyEntity:AS3ValType,\ decomposeEntity:AS3ValType,\ addEntity:AS3ValType,\ removeEntity:AS3ValType,\ initializeAnimation:AS3ValType,\ destroyAnimation:AS3ValType,\ initializeSkeletalChannel:AS3ValType,\ destroySkeletalChannel:AS3ValType,\ initializeMorphChannel:AS3ValType,\ initialize3DS:AS3ValType,\ loadComplete3DS:AS3ValType,\ applyForTmpBuffer:AS3ValType,\ freeTmpBuffer:AS3ValType,\ render:AS3ValType,\ initializeMD2:AS3ValType,\ test:AS3ValType,\ test2:AS3ValType", initializeCameraMethod, destroyCameraMethod, attachCameraMethod, initializeSceneMethod, destroySceneMethod, attachSceneMethod, initializeViewportMethod, destroyViewportMethod, getWorldPositionFromSreenMethod, initializeMaterialMethod, destroyMaterialMethod, initializeBitmapMethod, initializeTextureMethod, destroyTextureMethod, setMipmapMethod, getTextureLevelDescMethod, swapTextureEndianMethod, initializeLightMethod, addLightMethod, removeLightMethod, initializeFogMethod, addFogMethod, removeFogMethod, initializePrimitivesMethod, initializeTerrainMethod, initializeMeshMethod, destroyMeshMethod, cloneMeshMethod, initializeSkinMeshControllerMethod, destroySkinMeshControllerMethod, setMeshAttributeMethod, initializeEntityMethod, destroyEntityMethod, decomposeEntityMethod, addEntityMethod, removeEntityMethod, initializeAnimationMethod, destroyAnimationMethod, initializeSkeletalChannelMethod, destroySkeletalChannelMethod, initializeMorphChannelMethod, initialize3DSMethod, loadComplete3DSMethod, applyForTmpBufferMethod, freeTmpBufferMethod, renderMethod, initializeMD2Method, testMethod, test2Method ); AS3_Release( initializeCameraMethod ); AS3_Release( destroyCameraMethod ); AS3_Release( attachCameraMethod ); AS3_Release( initializeSceneMethod ); AS3_Release( destroySceneMethod ); AS3_Release( attachSceneMethod ); AS3_Release( initializeViewportMethod ); AS3_Release( destroyViewportMethod ); AS3_Release( getWorldPositionFromSreenMethod ); AS3_Release( initializeMaterialMethod ); AS3_Release( destroyMaterialMethod ); AS3_Release( initializeBitmapMethod ); AS3_Release( initializeTextureMethod ); AS3_Release( destroyTextureMethod ); AS3_Release( setMipmapMethod ); AS3_Release( getTextureLevelDescMethod ); AS3_Release( swapTextureEndianMethod ); AS3_Release( initializeLightMethod ); AS3_Release( addLightMethod ); AS3_Release( removeLightMethod ); AS3_Release( initializeFogMethod ); AS3_Release( addFogMethod ); AS3_Release( removeFogMethod ); AS3_Release( initializePrimitivesMethod ); AS3_Release( initializeTerrainMethod ); AS3_Release( initializeMeshMethod ); AS3_Release( destroyMeshMethod ); AS3_Release( cloneMeshMethod ); AS3_Release( initializeSkinMeshControllerMethod ); AS3_Release( destroySkinMeshControllerMethod ); AS3_Release( setMeshAttributeMethod ); AS3_Release( initializeEntityMethod ); AS3_Release( destroyEntityMethod ); AS3_Release( decomposeEntityMethod ); AS3_Release( addEntityMethod ); AS3_Release( removeEntityMethod ); AS3_Release( initializeAnimationMethod ); AS3_Release( destroyAnimationMethod ); AS3_Release( initializeSkeletalChannelMethod ); AS3_Release( destroySkeletalChannelMethod ); AS3_Release( initializeMorphChannelMethod ); AS3_Release( initialize3DSMethod ); AS3_Release( loadComplete3DSMethod ); AS3_Release( applyForTmpBufferMethod ); AS3_Release( freeTmpBufferMethod ); AS3_Release( renderMethod ); AS3_Release( initializeMD2Method ); AS3_Release( testMethod ); AS3_Release( test2Method ); AS3_LibInit( result ); return 0; }
int main() { AS3_Val isInCallBack = AS3_Function(0, QSPIsInCallBack); AS3_Val enableDebugMode = AS3_Function(0, QSPEnableDebugMode); AS3_Val getCurStateData = AS3_Function(0, QSPGetCurStateData); AS3_Val getVersion = AS3_Function(0, QSPGetVersion); AS3_Val getCompiledDateTime = AS3_Function(0, QSPGetCompiledDateTime); AS3_Val getFullRefreshCount = AS3_Function(0, QSPGetFullRefreshCount); AS3_Val getQstFullPath = AS3_Function(0, QSPGetQstFullPath); AS3_Val getCurLoc = AS3_Function(0, QSPGetCurLoc); AS3_Val getMainDesc = AS3_Function(0, QSPGetMainDesc); AS3_Val isMainDescChanged = AS3_Function(0, QSPIsMainDescChanged); AS3_Val getVarsDesc = AS3_Function(0, QSPGetVarsDesc); AS3_Val isVarsDescChanged = AS3_Function(0, QSPIsVarsDescChanged); AS3_Val getExprValue = AS3_FunctionAsync(0, QSPGetExprValue); AS3_Val setInputStrText = AS3_Function(0, QSPSetInputStrText); AS3_Val getActionsCount = AS3_Function(0, QSPGetActionsCount); AS3_Val getActionData = AS3_Function(0, QSPGetActionData); AS3_Val executeSelActionCode = AS3_FunctionAsync(0, QSPExecuteSelActionCode); AS3_Val setSelActionIndex = AS3_FunctionAsync(0, QSPSetSelActionIndex); AS3_Val getSelActionIndex = AS3_Function(0, QSPGetSelActionIndex); AS3_Val isActionsChanged = AS3_Function(0, QSPIsActionsChanged); AS3_Val getObjectsCount = AS3_Function(0, QSPGetObjectsCount); AS3_Val getObjectData = AS3_Function(0, QSPGetObjectData); AS3_Val setSelObjectIndex = AS3_FunctionAsync(0, QSPSetSelObjectIndex); AS3_Val getSelObjectIndex = AS3_Function(0, QSPGetSelObjectIndex); AS3_Val isObjectsChanged = AS3_Function(0, QSPIsObjectsChanged); AS3_Val showWindow = AS3_Function(0, QSPShowWindow); AS3_Val getVarValuesCount = AS3_Function(0, QSPGetVarValuesCount); AS3_Val getVarValues = AS3_Function(0, QSPGetVarValues); AS3_Val getMaxVarsCount = AS3_Function(0, QSPGetMaxVarsCount); AS3_Val getVarNameByIndex = AS3_Function(0, QSPGetVarNameByIndex); AS3_Val execString = AS3_FunctionAsync(0, QSPExecString); AS3_Val execLocationCode = AS3_FunctionAsync(0, QSPExecLocationCode); AS3_Val execCounter = AS3_FunctionAsync(0, QSPExecCounter); AS3_Val execUserInput = AS3_FunctionAsync(0, QSPExecUserInput); AS3_Val getLastErrorData = AS3_Function(0, QSPGetLastErrorData); AS3_Val getErrorDesc = AS3_Function(0, QSPGetErrorDesc); AS3_Val loadGameWorld = AS3_Function(0, QSPLoadGameWorld); AS3_Val loadGameWorldFromData = AS3_Function(0, QSPLoadGameWorldFromData); AS3_Val saveGame = AS3_FunctionAsync(0, QSPSaveGame); AS3_Val saveGameAsData = AS3_FunctionAsync(0, QSPSaveGameAsData); AS3_Val openSavedGame = AS3_FunctionAsync(0, QSPOpenSavedGame); AS3_Val openSavedGameFromData = AS3_FunctionAsync(0, QSPOpenSavedGameFromData); AS3_Val restartGame = AS3_FunctionAsync(0, QSPRestartGame); AS3_Val selectMenuItem = AS3_FunctionAsync(0, QSPSelectMenuItem); AS3_Val setCallBack = AS3_Function(0, QSPSetCallBack); AS3_Val init = AS3_Function(0, QSPInit); AS3_Val deInit = AS3_Function(0, QSPDeInit); AS3_Val returnValue = AS3_Function(0, QSPReturnValue); AS3_Val result = AS3_Object( "QSPIsInCallBack:AS3ValType, QSPEnableDebugMode:AS3ValType, QSPGetCurStateData:AS3ValType, QSPGetVersion:AS3ValType, " "QSPGetCompiledDateTime:AS3ValType, QSPGetFullRefreshCount:AS3ValType, QSPGetQstFullPath:AS3ValType, " "QSPGetCurLoc:AS3ValType, QSPGetMainDesc:AS3ValType, QSPIsMainDescChanged:AS3ValType, " "QSPGetVarsDesc:AS3ValType, QSPIsVarsDescChanged:AS3ValType, QSPGetExprValue:AS3ValType, " "QSPSetInputStrText:AS3ValType, QSPGetActionsCount:AS3ValType, QSPGetActionData:AS3ValType, " "QSPExecuteSelActionCode:AS3ValType, QSPSetSelActionIndex:AS3ValType, QSPGetSelActionIndex:AS3ValType, " "QSPIsActionsChanged:AS3ValType, QSPGetObjectsCount:AS3ValType, QSPGetObjectData:AS3ValType, " "QSPSetSelObjectIndex:AS3ValType, QSPGetSelObjectIndex:AS3ValType, QSPIsObjectsChanged:AS3ValType, " "QSPShowWindow:AS3ValType, QSPGetVarValuesCount:AS3ValType, QSPGetVarValues:AS3ValType, " "QSPGetMaxVarsCount:AS3ValType, QSPGetVarNameByIndex:AS3ValType, QSPExecString:AS3ValType, " "QSPExecLocationCode:AS3ValType, QSPExecCounter:AS3ValType, QSPExecUserInput:AS3ValType, " "QSPGetLastErrorData:AS3ValType, QSPGetErrorDesc:AS3ValType, QSPLoadGameWorld:AS3ValType, " "QSPLoadGameWorldFromData:AS3ValType, QSPSaveGame:AS3ValType, QSPSaveGameAsData:AS3ValType, " "QSPOpenSavedGame:AS3ValType, QSPOpenSavedGameFromData:AS3ValType, QSPRestartGame:AS3ValType, " "QSPSelectMenuItem:AS3ValType, QSPSetCallBack:AS3ValType, QSPInit:AS3ValType, QSPDeInit:AS3ValType, " "QSPReturnValue:AS3ValType", isInCallBack, enableDebugMode, getCurStateData, getVersion, getCompiledDateTime, getFullRefreshCount, getQstFullPath, getCurLoc, getMainDesc, isMainDescChanged, getVarsDesc, isVarsDescChanged, getExprValue, setInputStrText, getActionsCount, getActionData, executeSelActionCode, setSelActionIndex, getSelActionIndex, isActionsChanged, getObjectsCount, getObjectData, setSelObjectIndex, getSelObjectIndex, isObjectsChanged, showWindow, getVarValuesCount, getVarValues, getMaxVarsCount, getVarNameByIndex, execString, execLocationCode, execCounter, execUserInput, getLastErrorData, getErrorDesc, loadGameWorld, loadGameWorldFromData, saveGame, saveGameAsData, openSavedGame, openSavedGameFromData, restartGame, selectMenuItem, setCallBack, init, deInit, returnValue); // Release AS3_Release(isInCallBack); AS3_Release(enableDebugMode); AS3_Release(getCurStateData); AS3_Release(getVersion); AS3_Release(getCompiledDateTime); AS3_Release(getFullRefreshCount); AS3_Release(getQstFullPath); AS3_Release(getCurLoc); AS3_Release(getMainDesc); AS3_Release(isMainDescChanged); AS3_Release(getVarsDesc); AS3_Release(isVarsDescChanged); AS3_Release(getExprValue); AS3_Release(setInputStrText); AS3_Release(getActionsCount); AS3_Release(getActionData); AS3_Release(executeSelActionCode); AS3_Release(setSelActionIndex); AS3_Release(getSelActionIndex); AS3_Release(isActionsChanged); AS3_Release(getObjectsCount); AS3_Release(getObjectData); AS3_Release(setSelObjectIndex); AS3_Release(getSelObjectIndex); AS3_Release(isObjectsChanged); AS3_Release(showWindow); AS3_Release(getVarValuesCount); AS3_Release(getVarValues); AS3_Release(getMaxVarsCount); AS3_Release(getVarNameByIndex); AS3_Release(execString); AS3_Release(execLocationCode); AS3_Release(execCounter); AS3_Release(execUserInput); AS3_Release(getLastErrorData); AS3_Release(getErrorDesc); AS3_Release(loadGameWorld); AS3_Release(loadGameWorldFromData); AS3_Release(saveGame); AS3_Release(saveGameAsData); AS3_Release(openSavedGame); AS3_Release(openSavedGameFromData); AS3_Release(restartGame); AS3_Release(selectMenuItem); AS3_Release(setCallBack); AS3_Release(init); AS3_Release(deInit); AS3_Release(returnValue); AS3_LibInit(result); return 0; }
void gg_reg(AS3_Val lib, const char *name, AS3_ThunkProc p) { AS3_Val fun = AS3_Function(NULL, p); AS3_SetS(lib, name, fun); AS3_Release(fun); }
int main() { // This method does not free all these strings and AS3 vals, but what-ev! // This app uses so much freaking memory anyway :p AS3_Val result = AS3_Object(""); AS3_SetS(result, "allocateSampleMemory", AS3_Function(NULL, allocateSampleMemory) ); AS3_SetS(result, "reallocateSampleMemory", AS3_Function(NULL, reallocateSampleMemory) ); AS3_SetS(result, "deallocateSampleMemory", AS3_Function(NULL, deallocateSampleMemory) ); AS3_SetS(result, "setSamples", AS3_Function(NULL, setSamples) ); AS3_SetS(result, "copy", AS3_Function(NULL, copy) ); AS3_SetS(result, "changeGain", AS3_Function(NULL, changeGain) ); AS3_SetS(result, "mixIn", AS3_Function(NULL, mixIn) ); AS3_SetS(result, "mixInPan", AS3_Function(NULL, mixInPan) ); AS3_SetS(result, "multiplyIn", AS3_Function(NULL, multiplyIn) ); AS3_SetS(result, "standardize", AS3_Function(NULL, standardize) ); AS3_SetS(result, "wavetableIn", AS3_Function(NULL, wavetableIn) ); AS3_SetS(result, "delay", AS3_Function(NULL, delay) ); AS3_SetS(result, "biquad", AS3_Function(NULL, biquad) ); AS3_SetS(result, "writeBytes", AS3_Function(NULL, writeBytes) ); AS3_SetS(result, "envelope", AS3_Function(NULL, envelope) ); AS3_SetS(result, "overdrive", AS3_Function(NULL, overdrive) ); AS3_SetS(result, "clip", AS3_Function(NULL, clip) ); AS3_SetS(result, "normalize", AS3_Function(NULL, normalize) ); AS3_SetS(result, "writeWavBytes", AS3_Function(NULL, writeWavBytes) ); AS3_SetS(result, "readWavBytes", AS3_Function(NULL, readWavBytes) ); // make our note number to frequency lookup table fillNoteLookupTable(); fillPowerLookupTable(); // notify that we initialized -- THIS DOES NOT RETURN! AS3_LibInit(result); return 0; }