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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? gameswf_button.cpp

?? 一個(gè)開(kāi)源的嵌入式flash播放器的源代碼
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
// gameswf_button.cpp	-- Thatcher Ulrich <tu@tulrich.com> 2003// This source code has been donated to the Public Domain.  Do// whatever you want with it.// SWF buttons.  Mouse-sensitive update/display, actions, etc.#include "gameswf_button.h"#include "gameswf_action.h"#include "gameswf_render.h"#include "gameswf_sound.h"#include "gameswf_stream.h"/*Observations about button & mouse behaviorEntities that receive mouse events: only buttons and sprites, AFAIKWhen the mouse button goes down, it becomes "captured" by whateverelement is topmost, directly below the mouse at that moment.  Whilethe mouse is captured, no other entity receives mouse events,regardless of how the mouse or other elements move.The mouse remains captured until the mouse button goes up.  The mouseremains captured even if the element that captured it is removed fromthe display list.If the mouse isn't above a button or sprite when the mouse button goesdown, then the mouse is captured by the background (i.e. mouse eventsjust don't get sent, until the mouse button goes up again).Mouse events:+------------------+---------------+-------------------------------------+| Event            | Mouse Button  | description                         |=========================================================================| onRollOver       |     up        | sent to topmost entity when mouse   ||                  |               | cursor initially goes over it       |+------------------+---------------+-------------------------------------+| onRollOut        |     up        | when mouse leaves entity, after     ||                  |               | onRollOver                          |+------------------+---------------+-------------------------------------+| onPress          |  up -> down   | sent to topmost entity when mouse   ||                  |               | button goes down.  onRollOver       ||                  |               | always precedes onPress.  Initiates ||                  |               | mouse capture.                      |+------------------+---------------+-------------------------------------+| onRelease        |  down -> up   | sent to active entity if mouse goes ||                  |               | up while over the element           |+------------------+---------------+-------------------------------------+| onDragOut        |     down      | sent to active entity if mouse      ||                  |               | is no longer over the entity        |+------------------+---------------+-------------------------------------+| onReleaseOutside |  down -> up   | sent to active entity if mouse goes ||                  |               | up while not over the entity.       ||                  |               | onDragOut always precedes           ||                  |               | onReleaseOutside                    |+------------------+---------------+-------------------------------------+| onDragOver       |     down      | sent to active entity if mouse is   ||                  |               | dragged back over it after          ||                  |               | onDragOut                           |+------------------+---------------+-------------------------------------+There is always one active entity at any given time (considering NULL tobe an active entity, representing the background, and other objects thatdon't receive mouse events).When the mouse button is up, the active entity is the topmost elementdirectly under the mouse pointer.When the mouse button is down, the active entity remains whatever itwas when the button last went down.The active entity is the only object that receives mouse events.!!! The "trackAsMenu" property alters this behavior!  If trackAsMenuis set on the active entity, then onReleaseOutside is filtered out,and onDragOver from another entity is allowed (from the background, oranother trackAsMenu entity). !!!Pseudocode:active_entity = NULLmouse_button_state = UPmouse_inside_entity_state = falseframe loop:  if mouse_button_state == DOWN    // Handle trackAsMenu    if (active_entity->trackAsMenu)      possible_entity = topmost entity below mouse      if (possible_entity != active_entity && possible_entity->trackAsMenu)        // Transfer to possible entity	active_entity = possible_entity	active_entity->onDragOver()	mouse_inside_entity_state = true;    // Handle onDragOut, onDragOver    if (mouse_inside_entity_state == false)      if (mouse is actually inside the active_entity)        // onDragOver	active_entity->onDragOver()        mouse_inside_entity_state = true;    else // mouse_inside_entity_state == true      if (mouse is actually outside the active_entity)        // onDragOut	active_entity->onDragOut()	mouse_inside_entity_state = false;    // Handle onRelease, onReleaseOutside    if (mouse button is up)      if (mouse_inside_entity_state)        // onRelease        active_entity->onRelease()      else        // onReleaseOutside	if (active_entity->trackAsMenu == false)          active_entity->onReleaseOutside()      mouse_button_state = UP      if mouse_button_state == UP    new_active_entity = topmost entity below the mouse    if (new_active_entity != active_entity)      // onRollOut, onRollOver      active_entity->onRollOut()      active_entity = new_active_entity      active_entity->onRollOver()        // Handle press    if (mouse button is down)      // onPress      active_entity->onPress()      mouse_inside_entity_state = true      mouse_button_state = DOWN*/namespace gameswf{	void	generate_mouse_button_events(mouse_button_state* ms)	{		smart_ptr<movie>	active_entity = ms->m_active_entity;		smart_ptr<movie>	topmost_entity = ms->m_topmost_entity;		if (ms->m_mouse_button_state_last == 1)		{			// Mouse button was down.			// Handle trackAsMenu dragOver			if (active_entity == NULL			    || active_entity->get_track_as_menu())			{				if (topmost_entity != NULL				    && topmost_entity != active_entity				    && topmost_entity->get_track_as_menu() == true)				{					// Transfer to topmost entity, dragOver					active_entity = topmost_entity;					active_entity->on_button_event(event_id::DRAG_OVER);					ms->m_mouse_inside_entity_last = true;				}			}			// Handle onDragOut, onDragOver			if (ms->m_mouse_inside_entity_last == false)			{				if (topmost_entity == active_entity)				{					// onDragOver					if (active_entity != NULL)					{						active_entity->on_button_event(event_id::DRAG_OVER);					}					ms->m_mouse_inside_entity_last = true;				}			}			else			{				// mouse_inside_entity_last == true				if (topmost_entity != active_entity)				{					// onDragOut					if (active_entity != NULL)					{						active_entity->on_button_event(event_id::DRAG_OUT);					}					ms->m_mouse_inside_entity_last = false;				}			}			// Handle onRelease, onReleaseOutside			if (ms->m_mouse_button_state_current == 0)			{				// Mouse button just went up.				ms->m_mouse_button_state_last = 0;				if (active_entity != NULL)				{					if (ms->m_mouse_inside_entity_last)					{						// onRelease						active_entity->on_button_event(event_id::RELEASE);					}					else					{						// onReleaseOutside						if (active_entity->get_track_as_menu() == false)						{							active_entity->on_button_event(event_id::RELEASE_OUTSIDE);						}					}				}			}		}    		if (ms->m_mouse_button_state_last == 0)		{			// Mouse button was up.			// New active entity is whatever is below the mouse right now.			if (topmost_entity != active_entity)			{				// onRollOut				if (active_entity != NULL)				{					active_entity->on_button_event(event_id::ROLL_OUT);				}				active_entity = topmost_entity;				// onRollOver				if (active_entity != NULL)				{					active_entity->on_button_event(event_id::ROLL_OVER);				}				ms->m_mouse_inside_entity_last = true;			}    			// mouse button press			if (ms->m_mouse_button_state_current == 1)			{				// onPress				if (active_entity != NULL)				{					active_entity->on_button_event(event_id::PRESS);				}				ms->m_mouse_inside_entity_last = true;				ms->m_mouse_button_state_last = 1;			}		}		// Write the (possibly modified) smart_ptr copies back		// into the state struct.		ms->m_active_entity = active_entity;		ms->m_topmost_entity = topmost_entity;	}	struct button_character_instance : public character	{		button_character_definition*	m_def;		array< smart_ptr<character> >	m_record_character;		enum mouse_flags		{			IDLE = 0,			FLAG_OVER = 1,			FLAG_DOWN = 2,			OVER_DOWN = FLAG_OVER|FLAG_DOWN,			// aliases			OVER_UP = FLAG_OVER,			OUT_DOWN = FLAG_DOWN		};		int	m_last_mouse_flags, m_mouse_flags;		enum e_mouse_state		{			UP = 0,			DOWN,			OVER		};		e_mouse_state m_mouse_state;		button_character_instance(button_character_definition* def, movie* parent, int id)			:			character(parent, id),			m_def(def),			m_last_mouse_flags(IDLE),			m_mouse_flags(IDLE),			m_mouse_state(UP)		{			assert(m_def);			int r, r_num =  m_def->m_button_records.size();			m_record_character.resize(r_num);			movie_definition_sub*	movie_def = static_cast<movie_definition_sub*>(				parent->get_root_movie()->get_movie_definition());			for (r = 0; r < r_num; r++)			{				button_record*	bdef = &m_def->m_button_records[r];				if (bdef->m_character_def == NULL)				{					// Resolve the character id.					bdef->m_character_def = movie_def->get_character_def(bdef->m_character_id);				}				assert(bdef->m_character_def != NULL);				const matrix&	mat = m_def->m_button_records[r].m_button_matrix;				const cxform&	cx = m_def->m_button_records[r].m_button_cxform;				smart_ptr<character>	ch = bdef->m_character_def->create_character_instance(this, id);				m_record_character[r] = ch;				ch->set_matrix(mat);				ch->set_cxform(cx);				ch->restart();			}		}		~button_character_instance()		{		}		movie_root*	get_root() { return get_parent()->get_root(); }		movie*	get_root_movie() { return get_parent()->get_root_movie(); }		void	restart()		{			m_last_mouse_flags = IDLE;			m_mouse_flags = IDLE;			m_mouse_state = UP;			int r, r_num =  m_record_character.size();			for (r = 0; r < r_num; r++)			{				m_record_character[r]->restart();			}		}		virtual void	advance(float delta_time)		{			// Implement mouse-drag.			character::do_mouse_drag();			matrix	mat = get_world_matrix();			// Advance our relevant characters.			{for (int i = 0; i < m_def->m_button_records.size(); i++)			{				button_record&	rec = m_def->m_button_records[i];				if (m_record_character[i] == NULL)				{					continue;				}				// Matrix				matrix sub_matrix = mat;				sub_matrix.concatenate(rec.m_button_matrix);				// Advance characters that are activated by the new mouse state				if (((m_mouse_state == UP) && (rec.m_up)) ||				    ((m_mouse_state == DOWN) && (rec.m_down)) ||				    ((m_mouse_state == OVER) && (rec.m_over)))				{					m_record_character[i]->advance(delta_time);				}			}}		}		void	display()		{			for (int i = 0; i < m_def->m_button_records.size(); i++)			{				button_record&	rec = m_def->m_button_records[i];				if (m_record_character[i] == NULL)				{					continue;				}				if ((m_mouse_state == UP && rec.m_up)				    || (m_mouse_state == DOWN && rec.m_down)				    || (m_mouse_state == OVER && rec.m_over))				{					m_record_character[i]->display();				}			}			do_display_callback();		}		inline int	transition(int a, int b) const		// Combine the flags to avoid a conditional. It would be faster with a macro.		{			return (a << 2) | b;		}		virtual movie*	get_topmost_mouse_entity(float x, float y)		// Return the topmost entity that the given point covers.  NULL if none.		// I.e. check against ourself.		{			if (get_visible() == false) {				return false;			}			matrix	m = get_matrix();			point	p;			m.transform_by_inverse(&p, point(x, y));			{for (int i = 0; i < m_def->m_button_records.size(); i++)			{				button_record&	rec = m_def->m_button_records[i];				if (rec.m_character_id < 0 || rec.m_hit_test == false)				{					continue;				}				// Find the mouse position in button-record space.				point	sub_p;				rec.m_button_matrix.transform_by_inverse(&sub_p, p);				if (rec.m_character_def->point_test_local(sub_p.m_x, sub_p.m_y))				{					// The mouse is inside the shape.					return this;					// @@ Are there any circumstances where this is correct:					//return m_record_character[i].get_ptr();				}			}}			return NULL;		}		virtual void	on_button_event(event_id event)		{			// Set our mouse state (so we know how to render).			switch (event.m_id)			{			case event_id::ROLL_OUT:			case event_id::RELEASE_OUTSIDE:				m_mouse_state = UP;				break;			case event_id::RELEASE:			case event_id::ROLL_OVER:			case event_id::DRAG_OUT:				m_mouse_state = OVER;				break;			case event_id::PRESS:			case event_id::DRAG_OVER:				m_mouse_state = DOWN;				break;			default:				assert(0);	// missed a case?				break;			};			// Button transition sounds.			if (m_def->m_sound != NULL)			{				int bi; // button sound array index [0..3]				sound_handler* s = get_sound_handler();				// Check if there is a sound handler				if (s != NULL) {					switch (event.m_id)					{					case event_id::ROLL_OUT:						bi = 0;						break;					case event_id::ROLL_OVER:						bi = 1;						break;					case event_id::PRESS:						bi = 2;						break;					case event_id::RELEASE:						bi = 3;						break;					default:						bi = -1;						break;					}					if (bi >= 0)					{						button_character_definition::button_sound_info& bs = m_def->m_sound->m_button_sounds[bi];						// character zero is considered as null character						if (bs.m_sound_id > 0)						{							assert(m_def->m_sound->m_button_sounds[bi].m_sam != NULL);							if (bs.m_sound_style.m_stop_playback)

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
爽好多水快深点欧美视频| 欧美裸体bbwbbwbbw| 成人午夜在线视频| 制服丝袜亚洲精品中文字幕| 国产精品卡一卡二卡三| 免费av成人在线| 欧美撒尿777hd撒尿| 久久久久久麻豆| 蜜臀久久99精品久久久画质超高清| av在线播放一区二区三区| 日韩欧美国产精品| 亚洲综合在线电影| 国产成人亚洲综合a∨婷婷图片| 91精品国产一区二区人妖| 亚洲免费观看高清完整版在线| 狠狠色综合色综合网络| 欧美高清精品3d| 亚洲综合视频在线| 91在线视频网址| 中文字幕亚洲不卡| 国产精品中文字幕日韩精品| 日韩精品一区二区三区视频在线观看| 亚洲综合在线视频| 日本道色综合久久| 亚洲精品乱码久久久久| 99re6这里只有精品视频在线观看| 精品av综合导航| 韩国三级在线一区| 精品国产凹凸成av人网站| 蜜臀av性久久久久蜜臀aⅴ流畅 | 日韩欧美aaaaaa| 亚洲午夜免费视频| 欧美中文字幕一区二区三区 | 久久精品国产亚洲高清剧情介绍 | 久久精品一区二区三区四区| 精品在线亚洲视频| 精品va天堂亚洲国产| 国产乱色国产精品免费视频| 2023国产精品自拍| 高清在线观看日韩| 亚洲色图19p| 色久综合一二码| 亚洲电影一区二区三区| 欧美剧在线免费观看网站| 免费一级片91| 中文字幕乱码久久午夜不卡 | 国产乱子伦视频一区二区三区| 精品国产制服丝袜高跟| 国产精品99久| 亚洲免费在线播放| 正在播放亚洲一区| 狠狠色狠狠色合久久伊人| 国产亚洲va综合人人澡精品| 成人av网站在线观看| 洋洋av久久久久久久一区| 欧美一级一区二区| 国产成人精品午夜视频免费| 国产精品国产三级国产普通话三级 | 欧美一区二区三区在线观看| 美洲天堂一区二卡三卡四卡视频| 久久久久久久性| 91久久精品国产91性色tv| 日韩中文字幕不卡| 国产精品嫩草影院com| 欧美在线短视频| 国产一区二区在线免费观看| 日韩理论片中文av| 日韩一区二区在线观看视频播放| 国产精品18久久久久久久网站| 亚洲美女视频在线| 日韩欧美的一区二区| 99久久精品国产麻豆演员表| 日韩**一区毛片| 亚洲精品久久嫩草网站秘色| 精品久久久久久综合日本欧美| 成人h动漫精品| 美女www一区二区| 亚洲激情男女视频| 久久久久久久久久久久电影| 欧美亚洲愉拍一区二区| 国产精品88888| 日韩成人dvd| 亚洲精品乱码久久久久久久久| 精品国产免费一区二区三区四区 | 国产精品99久久久久久似苏梦涵 | 亚洲精品综合在线| 国产日韩影视精品| 欧美v日韩v国产v| 欧美性猛片aaaaaaa做受| 国产成人在线视频免费播放| 日韩在线一区二区三区| 亚洲欧美日韩中文字幕一区二区三区 | 久久精品国内一区二区三区| 亚洲女子a中天字幕| 国产婷婷色一区二区三区在线| 91精品国产综合久久精品| 91国偷自产一区二区三区观看| 高清不卡一区二区| 国产成人综合网| 国产一区二区三区四| 麻豆国产精品官网| 免费国产亚洲视频| 蜜桃av一区二区| 日产国产高清一区二区三区| 亚洲丰满少妇videoshd| 亚洲国产精品嫩草影院| 伊人性伊人情综合网| 樱花草国产18久久久久| 一区二区三区在线免费播放| 国产精品久久久一本精品| 中文字幕av一区二区三区| 国产精品视频免费| 国产精品久久久久永久免费观看 | 亚洲已满18点击进入久久| 亚洲欧美日韩国产成人精品影院| 国产精品毛片大码女人 | 久久色中文字幕| 精品久久久久99| 久久亚区不卡日本| 久久久天堂av| 国产欧美一区二区在线| 日本一区二区视频在线| 亚洲精品一区二区三区蜜桃下载| 精品黑人一区二区三区久久| 亚洲精品一区二区三区99| 久久精品亚洲一区二区三区浴池| 国产三级欧美三级日产三级99 | 精品一区二区三区蜜桃| 国产剧情av麻豆香蕉精品| 丰满亚洲少妇av| bt7086福利一区国产| 欧美亚男人的天堂| 欧美一区二区精品久久911| 精品久久99ma| 国产精品免费视频一区| 一区二区免费在线| 视频一区视频二区中文字幕| 另类人妖一区二区av| 成人av中文字幕| 欧美日韩一区二区三区视频| 日韩久久久精品| 99精品视频一区| 国产一区二三区好的| aaa亚洲精品一二三区| 欧美日韩一级二级三级| 欧美疯狂性受xxxxx喷水图片| 久久久99精品久久| 亚洲欧美电影院| 久久99精品久久久久久国产越南| 成人夜色视频网站在线观看| 91久久奴性调教| 国产亚洲一区二区三区四区| 亚洲精品国产一区二区精华液| 日本成人在线网站| 99久久精品国产一区二区三区| 欧美色图激情小说| 欧美激情一区在线| 日韩**一区毛片| 99r国产精品| 久久综合久久综合九色| 一区二区三区视频在线看| 久久草av在线| 欧美日韩一区成人| 专区另类欧美日韩| 精品无人区卡一卡二卡三乱码免费卡 | 久久久久久夜精品精品免费| 自拍偷自拍亚洲精品播放| 国内精品在线播放| 欧美天天综合网| 综合激情成人伊人| 国产成人午夜精品5599| 欧美一级欧美三级在线观看| 亚洲黄色小视频| 91视频xxxx| 中文字幕一区三区| 精品夜夜嗨av一区二区三区| 欧美日韩成人综合在线一区二区 | 成人av在线观| 国产亚洲精品aa午夜观看| 热久久久久久久| 日韩一区二区在线观看| 日本午夜一区二区| 国产亚洲一区二区在线观看| 麻豆国产欧美日韩综合精品二区 | 精品伊人久久久久7777人| 欧美日韩在线播放| 美女免费视频一区| 欧美成人video| 夫妻av一区二区| 亚洲精品高清在线| 欧美日韩中字一区| 麻豆视频一区二区| 中文一区二区完整视频在线观看| av中文字幕一区| 亚洲第一激情av| 精品日本一线二线三线不卡| 91美女在线视频| 国产成人在线视频网站| 国产一区不卡在线| 最新热久久免费视频|