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

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

?? gameswf_render_handler_xbox.cpp

?? 一個(gè)開(kāi)源的嵌入式flash播放器的源代碼
?? CPP
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
// gameswf_render_handler_xbox.cpp	-- Thatcher Ulrich <http://tulrich.com> 2003// This source code has been donated to the Public Domain.  Do// whatever you want with it.// A gameswf::render_handler that uses Xbox API's#ifdef _XBOX#include "gameswf.h"#include "gameswf/gameswf_log.h"#include "gameswf_types.h"#include "base/image.h"#include "base/container.h"#include <xtl.h>#include <d3d8.h>#include <string.h>namespace{	array<IDirect3DBaseTexture8*>	s_d3d_textures;	DWORD	s_vshader_handle = 0;	// Our vertex coords consist of two signed 16-bit integers, for (x,y) position only.	DWORD	s_vshader_decl[] =	{		D3DVSD_STREAM(0),		D3DVSD_REG(0, D3DVSDT_SHORT2),		0xFFFFFFFF	};	void	init_vshader()	// Initialize the vshader we use for SWF mesh rendering.	{		if (s_vshader_handle == 0)		{			HRESULT	result;			/* Shader source:				xvs.1.1				#pragma screenspace				mov	oD0, v3				dp4 oPos.x, v0, c[0]	// Transform position				dp4 oPos.y, v0, c[1]				dp4 oPos.z, v0, c[2]				dp4 oPos.w, v0, c[3]				dp4 oT0.x, v0, c[4]	// texgen				dp4 oT0.y, v0, c[5]			   Compile that with xsasm -h sometmp.vsh, and insert the contents of sometmp.h below:			*/			static const DWORD	s_compiled_shader[] =			{				0x00072078,				0x00000000, 0x0020061b, 0x0836106c, 0x2070f818,				0x00000000, 0x00ec001b, 0x0836186c, 0x20708800,				0x00000000, 0x00ec201b, 0x0836186c, 0x20704800,				0x00000000, 0x00ec401b, 0x0836186c, 0x20702800,				0x00000000, 0x00ec601b, 0x0836186c, 0x20701800,				0x00000000, 0x00ec801b, 0x0836186c, 0x20708848,				0x00000000, 0x00eca01b, 0x0836186c, 0x20704849			};			result = IDirect3DDevice8::CreateVertexShader(				s_vshader_decl,				s_compiled_shader,				&s_vshader_handle,				D3DUSAGE_PERSISTENTDIFFUSE);			if (result != S_OK)			{				gameswf::log_error("error: can't create Xbox vshader; error code = %d\n", result);				return;			}		}	}};// bitmap_info_xbox declarationstruct bitmap_info_xbox : public gameswf::bitmap_info{	bitmap_info_xbox(create_empty e);	bitmap_info_xbox(image::rgb* im);	bitmap_info_xbox(image::rgba* im);	virtual void set_alpha_image(int width, int height, Uint8* data);};struct render_handler_xbox : public gameswf::render_handler{	// Some renderer state.	gameswf::matrix	m_viewport_matrix;	gameswf::matrix	m_current_matrix;	gameswf::cxform	m_current_cxform;		void set_antialiased(bool enable)	{		// not supported	}	static void make_next_miplevel(int* width, int* height, Uint8* data)	// Utility.  Mutates *width, *height and *data to create the	// next mip level.	{		assert(width);		assert(height);		assert(data);		int	new_w = *width >> 1;		int	new_h = *height >> 1;		if (new_w < 1) new_w = 1;		if (new_h < 1) new_h = 1;				if (new_w * 2 != *width	 || new_h * 2 != *height)		{			// Image can't be shrunk along (at least) one			// of its dimensions, so don't bother			// resampling.	Technically we should, but			// it's pretty useless at this point.  Just			// change the image dimensions and leave the			// existing pixels.		}		else		{			// Resample.  Simple average 2x2 --> 1, in-place.			for (int j = 0; j < new_h; j++) {				Uint8*	out = ((Uint8*) data) + j * new_w;				Uint8*	in = ((Uint8*) data) + (j << 1) * *width;				for (int i = 0; i < new_w; i++) {					int	a;					a = (*(in + 0) + *(in + 1) + *(in + 0 + *width) + *(in + 1 + *width));					*(out) = (Uint8) (a >> 2);					out++;					in += 2;				}			}		}		// Munge parameters to reflect the shrunken image.		*width = new_w;		*height = new_h;	}	struct fill_style	{		enum mode		{			INVALID,			COLOR,			BITMAP_WRAP,			BITMAP_CLAMP,			LINEAR_GRADIENT,			RADIAL_GRADIENT,		};		mode	m_mode;		gameswf::rgba	m_color;		const gameswf::bitmap_info*	m_bitmap_info;		gameswf::matrix	m_bitmap_matrix;		gameswf::cxform	m_bitmap_color_transform;		bool	m_has_nonzero_bitmap_additive_color;		fill_style()			:			m_mode(INVALID),			m_has_nonzero_bitmap_additive_color(false)		{		}		void	apply(/*const matrix& current_matrix*/) const		// Push our style into D3D.		{			assert(m_mode != INVALID);			if (m_mode == COLOR)			{				apply_color(m_color);				IDirect3DDevice8::SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE);				//IDirect3DDevice8::SetRenderState(state, value);//				glDisable(GL_TEXTURE_2D);			}			else if (m_mode == BITMAP_WRAP				 || m_mode == BITMAP_CLAMP)			{				assert(m_bitmap_info != NULL);				apply_color(m_color);				if (m_bitmap_info == NULL)				{					IDirect3DDevice8::SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE);					//glDisable(GL_TEXTURE_2D);				}				else				{					// Set up the texture for rendering.					{						// Do the modulate part of the color						// transform in the first pass.  The						// additive part, if any, needs to						// happen in a second pass.// 						glColor4f(m_bitmap_color_transform.m_[0][0],// 							  m_bitmap_color_transform.m_[1][0],// 							  m_bitmap_color_transform.m_[2][0],// 							  m_bitmap_color_transform.m_[3][0]// 							  );						IDirect3DDevice8::SetVertexData4f(							D3DVSDE_DIFFUSE, 							m_bitmap_color_transform.m_[0][0],							m_bitmap_color_transform.m_[1][0],							m_bitmap_color_transform.m_[2][0],							m_bitmap_color_transform.m_[3][0]);					}//					glBindTexture(GL_TEXTURE_2D, m_bitmap_info->m_texture_id);//					glEnable(GL_TEXTURE_2D);//					glEnable(GL_TEXTURE_GEN_S);//					glEnable(GL_TEXTURE_GEN_T);					IDirect3DDevice8::SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);					IDirect3DDevice8::SetTexture(0, s_d3d_textures[m_bitmap_info->m_texture_id]);									if (m_mode == BITMAP_CLAMP)					{//						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);//						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);						IDirect3DDevice8::SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);						IDirect3DDevice8::SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);					}					else					{						assert(m_mode == BITMAP_WRAP);//						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);//						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);						IDirect3DDevice8::SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);						IDirect3DDevice8::SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);					}					// Set up the bitmap matrix for texgen.					float	inv_width = 1.0f / m_bitmap_info->m_original_width;					float	inv_height = 1.0f / m_bitmap_info->m_original_height;					const gameswf::matrix&	m = m_bitmap_matrix;//					glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);					float	p[4] = { 0, 0, 0, 0 };					p[0] = m.m_[0][0] * inv_width;					p[1] = m.m_[0][1] * inv_width;					p[3] = m.m_[0][2] * inv_width;//					glTexGenfv(GL_S, GL_OBJECT_PLANE, p);					IDirect3DDevice8::SetVertexShaderConstant(4, p, 1);//					glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);					p[0] = m.m_[1][0] * inv_height;					p[1] = m.m_[1][1] * inv_height;					p[3] = m.m_[1][2] * inv_height;//					glTexGenfv(GL_T, GL_OBJECT_PLANE, p);					IDirect3DDevice8::SetVertexShaderConstant(5, p, 1);				}			}		}		bool	needs_second_pass() const		// Return true if we need to do a second pass to make		// a valid color.  This is for cxforms with additive		// parts.		{			if (m_mode == BITMAP_WRAP			    || m_mode == BITMAP_CLAMP)			{				return m_has_nonzero_bitmap_additive_color;			}			else			{				return false;			}		}		void	apply_second_pass() const		// Set D3D state for a necessary second pass.		{			assert(needs_second_pass());			// Additive color.			IDirect3DDevice8::SetVertexData4f(				D3DVSDE_DIFFUSE,				m_bitmap_color_transform.m_[0][1] / 255.0f,				m_bitmap_color_transform.m_[1][1] / 255.0f,				m_bitmap_color_transform.m_[2][1] / 255.0f,				m_bitmap_color_transform.m_[3][1] / 255.0f				);			IDirect3DDevice8::SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);			IDirect3DDevice8::SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);#if 0			glDisable(GL_TEXTURE_2D);			glColor4f(				m_bitmap_color_transform.m_[0][1] / 255.0f,				m_bitmap_color_transform.m_[1][1] / 255.0f,				m_bitmap_color_transform.m_[2][1] / 255.0f,				m_bitmap_color_transform.m_[3][1] / 255.0f				);			glBlendFunc(GL_ONE, GL_ONE);#endif // 0		}		void	cleanup_second_pass() const		{			IDirect3DDevice8::SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);			IDirect3DDevice8::SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);#if 0			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);#endif // 0		}		void	disable() { m_mode = INVALID; }		void	set_color(gameswf::rgba color) { m_mode = COLOR; m_color = color; }		void	set_bitmap(const gameswf::bitmap_info* bi, const gameswf::matrix& m, bitmap_wrap_mode wm, const gameswf::cxform& color_transform)		{			m_mode = (wm == WRAP_REPEAT) ? BITMAP_WRAP : BITMAP_CLAMP;			m_color = gameswf::rgba();			m_bitmap_info = bi;			m_bitmap_matrix = m;			m_bitmap_color_transform = color_transform;			if (m_bitmap_color_transform.m_[0][1] > 1.0f			    || m_bitmap_color_transform.m_[1][1] > 1.0f			    || m_bitmap_color_transform.m_[2][1] > 1.0f			    || m_bitmap_color_transform.m_[3][1] > 1.0f)			{				m_has_nonzero_bitmap_additive_color = true;			}			else			{				m_has_nonzero_bitmap_additive_color = false;			}		}		bool	is_valid() const { return m_mode != INVALID; }	};	render_handler_xbox()	// Constructor.	{		init_vshader();	}	// Style state.	enum style_index	{		LEFT_STYLE = 0,		RIGHT_STYLE,		LINE_STYLE,		STYLE_COUNT	};	fill_style	m_current_styles[STYLE_COUNT];	gameswf::bitmap_info*	create_bitmap_info(image::rgb* im)	// Given an image, returns a pointer to a bitmap_info struct	// that can later be passed to fill_styleX_bitmap(), to set a	// bitmap fill style.	{		return new bitmap_info_xbox(im);	}	gameswf::bitmap_info*	create_bitmap_info(image::rgba* im)	// Given an image, returns a pointer to a bitmap_info struct	// that can later be passed to fill_style_bitmap(), to set a	// bitmap fill style.	//	// This version takes an image with an alpha channel.	{		return new bitmap_info_xbox(im);	}	gameswf::bitmap_info*	create_bitmap_info_blank()	// Creates and returns an empty bitmap_info structure.	Image data	// can be bound to this info later, via set_alpha_image().	{		return new bitmap_info_xbox(gameswf::bitmap_info::empty);	}	void	set_alpha_image(gameswf::bitmap_info* bi, int w, int h, Uint8* data)	// Set the specified bitmap_info so that it contains an alpha	// texture with the given data (1 byte per texel).

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区日韩精品视频| 成人蜜臀av电影| 国产偷国产偷亚洲高清人白洁| 色拍拍在线精品视频8848| 成人永久看片免费视频天堂| 狠狠色伊人亚洲综合成人| 日本最新不卡在线| 日韩黄色在线观看| 开心九九激情九九欧美日韩精美视频电影| 亚洲国产精品久久一线不卡| 依依成人精品视频| 亚欧色一区w666天堂| 午夜久久久久久久久| 日本麻豆一区二区三区视频| 日本中文字幕一区二区视频 | 成人国产亚洲欧美成人综合网 | 顶级嫩模精品视频在线看| 国产成人自拍网| 成人h版在线观看| 91国偷自产一区二区开放时间 | 337p日本欧洲亚洲大胆色噜噜| 欧美一区二区三区喷汁尤物| 精品国产亚洲在线| 国产亚洲精品7777| 亚洲青青青在线视频| 日韩avvvv在线播放| 韩国一区二区视频| av男人天堂一区| 91精品福利在线一区二区三区 | 亚洲丝袜制服诱惑| 午夜久久福利影院| 国产激情精品久久久第一区二区| 处破女av一区二区| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲综合一区二区精品导航| 婷婷亚洲久悠悠色悠在线播放| 蓝色福利精品导航| 91福利视频在线| 欧美mv和日韩mv国产网站| 国产欧美日韩另类一区| 日韩主播视频在线| 成人激情图片网| 欧美一区国产二区| 一区二区三区四区在线免费观看| 精品一区二区在线视频| 91色乱码一区二区三区| 欧美精品一区二区久久久| 一区二区欧美在线观看| 国产精品自拍av| 678五月天丁香亚洲综合网| 综合精品久久久| 国产尤物一区二区| 69久久夜色精品国产69蝌蚪网| 中文字幕日韩精品一区| 狠狠色丁香久久婷婷综合_中 | 韩国av一区二区三区四区| 欧美影院午夜播放| 中文字幕成人网| 精彩视频一区二区三区| 欧美日韩一区在线| 中文一区在线播放| 极品美女销魂一区二区三区免费| 欧美系列日韩一区| 中文一区二区在线观看| 国产综合一区二区| 欧美mv日韩mv国产网站| 蜜臀久久久久久久| 欧美一级夜夜爽| 日韩影院免费视频| 欧美乱熟臀69xxxxxx| 亚洲成人一区二区在线观看| 在线观看日韩毛片| 一二三区精品视频| 91国产丝袜在线播放| 亚洲一二三专区| 欧美色精品天天在线观看视频| 一区二区高清视频在线观看| 欧美艳星brazzers| 午夜欧美在线一二页| 欧美女孩性生活视频| 日韩电影免费在线观看网站| 91精品国产综合久久久久久久| 亚洲成人福利片| 91精品麻豆日日躁夜夜躁| 奇米影视7777精品一区二区| 日韩精品一区二区三区中文不卡| 美洲天堂一区二卡三卡四卡视频| 欧美久久久久久蜜桃| 麻豆一区二区三区| 久久久国产午夜精品| 国产不卡视频一区| av午夜精品一区二区三区| 色综合中文字幕国产 | 欧美激情中文不卡| 成人av在线资源网站| 一区二区三区四区乱视频| 国产成人av电影在线观看| 国产精品网站在线播放| 91丨porny丨在线| 一区二区三区视频在线看| 欧美人妇做爰xxxⅹ性高电影| 日本不卡的三区四区五区| 精品国内片67194| 99国产精品99久久久久久| 亚瑟在线精品视频| 久久综合五月天婷婷伊人| 97超碰欧美中文字幕| 日韩精品亚洲专区| 26uuu欧美日本| 色成年激情久久综合| 麻豆一区二区三| 1区2区3区欧美| 91精品国产日韩91久久久久久| 国产白丝精品91爽爽久久| 亚洲国产一区二区视频| 久久综合久久综合久久| 在线观看91精品国产入口| 蜜臀av亚洲一区中文字幕| 亚洲欧美综合另类在线卡通| 欧美变态tickling挠脚心| 91理论电影在线观看| 久久国产尿小便嘘嘘| 亚洲福中文字幕伊人影院| 久久久久久亚洲综合| 欧美精品xxxxbbbb| 色综合亚洲欧洲| 国产在线看一区| 免费精品视频在线| 亚洲一区在线看| 欧美国产欧美综合| 精品福利av导航| 欧美肥大bbwbbw高潮| 91国产免费看| 97超碰欧美中文字幕| 岛国精品一区二区| 免费xxxx性欧美18vr| 视频一区欧美精品| 一区二区欧美国产| 亚洲精品日韩专区silk| 国产精品国产三级国产aⅴ入口| 日韩精品一区二区三区视频| 欧美午夜精品理论片a级按摩| eeuss鲁片一区二区三区| 国产xxx精品视频大全| 精品一区二区免费在线观看| 日韩 欧美一区二区三区| 日韩电影在线免费观看| 亚洲线精品一区二区三区八戒| 亚洲欧洲av色图| 中文字幕日韩一区| 中文字幕欧美激情一区| 国产日韩精品久久久| 久久精品亚洲乱码伦伦中文| 精品99一区二区三区| 欧美v亚洲v综合ⅴ国产v| 精品福利视频一区二区三区| 精品国内片67194| 国产亚洲短视频| 国产精品免费丝袜| 国产精品理论在线观看| 综合分类小说区另类春色亚洲小说欧美| 国产网站一区二区| 亚洲欧美在线另类| 亚洲国产视频一区| 天天色综合天天| 蜜臀久久99精品久久久画质超高清 | 国产原创一区二区| 国产酒店精品激情| 成a人片亚洲日本久久| 一本到不卡免费一区二区| 欧美亚洲国产一区二区三区va| 久久精品亚洲国产奇米99| 精品国内二区三区| 91精品欧美综合在线观看最新| 91精品国产一区二区三区蜜臀| 精品国产一区二区在线观看| 久久先锋影音av| 亚洲三级在线看| 日韩影院精彩在线| 国产一区二区三区不卡在线观看| 成人性生交大片免费看在线播放| 色综合久久久久网| 538prom精品视频线放| 国产欧美日韩三级| 亚洲一区二区三区小说| 男男视频亚洲欧美| 成人毛片在线观看| 欧美色图免费看| 欧美成人a视频| 亚洲综合色网站| 美女视频黄久久| 成人黄色大片在线观看| 欧美在线色视频| 国产午夜精品久久久久久免费视| 亚洲另类在线一区| 韩国欧美国产1区| 精品视频一区二区三区免费| 国产视频一区二区三区在线观看 | 欧美精品视频www在线观看| 久久久精品免费网站|