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

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

?? gameswf_shape.cpp

?? 一個(gè)開源的嵌入式flash播放器的源代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號(hào):
						current_path.m_ay = y;					}					int	style = in->read_uint(num_line_bits);					if (style > 0)					{						style += line_base;					}					current_path.m_line = style;					if (SHAPE_LOG) IF_VERBOSE_PARSE(log_msg("  shape_character_read: line = %d\n", current_path.m_line));				}				if (flags & 0x10) {					assert(tag_type >= 22);					IF_VERBOSE_PARSE(log_msg("  shape_character read: more fill styles\n"));					// Store the current path if any.					if (! current_path.is_empty())					{						m_paths.push_back(current_path);						current_path.m_edges.resize(0);						// Clear styles.						current_path.m_fill0 = -1;						current_path.m_fill1 = -1;						current_path.m_line = -1;					}					// Tack on an empty path signalling a new shape.					// @@ need better understanding of whether this is correct??!?!!					// @@ i.e., we should just start a whole new shape here, right?					m_paths.push_back(path());					m_paths.back().m_new_shape = true;					fill_base = m_fill_styles.size();					line_base = m_line_styles.size();					read_fill_styles(&m_fill_styles, in, tag_type, m);					read_line_styles(&m_line_styles, in, tag_type);					num_fill_bits = in->read_uint(4);					num_line_bits = in->read_uint(4);				}			}			else			{				// EDGERECORD				int	edge_flag = in->read_uint(1);				if (edge_flag == 0)				{					// curved edge					int num_bits = 2 + in->read_uint(4);					float	cx = x + in->read_sint(num_bits);					float	cy = y + in->read_sint(num_bits);					float	ax = cx + in->read_sint(num_bits);					float	ay = cy + in->read_sint(num_bits);					if (SHAPE_LOG) IF_VERBOSE_PARSE(log_msg("  shape_character read: curved edge   = %4g %4g - %4g %4g - %4g %4g\n", x, y, cx, cy, ax, ay));					current_path.m_edges.push_back(edge(cx, cy, ax, ay));					x = ax;					y = ay;				}				else				{					// straight edge					int	num_bits = 2 + in->read_uint(4);					int	line_flag = in->read_uint(1);					float	dx = 0, dy = 0;					if (line_flag)					{						// General line.						dx = (float) in->read_sint(num_bits);						dy = (float) in->read_sint(num_bits);					}					else					{						int	vert_flag = in->read_uint(1);						if (vert_flag == 0) {							// Horizontal line.							dx = (float) in->read_sint(num_bits);						} else {							// Vertical line.							dy = (float) in->read_sint(num_bits);						}					}					if (SHAPE_LOG) IF_VERBOSE_PARSE(log_msg("  shape_character_read: straight edge = %4g %4g - %4g %4g\n", x, y, x + dx, y + dy));					current_path.m_edges.push_back(edge(x + dx, y + dy, x + dx, y + dy));					x += dx;					y += dy;				}			}		}	}	void	shape_character_def::display(character* inst)	// Draw the shape using our own inherent styles.	{		matrix	mat = inst->get_world_matrix();		cxform	cx = inst->get_world_cxform();		float	pixel_scale = inst->get_parent()->get_pixel_scale();		display(mat, cx, pixel_scale, m_fill_styles, m_line_styles);	}#ifdef DEBUG_DISPLAY_SHAPE_PATHS#include "base/ogl.h"	static void	point_normalize(point* p)	{		float	mag2 = p->m_x * p->m_x + p->m_y * p->m_y;		if (mag2 < 1e-9f)		{			// Very short vector.			// @@ log error			// Arbitrary unit vector.			p->m_x = 1;			p->m_y = 0;		}		float	inv_mag = 1.0f / sqrtf(mag2);		p->m_x *= inv_mag;		p->m_y *= inv_mag;	}	static void	show_fill_number(const point& p, int fill_number)	{		// We're inside a glBegin(GL_LINES)		// Eh, let's do it in binary, least sig four bits...		float	x = p.m_x;		float	y = p.m_y;		int	mask = 8;		while (mask)		{			if (mask & fill_number)			{				// Vert line --> 1.				glVertex2f(x, y - 40.0f);				glVertex2f(x, y + 40.0f);			}			else			{				// Rectangle --> 0.				glVertex2f(x - 10.0f, y - 40.0f);				glVertex2f(x + 10.0f, y - 40.0f);				glVertex2f(x + 10.0f, y - 40.0f);				glVertex2f(x + 10.0f, y + 40.0f);				glVertex2f(x - 10.0f, y + 40.0f);				glVertex2f(x + 10.0f, y + 40.0f);				glVertex2f(x - 10.0f, y - 40.0f);				glVertex2f(x - 10.0f, y + 40.0f);			}			x += 40.0f;			mask >>= 1;		}	}	static void	debug_display_shape_paths(		const matrix& mat,		float object_space_max_error,		const array<path>& paths,		const array<fill_style>& fill_styles,		const array<line_style>& line_styles)	{		for (int i = 0; i < paths.size(); i++)		{//			if (i > 0) break;//xxxxxxxx			const path&	p = paths[i];			if (p.m_fill0 == 0 && p.m_fill1 == 0)			{				continue;			}			gameswf::render::set_matrix(mat);			// Color the line according to which side has			// fills.			if (p.m_fill0 == 0) glColor4f(1, 0, 0, 0.5);			else if (p.m_fill1 == 0) glColor4f(0, 1, 0, 0.5);			else glColor4f(0, 0, 1, 0.5);			// Offset according to which loop we are.			float	offset_x = (i & 1) * 80.0f;			float	offset_y = ((i & 2) >> 1) * 80.0f;			glMatrixMode(GL_MODELVIEW);			glPushMatrix();			glTranslatef(offset_x, offset_y, 0.f);			point	pt;			glBegin(GL_LINE_STRIP);			mat.transform(&pt, point(p.m_ax, p.m_ay));			glVertex2f(pt.m_x, pt.m_y);			for (int j = 0; j < p.m_edges.size(); j++)			{				mat.transform(&pt, point(p.m_edges[j].m_cx, p.m_edges[j].m_cy));				glVertex2f(pt.m_x, pt.m_y);				mat.transform(&pt, point(p.m_edges[j].m_ax, p.m_edges[j].m_ay));				glVertex2f(pt.m_x, pt.m_y);			}			glEnd();			// Draw arrowheads.			point	dir, right, p0, p1;			glBegin(GL_LINES);			{for (int j = 0; j < p.m_edges.size(); j++)			{				mat.transform(&p0, point(p.m_edges[j].m_cx, p.m_edges[j].m_cy));				mat.transform(&p1, point(p.m_edges[j].m_ax, p.m_edges[j].m_ay));				dir = point(p1.m_x - p0.m_x, p1.m_y - p0.m_y);				point_normalize(&dir);				right = point(-dir.m_y, dir.m_x);	// perpendicular				const float	ARROW_MAG = 60.f;	// TWIPS?				if (p.m_fill0 != 0)				{					glColor4f(0, 1, 0, 0.5);					glVertex2f(p0.m_x,						   p0.m_y);					glVertex2f(p0.m_x - dir.m_x * ARROW_MAG - right.m_x * ARROW_MAG,						   p0.m_y - dir.m_y * ARROW_MAG - right.m_y * ARROW_MAG);					show_fill_number(point(p0.m_x - right.m_x * ARROW_MAG * 4,							       p0.m_y - right.m_y * ARROW_MAG * 4),							 p.m_fill0);				}				if (p.m_fill1 != 0)				{					glColor4f(1, 0, 0, 0.5);					glVertex2f(p0.m_x,						   p0.m_y);					glVertex2f(p0.m_x - dir.m_x * ARROW_MAG + right.m_x * ARROW_MAG,						   p0.m_y - dir.m_y * ARROW_MAG + right.m_y * ARROW_MAG);					show_fill_number(point(p0.m_x + right.m_x * ARROW_MAG * 4,							       p0.m_y + right.m_y * ARROW_MAG * 4),							 p.m_fill1);				}			}}			glEnd();			glPopMatrix();		}	}#endif // DEBUG_DISPLAY_SHAPE_PATHS			void	shape_character_def::display(		const matrix& mat,		const cxform& cx,		float pixel_scale,		const array<fill_style>& fill_styles,		const array<line_style>& line_styles) const	// Display our shape.  Use the fill_styles arg to	// override our default set of fill styles (e.g. when	// rendering text).	{		// Compute the error tolerance in object-space.		float	max_scale = mat.get_max_scale();		if (fabsf(max_scale) < 1e-6f)		{			// Scale is essentially zero.			return;		}		float	object_space_max_error = 20.0f / max_scale / pixel_scale * s_curve_max_pixel_error;#ifdef DEBUG_DISPLAY_SHAPE_PATHS		// Render a debug view of shape path outlines, instead		// of the tesselated shapes themselves.		if (gameswf_debug_show_paths)		{			debug_display_shape_paths(mat, object_space_max_error, m_paths, fill_styles, line_styles);			return;		}#endif // DEBUG_DISPLAY_SHAPE_PATHS		// See if we have an acceptable mesh available; if so then render with it.		for (int i = 0, n = m_cached_meshes.size(); i < n; i++)		{			const mesh_set*	candidate = m_cached_meshes[i];			if (object_space_max_error > candidate->get_error_tolerance() * 3.0f)			{				// Mesh is too high-res; the remaining meshes are higher res,				// so stop searching and build an appropriately scaled mesh.				break;			}			if (object_space_max_error > candidate->get_error_tolerance())			{				// Do it.				candidate->display(mat, cx, fill_styles, line_styles);				return;			}		}		// Construct a new mesh to handle this error tolerance.		mesh_set*	m = new mesh_set(this, object_space_max_error * 0.75f);		m_cached_meshes.push_back(m);		m->display(mat, cx, fill_styles, line_styles);				sort_and_clean_meshes();	}	static int	sort_by_decreasing_error(const void* A, const void* B)	{		const mesh_set*	a = *(const mesh_set**) A;		const mesh_set*	b = *(const mesh_set**) B;		if (a->get_error_tolerance() < b->get_error_tolerance())		{			return 1;		}		else if (a->get_error_tolerance() > b->get_error_tolerance())		{			return -1;		}		else		{			return 0;		}	}	void	shape_character_def::sort_and_clean_meshes() const	// Maintain cached meshes.  Clean out mesh_sets that haven't	// been used recently, and make sure they're sorted from high	// error to low error.	{		// Re-sort.		if (m_cached_meshes.size() > 0)		{			qsort(				&m_cached_meshes[0],				m_cached_meshes.size(),				sizeof(m_cached_meshes[0]),				sort_by_decreasing_error);			// Check to make sure the sort worked as intended.			#ifndef NDEBUG			for (int i = 0, n = m_cached_meshes.size() - 1; i < n; i++)			{				const mesh_set*	a = m_cached_meshes[i];				const mesh_set*	b = m_cached_meshes[i + 1];				assert(a->get_error_tolerance() > b->get_error_tolerance());			}			#endif // not NDEBUG		}	}			void	shape_character_def::tesselate(float error_tolerance, tesselate::trapezoid_accepter* accepter) const	// Push our shape data through the tesselator.	{		tesselate::begin_shape(accepter, error_tolerance);		for (int i = 0; i < m_paths.size(); i++)		{			if (m_paths[i].m_new_shape == true)			{				// Hm; should handle separate sub-shapes in a less lame way.				tesselate::end_shape();				tesselate::begin_shape(accepter, error_tolerance);			}			else			{				m_paths[i].tesselate();			}		}		tesselate::end_shape();	}	bool	shape_character_def::point_test_local(float x, float y)	// Return true if the specified point is on the interior of our shape.	// Incoming coords are local coords.	{		if (m_bound.point_test(x, y) == false)		{			// Early out.			return false;		}		// Try each of the paths.		for (int i = 0; i < m_paths.size(); i++)		{			if (m_paths[i].point_test(x, y))			{				return true;			}		}		return false;	}	float shape_character_def::get_height_local()	{		return m_bound.height();	}	float shape_character_def::get_width_local()	{		return m_bound.width();	}	void	shape_character_def::compute_bound(rect* r) const	// Find the bounds of this shape, and store them in	// the given rectangle.	{		r->m_x_min = 1e10f;		r->m_y_min = 1e10f;		r->m_x_max = -1e10f;		r->m_y_max = -1e10f;		for (int i = 0; i < m_paths.size(); i++)		{			const path&	p = m_paths[i];			r->expand_to_point(p.m_ax, p.m_ay);			for (int j = 0; j < p.m_edges.size(); j++)			{				r->expand_to_point(p.m_edges[j].m_ax, p.m_edges[j].m_ay);//					r->expand_to_point(p.m_edges[j].m_cx, p.m_edges[j].m_cy);			}		}	}	void	shape_character_def::output_cached_data(tu_file* out, const cache_options& options)	// Dump our precomputed mesh data to the given stream.	{		int	n = m_cached_meshes.size();		out->write_le32(n);		for (int i = 0; i < n; i++)		{			m_cached_meshes[i]->output_cached_data(out);		}	}	void	shape_character_def::input_cached_data(tu_file* in)	// Initialize our mesh data from the given stream.	{		int	n = in->read_le32();		m_cached_meshes.resize(n);		for (int i = 0; i < n; i++)		{			mesh_set*	ms = new mesh_set();			ms->input_cached_data(in);			m_cached_meshes[i] = ms;		}	}	}	// end namespace gameswf// Local Variables:// mode: C++// c-basic-offset: 8 // tab-width: 8// indent-tabs-mode: t// End:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲乱码国产乱码精品精的特点 | 秋霞av亚洲一区二区三| 精品国产一区二区在线观看| 黑人精品欧美一区二区蜜桃| 国产精品你懂的在线| 欧美色图片你懂的| 国产一区二区久久| 亚洲精品菠萝久久久久久久| 欧美一区二区在线看| 国产成人8x视频一区二区| 一区二区三区在线观看视频| 精品成人在线观看| 在线视频你懂得一区| 美腿丝袜亚洲综合| 亚洲人123区| 欧美日韩高清一区二区不卡| 成年人网站91| 国内一区二区视频| 亚洲在线免费播放| 国产精品麻豆视频| 精品乱人伦一区二区三区| 色综合婷婷久久| 国产一区二区久久| 一区二区三区精品在线| 国产精品久久久久久久第一福利| 欧美一区二区三区免费| 99热在这里有精品免费| 国产真实乱子伦精品视频| 午夜电影一区二区三区| 亚洲国产精品ⅴa在线观看| 欧美精品一区视频| 在线不卡中文字幕播放| 91首页免费视频| 国产精品自在欧美一区| 日本va欧美va精品| 一区二区国产视频| 中文字幕中文在线不卡住| 欧美精品一区二区蜜臀亚洲| 99re这里只有精品视频首页| 国产精品自拍三区| 激情综合色综合久久综合| 亚洲精品久久久蜜桃| 精品福利在线导航| 欧美亚洲自拍偷拍| 欧美视频中文字幕| 色美美综合视频| 99久久精品国产网站| 成人国产视频在线观看| 国产91丝袜在线观看| 国产精品一卡二卡| av男人天堂一区| 成人av一区二区三区| 丁香婷婷综合五月| 国产精品资源站在线| 国产激情精品久久久第一区二区| 久久成人18免费观看| 精一区二区三区| 免费av成人在线| 美女视频一区在线观看| 久久国产福利国产秒拍| 亚洲国产成人91porn| 亚洲电影激情视频网站| 午夜精品久久久久久不卡8050| 一区二区久久久久久| 亚洲成人先锋电影| 蜜桃在线一区二区三区| 国产成a人无v码亚洲福利| 99热这里都是精品| 欧美精品九九99久久| 久久综合九色欧美综合狠狠| 最好看的中文字幕久久| 爽好久久久欧美精品| 精品一区二区三区蜜桃| 成人激情开心网| 欧美精品自拍偷拍| 国产日韩欧美一区二区三区综合| 亚洲人成电影网站色mp4| 日韩国产精品久久久| 国产精品夜夜嗨| 在线免费观看日韩欧美| 精品国产不卡一区二区三区| 最好看的中文字幕久久| 美女mm1313爽爽久久久蜜臀| 99久久精品免费观看| 日韩精品一区二区三区蜜臀 | 国产精品对白交换视频| 午夜一区二区三区视频| 国产精品一区二区在线播放| 欧美在线观看你懂的| 国产亚洲综合av| 午夜天堂影视香蕉久久| 成人激情电影免费在线观看| 欧美一级高清大全免费观看| 中文字幕不卡在线观看| 美女免费视频一区| 欧美色图一区二区三区| 欧美国产成人精品| 久久国产成人午夜av影院| 色狠狠色噜噜噜综合网| 久久精品欧美日韩精品| 五月天婷婷综合| 色综合久久88色综合天天| 久久免费电影网| 欧美96一区二区免费视频| 99久久精品免费看国产| 久久精品一区二区三区不卡牛牛 | 4438亚洲最大| 亚洲精品菠萝久久久久久久| 国产精品一区专区| 日韩亚洲欧美综合| 午夜不卡av在线| 日本道精品一区二区三区| 国产精品美女一区二区三区| 精品在线亚洲视频| 欧美麻豆精品久久久久久| 国产精品国产三级国产三级人妇| 韩国精品一区二区| 日韩一区二区免费在线观看| 一区二区三区在线视频播放| 国产精品456露脸| 久久综合九色综合欧美就去吻| 丝袜亚洲另类丝袜在线| 欧美性生活一区| 亚洲欧美色综合| 成人av片在线观看| 国产精品亲子乱子伦xxxx裸| 老司机午夜精品99久久| 欧美一级黄色片| 麻豆高清免费国产一区| 日韩一区二区电影网| 美女在线视频一区| 欧美一二三区在线| 蜜臀av一级做a爰片久久| 正在播放亚洲一区| 午夜不卡av免费| 在线播放欧美女士性生活| 亚洲国产精品综合小说图片区| 91美女片黄在线观看91美女| 亚洲欧美激情在线| 色噜噜狠狠一区二区三区果冻| 亚洲精品日韩综合观看成人91| 日本精品视频一区二区| 一区二区三区在线观看视频| 在线观看成人免费视频| 亚洲妇女屁股眼交7| 欧美日韩夫妻久久| 激情综合一区二区三区| 国产亚洲va综合人人澡精品| 成人午夜私人影院| 亚洲精品日日夜夜| 欧美日韩国产中文| 久久精品国产第一区二区三区| 久久综合久久久久88| 高清在线成人网| 亚洲久草在线视频| 欧美日韩久久一区| 国产最新精品免费| 国产精品国产三级国产普通话99| 岛国精品在线播放| 中文字幕日韩欧美一区二区三区| 成人动漫在线一区| 亚洲一区二区在线观看视频 | 欧美日韩在线播放三区| 免费三级欧美电影| 中文子幕无线码一区tr| 色婷婷激情综合| 另类小说一区二区三区| 国产欧美一区二区精品性| 91小宝寻花一区二区三区| 亚洲国产一二三| 日韩一卡二卡三卡| 国产成人精品影视| 亚洲在线成人精品| 欧美精品一区二区三区在线播放 | 久久久91精品国产一区二区精品| youjizz国产精品| 日韩中文字幕1| 国产精品久久久久久久久搜平片 | 欧美精品v国产精品v日韩精品| 另类小说综合欧美亚洲| 国产精品免费看片| 欧美一区二区精品| 国产成人一区二区精品非洲| 亚洲一区二区三区中文字幕| 精品人伦一区二区色婷婷| 91一区二区在线| 精品一区二区精品| 一区二区久久久| 日本一区二区三区视频视频| 欧美日韩久久久久久| av亚洲精华国产精华精华| 蜜桃免费网站一区二区三区| 国产精品久久久久久久久快鸭| 337p亚洲精品色噜噜噜| 99久久婷婷国产综合精品| 久久精品国产99久久6| 亚洲一区二区三区中文字幕在线| 欧美国产精品久久| 精品1区2区在线观看| 欧美久久一区二区|