⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hxftypes.h

📁 Lido PXA270平台开发板的最新BSP,包括源代码
💻 H
字号:
/* ************************************************************************* *\
**
**    INTEL Corporation Proprietary Information
**
**    This listing is supplied under the terms of a license
**    agreement with INTEL Corporation and may not be copied
**    nor disclosed except in accordance with the terms of
**    that agreement.
**
**    Copyright (c) 2003 Intel Corporation.
**    All Rights Reserved.
**
** ************************************************************************* **
**	FILE: HXFTypes.h
**	DESCRIPTION:
**
**	AUTHOR: Cian Montgomery
**	CREATED: November 30, 2003
**
 *  $Date: 5/27/04 1:54p $ $Revision: 18 $
 *  $Log: /Intel_Development/Drivers/Marathon/WinCE42/opengles/HXFTypes.h $
 * 
 * 18    5/27/04 1:54p Clmontgo
 * Fixed point enhancements. 
 *
 * 17    5/16/04 12:53p Clmontgo
 *
 * 16    4/05/04 3:13p Clmontgo
 * Fix Transform Prototype
 *
 * 15    3/25/04 1:27p Clmontgo
 * Optimization of Clip flag generation and VP XForm. Fix for Clipping
 * issue observed in previous version.
\* ************************************************************************* */
#ifndef __HXTYPES_H__
#define __HXTYPES_H__
#include <stdlib.h>

#if defined(_DEBUG) && !defined(DEBUG)
#define DEBUG	1
#endif // _DEBUG

/* ************************************************************************* *\
** ************************************************************************* **
** Basic types
** ************************************************************************* **
\* ************************************************************************* */
typedef int HBOOL;
#define HTRUE 0x01
#define HFALSE 0x00

typedef unsigned char HBYTE;

typedef unsigned char HUINT8;
typedef char HINT8;

typedef unsigned short HUINT16;
typedef short HINT16;

typedef unsigned int HUINT32;
typedef int HINT32;

typedef __int64 HINT64;
typedef unsigned __int64 HUINT64;

typedef HINT32 HFIXED;

/* ************************************************************************* *\
** ************************************************************************* **
** Debug utilities
** ************************************************************************* **
\* ************************************************************************* */
#ifdef DEBUG
#define HXFASSERT(x) HXFAssert((HBOOL)(x))
void HXFAssert(HBOOL x);
#else
#define HXFASSERT(x)
#endif


/* ************************************************************************* *\
** ************************************************************************* **
** alignment information
** ************************************************************************* **
\* ************************************************************************* */
#define HXF_ALIGN (8)
#define HXF_ALIGN_MASK (~(HXF_ALIGN-1))
#define HXF_ALIGN_INV_MASK (HXF_ALIGN-1)

/* ************************************************************************* *\
** ************************************************************************* **
** Fixed point data types
** ************************************************************************* **
\* ************************************************************************* */
typedef struct _HMATRIX4FX
{
	union
	{
		struct
		{
			HFIXED _11, _12, _13, _14; // Column 1
			HFIXED _21, _22, _23, _24; // Column 2
			HFIXED _31, _32, _33, _34; // Column 3
			HFIXED _41, _42, _43, _44; // Column 4
		};
		HFIXED m[16];
	};
} HMATRIX4FX;


typedef struct _HVECTOR2FX
{
	union
	{
		struct
		{
			HFIXED x, y;
		};
		HFIXED v[2];
	};
} HVECTOR2FX;


typedef struct _HVECTOR3FX
{
	union
	{
		struct
		{
			HFIXED x, y, z;
		};
		HFIXED v[3];
	};
} HVECTOR3FX;

typedef struct _HVECTOR4FX
{
	union
	{
		struct
		{
			HFIXED x, y, z, w;
		};
		HFIXED v[4];
	};
} HVECTOR4FX;

/* ************************************************************************* *\
** ************************************************************************* **
** float data types
** ************************************************************************* **
\* ************************************************************************* */

typedef struct _HMATRIX4F
{
	union
	{
		struct
		{
			float _11, _12, _13, _14; // Column 1
			float _21, _22, _23, _24; // Column 2
			float _31, _32, _33, _34; // Column 3
			float _41, _42, _43, _44; // Column 4
		};
		float m[16];
	};
} HMATRIX4F;

typedef struct _HVECTOR3F
{
	union
	{
		struct
		{
			float x, y, z;
		};
		float v[3];
	};
} HVECTOR3F;


typedef struct _HVECTOR4F
{
	union
	{
		struct
		{
			float x, y, z, w;
		};
		float v[4];
	};
} HVECTOR4F;


typedef struct _HFATFLOAT
{
	HINT32 m, e;
} HFATFLOAT;

typedef struct _HMATRIX4FF
{
	union
	{
		struct
		{
			HFATFLOAT _11, _12, _13, _14; // Column 1
			HFATFLOAT _21, _22, _23, _24; // Column 2
			HFATFLOAT _31, _32, _33, _34; // Column 3
			HFATFLOAT _41, _42, _43, _44; // Column 4
		};
		HFATFLOAT m[16];
	};
} HMATRIX4FF;

#define HXFNORMAL_SHIFT	  	14
#define HXFNORMAL_SHIFTFX	(HXF_FX_SHIFT - HXFNORMAL_SHIFT)
typedef struct _HXFNORMAL
{
	union
	{
		struct
		{
			HINT16 x, y, z, w; // w is just a pad
		};
		HINT16 v[4];
	};
} HXFNORMAL;

typedef struct _HXFCOLOR4S
{
	HUINT16 b, g, r, a; // FIXME ENDIAN issues -- memory byte order will change on big endian systems - when loaded as 64 bit block
} HXFCOLOR4S;


typedef struct _HCOLOR4F
{
	union
	{
		struct
		{
			float r, g, b, a;
		};
		float v[4];
	};
} HCOLOR4F;

typedef struct _HTEXCOORD
{
	HFIXED s, t, r, q;
} HTEXCOORD;

typedef struct _HXFALIGNEDCOLOR4S
{
	HXFCOLOR4S* pClr;
	HBYTE Block[sizeof(HXFCOLOR4S) + HXF_ALIGN];
} HXFALIGNEDCOLOR4S;

typedef struct _HXFALIGNEDNORMAL
{
	HXFNORMAL* pNrm;
	HBYTE Block[sizeof(HXFNORMAL) + HXF_ALIGN];
} HXFALIGNEDNORMAL;


/* ************************************************************************* *\
** ************************************************************************* **
** Data Conversion Routines
** ************************************************************************* **
\* ************************************************************************* */
#define HXF_FX_SHIFT	      16
#define HXF_MAX_FIXED      0x7FFFFFFF  // 32767.99998
#define HXF_MAX_FX_FRACT   0x0000FFFF
#define HXF_MIN_FIXED      0x80000000 // -32768.

#define HXF_FX_WHOLE_MASK     0xFFFF0000
#define HXF_FX_FRACTION_MASK  0x0000FFFF


/* ************************************************************************* *\
** ************************************************************************* **
** Utility functions -- for lack of a better place
** ************************************************************************* **
\* ************************************************************************* */
void HXFPreload1(const void*);
void HXFPreload2(const void*, const void*);
void HXFPreload3(const void*, const void*, const void*);
void HXFPreload4(const void*, const void*, const void*, const void*);
// Preload 2 cache lines off of the specified addresses
void HXFPreload1_2L(const void*);
void HXFPreload2_2L(const void*, const void*);
void HXFPreload3_2L(const void*, const void*, const void*);
void HXFPreload4_2L(const void*, const void*, const void*, const void*);

void HXFAlignedColor4S_Initialize(HXFALIGNEDCOLOR4S*);
void HXFAlignedNormal_Initialize(HXFALIGNEDNORMAL*);


#endif // __HXTYPES_H__

/* ************************************************************************* *\
** ************************************************************************* **
** EOF
** ************************************************************************* **
\* ************************************************************************* */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -