亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gameswf_action.cpp

?? 一個開源的嵌入式flash播放器 具體看文檔和例子就可
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
// gameswf_action.cpp	-- Thatcher Ulrich <tu@tulrich.com> 2003// This source code has been donated to the Public Domain.  Do// whatever you want with it.// Implementation and helpers for SWF actions.#include "gameswf_action.h"#include "gameswf_impl.h"#include "gameswf_log.h"#include "gameswf_stream.h"#include "base/tu_random.h"#include "gameswf_string.h"#include "gameswf_movie.h"#include "gameswf_timers.h"#include "gameswf_textformat.h"#include "gameswf_sound.h"#ifdef HAVE_LIBXML#include "gameswf_xml.h"#include "gameswf_xmlsocket.h"#endif#ifdef _WIN32#define snprintf _snprintf#endif // _WIN32// NOTES://// Buttons// on (press)                 onPress// on (release)               onRelease// on (releaseOutside)        onReleaseOutside// on (rollOver)              onRollOver// on (rollOut)               onRollOut// on (dragOver)              onDragOver// on (dragOut)               onDragOut// on (keyPress"...")         onKeyDown, onKeyUp      <----- IMPORTANT//// Sprites// onClipEvent (load)         onLoad// onClipEvent (unload)       onUnload                Hm.// onClipEvent (enterFrame)   onEnterFrame// onClipEvent (mouseDown)    onMouseDown// onClipEvent (mouseUp)      onMouseUp// onClipEvent (mouseMove)    onMouseMove// onClipEvent (keyDown)      onKeyDown// onClipEvent (keyUp)        onKeyUp// onClipEvent (data)         onData// Text fields have event handlers too!// Sprite built in methods:// play()// stop()// gotoAndStop()// gotoAndPlay()// nextFrame()// startDrag()// getURL()// getBytesLoaded()// getBytesTotal()// Built-in functions: (do these actually exist in the VM, or are they just opcodes?)// Number()// String()// TODO builtins//// Number.toString() -- takes an optional arg that specifies the base//// parseInt(), parseFloat()//// Boolean() type cast//// typeof operator --> "number", "string", "boolean", "object" (also// for arrays), "null", "movieclip", "function", "undefined"//// isNaN()//// Number.MAX_VALUE, Number.MIN_VALUE//// String.fromCharCode()namespace gameswf{		//	// action stuff	//	void	action_init();	// Statics.	bool	s_inited = false;	smart_ptr<as_object>	s_global;	fscommand_callback	s_fscommand_handler = NULL;#define EXTERN_MOVIE	#ifdef EXTERN_MOVIE	void attach_extern_movie(const char* url, const movie* target, const movie* root_movie)	{		tu_string infile = get_workdir();		infile += url;		movie_definition_sub*	md = create_library_movie_sub(infile.c_str());		if (md == NULL)		{			log_error("can't create movie_definition_sub for %s\n", infile.c_str());			return;		}		gameswf::movie_interface* extern_movie;		if (target == root_movie)		{			extern_movie = create_library_movie_inst_sub(md);						if (extern_movie == NULL)			{				log_error("can't create extern root movie_interface for %s\n", infile.c_str());				return;			}			set_current_root(extern_movie);			movie* m = extern_movie->get_root_movie();			m->on_event(event_id::LOAD);		}		else		{			extern_movie = md->create_instance();			if (extern_movie == NULL)			{				log_error("can't create extern movie_interface for %s\n", infile.c_str());				return;			}      			save_extern_movie(extern_movie);      			character* tar = (character*)target;			const char* name = tar->get_name();			Uint16 depth = tar->get_depth();			bool use_cxform = false;			cxform color_transform =  tar->get_cxform();			bool use_matrix = false;			matrix mat = tar->get_matrix();			float ratio = tar->get_ratio();			Uint16 clip_depth = tar->get_clip_depth();			movie* parent = tar->get_parent();			movie* new_movie = extern_movie->get_root_movie();			assert(parent != NULL);			((character*)new_movie)->set_parent(parent);       			parent->replace_display_object(				(character*) new_movie,				name,				depth,				use_cxform,				color_transform,				use_matrix,				mat,				ratio,				clip_depth);		}	}#endif // EXTERN_MOVIE	void	register_fscommand_callback(fscommand_callback handler)	// External interface.	{		s_fscommand_handler = handler;	}	static bool string_to_number(double* result, const char* str)	// Utility.  Try to convert str to a number.  If successful,	// put the result in *result, and return true.  If not	// successful, put 0 in *result, and return false.	{		char* tail = 0;		*result = strtod(str, &tail);		if (tail == str || *tail != 0)		{			// Failed conversion to Number.			return false;		}		return true;	}	//	// array object	//	struct as_array_object : public as_object	{// @@ TODO//		as_array_object()//		{//			this->set_member("length", &array_not_impl);//			this->set_member("join", &array_not_impl);//			this->set_member("concat", &array_not_impl);//			this->set_member("slice", &array_not_impl);//			this->set_member("push", &array_not_impl);//			this->set_member("unshift", &array_not_impl);//			this->set_member("pop", &array_not_impl);//			this->set_member("shift", &array_not_impl);//			this->set_member("splice", &array_not_impl);//			this->set_member("sort", &array_not_impl);//			this->set_member("sortOn", &array_not_impl);//			this->set_member("reverse", &array_not_impl);//			this->set_member("toString", &array_not_impl);//		}	};	void	array_not_impl(const fn_call& fn)	{		log_error("array methods not implemented yet\n");	}	//	// as_as_function	//	void	as_as_function::operator()(const fn_call& fn)	// Dispatch.	{		as_environment*	our_env = m_env;		if (our_env == NULL)		{			our_env = fn.env;		}		assert(our_env);		// Set up local stack frame, for parameters and locals.		int	local_stack_top = our_env->get_local_frame_top();		our_env->add_frame_barrier();		if (m_is_function2 == false)		{			// Conventional function.			// Push the arguments onto the local frame.			int	args_to_pass = imin(fn.nargs, m_args.size());			for (int i = 0; i < args_to_pass; i++)			{				assert(m_args[i].m_register == 0);				our_env->add_local(m_args[i].m_name, fn.arg(i));			}		}		else		{			// function2: most args go in registers; any others get pushed.						// Create local registers.			our_env->add_local_registers(m_local_register_count);			// Handle the explicit args.			int	args_to_pass = imin(fn.nargs, m_args.size());			for (int i = 0; i < args_to_pass; i++)			{				if (m_args[i].m_register == 0)				{					// Conventional arg passing: create a local var.					our_env->add_local(m_args[i].m_name, fn.arg(i));				}				else				{					// Pass argument into a register.					int	reg = m_args[i].m_register;					*(our_env->local_register_ptr(reg)) = fn.arg(i);				}			}			// Handle the implicit args.			int	current_reg = 1;			if (m_function2_flags & 0x01)			{				// preload 'this' into a register.				(*(our_env->local_register_ptr(current_reg))).set_as_object_interface(our_env->m_target);				current_reg++;			}			if (m_function2_flags & 0x02)			{				// Don't put 'this' into a local var.			}			else			{				// Put 'this' in a local var.				our_env->add_local("this", as_value(our_env->m_target));			}			// Init arguments array, if it's going to be needed.			smart_ptr<as_array_object>	arg_array;			if ((m_function2_flags & 0x04) || ! (m_function2_flags & 0x08))			{				arg_array = new as_array_object;				as_value	index_number;				for (int i = 0; i < fn.nargs; i++)				{					index_number.set_int(i);					arg_array->set_member(index_number.to_string(), fn.arg(i));				}			}			if (m_function2_flags & 0x04)			{				// preload 'arguments' into a register.				(*(our_env->local_register_ptr(current_reg))).set_as_object_interface(arg_array.get_ptr());				current_reg++;			}			if (m_function2_flags & 0x08)			{				// Don't put 'arguments' in a local var.			}			else			{				// Put 'arguments' in a local var. 				our_env->add_local("arguments", as_value(arg_array.get_ptr()));			}			if (m_function2_flags & 0x10)			{				// Put 'super' in a register.				log_error("TODO: implement 'super' in function2 dispatch (reg)\n");				current_reg++;			}			if (m_function2_flags & 0x20)			{				// Don't put 'super' in a local var.			}			else			{				// Put 'super' in a local var.				log_error("TODO: implement 'super' in function2 dispatch (var)\n");			}			if (m_function2_flags & 0x40)			{				// Put '_root' in a register.				(*(our_env->local_register_ptr(current_reg))).set_as_object_interface(					our_env->m_target->get_root_movie());				current_reg++;			}			if (m_function2_flags & 0x80)			{				// Put '_parent' in a register.				array<with_stack_entry>	dummy;				as_value	parent = our_env->get_variable("_parent", dummy);				(*(our_env->local_register_ptr(current_reg))) = parent;				current_reg++;			}			if (m_function2_flags & 0x100)			{				// Put '_global' in a register.				(*(our_env->local_register_ptr(current_reg))).set_as_object_interface(s_global.get_ptr());				current_reg++;			}		}		// Execute the actions.		m_action_buffer->execute(our_env, m_start_pc, m_length, fn.result, m_with_stack, m_is_function2);		// Clean up stack frame.		our_env->set_local_frame_top(local_stack_top);		if (m_is_function2)		{			// Clean up the local registers.			our_env->drop_local_registers(m_local_register_count);		}	}	//	// Function/method dispatch.	//	as_value	call_method(		const as_value& method,		as_environment* env,		as_object_interface* this_ptr,		int nargs,		int first_arg_bottom_index)	// first_arg_bottom_index is the stack index, from the bottom, of the first argument.	// Subsequent arguments are at *lower* indices.  E.g. if first_arg_bottom_index = 7,	// then arg1 is at env->bottom(7), arg2 is at env->bottom(6), etc.	{		as_value	val;		as_c_function_ptr	func = method.to_c_function();		if (func)		{			// It's a C function.  Call it.			(*func)(fn_call(&val, this_ptr, env, nargs, first_arg_bottom_index));		}		else if (as_as_function* as_func = method.to_as_function())		{			// It's an ActionScript function.  Call it.			(*as_func)(fn_call(&val, this_ptr, env, nargs, first_arg_bottom_index));		}		else		{			log_error("error in call_method(): method is not a function\n");		}		return val;	}	as_value	call_method0(		const as_value& method,		as_environment* env,		as_object_interface* this_ptr)	{		return call_method(method, env, this_ptr, 0, env->get_top_index() + 1);	}			const char*	call_method_parsed(		as_environment* env,		as_object_interface* this_ptr,		const char* method_name,		const char* method_arg_fmt,		va_list args)	// Printf-like vararg interface for calling ActionScript.	// Handy for external binding.	{		log_msg("FIXME(%d): %s\n", __LINE__, __FUNCTION__);#if 0		static const int	BUFSIZE = 1000;		char	buffer[BUFSIZE];		array<const char*>	tokens;		// Brutal crap parsing.  Basically null out any		// delimiter characters, so that the method name and		// args sit in the buffer as null-terminated C		// strings.  Leave an intial ' character as the first		// char in a string argument.		// Don't verify parens or matching quotes or anything.		{			strncpy(buffer, method_call, BUFSIZE);			buffer[BUFSIZE - 1] = 0;			char*	p = buffer;			char	in_quote = 0;			bool	in_arg = false;			for (;; p++)			{				char	c = *p;				if (c == 0)				{					// End of string.					break;				}				else if (c == in_quote)				{					// End of quotation.					assert(in_arg);					*p = 0;					in_quote = 0;					in_arg = false;				}				else if (in_arg)				{					if (in_quote == 0)					{						if (c == ')' || c == '(' || c == ',' || c == ' ')						{							// End of arg.							*p = 0;							in_arg = false;						}					}				}				else				{					// Not in arg.  Watch for start of arg.					assert(in_quote == 0);					if (c == '\'' || c == '\"')					{						// Start of quote.						in_quote = c;						in_arg = true;						*p = '\'';	// ' at the start of the arg, so later we know this is a string.						tokens.push_back(p);					}					else if (c == ' ' || c == ',')					{						// Non-arg junk, null it out.						*p = 0;					}					else					{						// Must be the start of a numeric arg.						in_arg = true;						tokens.push_back(p);					}				}			}		}#endif // 0		// Parse va_list args		int	starting_index = env->get_top_index();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大片拔萝卜| 日韩欧美卡一卡二| 日韩欧美综合一区| 国产成人8x视频一区二区| 亚洲日本青草视频在线怡红院 | 一区二区三区四区中文字幕| 欧美在线观看视频在线| 国产精品一区二区久久精品爱涩| 亚洲视频你懂的| 日韩一级免费观看| 欧美日韩国产精品自在自线| 一本大道久久a久久综合| 99久久免费国产| 色偷偷久久一区二区三区| 国产精品伊人色| 丝袜美腿亚洲色图| 亚洲精品国久久99热| 久久久99久久| 久久亚洲春色中文字幕久久久| 4438x亚洲最大成人网| 91精品国产日韩91久久久久久| 91亚洲午夜精品久久久久久| av中文一区二区三区| 精品无码三级在线观看视频| 免费高清在线一区| 日韩va亚洲va欧美va久久| 亚洲女人的天堂| 亚洲老妇xxxxxx| 欧美激情中文字幕| 国产精品污污网站在线观看| 精品动漫一区二区三区在线观看| 国产偷国产偷亚洲高清人白洁 | 不卡区在线中文字幕| 国产精品天美传媒| 91美女片黄在线观看| 夫妻av一区二区| 国产乱一区二区| 欧美视频在线一区二区三区| 国产精品午夜在线观看| 欧美日韩一区二区三区在线看| 国产毛片精品国产一区二区三区| 91视频你懂的| 亚洲日本一区二区| 免费xxxx性欧美18vr| 国产很黄免费观看久久| 91免费版pro下载短视频| 欧美一区二区黄色| 精品少妇一区二区三区在线视频| 国产欧美精品一区二区三区四区 | 激情综合色丁香一区二区| 精品在线亚洲视频| 成人av在线影院| 欧美福利一区二区| 91精品国产综合久久久久久漫画| 欧美一区二区在线免费播放| 欧美国产日本视频| 波波电影院一区二区三区| 老鸭窝一区二区久久精品| 久久成人免费网站| 色综合久久中文字幕综合网| 日韩一级片在线播放| 日韩美女精品在线| 紧缚捆绑精品一区二区| 99久久免费精品| 久久蜜桃香蕉精品一区二区三区| 亚洲一区二区三区爽爽爽爽爽| 精品一区二区三区免费播放| 在线观看视频一区二区欧美日韩| 久久综合五月天婷婷伊人| 亚洲国产毛片aaaaa无费看 | 91蜜桃婷婷狠狠久久综合9色| 精品免费日韩av| 五月天激情综合| 99免费精品在线| 精品黑人一区二区三区久久 | 国产在线视频一区二区三区| 在线一区二区视频| 欧美激情综合在线| 亚洲一区精品在线| 欧美中文字幕一二三区视频| 亚洲18色成人| 香蕉影视欧美成人| 91色porny蝌蚪| 国产精品女主播av| 美女视频黄a大片欧美| 欧美人xxxx| 亚洲mv在线观看| 3d动漫精品啪啪1区2区免费 | 久久久国产精华| 成人精品视频.| 色哟哟国产精品免费观看| 亚洲国产成人自拍| 国产凹凸在线观看一区二区| 欧美变态tickle挠乳网站| 日本中文字幕不卡| 777久久久精品| 久久久久久亚洲综合影院红桃| 国产99一区视频免费| 国产片一区二区| 99re亚洲国产精品| 亚洲国产日韩综合久久精品| 欧美日韩一区二区三区不卡 | 日韩欧美一级片| 久久精品国产秦先生| 亚洲女人****多毛耸耸8| 成人性生交大片免费看在线播放 | 久久久久国产精品麻豆| 国产精品69久久久久水密桃| 亚洲欧洲精品一区二区三区| 制服丝袜日韩国产| 国产精一区二区三区| 亚洲观看高清完整版在线观看| 久久综合av免费| 成人18视频在线播放| 久久午夜国产精品| 色综合天天天天做夜夜夜夜做| 亚洲成av人影院| 国产精品美女一区二区在线观看| 国产三级精品视频| 午夜精品久久久久久久99水蜜桃 | 久久精品一级爱片| 国产一区福利在线| 亚洲国产高清在线观看视频| av一区二区三区| 亚洲一区二区免费视频| 欧美精品三级在线观看| 蜜臀久久99精品久久久久久9| 久久久五月婷婷| aaa欧美大片| 亚洲成a人片在线观看中文| 欧美一区二区三区成人| 国产在线精品视频| 亚洲人成网站色在线观看| 成人激情小说乱人伦| 国产伦精一区二区三区| 五月激情综合婷婷| 亚洲免费视频成人| 国产精品久久久久久久久免费樱桃 | 在线精品视频免费播放| 国产乱对白刺激视频不卡| 免费观看久久久4p| 图片区小说区区亚洲影院| 亚洲一卡二卡三卡四卡无卡久久| 亚洲色图欧洲色图| 亚洲日本在线a| 亚洲激情在线播放| 日日摸夜夜添夜夜添精品视频| 亚洲男帅同性gay1069| 亚洲综合免费观看高清完整版 | 久久久久国产一区二区三区四区| 一本大道久久a久久精二百 | 福利一区二区在线观看| 日韩午夜激情av| 亚洲欧美色图小说| 欧美一区二区视频观看视频| 欧美人妇做爰xxxⅹ性高电影| 国产精品一区二区无线| 亚洲国产精品一区二区久久恐怖片| 日韩视频免费观看高清完整版| 成人黄色免费短视频| 五月婷婷久久丁香| 中文字幕第一区综合| 欧美一三区三区四区免费在线看| 亚洲韩国精品一区| 日韩精品乱码av一区二区| 精品一区二区三区不卡| 成人av在线看| 欧美一区二区性放荡片| 亚洲精品在线免费播放| 亚洲色图一区二区三区| 日韩国产一二三区| 国产成人精品亚洲777人妖| 日本精品裸体写真集在线观看| 91精品国产综合久久久久久| 美日韩一区二区| 中文字幕五月欧美| 不卡视频在线看| 中文一区在线播放| 精品精品欲导航| 精品视频一区三区九区| 99久久综合国产精品| 国产精品456| 老司机精品视频在线| 午夜久久久影院| 亚洲激情五月婷婷| 中文字幕一区免费在线观看| 久久综合五月天婷婷伊人| 日韩欧美不卡一区| 欧美日韩国产系列| 欧洲一区在线观看| 91丝袜美腿高跟国产极品老师| 国产一区二区毛片| 美女视频网站久久| 免费精品99久久国产综合精品| 亚洲国产婷婷综合在线精品| 亚洲精品国产视频| 亚洲久本草在线中文字幕| 亚洲欧美怡红院| 国产精品国产馆在线真实露脸 | 精品国免费一区二区三区|