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

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

?? gameswf_impl.cpp

?? 一個開源的嵌入式flash播放器的源代碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
// gameswf_impl.cpp	-- Thatcher Ulrich <tu@tulrich.com> 2003// This source code has been donated to the Public Domain.  Do// whatever you want with it.// Some implementation for SWF player.// Useful links://// http://sswf.sourceforge.net/SWFalexref.html// http://www.openswf.org// @@ Need to break this file into pieces#include "base/tu_file.h"#include "base/utility.h"#include "gameswf_action.h"#include "gameswf_button.h"#include "gameswf_impl.h"#include "gameswf_font.h"#include "gameswf_fontlib.h"#include "gameswf_log.h"#include "gameswf_morph2.h"#include "gameswf_render.h"#include "gameswf_shape.h"#include "gameswf_stream.h"#include "gameswf_styles.h"#include "gameswf_dlist.h"#include "gameswf_timers.h"#include "base/image.h"#include "base/jpeg.h"#include "base/zlib_adapter.h"#include <string.h>	// for memset#include <typeinfo>#include <float.h>#if TU_CONFIG_LINK_TO_ZLIB#include <zlib.h>#endif // TU_CONFIG_LINK_TO_ZLIBnamespace gameswf{	bool	s_verbose_action = false;	bool	s_verbose_parse = false;#ifndef NDEBUG	bool	s_verbose_debug = true;#else	bool	s_verbose_debug = false;#endif	void	set_verbose_action(bool verbose)	// Enable/disable log messages re: actions.	{		s_verbose_action = verbose;	}	void	set_verbose_parse(bool verbose)	// Enable/disable log messages re: parsing the movie.	{		s_verbose_parse = verbose;	}	static bool	s_use_cache_files = true;	void	set_use_cache_files(bool use_cache)	// Enable/disable attempts to read cache files when loading	// movies.	{		s_use_cache_files = use_cache;	}	// Keep a table of loader functions for the different tag types.	static hash<int, loader_function>	s_tag_loaders;	void	register_tag_loader(int tag_type, loader_function lf)	// Associate the specified tag type with the given tag loader	// function.	{		assert(s_tag_loaders.get(tag_type, NULL) == false);		assert(lf != NULL);		s_tag_loaders.add(tag_type, lf);	}	//	// file_opener callback stuff	//	static file_opener_callback	s_opener_function = NULL;	void	register_file_opener_callback(file_opener_callback opener)	// Host calls this to register a function for opening files,	// for loading movies.	{		s_opener_function = opener;	}	//	// progress callback stuff (from Vitaly)	//	static progress_callback	s_progress_function = NULL;	void	register_progress_callback(progress_callback progress_handle)	// Host calls this to register a function for progress bar handling	// during loading movies.	{		s_progress_function = progress_handle;	}		//	// some utility stuff	//	static void	execute_actions(as_environment* env, const array<action_buffer*>& action_list)	// Execute the actions in the action list, in the given	// environment.	{		for (int i = 0; i < action_list.size(); i++)		{			action_list[i]->execute(env);		}	}	static void	dump_tag_bytes(stream* in)	// Log the contents of the current tag, in hex.	{		static const int	ROW_BYTES = 16;		char	row_buf[ROW_BYTES];		int	row_count = 0;		while(in->get_position() < in->get_tag_end_position())		{			int	c = in->read_u8();			log_msg("%02X", c);			if (c < 32) c = '.';			if (c > 127) c = '.';			row_buf[row_count] = c;						row_count++;			if (row_count >= ROW_BYTES)			{				log_msg("    ");				for (int i = 0; i < ROW_BYTES; i++)				{					log_msg("%c", row_buf[i]);				}				log_msg("\n");				row_count = 0;			}			else			{				log_msg(" ");			}		}		if (row_count > 0)		{			log_msg("\n");		}	}	character*	character_def::create_character_instance(movie* parent, int id)	// Default.  Make a generic_character.	{		return new generic_character(this, parent, id);	}	//	// ref_counted	//	ref_counted::ref_counted()		:		m_ref_count(0),		m_weak_proxy(0)	{	}	ref_counted::~ref_counted()	{		assert(m_ref_count == 0);		if (m_weak_proxy)		{			m_weak_proxy->notify_object_died();			m_weak_proxy->drop_ref();		}	}	void	ref_counted::add_ref() const	{		assert(m_ref_count >= 0);		m_ref_count++;	}	void	ref_counted::drop_ref() const	{		assert(m_ref_count > 0);		m_ref_count--;		if (m_ref_count <= 0)		{			// Delete me!			delete this;		}	}	weak_proxy* ref_counted::get_weak_proxy() const	{		assert(m_ref_count > 0);	// By rights, somebody should be holding a ref to us.		if (m_weak_proxy == NULL)		{			m_weak_proxy = new weak_proxy;			m_weak_proxy->add_ref();		}		return m_weak_proxy;	}	//	// character	//	void	character::do_mouse_drag()	// Implement mouse-dragging for this movie.	{		drag_state	st;		get_drag_state(&st);		if (this == st.m_character)		{			// We're being dragged!			int	x, y, buttons;			get_root_movie()->get_mouse_state(&x, &y, &buttons);			point	world_mouse(PIXELS_TO_TWIPS(x), PIXELS_TO_TWIPS(y));			if (st.m_bound)			{				// Clamp mouse coords within a defined rect.				world_mouse.m_x =					fclamp(world_mouse.m_x, st.m_bound_x0, st.m_bound_x1);				world_mouse.m_y =					fclamp(world_mouse.m_y, st.m_bound_y0, st.m_bound_y1);			}			if (st.m_lock_center)			{				matrix	world_mat = get_world_matrix();				point	local_mouse;				world_mat.transform_by_inverse(&local_mouse, world_mouse);				matrix	parent_world_mat;				if (m_parent)				{					parent_world_mat = m_parent->get_world_matrix();				}				point	parent_mouse;				parent_world_mat.transform_by_inverse(&parent_mouse, world_mouse);									// Place our origin so that it coincides with the mouse coords				// in our parent frame.				matrix	local = get_matrix();				local.m_[0][2] = parent_mouse.m_x;				local.m_[1][2] = parent_mouse.m_y;				set_matrix(local);			}			else			{				// Implement relative drag...			}		}	}	//	// Helper for movie_def_impl	//	struct import_info	{		tu_string	m_source_url;		int	        m_character_id;		tu_string	m_symbol;		import_info()			:			m_character_id(-1)		{		}		import_info(const char* source, int id, const char* symbol)			:			m_source_url(source),			m_character_id(id),			m_symbol(symbol)		{		}	};	//	// movie_def_impl	//	// This class holds the immutable definition of a movie's	// contents.  It cannot be played directly, and does not hold	// current state; for that you need to call create_instance()	// to get a movie_instance.	//	struct movie_def_impl : public movie_definition_sub	{		hash<int, smart_ptr<character_def> >	m_characters;		hash<int, smart_ptr<font> >	 m_fonts;		hash<int, smart_ptr<bitmap_character_def> >	m_bitmap_characters;		hash<int, smart_ptr<sound_sample> >	m_sound_samples;		array<array<execute_tag*> >	   m_playlist;	// A list of movie control events for each frame.		array<array<execute_tag*> >	   m_init_action_list;	// Init actions for each frame.		stringi_hash<int>	           m_named_frames;	// 0-based frame #'s		stringi_hash<smart_ptr<resource> > m_exports;		// Items we import.		array<import_info>	m_imports;		// Movies we import from; hold a ref on these, to keep them alive		array<smart_ptr<movie_definition> >	m_import_source_movies;		// Bitmaps used in this movie; collected in one place to make		// it possible for the host to manage them as textures.		array<smart_ptr<bitmap_info> >	m_bitmap_list;		create_bitmaps_flag	m_create_bitmaps;		create_font_shapes_flag	m_create_font_shapes;		rect	m_frame_size;		float	m_frame_rate;		int	m_frame_count;		int	m_version;		int	m_loading_frame;		uint32	m_file_length;		jpeg::input*	m_jpeg_in;		movie_def_impl(create_bitmaps_flag cbf, create_font_shapes_flag cfs)			:			m_create_bitmaps(cbf),			m_create_font_shapes(cfs),			m_frame_rate(30.0f),			m_frame_count(0),			m_version(0),			m_loading_frame(0),			m_jpeg_in(0)		{		}		~movie_def_impl()		{			// Release our playlist data.			{for (int i = 0, n = m_playlist.size(); i < n; i++)			{				for (int j = 0, m = m_playlist[i].size(); j < m; j++)				{					delete m_playlist[i][j];				}			}}			// Release init action data.			{for (int i = 0, n = m_init_action_list.size(); i < n; i++)			{				for (int j = 0, m = m_init_action_list[i].size(); j < m; j++)				{					delete m_init_action_list[i][j];				}			}}			assert(m_jpeg_in == NULL);	// It's supposed to be cleaned up in read()		}		movie_interface*	create_instance();		// ...		int	get_frame_count() const { return m_frame_count; }		float	get_frame_rate() const { return m_frame_rate; }		float	get_width_pixels() const { return ceilf(TWIPS_TO_PIXELS(m_frame_size.width())); }		float	get_height_pixels() const { return ceilf(TWIPS_TO_PIXELS(m_frame_size.height())); }		virtual int	get_version() const { return m_version; }		virtual int	get_loading_frame() const { return m_loading_frame; }		uint32	get_file_bytes() const { return m_file_length; }		/* movie_def_impl */		virtual create_bitmaps_flag	get_create_bitmaps() const		// Returns DO_CREATE_BITMAPS if we're supposed to		// initialize our bitmap infos, or DO_NOT_INIT_BITMAPS		// if we're supposed to create blank placeholder		// bitmaps (to be init'd later explicitly by the host		// program).		{			return m_create_bitmaps;		}		/* movie_def_impl */		virtual create_font_shapes_flag	get_create_font_shapes() const		// Returns DO_LOAD_FONT_SHAPES if we're supposed to		// initialize our font shape info, or		// DO_NOT_LOAD_FONT_SHAPES if we're supposed to not		// create any (vector) font glyph shapes, and instead		// rely on precached textured fonts glyphs.		{			return m_create_font_shapes;		}		virtual void	add_bitmap_info(bitmap_info* bi)		// All bitmap_info's used by this movie should be		// registered with this API.		{			m_bitmap_list.push_back(bi);		}		virtual int	get_bitmap_info_count() const { return m_bitmap_list.size(); }		virtual bitmap_info*	get_bitmap_info(int i) const		{			return m_bitmap_list[i].get_ptr();		}		virtual void	export_resource(const tu_string& symbol, resource* res)		// Expose one of our resources under the given symbol,		// for export.  Other movies can import it.		{			// SWF sometimes exports the same thing more than once!			m_exports.set(symbol, res);		}		virtual smart_ptr<resource>	get_exported_resource(const tu_string& symbol)		// Get the named exported resource, if we expose it.		// Otherwise return NULL.		{			smart_ptr<resource>	res;			m_exports.get(symbol, &res);			return res;		}		virtual void	add_import(const char* source_url, int id, const char* symbol)		// Adds an entry to a table of resources that need to		// be imported from other movies.  Client code must		// call resolve_import() later, when the source movie		// has been loaded, so that the actual resource can be		// used.		{			assert(in_import_table(id) == false);			m_imports.push_back(import_info(source_url, id, symbol));		}		bool	in_import_table(int character_id)		// Debug helper; returns true if the given		// character_id is listed in the import table.		{			for (int i = 0, n = m_imports.size(); i < n; i++)			{				if (m_imports[i].m_character_id == character_id)				{					return true;				}			}			return false;		}		virtual void	visit_imported_movies(import_visitor* visitor)		// Calls back the visitor for each movie that we		// import symbols from.		{			stringi_hash<bool>	visited;	// ugh!			for (int i = 0, n = m_imports.size(); i < n; i++)			{				import_info&	inf = m_imports[i];				if (visited.find(inf.m_source_url) == visited.end())				{					// Call back the visitor.					visitor->visit(inf.m_source_url.c_str());					visited.set(inf.m_source_url, true);				}			}		}		virtual void	resolve_import(const char* source_url, movie_definition* source_movie)		// Grabs the stuff we want from the source movie.		{			// @@ should be safe, but how can we verify			// it?  Compare a member function pointer, or			// something?			movie_def_impl*	def_impl = static_cast<movie_def_impl*>(source_movie);			movie_definition_sub*	def = static_cast<movie_definition_sub*>(def_impl);			// Iterate in reverse, since we remove stuff along the way.			for (int i = m_imports.size() - 1; i >= 0; i--)			{				const import_info&	inf = m_imports[i];				if (inf.m_source_url == source_url)				{					// Do the import.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99视频超级精品| 91久久久免费一区二区| 亚洲国产成人tv| 亚洲免费在线电影| 国产精品欧美久久久久一区二区| 久久久不卡网国产精品二区| 精品黑人一区二区三区久久| 日韩三级精品电影久久久| 欧美一级免费大片| 日韩免费一区二区三区在线播放| 日韩免费电影一区| 久久一留热品黄| 欧美激情中文字幕一区二区| 亚洲色图另类专区| 五月开心婷婷久久| 久久99热这里只有精品| 国产夫妻精品视频| 91麻豆自制传媒国产之光| 色爱区综合激月婷婷| 在线播放中文一区| 精品99一区二区三区| 国产精品久久久久久久久晋中 | 日韩久久久久久| 精品欧美一区二区在线观看| 国产日韩欧美综合一区| 一片黄亚洲嫩模| 美女视频黄 久久| 成人黄色片在线观看| 欧美日韩在线三级| 久久视频一区二区| 亚洲视频免费观看| 视频一区国产视频| 国产精品456露脸| 一本久久综合亚洲鲁鲁五月天| 欧美色综合影院| 精品福利在线导航| 亚洲免费av网站| 久久99精品国产麻豆婷婷洗澡| 成人在线一区二区三区| 欧美色倩网站大全免费| 日本一区二区免费在线观看视频| 日韩毛片精品高清免费| 久久机这里只有精品| 色域天天综合网| 久久只精品国产| 午夜a成v人精品| 波多野洁衣一区| 欧美成人福利视频| 亚洲精品久久久久久国产精华液| 日本午夜一区二区| 99re这里都是精品| 精品国产乱码91久久久久久网站| 国产精品久久久久一区| 麻豆91在线观看| 欧美无砖专区一中文字| 中文字幕一区在线观看视频| 日本sm残虐另类| 欧美精品电影在线播放| 亚洲黄色免费网站| 99国产精品久久| 国产精品女同互慰在线看| 久久精工是国产品牌吗| 在线91免费看| 一区二区三区在线高清| 91一区二区在线观看| 国产精品毛片a∨一区二区三区| 精品一区二区三区不卡| 欧美放荡的少妇| 日韩高清不卡在线| 欧美日韩成人一区二区| 亚洲综合色网站| 99精品欧美一区二区蜜桃免费| 久久久精品tv| 国产福利一区二区三区视频在线| 欧美videossexotv100| 久久99蜜桃精品| 日韩一区二区三区在线观看| 免费人成精品欧美精品 | 欧美伊人久久久久久久久影院| 亚洲国产成人一区二区三区| 国产一区在线观看视频| 2022国产精品视频| 国产精品一卡二卡在线观看| 国产女人18毛片水真多成人如厕 | 91在线视频官网| 亚洲色欲色欲www在线观看| 91一区二区在线观看| 亚洲国产日韩a在线播放| 欧美视频一区二区| 麻豆国产欧美一区二区三区| 欧美成人精品二区三区99精品| 久久99精品国产麻豆婷婷| 久久蜜臀精品av| 91亚洲男人天堂| 亚洲一区二区三区四区在线观看| 欧美自拍偷拍一区| 水野朝阳av一区二区三区| 日韩视频一区在线观看| 国产在线乱码一区二区三区| 亚洲国产精华液网站w| 欧美在线影院一区二区| 日韩不卡一二三区| 欧美激情一区三区| 在线一区二区三区四区五区 | 国产一区二区调教| 国产精品久久久久三级| 欧美三电影在线| 国产一区二区久久| 亚洲午夜精品17c| 久久色视频免费观看| 91老司机福利 在线| 蜜桃91丨九色丨蝌蚪91桃色| 中文字幕乱码亚洲精品一区 | 欧美bbbbb| 国产精品狼人久久影院观看方式| 欧美久久久久免费| 国产成人av网站| 日韩中文字幕1| 亚洲欧美偷拍三级| 日韩免费观看高清完整版| 色婷婷综合久久久久中文 | 精品久久国产字幕高潮| 色香蕉成人二区免费| 经典三级一区二区| 亚洲一区二区视频在线观看| 26uuu另类欧美亚洲曰本| 欧美日韩亚洲不卡| 不卡av电影在线播放| 欧美aaaaaa午夜精品| 一区二区三区中文字幕电影| 久久久久国产一区二区三区四区| 欧美少妇一区二区| 91亚洲精品久久久蜜桃| 国产精品888| 免播放器亚洲一区| 图片区小说区区亚洲影院| 亚洲欧美激情小说另类| 国产日韩欧美a| 欧美成人a视频| 91精品国产色综合久久ai换脸 | 丰满少妇在线播放bd日韩电影| 亚洲国产精品影院| 亚洲综合小说图片| 亚洲精品视频在线看| 国产精品初高中害羞小美女文| 久久先锋影音av| 精品国产一区二区精华| 6080yy午夜一二三区久久| 欧美日韩精品一区二区三区四区| 一本大道av一区二区在线播放| 成人高清在线视频| 成人丝袜18视频在线观看| 国产剧情av麻豆香蕉精品| 久久精品国产精品亚洲精品| 久久成人麻豆午夜电影| 久久99国内精品| 久久成人久久爱| 国产精品资源站在线| 激情图区综合网| 成人综合婷婷国产精品久久免费| 国产麻豆精品在线| 国产精品亚洲午夜一区二区三区| 国产一区亚洲一区| 不卡av电影在线播放| 色综合婷婷久久| 精品1区2区3区| 91精品国产高清一区二区三区 | 久久综合九色欧美综合狠狠| 精品成a人在线观看| 日本一区二区三区免费乱视频| 国产精品午夜电影| 亚洲欧美色综合| 免费三级欧美电影| 丁香婷婷综合网| 在线观看日韩国产| 欧美一级片免费看| 国产精品久久久99| 亚洲一区二区精品3399| 青青国产91久久久久久| 国产精品亚洲综合一区在线观看| 99精品一区二区三区| 在线成人免费视频| 国产无一区二区| 亚洲综合免费观看高清完整版在线 | 亚洲综合色网站| 老司机午夜精品99久久| 99久久久免费精品国产一区二区 | 日韩写真欧美这视频| 国产亚洲一区二区三区四区| 亚洲视频一二三| 久久99精品久久久久| 色综合激情五月| 久久综合精品国产一区二区三区| 亚洲精品免费一二三区| 国产尤物一区二区在线| 欧美日韩另类一区| 久久精品一区二区三区av| 亚洲国产va精品久久久不卡综合| 精品一区二区三区免费播放| 欧美色视频在线|