• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AS3_Array函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AS3_Array函数的典型用法代码示例。如果您正苦于以下问题:C++ AS3_Array函数的具体用法?C++ AS3_Array怎么用?C++ AS3_Array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AS3_Array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: qspCallSaveGame

void qspCallSaveGame(QSP_CHAR *file)
{
	/* Здесь позволяем пользователю выбрать файл */
	/* для сохранения состояния игры и сохраняем */
	/* в нем текущее состояние */
	QSPCallState state;
	AS3_Val args;
	char *strUTF8;
	if (qspCallBacks[QSP_CALL_SAVEGAMESTATUS].IsSet)
	{
		qspSaveCallState(&state, QSP_FALSE, QSP_TRUE);
		if (file)
		{
			strUTF8 = qspW2C(file);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_SAVEGAMESTATUS].FuncVal, qspCallBacks[QSP_CALL_SAVEGAMESTATUS].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:25,代码来源:callbacks.c


示例2: qspCallIsPlayingFile

QSP_BOOL qspCallIsPlayingFile(QSP_CHAR *file)
{
	/* Здесь проверяем, проигрывается ли файл */
	QSPCallState state;
	QSP_BOOL isPlaying;
	AS3_Val args;
	char *strUTF8;
	if (qspCallBacks[QSP_CALL_ISPLAYINGFILE].IsSet)
	{
		qspSaveCallState(&state, QSP_TRUE, QSP_FALSE);
		if (file)
		{
			strUTF8 = qspW2C(file);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_ISPLAYINGFILE].FuncVal, qspCallBacks[QSP_CALL_ISPLAYINGFILE].ThisVal, args);
		AS3_Release(args);
		flyield();
		isPlaying = (QSP_BOOL)AS3_IntValue(result);
		AS3_Release(result);
		qspRestoreCallState(&state);
		return isPlaying;
	}
	return QSP_FALSE;
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:28,代码来源:callbacks.c


示例3: qspSaveCallState

QSP_CHAR *qspCallInputBox(QSP_CHAR *text)
{
	/* Здесь вводим текст */
	QSPCallState state;
	QSP_CHAR *buffer;
	AS3_Val args;
	char *strUTF8;
	char *resText;
	int maxLen = 511;
	if (qspCallBacks[QSP_CALL_INPUTBOX].IsSet)
	{
		qspSaveCallState(&state, QSP_TRUE, QSP_FALSE);
		if (text)
		{
			strUTF8 = qspW2C(text);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_INPUTBOX].FuncVal, qspCallBacks[QSP_CALL_INPUTBOX].ThisVal, args);
		AS3_Release(args);
		flyield();
		resText = AS3_StringValue(result);
		AS3_Release(result);
		buffer = qspC2W(resText);
		free(resText);
		qspRestoreCallState(&state);
	}
	else
		buffer = qspGetNewText(QSP_FMT(""), 0);
	return buffer;
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:33,代码来源:callbacks.c


示例4: cloneMesh

AS3_Val cloneMesh( void * self, AS3_Val args )
{
	Mesh* src, *mesh;

	Material* material;

	Texture* texture;

	int render_mode, i;

	Vector3D** vp;

	AS3_ArrayValue( args, "PtrType, PtrType, PtrType, IntType",& src, & material, & texture, & render_mode);

	mesh = mesh_clone(src, material, texture, render_mode);

	if( ( vp = ( Vector3D * *   )malloc( sizeof( Vector3D * ) * mesh -> nVertices ) ) == NULL )
	{
		return AS3_Array( "PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType",
							mesh,
							& mesh->lightEnable,
							& mesh->fogEnable,
							& mesh->useMipmap,
							//& mesh->terrainTrace,
							& mesh->mip_dist,
							& mesh->v_dirty, 
							& mesh->octree_depth,
							& mesh->addressMode,
							& mesh->texTransform->rotation,
							mesh->texTransform->offset,
							mesh->texTransform->scale,
							& mesh->texTransformDirty,
							& mesh->hit,
							& mesh->skinMeshController);
	}

	for( i = 0; i < mesh -> nVertices; i ++ )
	{
		vp[i] = mesh -> vertices[i]->position;
	}

	return AS3_Array( "PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType",
						mesh,
						& mesh->lightEnable,
						& mesh->fogEnable,
						& mesh->useMipmap,
						//& mesh->terrainTrace,
						& mesh->mip_dist,
						& mesh->v_dirty,
						& mesh->octree_depth,
						& mesh->addressMode,
						& mesh->texTransform->rotation, 
						mesh->texTransform->offset,
						mesh->texTransform->scale,
						& mesh->texTransformDirty,
						& mesh->hit,
						& mesh->skinMeshController,
						& vp );
}
开发者ID:linfuqing,项目名称:alchemy3d,代码行数:59,代码来源:alchemy3d.c


示例5: create_as3_value_from_lua_stack

/*
* Create an ActionScript value from the lua stack starting
* at index start and ending at index end.  If collapse_array == 1,
* an empty return will be transformed into AS3_Undefined() and a
* return of length 1 will just return the specific value.
* Otherwise an array is returned.
*/
AS3_Val create_as3_value_from_lua_stack(
    lua_State * L,
    int start,
    int end,
    BOOL collapse_array
  )
{
  /* WARNING: Panic alert! Use L*_FN checkers here! */

  LCALL(L, stack);
  AS3_Val ret;

  SPAM(("create_as3_value_from_lua_stack(): begin"));

  if (collapse_array == TRUE && start > end)
  {
    ret = AS3_Null();
  }
  else if (collapse_array == TRUE && start == end)
  {
    ret = get_as3_value_from_lua_stack(L, start);
  }
  else
  {
    int i;

    ret = AS3_Array("");
    for (i = start; i <= end; ++i)
    {
      AS3_Val value;
      AS3_Val r;

      /*SPAM(("create_as3_value_from_lua_stack() + 1 begin"));*/

      value = get_as3_value_from_lua_stack(L, i);
      r = AS3_CallTS("push", ret, "AS3ValType", value);
      SAFE_RELEASE(r); /* Ignoring result */

      SAFE_RELEASE(value);

      /*SPAM(("create_as3_value_from_lua_stack() + 1 end"));*/
    }
  }

#ifdef DO_SPAM
  SPAM(("create_as3_value_from_lua_stack(): end"));
  AS3_Trace(
      AS3_Call(
          getQualifiedClassName_method, NULL, AS3_Array("AS3ValType", ret)
        )
    );
#endif /* DO_SPAM */

  LCHECK_FN(L, stack, 0, fatal_error);

  return ret;
}
开发者ID:Khainer,项目名称:lua-alchemy,代码行数:64,代码来源:bridge_as3_lua.c


示例6: initializeMorphChannel

AS3_Val initializeMorphChannel( void* self, AS3_Val args )
{
	Animation* animation;
	int length, i, duration = 0;
	char* name;
	float* times;
	Vector3D** vertices;
	int* verticesLength;
	MorphChannel* channel;
	Frame* frames;

	AS3_ArrayValue(args, "PtrType, IntType, PtrType, PtrType, PtrType, PtrType", &animation, &length, &name, &times, &vertices, &verticesLength);

	if(length)
	{
		if( ( frames = ( Frame * )malloc(sizeof(Frame) * length) ) == NULL ) 
			exit( TRUE );

		for(i = 0; i < length; i ++)
		{
			frames[i].length   = verticesLength[i];
			frames[i].vertices = vertices[i];
			frames[i].time     = times[i];

			memcpy(frames[i].name, name + i * FRAME_NAME_LENGTH, FRAME_NAME_LENGTH);

			duration += frames[i].time;
		}
	}

	channel = newMorphChannel(animation, frames, length, duration);

	return AS3_Array("PtrType, PtrType, PtrType, PtrType", channel, &channel->dirty, channel->currentFrameName, &channel->nameLength);
}
开发者ID:dreamsxin,项目名称:zero3d,代码行数:34,代码来源:alchemy3d.c


示例7: doUnAes

AS3_Val doUnAes(void *data, AS3_Val args)
{
	AS3_Val input = NULL;
    unsigned int in_len;
	char * ar;
	AS3_ArrayValue(args, "AS3ValType, IntType", &input, &in_len);
	ar = (char *)malloc(in_len);
	
	AS3_ByteArray_readBytes((void*)ar, input, in_len);
		
	char * aesData;
	int out_len = 0;
	char * keyStr = "kael";
	
	//use AES to Decrypt the bytes	
	aesData = DES_Decrypt(ar, keyStr, in_len, &out_len );

	//make a new as3 byteArray var
	AS3_Val baNS = AS3_String("flash.utils");
	AS3_Val baClass = AS3_NSGetS(baNS, "ByteArray");
	AS3_Val emptyParams = AS3_Array("");
	AS3_Val byteArray2 = AS3_New(baClass, emptyParams);
	
	AS3_ByteArray_writeBytes(byteArray2, aesData, out_len);
	return byteArray2;
}
开发者ID:kaelliu,项目名称:Miscellaneous,代码行数:26,代码来源:alchemyAes.c


示例8: initializeLight

AS3_Val initializeLight( void* self, AS3_Val args )
{
	//Scene * scene;
	Entity * source;
	int type;
	Light * light;
	Lights * node;

	AS3_ArrayValue( args, "PtrType, IntType", &source, &type );

	light = newPointLight( type, source );
	//scene_addLight( scene, light );

	if( ( node = ( Lights * )malloc( sizeof( Lights ) ) ) == NULL )
	{
		exit( TRUE );
	}

	node -> light = light;
	node -> next  = NULL;

	return AS3_Array( "PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType",
		light, &light->mode, &light->bOnOff, &light->type, light->ambient, light->diffuse, light->specular,
		&light->range, &light->falloff, &light->theta, &light->phi, &light->attenuation0, &light->attenuation1, &light->attenuation2, node );
}
开发者ID:dreamsxin,项目名称:zero3d,代码行数:25,代码来源:alchemy3d.c


示例9: initializeScene

AS3_Val initializeScene( void* self, AS3_Val args )
{
	Scene * scene;

	scene =  newScene();

	return AS3_Array( "PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType, PtrType", scene, & scene->nNodes, & scene->nVertices, & scene->nFaces, & scene->nRenderList, & scene->nCullList, & scene->nClippList, &scene->terrain );
}
开发者ID:dreamsxin,项目名称:zero3d,代码行数:8,代码来源:alchemy3d.c


示例10: initializeTexture

AS3_Val initializeTexture( void* self, AS3_Val args )
{
	char * name;

	Texture * texture;

	AS3_ArrayValue( args, "StrType", &name );

	texture = newTexture( name );

	return AS3_Array( "PtrType, PtrType, PtrType, PtrType, PtrType", texture, & texture->perspective_dist, &texture->perspectiveLP_dist, &texture->alphaTestRef, &texture->numMipLevels);
}
开发者ID:dreamsxin,项目名称:zero3d,代码行数:12,代码来源:alchemy3d.c


示例11: initialize_as3_constants

/* setup some useful constants */
void initialize_as3_constants()
{
  no_params = AS3_Array("");
  zero_param = AS3_Int(0);
  Number_class = get_class2(NULL, "Number");
  int_class = get_class2(NULL, "int");
  String_class = get_class2(NULL, "String");
  Boolean_class = get_class2(NULL, "Boolean");
  flash_utils_namespace = AS3_String("flash.utils");
  getQualifiedClassName_method = AS3_NSGetS(flash_utils_namespace, "getQualifiedClassName");
  Array_class = get_class2(NULL, "Array");
}
开发者ID:Tmdean,项目名称:lua-alchemy,代码行数:13,代码来源:bridge_as3_c.c


示例12: push_as3_to_lua_stack_if_convertible

/*
* Given an ActionScript object, push it onto the Lua stack as a Lua native
* type if a primitive class (String, Number, Boolean, int, null).
* If object is not convertible to native Lua value, do not push anything
* (and return 0).
*
* WARNING: It important that this function does not touch
*          non-primitive values (like Arrays). If this will be changed,
*          optional primitive autoconversion logic will break.
*/
int push_as3_to_lua_stack_if_convertible(lua_State * L, AS3_Val val)
{
  LCALL(L, stack);

#ifdef DO_SPAM
  SPAM(("push_as3_to_lua_stack_if_convertible(): begin: value, type"));
  AS3_Trace(val);
  AS3_Trace(
      AS3_Call(
          getQualifiedClassName_method, NULL, AS3_Array("AS3ValType", val)
        )
    );
#endif /* DO_SPAM */

  if (AS3_InstanceOf(val, Number_class))
  {
    lua_pushnumber(L, AS3_NumberValue(val));
  }
  else if (AS3_InstanceOf(val, int_class))
  {
    lua_pushinteger(L, AS3_IntValue(val));
  }
  else if (AS3_InstanceOf(val, String_class))
  {
    size_t length = 0;
    AS3_Malloced_Str str = get_string_bytes(val, &length);
    lua_pushlstring(L, str, length);
    free(str);
  }
  else if (AS3_InstanceOf(val, Boolean_class))
  {
    lua_pushboolean(L, AS3_IntValue(val));
  }
  else if (val == AS3_Undefined())
  {
    lua_pushnil(L);
  }
  else if (is_null(val))
  {
    lua_pushnil(L);
  }
  else
  {
    SPAM(("push_as3_to_lua_stack_if_convertible(): not convertible"));
    LRETURN(L, stack, 0);
  }

  SPAM(("push_as3_to_lua_stack_if_convertible(): end"));

  LRETURN(L, stack, 1);
}
开发者ID:Khainer,项目名称:lua-alchemy,代码行数:61,代码来源:bridge_as3_lua.c


示例13: qspCallShowPicture

void qspCallShowPicture(QSP_CHAR *file)
{
	/* Здесь показываем изображение */
	QSPCallState state;
	AS3_Val args;
	char *strUTF8;
	if (qspCallBacks[QSP_CALL_SHOWIMAGE].IsSet)
	{
		qspSaveCallState(&state, QSP_TRUE, QSP_FALSE);
		if (file)
		{
			strUTF8 = qspW2C(file);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_SHOWIMAGE].FuncVal, qspCallBacks[QSP_CALL_SHOWIMAGE].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:23,代码来源:callbacks.c


示例14: qspCallShowMessage

void qspCallShowMessage(QSP_CHAR *text)
{
	/* Здесь показываем сообщение */
	QSPCallState state;
	AS3_Val args;
	char *strUTF8;
	if (qspCallBacks[QSP_CALL_SHOWMSGSTR].IsSet)
	{
		qspSaveCallState(&state, QSP_TRUE, QSP_FALSE);
		if (text)
		{
			strUTF8 = qspW2C(text);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_SHOWMSGSTR].FuncVal, qspCallBacks[QSP_CALL_SHOWMSGSTR].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:23,代码来源:callbacks.c


示例15: qspCallCloseFile

void qspCallCloseFile(QSP_CHAR *file)
{
	/* Здесь выполняем закрытие файла */
	QSPCallState state;
	AS3_Val args;
	char *strUTF8;
	if (qspCallBacks[QSP_CALL_CLOSEFILE].IsSet)
	{
		qspSaveCallState(&state, QSP_TRUE, QSP_FALSE);
		if (file)
		{
			strUTF8 = qspW2C(file);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_CLOSEFILE].FuncVal, qspCallBacks[QSP_CALL_CLOSEFILE].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:23,代码来源:callbacks.c


示例16: qspCallSystem

void qspCallSystem(QSP_CHAR *cmd)
{
	/* Здесь выполняем системный вызов */
	QSPCallState state;
	AS3_Val args;
	char *strUTF8;
	if (qspCallBacks[QSP_CALL_SYSTEM].IsSet)
	{
		qspSaveCallState(&state, QSP_FALSE, QSP_FALSE);
		if (cmd)
		{
			strUTF8 = qspW2C(cmd);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_SYSTEM].FuncVal, qspCallBacks[QSP_CALL_SYSTEM].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:23,代码来源:callbacks.c


示例17: qspCallSetInputStrText

void qspCallSetInputStrText(QSP_CHAR *text)
{
	/* Здесь устанавливаем текст строки ввода */
	QSPCallState state;
	AS3_Val args;
	char *textUTF8;
	if (qspCallBacks[QSP_CALL_SETINPUTSTRTEXT].IsSet)
	{
		qspSaveCallState(&state, QSP_TRUE, QSP_FALSE);
		if (text)
		{
			textUTF8 = qspW2C(text);
			args = AS3_Array("StrType", textUTF8);
			free(textUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_SETINPUTSTRTEXT].FuncVal, qspCallBacks[QSP_CALL_SETINPUTSTRTEXT].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:23,代码来源:callbacks.c


示例18: qspCallDebug

void qspCallDebug(QSP_CHAR *str)
{
	/* Здесь передаем управление отладчику */
	QSPCallState state;
	char *strUTF8;
	AS3_Val args;
	if (qspCallBacks[QSP_CALL_DEBUG].IsSet)
	{
		qspSaveCallState(&state, QSP_FALSE, QSP_FALSE);
		if (str)
		{
			strUTF8 = qspW2C(str);
			args = AS3_Array("StrType", strUTF8);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType", 0);
		AS3_Call(qspCallBacks[QSP_CALL_DEBUG].FuncVal, qspCallBacks[QSP_CALL_DEBUG].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:23,代码来源:callbacks.c


示例19: qspCallPlayFile

void qspCallPlayFile(QSP_CHAR *file, int volume)
{
	/* Здесь начинаем воспроизведение файла с заданной громкостью */
	QSPCallState state;
	AS3_Val args;
	char *strUTF8;
	if (qspCallBacks[QSP_CALL_PLAYFILE].IsSet)
	{
		qspSaveCallState(&state, QSP_TRUE, QSP_FALSE);
		if (file)
		{
			strUTF8 = qspW2C(file);
			args = AS3_Array("StrType, IntType", strUTF8, volume);
			free(strUTF8);
		}
		else
			args = AS3_Array("StrType, IntType", 0, volume);
		AS3_Call(qspCallBacks[QSP_CALL_PLAYFILE].FuncVal, qspCallBacks[QSP_CALL_PLAYFILE].ThisVal, args);
		AS3_Release(args);
		flyield();
		qspRestoreCallState(&state);
	}
}
开发者ID:fylfot,项目名称:QSP-iPhone,代码行数:23,代码来源:callbacks.c


示例20: is_null

/*
  TODO: Ugly workaround. Remove.
        See http://tinyurl.com/a9djb2
*/
BOOL is_null(AS3_Val val)
{
  BOOL result = FALSE;
  AS3_Val argsVal = AS3_Array("AS3ValType", val);
  AS3_Val classNameVal = AS3_Call(getQualifiedClassName_method, NULL, argsVal);
  AS3_Malloced_Str className = AS3_StringValue(classNameVal);
  AS3_Release(argsVal);
  AS3_Release(classNameVal);

  result = (strncmp(className, "null", 4) == 0);

  free(className);

  return result;
}
开发者ID:Tmdean,项目名称:lua-alchemy,代码行数:19,代码来源:bridge_as3_c.c



注:本文中的AS3_Array函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AS3_GetScalarFromVar函数代码示例发布时间:2022-05-30
下一篇:
C++ AR_SREV_9300_20_OR_LATER函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap