set svn:eol-style=native for **.h

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1438 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
bushing
2008-12-08 04:46:09 +00:00
parent e6fe5ec42f
commit 30c883bcfc
334 changed files with 30407 additions and 30407 deletions

View File

@ -1,29 +1,29 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _BPSTRUCTS_H
#define _BPSTRUCTS_H
#pragma pack(4)
#include "BPMemory.h"
void BPInit();
void LoadBPReg(u32 value0);
void ActivateTextures();
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _BPSTRUCTS_H
#define _BPSTRUCTS_H
#pragma pack(4)
#include "BPMemory.h"
void BPInit();
void LoadBPReg(u32 value0);
void ActivateTextures();
#endif

View File

@ -1,29 +1,29 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _CPSTRUCTS_H
#define _CPSTRUCTS_H
#include "Common.h"
#include "CPMemory.h"
#include "XFMemory.h"
void CPUpdateMatricesA();
void CPUpdateMatricesB();
void LoadCPReg(u32 SubCmd, u32 Value);
#endif
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _CPSTRUCTS_H
#define _CPSTRUCTS_H
#include "Common.h"
#include "CPMemory.h"
#include "XFMemory.h"
void CPUpdateMatricesA();
void CPUpdateMatricesB();
void LoadCPReg(u32 SubCmd, u32 Value);
#endif

View File

@ -1,67 +1,67 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include <string>
struct Config
{
Config();
void Load();
void Save();
int iAdapter;
int iFSResolution;
int iMultisampleMode;
int iPostprocessEffect;
int iCompileDLsLevel;
bool renderToMainframe;
bool bFullscreen;
bool bVsync;
bool bWireFrame;
bool bOverlayStats;
bool bDumpTextures;
bool bOldCard;
bool bShowShaderErrors;
//enhancements
bool bForceFiltering;
bool bForceMaxAniso;
bool bPreUpscale;
int iPreUpscaleFilter;
bool bTruform;
int iTruformLevel;
int iWindowedRes;
char psProfile[16];
char vsProfile[16];
bool bTexFmtOverlayEnable;
bool bTexFmtOverlayCenter;
std::string texDumpPath;
};
extern Config g_Config;
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include <string>
struct Config
{
Config();
void Load();
void Save();
int iAdapter;
int iFSResolution;
int iMultisampleMode;
int iPostprocessEffect;
int iCompileDLsLevel;
bool renderToMainframe;
bool bFullscreen;
bool bVsync;
bool bWireFrame;
bool bOverlayStats;
bool bDumpTextures;
bool bOldCard;
bool bShowShaderErrors;
//enhancements
bool bForceFiltering;
bool bForceMaxAniso;
bool bPreUpscale;
int iPreUpscaleFilter;
bool bTruform;
int iTruformLevel;
int iWindowedRes;
char psProfile[16];
char vsProfile[16];
bool bTexFmtOverlayEnable;
bool bTexFmtOverlayCenter;
std::string texDumpPath;
};
extern Config g_Config;
#endif

View File

@ -1,97 +1,97 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _D3DBASE_H
#define _D3DBASE_H
#include <d3d9.h>
#include <vector>
#include <set>
#ifndef SAFE_RELEASE
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
#endif
#include "Common.h"
namespace D3D
{
enum ShaderVersion
{
PSNONE = 0,
PS20 = 2,
PS30 = 3,
PS40 = 4,
};
HRESULT Init();
HRESULT Create(int adapter, HWND wnd, bool fullscreen, int resolution, int aa_mode);
void Close();
void Shutdown();
void Reset();
bool BeginFrame(bool clear=true, u32 color=0, float z=1.0f);
void EndFrame();
void SwitchFullscreen(bool fullscreen);
bool IsFullscreen();
int GetDisplayWidth();
int GetDisplayHeight();
ShaderVersion GetShaderVersion();
LPDIRECT3DSURFACE9 GetBackBufferSurface();
const D3DCAPS9 &GetCaps();
extern IDirect3DDevice9 *dev;
void ShowD3DError(HRESULT err);
void EnableAlphaToCoverage();
struct Resolution
{
char name[32];
int xres;
int yres;
std::set<D3DFORMAT> bitdepths;
std::set<int> refreshes;
};
struct AALevel
{
AALevel(const char *n, D3DMULTISAMPLE_TYPE m, int q) {strcpy(name, n); ms_setting=m; qual_setting=q;}
char name[32];
D3DMULTISAMPLE_TYPE ms_setting;
int qual_setting;
};
struct Adapter
{
D3DADAPTER_IDENTIFIER9 ident;
std::vector<Resolution> resolutions;
std::vector<AALevel> aa_levels;
bool supports_alpha_to_coverage;
};
struct Shader
{
int Minor;
int Major;
};
const Adapter &GetAdapter(int i);
const Adapter &GetCurAdapter();
int GetNumAdapters();
}
#endif
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _D3DBASE_H
#define _D3DBASE_H
#include <d3d9.h>
#include <vector>
#include <set>
#ifndef SAFE_RELEASE
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
#endif
#include "Common.h"
namespace D3D
{
enum ShaderVersion
{
PSNONE = 0,
PS20 = 2,
PS30 = 3,
PS40 = 4,
};
HRESULT Init();
HRESULT Create(int adapter, HWND wnd, bool fullscreen, int resolution, int aa_mode);
void Close();
void Shutdown();
void Reset();
bool BeginFrame(bool clear=true, u32 color=0, float z=1.0f);
void EndFrame();
void SwitchFullscreen(bool fullscreen);
bool IsFullscreen();
int GetDisplayWidth();
int GetDisplayHeight();
ShaderVersion GetShaderVersion();
LPDIRECT3DSURFACE9 GetBackBufferSurface();
const D3DCAPS9 &GetCaps();
extern IDirect3DDevice9 *dev;
void ShowD3DError(HRESULT err);
void EnableAlphaToCoverage();
struct Resolution
{
char name[32];
int xres;
int yres;
std::set<D3DFORMAT> bitdepths;
std::set<int> refreshes;
};
struct AALevel
{
AALevel(const char *n, D3DMULTISAMPLE_TYPE m, int q) {strcpy(name, n); ms_setting=m; qual_setting=q;}
char name[32];
D3DMULTISAMPLE_TYPE ms_setting;
int qual_setting;
};
struct Adapter
{
D3DADAPTER_IDENTIFIER9 ident;
std::vector<Resolution> resolutions;
std::vector<AALevel> aa_levels;
bool supports_alpha_to_coverage;
};
struct Shader
{
int Minor;
int Major;
};
const Adapter &GetAdapter(int i);
const Adapter &GetCurAdapter();
int GetNumAdapters();
}
#endif

View File

@ -1,33 +1,33 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
namespace Postprocess
{
void Initialize();
void Cleanup();
void BeginFrame();
void FinalizeFrame();
int GetWidth();
int GetHeight();
const char **GetPostprocessingNames();
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
namespace Postprocess
{
void Initialize();
void Cleanup();
void BeginFrame();
void FinalizeFrame();
int GetWidth();
int GetHeight();
const char **GetPostprocessingNames();
}

View File

@ -1,26 +1,26 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
namespace D3D
{
LPDIRECT3DVERTEXSHADER9 CompileVShader(const char *code, int len);
LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len);
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
namespace D3D
{
LPDIRECT3DVERTEXSHADER9 CompileVShader(const char *code, int len);
LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len);
}

View File

@ -1,28 +1,28 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
namespace D3D
{
LPDIRECT3DTEXTURE9 CreateTexture2D(const u8* buffer, const int width, const int height, const int pitch, D3DFORMAT fmt = D3DFMT_A8R8G8B8);
void ReplaceTexture2D(LPDIRECT3DTEXTURE9 pTexture, const u8* buffer, const int width, const int height,const int pitch, D3DFORMAT fmt);
LPDIRECT3DTEXTURE9 CreateRenderTarget(const int width, const int height);
LPDIRECT3DSURFACE9 CreateDepthStencilSurface(const int width, const int height);
}
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
namespace D3D
{
LPDIRECT3DTEXTURE9 CreateTexture2D(const u8* buffer, const int width, const int height, const int pitch, D3DFORMAT fmt = D3DFMT_A8R8G8B8);
void ReplaceTexture2D(LPDIRECT3DTEXTURE9 pTexture, const u8* buffer, const int width, const int height,const int pitch, D3DFORMAT fmt);
LPDIRECT3DTEXTURE9 CreateRenderTarget(const int width, const int height);
LPDIRECT3DSURFACE9 CreateDepthStencilSurface(const int width, const int height);
}

View File

@ -1,61 +1,61 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
namespace D3D
{
// Font creation flags
#define D3DFONT_BOLD 0x0001
#define D3DFONT_ITALIC 0x0002
// Font rendering flags
#define D3DFONT_CENTERED 0x0001
//a cut-down variant of the DXSDK CD3DFont class
class CD3DFont
{
LPDIRECT3DTEXTURE9 m_pTexture; // The d3d texture for this font
LPDIRECT3DVERTEXBUFFER9 m_pVB; // VertexBuffer for rendering text
//int m_dwTexWidth; // Texture dimensions
//int m_dwTexHeight;
float m_fTextScale;
float m_fTexCoords[128-32][4];
public:
CD3DFont();
// 2D (no longer 3D) text drawing function
// Initializing and destroying device-dependent objects
void SetRenderStates();
int Init();
int Shutdown();
int DrawTextScaled( float x, float y,
float fXScale, float fYScale,
float spacing, u32 dwColor,
const char* strText, bool center=true );
// Constructor / destructor
//~CD3DFont();
};
extern CD3DFont font;
void quad2d(float x1, float y1, float x2, float y2, u32 color, float u1=0, float v1=0, float u2=1, float v2=1);
}
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
namespace D3D
{
// Font creation flags
#define D3DFONT_BOLD 0x0001
#define D3DFONT_ITALIC 0x0002
// Font rendering flags
#define D3DFONT_CENTERED 0x0001
//a cut-down variant of the DXSDK CD3DFont class
class CD3DFont
{
LPDIRECT3DTEXTURE9 m_pTexture; // The d3d texture for this font
LPDIRECT3DVERTEXBUFFER9 m_pVB; // VertexBuffer for rendering text
//int m_dwTexWidth; // Texture dimensions
//int m_dwTexHeight;
float m_fTextScale;
float m_fTexCoords[128-32][4];
public:
CD3DFont();
// 2D (no longer 3D) text drawing function
// Initializing and destroying device-dependent objects
void SetRenderStates();
int Init();
int Shutdown();
int DrawTextScaled( float x, float y,
float fXScale, float fYScale,
float spacing, u32 dwColor,
const char* strText, bool center=true );
// Constructor / destructor
//~CD3DFont();
};
extern CD3DFont font;
void quad2d(float x1, float y1, float x2, float y2, u32 color, float u1=0, float v1=0, float u2=1, float v2=1);
}

View File

@ -1,72 +1,72 @@
#pragma once
#if 0
#include "D3DBase.h"
#include "DecodedVArray.h"
#include <map>
class CompiledDList
{
u32 *data;
int dataSize;
int pass;
int codeSize;
u8 *code;
struct Batch
{
DecodedVArray varray;
LPDIRECT3DINDEXBUFFER9 ibuffer;
int numDraws;
};
Batch *batches;
int numBatches;
u32 addr, size;
bool Compile();
bool Pass1();
void Pass2();
void Run();
public:
CompiledDList(u32 _addr, u32 _size);
~CompiledDList();
bool Call();
static void DrawHelperHelper(CompiledDList *dl, int vno, int prim);
};
class DListCache
{
struct DLCacheEntry
{
CompiledDList *dlist;
int frameCount;
int pass;
u32 size;
DLCacheEntry()
{
pass=0;
dlist=0;
frameCount=0;
}
void Destroy()
{
if (dlist)
delete dlist;
}
};
typedef std::map<DWORD,DLCacheEntry> DLCache;
static DLCache dlists;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void Call(u32 _addr, u32 _size);
};
#pragma once
#if 0
#include "D3DBase.h"
#include "DecodedVArray.h"
#include <map>
class CompiledDList
{
u32 *data;
int dataSize;
int pass;
int codeSize;
u8 *code;
struct Batch
{
DecodedVArray varray;
LPDIRECT3DINDEXBUFFER9 ibuffer;
int numDraws;
};
Batch *batches;
int numBatches;
u32 addr, size;
bool Compile();
bool Pass1();
void Pass2();
void Run();
public:
CompiledDList(u32 _addr, u32 _size);
~CompiledDList();
bool Call();
static void DrawHelperHelper(CompiledDList *dl, int vno, int prim);
};
class DListCache
{
struct DLCacheEntry
{
CompiledDList *dlist;
int frameCount;
int pass;
u32 size;
DLCacheEntry()
{
pass=0;
dlist=0;
frameCount=0;
}
void Destroy()
{
if (dlist)
delete dlist;
}
};
typedef std::map<DWORD,DLCacheEntry> DLCache;
static DLCache dlists;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void Call(u32 _addr, u32 _size);
};
#endif

View File

@ -1,114 +1,114 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _DECODED_VARRAY_H
#define _DECODED_VARRAY_H
#include "Vec3.h"
#include "Common.h"
typedef Vec3 DecPos;
typedef Vec3 DecNormal;
struct DecUV
{
float u,v;
};
typedef u32 DecColor;
typedef u8 DecMtxInd;
int ComputeVertexSize(u32 components);
//TODO(ector): Change the internal implementation to pack it tight according to components
// The tight packing will be fed directly to the gfx card in the mystic future.
class DecodedVArray
{
int size;
u32 components;
int vertexSize;
public:
int count;
DecodedVArray();
~DecodedVArray();
void SetComponents(u32 comps) {components = comps; vertexSize = ComputeVertexSize(components);
ComputeComponents(); }
u32 GetComponents() const {return components;}
void Create(int _size, int pmcount, int tmcount, int nrmcount, int colcount, int tccount);
void Zero();
void Destroy();
void Reset() {count=0;}
int GetSize() {return size;}
int GetCount() {return count;}
void Next() {count++;}
void SetPosNrmIdx(int i) {posMtxInds[count] = i;}
void SetTcIdx(int n, int i) {texMtxInds[n][count] = i;}
void SetPosX(float x) {positions[count].x=x;}
void SetPosY(float y) {positions[count].y=y;}
void SetPosZ(float z) {positions[count].z=z;}
void SetNormalX(int n,float x) {normals[n][count].x=x;}
void SetNormalY(int n,float y) {normals[n][count].y=y;}
void SetNormalZ(int n,float z) {normals[n][count].z=z;}
void SetU(int n, float u) {uvs[n][count].u = u;}
void SetV(int n, float v) {uvs[n][count].v = v;}
void SetPosition(float x, float y, float z) {
positions[count].x=x;
positions[count].y=y;
positions[count].z=z;
}
void SetNormal(int n, float x, float y, float z) {
normals[n][count].x=x;
normals[n][count].y=y;
normals[n][count].z=z;
}
void SetColor(int n, u32 c)
{
colors[n][count] = c;
}
void SetUV(int n, float u, float v) {
uvs[n][count].u=u;
uvs[n][count].v=v;
}
void ComputeComponents() {
hasPosMatIdx = (components & (1 << 1)) != 0;
for(int i = 0; i < 8; i++)
hasTexMatIdx[i] = (components & (1 << (i + 2))) != 0;
hasNrm = (components & (1 << 10)) != 0;
}
const DecPos &GetPos(int n) const { return positions[n]; }
const DecNormal &GetNormal(int i, int n) const { return normals[i][n]; }
const DecColor &GetColor(int i, int n) const { return colors[i][n]; }
const DecUV &GetUV(int i, int n) const { return uvs[i][n]; }
const DecMtxInd &GetPosMtxInd(int n) const { return posMtxInds[n]; }
const DecMtxInd &GetTexMtxInd(int i, int n) const { return texMtxInds[i][n]; }
//private:
DecPos *positions;
DecNormal *normals[3];
DecColor *colors[2];
DecUV *uvs[8];
DecMtxInd *posMtxInds;
DecMtxInd *texMtxInds[8];
// Component data
bool hasPosMatIdx, hasTexMatIdx[8], hasNrm;
};
#endif
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _DECODED_VARRAY_H
#define _DECODED_VARRAY_H
#include "Vec3.h"
#include "Common.h"
typedef Vec3 DecPos;
typedef Vec3 DecNormal;
struct DecUV
{
float u,v;
};
typedef u32 DecColor;
typedef u8 DecMtxInd;
int ComputeVertexSize(u32 components);
//TODO(ector): Change the internal implementation to pack it tight according to components
// The tight packing will be fed directly to the gfx card in the mystic future.
class DecodedVArray
{
int size;
u32 components;
int vertexSize;
public:
int count;
DecodedVArray();
~DecodedVArray();
void SetComponents(u32 comps) {components = comps; vertexSize = ComputeVertexSize(components);
ComputeComponents(); }
u32 GetComponents() const {return components;}
void Create(int _size, int pmcount, int tmcount, int nrmcount, int colcount, int tccount);
void Zero();
void Destroy();
void Reset() {count=0;}
int GetSize() {return size;}
int GetCount() {return count;}
void Next() {count++;}
void SetPosNrmIdx(int i) {posMtxInds[count] = i;}
void SetTcIdx(int n, int i) {texMtxInds[n][count] = i;}
void SetPosX(float x) {positions[count].x=x;}
void SetPosY(float y) {positions[count].y=y;}
void SetPosZ(float z) {positions[count].z=z;}
void SetNormalX(int n,float x) {normals[n][count].x=x;}
void SetNormalY(int n,float y) {normals[n][count].y=y;}
void SetNormalZ(int n,float z) {normals[n][count].z=z;}
void SetU(int n, float u) {uvs[n][count].u = u;}
void SetV(int n, float v) {uvs[n][count].v = v;}
void SetPosition(float x, float y, float z) {
positions[count].x=x;
positions[count].y=y;
positions[count].z=z;
}
void SetNormal(int n, float x, float y, float z) {
normals[n][count].x=x;
normals[n][count].y=y;
normals[n][count].z=z;
}
void SetColor(int n, u32 c)
{
colors[n][count] = c;
}
void SetUV(int n, float u, float v) {
uvs[n][count].u=u;
uvs[n][count].v=v;
}
void ComputeComponents() {
hasPosMatIdx = (components & (1 << 1)) != 0;
for(int i = 0; i < 8; i++)
hasTexMatIdx[i] = (components & (1 << (i + 2))) != 0;
hasNrm = (components & (1 << 10)) != 0;
}
const DecPos &GetPos(int n) const { return positions[n]; }
const DecNormal &GetNormal(int i, int n) const { return normals[i][n]; }
const DecColor &GetColor(int i, int n) const { return colors[i][n]; }
const DecUV &GetUV(int i, int n) const { return uvs[i][n]; }
const DecMtxInd &GetPosMtxInd(int n) const { return posMtxInds[n]; }
const DecMtxInd &GetTexMtxInd(int i, int n) const { return texMtxInds[i][n]; }
//private:
DecPos *positions;
DecNormal *normals[3];
DecColor *colors[2];
DecUV *uvs[8];
DecMtxInd *posMtxInds;
DecMtxInd *texMtxInds[8];
// Component data
bool hasPosMatIdx, hasTexMatIdx[8], hasNrm;
};
#endif

View File

@ -1,20 +1,20 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
void DlgSettings_Show(HINSTANCE hInstance, HWND parent);

View File

@ -1,16 +1,16 @@
#ifndef _EMUWINDOW_H
#define _EMUWINDOW_H
#include <windows.h>
namespace EmuWindow
{
HWND GetWnd();
HWND GetParentWnd();
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title);
void Show();
void Close();
void SetSize(int displayWidth, int displayHeight);
}
#endif
#ifndef _EMUWINDOW_H
#define _EMUWINDOW_H
#include <windows.h>
namespace EmuWindow
{
HWND GetWnd();
HWND GetParentWnd();
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title);
void Show();
void Close();
void SetSize(int displayWidth, int displayHeight);
}
#endif

View File

@ -1,36 +1,36 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
class IndexGenerator
{
unsigned short *ptr;
int numPrims;
int index;
public:
void Start(unsigned short *startptr);
void AddList(int numVerts);
void AddStrip(int numVerts);
void AddLineList(int numVerts);
void AddPointList(int numVerts); //dummy for counting vertices
void AddLineStrip(int numVerts);
void AddFan(int numVerts);
void AddQuads(int numVerts);
int GetNumPrims() {return numPrims;} //returns numprimitives
int GetNumVerts() {return index;} //returns numprimitives
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
class IndexGenerator
{
unsigned short *ptr;
int numPrims;
int index;
public:
void Start(unsigned short *startptr);
void AddList(int numVerts);
void AddStrip(int numVerts);
void AddLineList(int numVerts);
void AddPointList(int numVerts); //dummy for counting vertices
void AddLineStrip(int numVerts);
void AddFan(int numVerts);
void AddQuads(int numVerts);
int GetNumPrims() {return numPrims;} //returns numprimitives
int GetNumVerts() {return index;} //returns numprimitives
};

View File

@ -1,30 +1,30 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "Common.h"
#include "D3DShader.h"
const char *GeneratePixelShader();
#define PS_CONST_COLORS 0
#define PS_CONST_KCOLORS 4
#define PS_CONST_CONSTALPHA 8
#define PS_CONST_ALPHAREF 9 // x,y
#define PS_CONST_INDMTXSTART 10
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "Common.h"
#include "D3DShader.h"
const char *GeneratePixelShader();
#define PS_CONST_COLORS 0
#define PS_CONST_KCOLORS 4
#define PS_CONST_CONSTALPHA 8
#define PS_CONST_ALPHAREF 9 // x,y
#define PS_CONST_INDMTXSTART 10
#define PS_CONST_INDSIZE 2

View File

@ -1,84 +1,84 @@
#ifndef _RGBAFLOAT_H
#define _RGBAFLOAT_H
struct RGBAFloat
{
float r,g,b,a;
RGBAFloat(){a=r=g=b=1.0f;}
RGBAFloat(float _r, float _g, float _b, float _a)
{
r=_r;g=_g;b=_b;a=_a;
}
void clamp()
{
if (r>1) r=1;
if (g>1) g=1;
if (b>1) b=1;
if (a>1) a=1;
if (r<0) r=0;
if (g<0) g=0;
if (b<0) b=0;
if (a<0) a=0;
}
void convertToD3DColor(u32 &color)
{
clamp();
color = (int(a*255)<<24) | (int(r*255)<<16) | (int(g*255)<<8) | (int(b*255));
}
void convertRGB_GC(u32 color)
{
r=((color>>24)&0xFF)/255.0f;
g=((color>>16)&0xFF)/255.0f;
b=((color>>8)&0xFF)/255.0f;
}
void convertRGB(u32 color)
{
r=((color>>16)&0xFF)/255.0f;
g=((color>>8)&0xFF)/255.0f;
b=((color)&0xFF)/255.0f;
}
void convertA(u32 color)
{
a=((color>>24)&0xFF)/255.0f;
}
void convertA_GC(u32 color)
{
a=((color)&0xFF)/255.0f;
}
void convert(u32 color)
{
convertRGB(color);
convertA(color);
}
void convert_GC(u32 color)
{
convertRGB_GC(color);
convertA_GC(color);
}
void operator *=(float f)
{
r*=f;g*=f;b*=f; a*=f;
}
RGBAFloat operator *(float f)
{
return RGBAFloat(r*f,g*f,b*f,a*f);
}
RGBAFloat operator *(RGBAFloat &o)
{
return RGBAFloat(r*o.r,g*o.g,b*o.b,a*o.a);
}
void operator *=(RGBAFloat &o)
{
r*=o.r;g*=o.g;b*=o.b;a*=o.a;
}
RGBAFloat operator +(RGBAFloat &o)
{
return RGBAFloat(r+o.r,g+o.g,b+o.b,a+o.a);
}
void operator +=(RGBAFloat &o)
{
r+=o.r;g+=o.g;b+=o.b;a+=o.a;
}
};
#ifndef _RGBAFLOAT_H
#define _RGBAFLOAT_H
struct RGBAFloat
{
float r,g,b,a;
RGBAFloat(){a=r=g=b=1.0f;}
RGBAFloat(float _r, float _g, float _b, float _a)
{
r=_r;g=_g;b=_b;a=_a;
}
void clamp()
{
if (r>1) r=1;
if (g>1) g=1;
if (b>1) b=1;
if (a>1) a=1;
if (r<0) r=0;
if (g<0) g=0;
if (b<0) b=0;
if (a<0) a=0;
}
void convertToD3DColor(u32 &color)
{
clamp();
color = (int(a*255)<<24) | (int(r*255)<<16) | (int(g*255)<<8) | (int(b*255));
}
void convertRGB_GC(u32 color)
{
r=((color>>24)&0xFF)/255.0f;
g=((color>>16)&0xFF)/255.0f;
b=((color>>8)&0xFF)/255.0f;
}
void convertRGB(u32 color)
{
r=((color>>16)&0xFF)/255.0f;
g=((color>>8)&0xFF)/255.0f;
b=((color)&0xFF)/255.0f;
}
void convertA(u32 color)
{
a=((color>>24)&0xFF)/255.0f;
}
void convertA_GC(u32 color)
{
a=((color)&0xFF)/255.0f;
}
void convert(u32 color)
{
convertRGB(color);
convertA(color);
}
void convert_GC(u32 color)
{
convertRGB_GC(color);
convertA_GC(color);
}
void operator *=(float f)
{
r*=f;g*=f;b*=f; a*=f;
}
RGBAFloat operator *(float f)
{
return RGBAFloat(r*f,g*f,b*f,a*f);
}
RGBAFloat operator *(RGBAFloat &o)
{
return RGBAFloat(r*o.r,g*o.g,b*o.b,a*o.a);
}
void operator *=(RGBAFloat &o)
{
r*=o.r;g*=o.g;b*=o.b;a*=o.a;
}
RGBAFloat operator +(RGBAFloat &o)
{
return RGBAFloat(r+o.r,g+o.g,b+o.b,a+o.a);
}
void operator +=(RGBAFloat &o)
{
r+=o.r;g+=o.g;b+=o.b;a+=o.a;
}
};
#endif

View File

@ -1,123 +1,123 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __H_RENDER__
#define __H_RENDER__
#include "PluginSpecs_Video.h"
#include <vector>
#include <string>
#include "D3DBase.h"
class Renderer
{
// screen offset
static float m_x,m_y,m_width, m_height,xScale,yScale;
const static int MaxTextureStages = 9;
const static int MaxRenderStates = 210;
const static DWORD MaxTextureTypes = 33;
const static DWORD MaxSamplerSize = 13;
const static DWORD MaxSamplerTypes = 15;
static std::vector<LPDIRECT3DBASETEXTURE9> m_Textures;
static DWORD m_RenderStates[MaxRenderStates];
static DWORD m_TextureStageStates[MaxTextureStages][MaxTextureTypes];
static DWORD m_SamplerStates[MaxSamplerSize][MaxSamplerTypes];
static DWORD m_FVF;
public:
static void Init(SVideoInitialize &_VideoInitialize);
static void Shutdown();
// initialize opengl standard values (like view port)
static void Initialize(void);
// must be called if the window size has changed
static void ReinitView(void);
//
// --- Render Functions ---
//
static void SwapBuffers(void);
static void Flush(void);
static float GetXScale(){return xScale;}
static float GetYScale(){return yScale;}
static void SetScissorBox(RECT &rc);
static void SetViewport(float* _Viewport);
static void SetProjection(float* _pProjection, int constantIndex = -1);
static void AddMessage(const std::string &message, unsigned int ms);
static void ProcessMessages();
static void RenderText(const std::string &text, int left, int top, unsigned int color);
/**
* Assigns a texture to a device stage.
* @param Stage Stage to assign to.
* @param pTexture Texture to be assigned.
*/
static void SetTexture( DWORD Stage, IDirect3DBaseTexture9 *pTexture );
/**
* Sets the current vertex stream declaration.
* @param FVF Fixed function vertex type
*/
static void SetFVF( DWORD FVF );
/**
* Sets a single device render-state parameter.
* @param State Device state variable that is being modified.
* @param Value New value for the device render state to be set.
*/
static void SetRenderState( D3DRENDERSTATETYPE State, DWORD Value );
/**
* Sets the state value for the currently assigned texture.
* @param Stage Stage identifier of the texture for which the state value is set.
* @param Type Texture state to set.
* @param Value State value to set.
*/
static void SetTextureStageState( DWORD Stage, D3DTEXTURESTAGESTATETYPE Type,DWORD Value );
/**
* Sets the sampler state value.
* @param Sampler The sampler stage index.
* @param Type Type of the sampler.
* @param Value State value to set.
*/
static void SetSamplerState( DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value );
/**
* Renders data specified by a user memory pointer as a sequence of geometric primitives of the specified type.
* @param PrimitiveType Type of primitive to render.
* @param PrimitiveCount Number of primitives to render.
* @param pVertexStreamZeroData User memory pointer to the vertex data.
* @param VertexStreamZeroStride The number of bytes of data for each vertex.
*/
static void DrawPrimitiveUP( D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount,
const void* pVertexStreamZeroData, UINT VertexStreamZeroStride );
/**
* Renders a sequence of non indexed, geometric primitives of the specified type from the current set of data input streams.
* @param PrimitiveType Type of primitive to render.
* @param StartVertex Index of the first vertex to load.
* @param PrimitiveCount Number of primitives to render.
*/
static void DrawPrimitive( D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount );
};
#endif // __H_RENDER__
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __H_RENDER__
#define __H_RENDER__
#include "PluginSpecs_Video.h"
#include <vector>
#include <string>
#include "D3DBase.h"
class Renderer
{
// screen offset
static float m_x,m_y,m_width, m_height,xScale,yScale;
const static int MaxTextureStages = 9;
const static int MaxRenderStates = 210;
const static DWORD MaxTextureTypes = 33;
const static DWORD MaxSamplerSize = 13;
const static DWORD MaxSamplerTypes = 15;
static std::vector<LPDIRECT3DBASETEXTURE9> m_Textures;
static DWORD m_RenderStates[MaxRenderStates];
static DWORD m_TextureStageStates[MaxTextureStages][MaxTextureTypes];
static DWORD m_SamplerStates[MaxSamplerSize][MaxSamplerTypes];
static DWORD m_FVF;
public:
static void Init(SVideoInitialize &_VideoInitialize);
static void Shutdown();
// initialize opengl standard values (like view port)
static void Initialize(void);
// must be called if the window size has changed
static void ReinitView(void);
//
// --- Render Functions ---
//
static void SwapBuffers(void);
static void Flush(void);
static float GetXScale(){return xScale;}
static float GetYScale(){return yScale;}
static void SetScissorBox(RECT &rc);
static void SetViewport(float* _Viewport);
static void SetProjection(float* _pProjection, int constantIndex = -1);
static void AddMessage(const std::string &message, unsigned int ms);
static void ProcessMessages();
static void RenderText(const std::string &text, int left, int top, unsigned int color);
/**
* Assigns a texture to a device stage.
* @param Stage Stage to assign to.
* @param pTexture Texture to be assigned.
*/
static void SetTexture( DWORD Stage, IDirect3DBaseTexture9 *pTexture );
/**
* Sets the current vertex stream declaration.
* @param FVF Fixed function vertex type
*/
static void SetFVF( DWORD FVF );
/**
* Sets a single device render-state parameter.
* @param State Device state variable that is being modified.
* @param Value New value for the device render state to be set.
*/
static void SetRenderState( D3DRENDERSTATETYPE State, DWORD Value );
/**
* Sets the state value for the currently assigned texture.
* @param Stage Stage identifier of the texture for which the state value is set.
* @param Type Texture state to set.
* @param Value State value to set.
*/
static void SetTextureStageState( DWORD Stage, D3DTEXTURESTAGESTATETYPE Type,DWORD Value );
/**
* Sets the sampler state value.
* @param Sampler The sampler stage index.
* @param Type Type of the sampler.
* @param Value State value to set.
*/
static void SetSamplerState( DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value );
/**
* Renders data specified by a user memory pointer as a sequence of geometric primitives of the specified type.
* @param PrimitiveType Type of primitive to render.
* @param PrimitiveCount Number of primitives to render.
* @param pVertexStreamZeroData User memory pointer to the vertex data.
* @param VertexStreamZeroStride The number of bytes of data for each vertex.
*/
static void DrawPrimitiveUP( D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount,
const void* pVertexStreamZeroData, UINT VertexStreamZeroStride );
/**
* Renders a sequence of non indexed, geometric primitives of the specified type from the current set of data input streams.
* @param PrimitiveType Type of primitive to render.
* @param StartVertex Index of the first vertex to load.
* @param PrimitiveCount Number of primitives to render.
*/
static void DrawPrimitive( D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount );
};
#endif // __H_RENDER__

View File

@ -1,97 +1,97 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
#include <map>
#include "PixelShader.h"
#include "VertexShader.h"
typedef u32 tevhash;
tevhash GetCurrentTEV();
class PShaderCache
{
struct PSCacheEntry
{
LPDIRECT3DPIXELSHADER9 shader;
//CGPShader shader;
int frameCount;
PSCacheEntry()
{
shader=0;
frameCount=0;
}
void Destroy()
{
if (shader)
shader->Release();
}
};
typedef std::map<tevhash,PSCacheEntry> PSCache;
static PSCache pshaders;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void SetShader();
};
class VShaderCache
{
struct VSCacheEntry
{
LPDIRECT3DVERTEXSHADER9 shader;
//CGVShader shader;
int frameCount;
VSCacheEntry()
{
shader=0;
frameCount=0;
}
void Destroy()
{
if (shader)
shader->Release();
}
};
typedef std::map<tevhash,VSCacheEntry> VSCache;
static VSCache vshaders;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void SetShader();
};
void InitCG();
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "D3DBase.h"
#include <map>
#include "PixelShader.h"
#include "VertexShader.h"
typedef u32 tevhash;
tevhash GetCurrentTEV();
class PShaderCache
{
struct PSCacheEntry
{
LPDIRECT3DPIXELSHADER9 shader;
//CGPShader shader;
int frameCount;
PSCacheEntry()
{
shader=0;
frameCount=0;
}
void Destroy()
{
if (shader)
shader->Release();
}
};
typedef std::map<tevhash,PSCacheEntry> PSCache;
static PSCache pshaders;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void SetShader();
};
class VShaderCache
{
struct VSCacheEntry
{
LPDIRECT3DVERTEXSHADER9 shader;
//CGVShader shader;
int frameCount;
VSCacheEntry()
{
shader=0;
frameCount=0;
}
void Destroy()
{
if (shader)
shader->Release();
}
};
typedef std::map<tevhash,VSCacheEntry> VSCache;
static VSCache vshaders;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void SetShader();
};
void InitCG();
void ShutdownCG();

View File

@ -1,64 +1,64 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _TEXTURECACHE_H
#define _TEXTURECACHE_H
#include <map>
#include "D3DBase.h"
class TextureCache
{
struct TCacheEntry
{
LPDIRECT3DTEXTURE9 texture;
u32 addr;
u32 hash;
u32 paletteHash;
u32 hashoffset;
u32 oldpixel;
bool isRenderTarget;
bool isNonPow2;
int frameCount;
int w,h,fmt;
TCacheEntry()
{
texture=0;
isRenderTarget=0;
hash=0;
}
void Destroy();
};
typedef std::map<u32,TCacheEntry> TexCache;
static u8 *temp;
static TexCache textures;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void Invalidate();
static void Load(int stage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
static void CopyEFBToRenderTarget(u32 address, RECT *source);
};
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _TEXTURECACHE_H
#define _TEXTURECACHE_H
#include <map>
#include "D3DBase.h"
class TextureCache
{
struct TCacheEntry
{
LPDIRECT3DTEXTURE9 texture;
u32 addr;
u32 hash;
u32 paletteHash;
u32 hashoffset;
u32 oldpixel;
bool isRenderTarget;
bool isNonPow2;
int frameCount;
int w,h,fmt;
TCacheEntry()
{
texture=0;
isRenderTarget=0;
hash=0;
}
void Destroy();
};
typedef std::map<u32,TCacheEntry> TexCache;
static u8 *temp;
static TexCache textures;
public:
static void Init();
static void Cleanup();
static void Shutdown();
static void Invalidate();
static void Load(int stage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
static void CopyEFBToRenderTarget(u32 address, RECT *source);
};
#endif

View File

@ -1,55 +1,55 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _TRANSFORMENGINE_H
#define _TRANSFORMENGINE_H
//T&L Engine
//as much work as possible will be delegated to vertex shaders later
//to take full advantage of current PC HW
#include "VertexManager.h"
#include "DecodedVArray.h"
class CTransformEngine
{
static float* m_pPosMatrix;
static float* m_pNormalMatrix;
static float* m_pTexMatrix[8];
static float* m_pTexPostMatrix[8];
public:
static void TransformVertices(int _numVertices,
const DecodedVArray *varray,
D3DVertex *vbuffer);
static void SetPosNormalMatrix(float *p, float *n)
{
m_pPosMatrix = p;
m_pNormalMatrix = n;
}
static void SetTexMatrix(int i, float *f)
{
m_pTexMatrix[i] = f;
}
static void SetTexPostMatrix(int i, float *f)
{
m_pTexPostMatrix[i] = f;
}
};
#endif
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _TRANSFORMENGINE_H
#define _TRANSFORMENGINE_H
//T&L Engine
//as much work as possible will be delegated to vertex shaders later
//to take full advantage of current PC HW
#include "VertexManager.h"
#include "DecodedVArray.h"
class CTransformEngine
{
static float* m_pPosMatrix;
static float* m_pNormalMatrix;
static float* m_pTexMatrix[8];
static float* m_pTexPostMatrix[8];
public:
static void TransformVertices(int _numVertices,
const DecodedVArray *varray,
D3DVertex *vbuffer);
static void SetPosNormalMatrix(float *p, float *n)
{
m_pPosMatrix = p;
m_pNormalMatrix = n;
}
static void SetTexMatrix(int i, float *f)
{
m_pTexMatrix[i] = f;
}
static void SetTexPostMatrix(int i, float *f)
{
m_pTexPostMatrix[i] = f;
}
};
#endif

View File

@ -1,63 +1,63 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _UTILS_H
#define _UTILS_H
#include "Common.h"
#include "main.h"
#include "LookUpTables.h"
extern int frameCount;
LRESULT CALLBACK AboutProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
//#define RAM_MASK 0x1FFFFFF
inline u8 *Memory_GetPtr(u32 _uAddress)
{
return g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u8 Memory_Read_U8(u32 _uAddress)
{
return *g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u16 Memory_Read_U16(u32 _uAddress)
{
return _byteswap_ushort(*(u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
// return _byteswap_ushort(*(u16*)&g_pMemory[_uAddress & RAM_MASK]);
}
inline u32 Memory_Read_U32(u32 _uAddress)
{
if (_uAddress == 0x020143a8)
{
int i =0;
}
return _byteswap_ulong(*(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
// return _byteswap_ulong(*(u32*)&g_pMemory[_uAddress & RAM_MASK]);
}
inline float Memory_Read_Float(u32 _uAddress)
{
u32 uTemp = Memory_Read_U32(_uAddress);
return *(float*)&uTemp;
}
#endif
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _UTILS_H
#define _UTILS_H
#include "Common.h"
#include "main.h"
#include "LookUpTables.h"
extern int frameCount;
LRESULT CALLBACK AboutProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
//#define RAM_MASK 0x1FFFFFF
inline u8 *Memory_GetPtr(u32 _uAddress)
{
return g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u8 Memory_Read_U8(u32 _uAddress)
{
return *g_VideoInitialize.pGetMemoryPointer(_uAddress);
}
inline u16 Memory_Read_U16(u32 _uAddress)
{
return _byteswap_ushort(*(u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
// return _byteswap_ushort(*(u16*)&g_pMemory[_uAddress & RAM_MASK]);
}
inline u32 Memory_Read_U32(u32 _uAddress)
{
if (_uAddress == 0x020143a8)
{
int i =0;
}
return _byteswap_ulong(*(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
// return _byteswap_ulong(*(u32*)&g_pMemory[_uAddress & RAM_MASK]);
}
inline float Memory_Read_Float(u32 _uAddress)
{
u32 uTemp = Memory_Read_U32(_uAddress);
return *(float*)&uTemp;
}
#endif

View File

@ -1,116 +1,116 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VEC3_H
#define _VEC3_H
#include <stdlib.h>
#include <math.h>
class Vec3
{
public:
float x,y,z;
Vec3() { }
explicit Vec3(float f) {x=y=z=f;}
explicit Vec3(const float *f) {x=f[0]; y=f[1]; z=f[2];}
Vec3(const float _x, const float _y, const float _z) {
x=_x; y=_y; z=_z;
}
void set(const float _x, const float _y, const float _z) {
x=_x; y=_y; z=_z;
}
Vec3 operator + (const Vec3 &other) const {
return Vec3(x+other.x, y+other.y, z+other.z);
}
void operator += (const Vec3 &other) {
x+=other.x; y+=other.y; z+=other.z;
}
Vec3 operator -(const Vec3 &v) const {
return Vec3(x-v.x,y-v.y,z-v.z);
}
void operator -= (const Vec3 &other)
{
x-=other.x; y-=other.y; z-=other.z;
}
Vec3 operator -() const {
return Vec3(-x,-y,-z);
}
Vec3 operator * (const float f) const {
return Vec3(x*f,y*f,z*f);
}
Vec3 operator / (const float f) const {
float invf = (1.0f/f);
return Vec3(x*invf,y*invf,z*invf);
}
void operator /= (const float f)
{
*this = *this / f;
}
float operator * (const Vec3 &other) const {
return x*other.x + y*other.y + z*other.z;
}
void operator *= (const float f) {
*this = *this * f;
}
Vec3 scaled_by(const Vec3 &other) const {
return Vec3(x*other.x, y*other.y, z*other.z);
}
Vec3 operator %(const Vec3 &v) const {
return Vec3(y*v.z-z*v.y, z*v.x-x*v.z, x*v.y-y*v.x);
}
float length2() const {
return x*x+y*y+z*z;
}
float length() const {
return sqrtf(length2());
}
float distance2_to(Vec3 &other)
{
return (other-(*this)).length2();
}
Vec3 normalized() const {
return (*this) / length();
}
void normalize() {
(*this) /= length();
}
float &operator [] (int i)
{
return *((&x) + i);
}
const float operator [] (const int i) const
{
return *((&x) + i);
}
bool operator == (const Vec3 &other) const
{
if (x==other.x && y==other.y && z==other.z)
return true;
else
return false;
}
void setZero()
{
memset((void *)this,0,sizeof(float)*3);
}
};
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VEC3_H
#define _VEC3_H
#include <stdlib.h>
#include <math.h>
class Vec3
{
public:
float x,y,z;
Vec3() { }
explicit Vec3(float f) {x=y=z=f;}
explicit Vec3(const float *f) {x=f[0]; y=f[1]; z=f[2];}
Vec3(const float _x, const float _y, const float _z) {
x=_x; y=_y; z=_z;
}
void set(const float _x, const float _y, const float _z) {
x=_x; y=_y; z=_z;
}
Vec3 operator + (const Vec3 &other) const {
return Vec3(x+other.x, y+other.y, z+other.z);
}
void operator += (const Vec3 &other) {
x+=other.x; y+=other.y; z+=other.z;
}
Vec3 operator -(const Vec3 &v) const {
return Vec3(x-v.x,y-v.y,z-v.z);
}
void operator -= (const Vec3 &other)
{
x-=other.x; y-=other.y; z-=other.z;
}
Vec3 operator -() const {
return Vec3(-x,-y,-z);
}
Vec3 operator * (const float f) const {
return Vec3(x*f,y*f,z*f);
}
Vec3 operator / (const float f) const {
float invf = (1.0f/f);
return Vec3(x*invf,y*invf,z*invf);
}
void operator /= (const float f)
{
*this = *this / f;
}
float operator * (const Vec3 &other) const {
return x*other.x + y*other.y + z*other.z;
}
void operator *= (const float f) {
*this = *this * f;
}
Vec3 scaled_by(const Vec3 &other) const {
return Vec3(x*other.x, y*other.y, z*other.z);
}
Vec3 operator %(const Vec3 &v) const {
return Vec3(y*v.z-z*v.y, z*v.x-x*v.z, x*v.y-y*v.x);
}
float length2() const {
return x*x+y*y+z*z;
}
float length() const {
return sqrtf(length2());
}
float distance2_to(Vec3 &other)
{
return (other-(*this)).length2();
}
Vec3 normalized() const {
return (*this) / length();
}
void normalize() {
(*this) /= length();
}
float &operator [] (int i)
{
return *((&x) + i);
}
const float operator [] (const int i) const
{
return *((&x) + i);
}
bool operator == (const Vec3 &other) const
{
if (x==other.x && y==other.y && z==other.z)
return true;
else
return false;
}
void setZero()
{
memset((void *)this,0,sizeof(float)*3);
}
};
#endif

View File

@ -1,195 +1,195 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VERTEXLOADER_H
#define _VERTEXLOADER_H
int ComputeVertexSize(u32 components);
#include "CPStructs.h"
#include "DecodedVArray.h"
#include "DataReader.h"
#define LOADERDECL __cdecl
typedef void (LOADERDECL *TPipelineFunction)(const void*);
class VertexLoader
{
public:
enum
{
NRM_ZERO = 0,
NRM_ONE = 1,
NRM_THREE = 3
};
enum {
VB_HAS_POSMTXIDX =(1<<1),
VB_HAS_TEXMTXIDX0=(1<<2),
VB_HAS_TEXMTXIDX1=(1<<3),
VB_HAS_TEXMTXIDX2=(1<<4),
VB_HAS_TEXMTXIDX3=(1<<5),
VB_HAS_TEXMTXIDX4=(1<<6),
VB_HAS_TEXMTXIDX5=(1<<7),
VB_HAS_TEXMTXIDX6=(1<<8),
VB_HAS_TEXMTXIDX7=(1<<9),
VB_HAS_TEXMTXIDXALL=(0xff<<2),
//VB_HAS_POS=0, // Implied, it always has pos! don't bother testing
VB_HAS_NRM0=(1<<10),
VB_HAS_NRM1=(1<<11),
VB_HAS_NRM2=(1<<12),
VB_HAS_NRMALL=(7<<10),
VB_HAS_COL0=(1<<13),
VB_HAS_COL1=(1<<14),
VB_HAS_UV0=(1<<15),
VB_HAS_UV1=(1<<16),
VB_HAS_UV2=(1<<17),
VB_HAS_UV3=(1<<18),
VB_HAS_UV4=(1<<19),
VB_HAS_UV5=(1<<20),
VB_HAS_UV6=(1<<21),
VB_HAS_UV7=(1<<22),
VB_HAS_UVALL=(0xff<<15),
VB_HAS_UVTEXMTXSHIFT=13,
};
private:
TPipelineFunction m_PipelineStates[32];
int m_numPipelineStates;
int m_VertexSize;
int m_counter;
u32 m_components;
UVAT_group0 m_group0;
UVAT_group1 m_group1;
UVAT_group2 m_group2;
bool m_AttrDirty;
TVtxAttr m_VtxAttr; //Decoded into easy format
//common for all loaders
static TVtxDesc m_VtxDesc;
static bool m_DescDirty;
// seup the pipeline with this vertex fmt
void SetupColor(int num, int _iMode, int _iFormat, int _iElements);
void SetupTexCoord(int num, int _iMode, int _iFormat, int _iElements, int _iFrac);
public:
// constructor
VertexLoader();
~VertexLoader();
// run the pipeline
static void SetVArray(DecodedVArray *_varray);
void Setup();
void PrepareRun();
void RunVertices(int count);
void WriteCall(TPipelineFunction func);
int GetVertexSize(){return m_VertexSize;}
//VtxDesc - global
static void SetVtxDesc_Lo(u32 _iValue)
{
u64 old = m_VtxDesc.Hex;
m_VtxDesc.Hex &= ~0x1FFFF; // keep the Upper bits
m_VtxDesc.Hex |= _iValue;
if (m_VtxDesc.Hex != old)
m_DescDirty = true;
};
static void SetVtxDesc_Hi(u32 _iValue)
{
u64 old = m_VtxDesc.Hex;
m_VtxDesc.Hex &= 0x1FFFF; // keep the lower 17Bits
m_VtxDesc.Hex |= (u64)_iValue << 17;
if (m_VtxDesc.Hex != old)
m_DescDirty = true;
};
static TVtxDesc &GetVtxDesc() {return m_VtxDesc;}
void SetVAT_group0(u32 _group0)
{
if (m_group0.Hex == _group0)
return;
m_AttrDirty = true;
m_group0.Hex = _group0;
m_VtxAttr.PosElements = m_group0.PosElements;
m_VtxAttr.PosFormat = m_group0.PosFormat;
m_VtxAttr.PosFrac = m_group0.PosFrac;
m_VtxAttr.NormalElements = m_group0.NormalElements;
m_VtxAttr.NormalFormat = m_group0.NormalFormat;
m_VtxAttr.color[0].Elements = m_group0.Color0Elements;
m_VtxAttr.color[0].Comp = m_group0.Color0Comp;
m_VtxAttr.color[1].Elements = m_group0.Color1Elements;
m_VtxAttr.color[1].Comp = m_group0.Color1Comp;
m_VtxAttr.texCoord[0].Elements = m_group0.Tex0CoordElements;
m_VtxAttr.texCoord[0].Format = m_group0.Tex0CoordFormat;
m_VtxAttr.texCoord[0].Frac = m_group0.Tex0Frac;
m_VtxAttr.ByteDequant = m_group0.ByteDequant;
m_VtxAttr.NormalIndex3 = m_group0.NormalIndex3;
};
void SetVAT_group1(u32 _group1)
{
if (m_group1.Hex == _group1)
return;
m_AttrDirty = true;
m_group1.Hex = _group1;
m_VtxAttr.texCoord[1].Elements = m_group1.Tex1CoordElements;
m_VtxAttr.texCoord[1].Format = m_group1.Tex1CoordFormat;
m_VtxAttr.texCoord[1].Frac = m_group1.Tex1Frac;
m_VtxAttr.texCoord[2].Elements = m_group1.Tex2CoordElements;
m_VtxAttr.texCoord[2].Format = m_group1.Tex2CoordFormat;
m_VtxAttr.texCoord[2].Frac = m_group1.Tex2Frac;
m_VtxAttr.texCoord[3].Elements = m_group1.Tex3CoordElements;
m_VtxAttr.texCoord[3].Format = m_group1.Tex3CoordFormat;
m_VtxAttr.texCoord[3].Frac = m_group1.Tex3Frac;
m_VtxAttr.texCoord[4].Elements = m_group1.Tex4CoordElements;
m_VtxAttr.texCoord[4].Format = m_group1.Tex4CoordFormat;
};
void SetVAT_group2(u32 _group2)
{
if (m_group2.Hex == _group2)
return;
m_AttrDirty = true;
m_group2.Hex = _group2;
m_VtxAttr.texCoord[4].Frac = m_group2.Tex4Frac;
m_VtxAttr.texCoord[5].Elements = m_group2.Tex5CoordElements;
m_VtxAttr.texCoord[5].Format = m_group2.Tex5CoordFormat;
m_VtxAttr.texCoord[5].Frac = m_group2.Tex5Frac;
m_VtxAttr.texCoord[6].Elements = m_group2.Tex6CoordElements;
m_VtxAttr.texCoord[6].Format = m_group2.Tex6CoordFormat;
m_VtxAttr.texCoord[6].Frac = m_group2.Tex6Frac;
m_VtxAttr.texCoord[7].Elements = m_group2.Tex7CoordElements;
m_VtxAttr.texCoord[7].Format = m_group2.Tex7CoordFormat;
m_VtxAttr.texCoord[7].Frac = m_group2.Tex7Frac;
};
};
extern VertexLoader g_VertexLoaders[8];
extern DecodedVArray* varray;
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VERTEXLOADER_H
#define _VERTEXLOADER_H
int ComputeVertexSize(u32 components);
#include "CPStructs.h"
#include "DecodedVArray.h"
#include "DataReader.h"
#define LOADERDECL __cdecl
typedef void (LOADERDECL *TPipelineFunction)(const void*);
class VertexLoader
{
public:
enum
{
NRM_ZERO = 0,
NRM_ONE = 1,
NRM_THREE = 3
};
enum {
VB_HAS_POSMTXIDX =(1<<1),
VB_HAS_TEXMTXIDX0=(1<<2),
VB_HAS_TEXMTXIDX1=(1<<3),
VB_HAS_TEXMTXIDX2=(1<<4),
VB_HAS_TEXMTXIDX3=(1<<5),
VB_HAS_TEXMTXIDX4=(1<<6),
VB_HAS_TEXMTXIDX5=(1<<7),
VB_HAS_TEXMTXIDX6=(1<<8),
VB_HAS_TEXMTXIDX7=(1<<9),
VB_HAS_TEXMTXIDXALL=(0xff<<2),
//VB_HAS_POS=0, // Implied, it always has pos! don't bother testing
VB_HAS_NRM0=(1<<10),
VB_HAS_NRM1=(1<<11),
VB_HAS_NRM2=(1<<12),
VB_HAS_NRMALL=(7<<10),
VB_HAS_COL0=(1<<13),
VB_HAS_COL1=(1<<14),
VB_HAS_UV0=(1<<15),
VB_HAS_UV1=(1<<16),
VB_HAS_UV2=(1<<17),
VB_HAS_UV3=(1<<18),
VB_HAS_UV4=(1<<19),
VB_HAS_UV5=(1<<20),
VB_HAS_UV6=(1<<21),
VB_HAS_UV7=(1<<22),
VB_HAS_UVALL=(0xff<<15),
VB_HAS_UVTEXMTXSHIFT=13,
};
private:
TPipelineFunction m_PipelineStates[32];
int m_numPipelineStates;
int m_VertexSize;
int m_counter;
u32 m_components;
UVAT_group0 m_group0;
UVAT_group1 m_group1;
UVAT_group2 m_group2;
bool m_AttrDirty;
TVtxAttr m_VtxAttr; //Decoded into easy format
//common for all loaders
static TVtxDesc m_VtxDesc;
static bool m_DescDirty;
// seup the pipeline with this vertex fmt
void SetupColor(int num, int _iMode, int _iFormat, int _iElements);
void SetupTexCoord(int num, int _iMode, int _iFormat, int _iElements, int _iFrac);
public:
// constructor
VertexLoader();
~VertexLoader();
// run the pipeline
static void SetVArray(DecodedVArray *_varray);
void Setup();
void PrepareRun();
void RunVertices(int count);
void WriteCall(TPipelineFunction func);
int GetVertexSize(){return m_VertexSize;}
//VtxDesc - global
static void SetVtxDesc_Lo(u32 _iValue)
{
u64 old = m_VtxDesc.Hex;
m_VtxDesc.Hex &= ~0x1FFFF; // keep the Upper bits
m_VtxDesc.Hex |= _iValue;
if (m_VtxDesc.Hex != old)
m_DescDirty = true;
};
static void SetVtxDesc_Hi(u32 _iValue)
{
u64 old = m_VtxDesc.Hex;
m_VtxDesc.Hex &= 0x1FFFF; // keep the lower 17Bits
m_VtxDesc.Hex |= (u64)_iValue << 17;
if (m_VtxDesc.Hex != old)
m_DescDirty = true;
};
static TVtxDesc &GetVtxDesc() {return m_VtxDesc;}
void SetVAT_group0(u32 _group0)
{
if (m_group0.Hex == _group0)
return;
m_AttrDirty = true;
m_group0.Hex = _group0;
m_VtxAttr.PosElements = m_group0.PosElements;
m_VtxAttr.PosFormat = m_group0.PosFormat;
m_VtxAttr.PosFrac = m_group0.PosFrac;
m_VtxAttr.NormalElements = m_group0.NormalElements;
m_VtxAttr.NormalFormat = m_group0.NormalFormat;
m_VtxAttr.color[0].Elements = m_group0.Color0Elements;
m_VtxAttr.color[0].Comp = m_group0.Color0Comp;
m_VtxAttr.color[1].Elements = m_group0.Color1Elements;
m_VtxAttr.color[1].Comp = m_group0.Color1Comp;
m_VtxAttr.texCoord[0].Elements = m_group0.Tex0CoordElements;
m_VtxAttr.texCoord[0].Format = m_group0.Tex0CoordFormat;
m_VtxAttr.texCoord[0].Frac = m_group0.Tex0Frac;
m_VtxAttr.ByteDequant = m_group0.ByteDequant;
m_VtxAttr.NormalIndex3 = m_group0.NormalIndex3;
};
void SetVAT_group1(u32 _group1)
{
if (m_group1.Hex == _group1)
return;
m_AttrDirty = true;
m_group1.Hex = _group1;
m_VtxAttr.texCoord[1].Elements = m_group1.Tex1CoordElements;
m_VtxAttr.texCoord[1].Format = m_group1.Tex1CoordFormat;
m_VtxAttr.texCoord[1].Frac = m_group1.Tex1Frac;
m_VtxAttr.texCoord[2].Elements = m_group1.Tex2CoordElements;
m_VtxAttr.texCoord[2].Format = m_group1.Tex2CoordFormat;
m_VtxAttr.texCoord[2].Frac = m_group1.Tex2Frac;
m_VtxAttr.texCoord[3].Elements = m_group1.Tex3CoordElements;
m_VtxAttr.texCoord[3].Format = m_group1.Tex3CoordFormat;
m_VtxAttr.texCoord[3].Frac = m_group1.Tex3Frac;
m_VtxAttr.texCoord[4].Elements = m_group1.Tex4CoordElements;
m_VtxAttr.texCoord[4].Format = m_group1.Tex4CoordFormat;
};
void SetVAT_group2(u32 _group2)
{
if (m_group2.Hex == _group2)
return;
m_AttrDirty = true;
m_group2.Hex = _group2;
m_VtxAttr.texCoord[4].Frac = m_group2.Tex4Frac;
m_VtxAttr.texCoord[5].Elements = m_group2.Tex5CoordElements;
m_VtxAttr.texCoord[5].Format = m_group2.Tex5CoordFormat;
m_VtxAttr.texCoord[5].Frac = m_group2.Tex5Frac;
m_VtxAttr.texCoord[6].Elements = m_group2.Tex6CoordElements;
m_VtxAttr.texCoord[6].Format = m_group2.Tex6CoordFormat;
m_VtxAttr.texCoord[6].Frac = m_group2.Tex6Frac;
m_VtxAttr.texCoord[7].Elements = m_group2.Tex7CoordElements;
m_VtxAttr.texCoord[7].Format = m_group2.Tex7CoordFormat;
m_VtxAttr.texCoord[7].Frac = m_group2.Tex7Frac;
};
};
extern VertexLoader g_VertexLoaders[8];
extern DecodedVArray* varray;
#endif

View File

@ -1,226 +1,226 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VERTEXLOADERCOLOR_H
#define _VERTEXLOADERCOLOR_H
#include "LookUpTables.h"
#define RSHIFT 16
#define GSHIFT 8
#define BSHIFT 0
#define ASHIFT 24
extern DecodedVArray *varray;
extern int colIndex;
inline void _SetCol(u32 val)
{
varray->SetColor(colIndex, val);
colIndex++;
}
void _SetCol4444(u16 val)
{
u32 col = lut4to8[(val>>0)&0xF]<<ASHIFT;
col |= lut4to8[(val>>12)&0xF] <<RSHIFT;
col |= lut4to8[(val>>8)&0xF] <<GSHIFT;
col |= lut4to8[(val>>4)&0xF] <<BSHIFT;
_SetCol(col);
}
void _SetCol6666(u32 val)
{
u32 col = lut6to8[(val>>18)&0x3F] << RSHIFT;
col |= lut6to8[(val>>12)&0x3F] << GSHIFT;
col |= lut6to8[(val>>6)&0x3F] << BSHIFT;
col |= lut6to8[(val>>0)&0x3F] << ASHIFT;
_SetCol(col);
}
void _SetCol565(u16 val)
{
u32 col = lut5to8[(val>>11)&0x1f] << RSHIFT;
col |= lut6to8[(val>>5 )&0x3f] << GSHIFT;
col |= lut5to8[(val )&0x1f] << BSHIFT;
_SetCol(col | (0xFF<<ASHIFT));
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
inline u32 _Read24(u32 iAddress)
{
u32 col = Memory_Read_U8(iAddress) << RSHIFT; //should just get a pointer to main memory instead of going thru slow memhandler
col |= Memory_Read_U8(iAddress+1) << GSHIFT; //we can guarantee that it is reading from main memory
col |= Memory_Read_U8(iAddress+2) << BSHIFT;
return col | (0xFF<<ASHIFT);
}
inline u32 _Read32(u32 iAddress)
{
u32 col = Memory_Read_U8(iAddress) << RSHIFT; //should just get a pointer to main memory instead of going thru slow memhandler
col |= Memory_Read_U8(iAddress+1) << GSHIFT; //we can guarantee that it is reading from main memory
col |= Memory_Read_U8(iAddress+2) << BSHIFT;
col |= Memory_Read_U8(iAddress+3) << ASHIFT;
return col;
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void LOADERDECL Color_ReadDirect_24b_888(const void *_p)
{
u32 col = DataReadU8()<<RSHIFT;
col |= DataReadU8()<<GSHIFT;
col |= DataReadU8()<<BSHIFT;
_SetCol(col | (0xFF<<ASHIFT));
}
void LOADERDECL Color_ReadDirect_32b_888x(const void *_p){
u32 col = DataReadU8()<<RSHIFT;
col |= DataReadU8()<<GSHIFT;
col |= DataReadU8()<<BSHIFT;
_SetCol(col | (0xFF<<ASHIFT));
DataReadU8();
}
void LOADERDECL Color_ReadDirect_16b_565(const void *_p)
{
_SetCol565(DataReadU16());
}
void LOADERDECL Color_ReadDirect_16b_4444(const void *_p)
{
_SetCol4444(DataReadU16());
}
void LOADERDECL Color_ReadDirect_24b_6666(const void *_p)
{
u32 val = DataReadU8()<<16;
val|=DataReadU8()<<8;
val|=DataReadU8();
_SetCol6666(val);
}
// F|RES: i am not 100 percent sure, but the colElements seems to be important for rendering only
// at least it fixes mario party 4
//
// if (colElements[colIndex])
// else
// col |= 0xFF<<ASHIFT;
//
void LOADERDECL Color_ReadDirect_32b_8888(const void *_p)
{
u32 col = DataReadU8()<<RSHIFT;
col |= DataReadU8()<<GSHIFT;
col |= DataReadU8()<<BSHIFT;
col |= DataReadU8()<<ASHIFT;
// "kill" the alpha
if (!colElements[colIndex])
col |= 0xFF << ASHIFT;
_SetCol(col);
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void LOADERDECL Color_ReadIndex8_16b_565(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol565(val);
}
void LOADERDECL Color_ReadIndex8_24b_888(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex8_32b_888x(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR]+colIndex);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex8_16b_4444(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol4444(val);
}
void LOADERDECL Color_ReadIndex8_24b_6666(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u32 val = Memory_Read_U8(iAddress+2) |
(Memory_Read_U8(iAddress+1)<<8) |
(Memory_Read_U8(iAddress)<<16);
_SetCol6666(val);
}
void LOADERDECL Color_ReadIndex8_32b_8888(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read32(iAddress));
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void LOADERDECL Color_ReadIndex16_16b_565(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol565(val);
}
void LOADERDECL Color_ReadIndex16_24b_888(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex16_32b_888x(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex16_16b_4444(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol4444(val);
}
void LOADERDECL Color_ReadIndex16_24b_6666(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u32 val = Memory_Read_U8(iAddress+2) |
(Memory_Read_U8(iAddress+1)<<8) |
(Memory_Read_U8(iAddress)<<16);
_SetCol6666(val);
}
void LOADERDECL Color_ReadIndex16_32b_8888(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read32(iAddress));
}
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VERTEXLOADERCOLOR_H
#define _VERTEXLOADERCOLOR_H
#include "LookUpTables.h"
#define RSHIFT 16
#define GSHIFT 8
#define BSHIFT 0
#define ASHIFT 24
extern DecodedVArray *varray;
extern int colIndex;
inline void _SetCol(u32 val)
{
varray->SetColor(colIndex, val);
colIndex++;
}
void _SetCol4444(u16 val)
{
u32 col = lut4to8[(val>>0)&0xF]<<ASHIFT;
col |= lut4to8[(val>>12)&0xF] <<RSHIFT;
col |= lut4to8[(val>>8)&0xF] <<GSHIFT;
col |= lut4to8[(val>>4)&0xF] <<BSHIFT;
_SetCol(col);
}
void _SetCol6666(u32 val)
{
u32 col = lut6to8[(val>>18)&0x3F] << RSHIFT;
col |= lut6to8[(val>>12)&0x3F] << GSHIFT;
col |= lut6to8[(val>>6)&0x3F] << BSHIFT;
col |= lut6to8[(val>>0)&0x3F] << ASHIFT;
_SetCol(col);
}
void _SetCol565(u16 val)
{
u32 col = lut5to8[(val>>11)&0x1f] << RSHIFT;
col |= lut6to8[(val>>5 )&0x3f] << GSHIFT;
col |= lut5to8[(val )&0x1f] << BSHIFT;
_SetCol(col | (0xFF<<ASHIFT));
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
inline u32 _Read24(u32 iAddress)
{
u32 col = Memory_Read_U8(iAddress) << RSHIFT; //should just get a pointer to main memory instead of going thru slow memhandler
col |= Memory_Read_U8(iAddress+1) << GSHIFT; //we can guarantee that it is reading from main memory
col |= Memory_Read_U8(iAddress+2) << BSHIFT;
return col | (0xFF<<ASHIFT);
}
inline u32 _Read32(u32 iAddress)
{
u32 col = Memory_Read_U8(iAddress) << RSHIFT; //should just get a pointer to main memory instead of going thru slow memhandler
col |= Memory_Read_U8(iAddress+1) << GSHIFT; //we can guarantee that it is reading from main memory
col |= Memory_Read_U8(iAddress+2) << BSHIFT;
col |= Memory_Read_U8(iAddress+3) << ASHIFT;
return col;
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void LOADERDECL Color_ReadDirect_24b_888(const void *_p)
{
u32 col = DataReadU8()<<RSHIFT;
col |= DataReadU8()<<GSHIFT;
col |= DataReadU8()<<BSHIFT;
_SetCol(col | (0xFF<<ASHIFT));
}
void LOADERDECL Color_ReadDirect_32b_888x(const void *_p){
u32 col = DataReadU8()<<RSHIFT;
col |= DataReadU8()<<GSHIFT;
col |= DataReadU8()<<BSHIFT;
_SetCol(col | (0xFF<<ASHIFT));
DataReadU8();
}
void LOADERDECL Color_ReadDirect_16b_565(const void *_p)
{
_SetCol565(DataReadU16());
}
void LOADERDECL Color_ReadDirect_16b_4444(const void *_p)
{
_SetCol4444(DataReadU16());
}
void LOADERDECL Color_ReadDirect_24b_6666(const void *_p)
{
u32 val = DataReadU8()<<16;
val|=DataReadU8()<<8;
val|=DataReadU8();
_SetCol6666(val);
}
// F|RES: i am not 100 percent sure, but the colElements seems to be important for rendering only
// at least it fixes mario party 4
//
// if (colElements[colIndex])
// else
// col |= 0xFF<<ASHIFT;
//
void LOADERDECL Color_ReadDirect_32b_8888(const void *_p)
{
u32 col = DataReadU8()<<RSHIFT;
col |= DataReadU8()<<GSHIFT;
col |= DataReadU8()<<BSHIFT;
col |= DataReadU8()<<ASHIFT;
// "kill" the alpha
if (!colElements[colIndex])
col |= 0xFF << ASHIFT;
_SetCol(col);
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void LOADERDECL Color_ReadIndex8_16b_565(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol565(val);
}
void LOADERDECL Color_ReadIndex8_24b_888(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex8_32b_888x(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR]+colIndex);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex8_16b_4444(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol4444(val);
}
void LOADERDECL Color_ReadIndex8_24b_6666(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u32 val = Memory_Read_U8(iAddress+2) |
(Memory_Read_U8(iAddress+1)<<8) |
(Memory_Read_U8(iAddress)<<16);
_SetCol6666(val);
}
void LOADERDECL Color_ReadIndex8_32b_8888(const void *_p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read32(iAddress));
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void LOADERDECL Color_ReadIndex16_16b_565(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol565(val);
}
void LOADERDECL Color_ReadIndex16_24b_888(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex16_32b_888x(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read24(iAddress));
}
void LOADERDECL Color_ReadIndex16_16b_4444(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u16 val = Memory_Read_U16(iAddress);
_SetCol4444(val);
}
void LOADERDECL Color_ReadIndex16_24b_6666(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
u32 val = Memory_Read_U8(iAddress+2) |
(Memory_Read_U8(iAddress+1)<<8) |
(Memory_Read_U8(iAddress)<<16);
_SetCol6666(val);
}
void LOADERDECL Color_ReadIndex16_32b_8888(const void *_p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_COLOR+colIndex] + (Index * arraystrides[ARRAY_COLOR+colIndex]);
_SetCol(_Read32(iAddress));
}
#endif

View File

@ -1,41 +1,41 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "Common.h"
#include "TransformEngine.h"
// ==============================================================================
// Direct
// ==============================================================================
void LOADERDECL PosMtx_ReadDirect_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
int index = DataReadU8() & 0x3f;
float *flipmem = (float *)xfmem;
varray->SetPosNrmIdx(index);
}
int s_texmtxread = 0, s_texmtxwrite = 0;
void LOADERDECL TexMtx_ReadDirect_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
int index = DataReadU8() & 0x3f;
varray->SetTcIdx(s_texmtxread++, index);
}
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "Common.h"
#include "TransformEngine.h"
// ==============================================================================
// Direct
// ==============================================================================
void LOADERDECL PosMtx_ReadDirect_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
int index = DataReadU8() & 0x3f;
float *flipmem = (float *)xfmem;
varray->SetPosNrmIdx(index);
}
int s_texmtxread = 0, s_texmtxwrite = 0;
void LOADERDECL TexMtx_ReadDirect_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
int index = DataReadU8() & 0x3f;
varray->SetTcIdx(s_texmtxread++, index);
}

View File

@ -1,90 +1,90 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "CommonTypes.h"
class VertexLoader_Normal
{
public:
static bool index3;
// Init
static void Init(void);
// GetSize
static unsigned int GetSize(unsigned int _type, unsigned int _format, unsigned int _elements);
// GetFunction
static TPipelineFunction GetFunction(unsigned int _type, unsigned int _format, unsigned int _elements);
private:
enum ENormalType
{
NRM_NOT_PRESENT = 0,
NRM_DIRECT = 1,
NRM_INDEX8 = 2,
NRM_INDEX16 = 3,
NUM_NRM_TYPE
};
enum ENormalFormat
{
FORMAT_UBYTE = 0,
FORMAT_BYTE = 1,
FORMAT_USHORT = 2,
FORMAT_SHORT = 3,
FORMAT_FLOAT = 4,
NUM_NRM_FORMAT
};
enum ENormalElements
{
NRM_NBT = 0,
NRM_NBT3 = 1,
NUM_NRM_ELEMENTS
};
// tables
static u8 m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS];
static TPipelineFunction m_funcTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS];
// direct
static void LOADERDECL Normal_DirectByte(const void* _p);
static void LOADERDECL Normal_DirectShort(const void* _p);
static void LOADERDECL Normal_DirectFloat(const void* _p);
static void LOADERDECL Normal_DirectByte3(const void* _p);
static void LOADERDECL Normal_DirectShort3(const void* _p);
static void LOADERDECL Normal_DirectFloat3(const void* _p);
// index8
static void LOADERDECL Normal_Index8_Byte(const void* _p);
static void LOADERDECL Normal_Index8_Short(const void* _p);
static void LOADERDECL Normal_Index8_Float(const void* _p);
static void LOADERDECL Normal_Index8_Byte3(const void* _p);
static void LOADERDECL Normal_Index8_Short3(const void* _p);
static void LOADERDECL Normal_Index8_Float3(const void* _p);
// index16
static void LOADERDECL Normal_Index16_Byte(const void* _p);
static void LOADERDECL Normal_Index16_Short(const void* _p);
static void LOADERDECL Normal_Index16_Float(const void* _p);
static void LOADERDECL Normal_Index16_Byte3(const void* _p);
static void LOADERDECL Normal_Index16_Short3(const void* _p);
static void LOADERDECL Normal_Index16_Float3(const void* _p);
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "CommonTypes.h"
class VertexLoader_Normal
{
public:
static bool index3;
// Init
static void Init(void);
// GetSize
static unsigned int GetSize(unsigned int _type, unsigned int _format, unsigned int _elements);
// GetFunction
static TPipelineFunction GetFunction(unsigned int _type, unsigned int _format, unsigned int _elements);
private:
enum ENormalType
{
NRM_NOT_PRESENT = 0,
NRM_DIRECT = 1,
NRM_INDEX8 = 2,
NRM_INDEX16 = 3,
NUM_NRM_TYPE
};
enum ENormalFormat
{
FORMAT_UBYTE = 0,
FORMAT_BYTE = 1,
FORMAT_USHORT = 2,
FORMAT_SHORT = 3,
FORMAT_FLOAT = 4,
NUM_NRM_FORMAT
};
enum ENormalElements
{
NRM_NBT = 0,
NRM_NBT3 = 1,
NUM_NRM_ELEMENTS
};
// tables
static u8 m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS];
static TPipelineFunction m_funcTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS];
// direct
static void LOADERDECL Normal_DirectByte(const void* _p);
static void LOADERDECL Normal_DirectShort(const void* _p);
static void LOADERDECL Normal_DirectFloat(const void* _p);
static void LOADERDECL Normal_DirectByte3(const void* _p);
static void LOADERDECL Normal_DirectShort3(const void* _p);
static void LOADERDECL Normal_DirectFloat3(const void* _p);
// index8
static void LOADERDECL Normal_Index8_Byte(const void* _p);
static void LOADERDECL Normal_Index8_Short(const void* _p);
static void LOADERDECL Normal_Index8_Float(const void* _p);
static void LOADERDECL Normal_Index8_Byte3(const void* _p);
static void LOADERDECL Normal_Index8_Short3(const void* _p);
static void LOADERDECL Normal_Index8_Float3(const void* _p);
// index16
static void LOADERDECL Normal_Index16_Byte(const void* _p);
static void LOADERDECL Normal_Index16_Short(const void* _p);
static void LOADERDECL Normal_Index16_Float(const void* _p);
static void LOADERDECL Normal_Index16_Byte3(const void* _p);
static void LOADERDECL Normal_Index16_Short3(const void* _p);
static void LOADERDECL Normal_Index16_Float3(const void* _p);
};

View File

@ -1,213 +1,213 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef VERTEXHANDLER_POSITION_H
#define VERTEXHANDLER_POSITION_H
#include "Common.h"
#include "Utils.h"
// ==============================================================================
// Direct
// ==============================================================================
template<class T>
inline void LOADERDECL _ReadPos8Mem(int iAddress, TVtxAttr* pVtxAttr)
{
varray->SetPosX(((float)(T)Memory_Read_U8(iAddress)) * posScale);
varray->SetPosY(((float)(T)Memory_Read_U8(iAddress+1)) * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ(((float)(T)Memory_Read_U8(iAddress+2)) * posScale);
else
varray->SetPosZ(1.0);
}
template<class T>
inline void LOADERDECL _ReadPos16Mem(int iAddress, TVtxAttr* pVtxAttr)
{
varray->SetPosX(((float)(T)Memory_Read_U16(iAddress)) * posScale);
varray->SetPosY(((float)(T)Memory_Read_U16(iAddress+2)) * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ(((float)(T)Memory_Read_U16(iAddress+4)) * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL _ReadPosFloatMem(int iAddress, TVtxAttr* pVtxAttr)
{
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
varray->SetPosX(*(float*)&uTemp);
uTemp = Memory_Read_U32(iAddress+4);
varray->SetPosY(*(float*)&uTemp);
if (pVtxAttr->PosElements)
{
uTemp = Memory_Read_U32(iAddress+8);
varray->SetPosZ(*(float*)&uTemp);
}
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)DataReadU8() * posScale);
varray->SetPosY((float)DataReadU8() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)DataReadU8() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_Byte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)(s8)DataReadU8() * posScale);
varray->SetPosY((float)(s8)DataReadU8() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)(s8)DataReadU8() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_UShort(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)DataReadU16() * posScale);
varray->SetPosY((float)DataReadU16() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)DataReadU16() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_Short(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)(s16)DataReadU16() * posScale);
varray->SetPosY((float)(s16)DataReadU16() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)(s16)DataReadU16() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_Float(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX(DataReadF32());
varray->SetPosY(DataReadF32());
if (pVtxAttr->PosElements)
varray->SetPosZ(DataReadF32());
else
varray->SetPosZ(1.0);
}
// ==============================================================================
// Index 8
// ==============================================================================
void LOADERDECL Pos_ReadIndex8_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<u8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_Byte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<s8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_UShort(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<u16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_Short(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<s16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_Float(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPosFloatMem(iAddress, pVtxAttr);
}
// ==============================================================================
// Index 16
// ==============================================================================
void LOADERDECL Pos_ReadIndex16_UByte(const void* _p){
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<u8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_Byte(const void* _p){
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<s8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_UShort(const void* _p){
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<u16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_Short(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<s16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_Float(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPosFloatMem(iAddress, pVtxAttr);
}
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef VERTEXHANDLER_POSITION_H
#define VERTEXHANDLER_POSITION_H
#include "Common.h"
#include "Utils.h"
// ==============================================================================
// Direct
// ==============================================================================
template<class T>
inline void LOADERDECL _ReadPos8Mem(int iAddress, TVtxAttr* pVtxAttr)
{
varray->SetPosX(((float)(T)Memory_Read_U8(iAddress)) * posScale);
varray->SetPosY(((float)(T)Memory_Read_U8(iAddress+1)) * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ(((float)(T)Memory_Read_U8(iAddress+2)) * posScale);
else
varray->SetPosZ(1.0);
}
template<class T>
inline void LOADERDECL _ReadPos16Mem(int iAddress, TVtxAttr* pVtxAttr)
{
varray->SetPosX(((float)(T)Memory_Read_U16(iAddress)) * posScale);
varray->SetPosY(((float)(T)Memory_Read_U16(iAddress+2)) * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ(((float)(T)Memory_Read_U16(iAddress+4)) * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL _ReadPosFloatMem(int iAddress, TVtxAttr* pVtxAttr)
{
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
varray->SetPosX(*(float*)&uTemp);
uTemp = Memory_Read_U32(iAddress+4);
varray->SetPosY(*(float*)&uTemp);
if (pVtxAttr->PosElements)
{
uTemp = Memory_Read_U32(iAddress+8);
varray->SetPosZ(*(float*)&uTemp);
}
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)DataReadU8() * posScale);
varray->SetPosY((float)DataReadU8() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)DataReadU8() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_Byte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)(s8)DataReadU8() * posScale);
varray->SetPosY((float)(s8)DataReadU8() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)(s8)DataReadU8() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_UShort(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)DataReadU16() * posScale);
varray->SetPosY((float)DataReadU16() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)DataReadU16() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_Short(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX((float)(s16)DataReadU16() * posScale);
varray->SetPosY((float)(s16)DataReadU16() * posScale);
if (pVtxAttr->PosElements)
varray->SetPosZ((float)(s16)DataReadU16() * posScale);
else
varray->SetPosZ(1.0);
}
void LOADERDECL Pos_ReadDirect_Float(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
varray->SetPosX(DataReadF32());
varray->SetPosY(DataReadF32());
if (pVtxAttr->PosElements)
varray->SetPosZ(DataReadF32());
else
varray->SetPosZ(1.0);
}
// ==============================================================================
// Index 8
// ==============================================================================
void LOADERDECL Pos_ReadIndex8_UByte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<u8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_Byte(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<s8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_UShort(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<u16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_Short(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<s16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex8_Float(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPosFloatMem(iAddress, pVtxAttr);
}
// ==============================================================================
// Index 16
// ==============================================================================
void LOADERDECL Pos_ReadIndex16_UByte(const void* _p){
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<u8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_Byte(const void* _p){
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos8Mem<s8>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_UShort(const void* _p){
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<u16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_Short(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPos16Mem<s16>(iAddress, pVtxAttr);
}
void LOADERDECL Pos_ReadIndex16_Float(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_POSITION] + (Index * arraystrides[ARRAY_POSITION]);
_ReadPosFloatMem(iAddress, pVtxAttr);
}
#endif

View File

@ -1,202 +1,202 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef VERTEXHANDLER_TEXCOORD_H
#define VERTEXHANDLER_TEXCOORD_H
extern int tcIndex;
void LOADERDECL TexCoord_ReadDirect_UByte(const void* _p)
{
varray->SetU(tcIndex, DataReadU8() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, DataReadU8() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Byte(const void* _p)
{
varray->SetU(tcIndex, (s8)DataReadU8() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (s8)DataReadU8() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_UShort(const void* _p)
{
varray->SetU(tcIndex, DataReadU16() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, DataReadU16() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Short(const void* _p)
{
varray->SetU(tcIndex, (s16)DataReadU16() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (s16)DataReadU16() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Float(const void* _p)
{
varray->SetU(tcIndex, DataReadF32() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, DataReadF32() * tcScaleV[tcIndex]);
tcIndex++;
}
// ==================================================================================
void LOADERDECL TexCoord_ReadIndex8_UByte(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(u8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(u8)Memory_Read_U8(iAddress+1) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_Byte(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(s8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(s8)Memory_Read_U8(iAddress+1) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_UShort(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(u16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(u16)Memory_Read_U16(iAddress+2) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_Short(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(s16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(s16)Memory_Read_U16(iAddress+2) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_Float(const void* _p)
{
u16 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
varray->SetU(tcIndex, *(float*)&uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = Memory_Read_U32(iAddress+4);
varray->SetV(tcIndex, *(float*)&uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
// ==================================================================================
void LOADERDECL TexCoord_ReadIndex16_UByte(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = (u8)Memory_Read_U8(iAddress );
varray->SetU(tcIndex, float(uTemp)* tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (u8)Memory_Read_U8(iAddress+1);
varray->SetV(tcIndex, float(uTemp)* tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_Byte(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = (s8)Memory_Read_U8(iAddress );
varray->SetU(tcIndex, float(uTemp)* tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (s8)Memory_Read_U8(iAddress+1);
varray->SetV(tcIndex, float(uTemp)* tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_UShort(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
float uTemp;
uTemp = (float)(u16)Memory_Read_U16(iAddress );
varray->SetU(tcIndex, uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (float)(u16)Memory_Read_U16(iAddress+2);
varray->SetV(tcIndex, uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_Short(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
float uTemp;
uTemp = (float)(s16)Memory_Read_U16(iAddress );
varray->SetU(tcIndex, uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (float)(s16)Memory_Read_U16(iAddress+2);
varray->SetV(tcIndex, uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_Float(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
varray->SetU(tcIndex, *(float*)&uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = Memory_Read_U32(iAddress+4);
varray->SetV(tcIndex, *(float*)&uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef VERTEXHANDLER_TEXCOORD_H
#define VERTEXHANDLER_TEXCOORD_H
extern int tcIndex;
void LOADERDECL TexCoord_ReadDirect_UByte(const void* _p)
{
varray->SetU(tcIndex, DataReadU8() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, DataReadU8() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Byte(const void* _p)
{
varray->SetU(tcIndex, (s8)DataReadU8() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (s8)DataReadU8() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_UShort(const void* _p)
{
varray->SetU(tcIndex, DataReadU16() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, DataReadU16() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Short(const void* _p)
{
varray->SetU(tcIndex, (s16)DataReadU16() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (s16)DataReadU16() * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadDirect_Float(const void* _p)
{
varray->SetU(tcIndex, DataReadF32() * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, DataReadF32() * tcScaleV[tcIndex]);
tcIndex++;
}
// ==================================================================================
void LOADERDECL TexCoord_ReadIndex8_UByte(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(u8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(u8)Memory_Read_U8(iAddress+1) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_Byte(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(s8)Memory_Read_U8(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(s8)Memory_Read_U8(iAddress+1) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_UShort(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(u16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(u16)Memory_Read_U16(iAddress+2) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_Short(const void* _p)
{
u8 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
varray->SetU(tcIndex, (float)(s16)Memory_Read_U16(iAddress) * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
varray->SetV(tcIndex, (float)(s16)Memory_Read_U16(iAddress+2) * tcScaleV[tcIndex]);
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex8_Float(const void* _p)
{
u16 Index = DataReadU8();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
varray->SetU(tcIndex, *(float*)&uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = Memory_Read_U32(iAddress+4);
varray->SetV(tcIndex, *(float*)&uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
// ==================================================================================
void LOADERDECL TexCoord_ReadIndex16_UByte(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = (u8)Memory_Read_U8(iAddress );
varray->SetU(tcIndex, float(uTemp)* tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (u8)Memory_Read_U8(iAddress+1);
varray->SetV(tcIndex, float(uTemp)* tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_Byte(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = (s8)Memory_Read_U8(iAddress );
varray->SetU(tcIndex, float(uTemp)* tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (s8)Memory_Read_U8(iAddress+1);
varray->SetV(tcIndex, float(uTemp)* tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_UShort(const void* _p)
{
TVtxAttr* pVtxAttr = (TVtxAttr*)_p;
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
float uTemp;
uTemp = (float)(u16)Memory_Read_U16(iAddress );
varray->SetU(tcIndex, uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (float)(u16)Memory_Read_U16(iAddress+2);
varray->SetV(tcIndex, uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_Short(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
float uTemp;
uTemp = (float)(s16)Memory_Read_U16(iAddress );
varray->SetU(tcIndex, uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = (float)(s16)Memory_Read_U16(iAddress+2);
varray->SetV(tcIndex, uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
void LOADERDECL TexCoord_ReadIndex16_Float(const void* _p)
{
u16 Index = DataReadU16();
u32 iAddress = arraybases[ARRAY_TEXCOORD0+tcIndex] + (Index * arraystrides[ARRAY_TEXCOORD0+tcIndex]);
u32 uTemp;
uTemp = Memory_Read_U32(iAddress );
varray->SetU(tcIndex, *(float*)&uTemp * tcScaleU[tcIndex]);
if (tcElements[tcIndex])
{
uTemp = Memory_Read_U32(iAddress+4);
varray->SetV(tcIndex, *(float*)&uTemp * tcScaleV[tcIndex]);
}
tcIndex++;
}
#endif

View File

@ -1,61 +1,61 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "CPStructs.h"
#include "VertexLoader.h"
#include "DecodedVArray.h"
struct UV
{
float u,v,w;
};
struct D3DVertex {
Vec3 pos;
Vec3 normal;
u32 colors[2];
UV uv[8];
};
enum Collection
{
C_NOTHING=0,
C_TRIANGLES=1,
C_LINES=2,
C_POINTS=3
};
namespace VertexManager
{
extern const Collection collectionTypeLUT[8];
bool Init();
void Shutdown();
void BeginFrame();
void CreateDeviceObjects();
void DestroyDeviceObjects();
void AddVertices(int _primitive, int _numVertices, const DecodedVArray *varray);
void Flush();
} // namespace
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#include "CPStructs.h"
#include "VertexLoader.h"
#include "DecodedVArray.h"
struct UV
{
float u,v,w;
};
struct D3DVertex {
Vec3 pos;
Vec3 normal;
u32 colors[2];
UV uv[8];
};
enum Collection
{
C_NOTHING=0,
C_TRIANGLES=1,
C_LINES=2,
C_POINTS=3
};
namespace VertexManager
{
extern const Collection collectionTypeLUT[8];
bool Init();
void Shutdown();
void BeginFrame();
void CreateDeviceObjects();
void DestroyDeviceObjects();
void AddVertices(int _primitive, int _numVertices, const DecodedVArray *varray);
void Flush();
} // namespace

View File

@ -1,50 +1,50 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VERTEXSHADER_H
#define _VERTEXSHADER_H
#include "Common.h"
const char *GenerateVertexShader();
// shader variables
#define I_POSNORMALMATRIX "cpnmtx"
#define I_PROJECTION "cproj"
#define I_MATERIALS "cmtrl"
#define I_LIGHTS "clights"
#define I_TEXMATRICES "ctexmtx"
#define I_TRANSFORMMATRICES "ctrmtx"
#define I_NORMALMATRICES "cnmtx"
#define I_POSTTRANSFORMMATRICES "cpostmtx"
#define I_FOGPARAMS "cfog"
#define C_POSNORMALMATRIX 0
#define C_PROJECTION (C_POSNORMALMATRIX+6)
#define C_MATERIALS (C_PROJECTION+4)
#define C_LIGHTS (C_MATERIALS+4)
#define C_TEXMATRICES (C_LIGHTS+40)
#define C_TRANSFORMMATRICES (C_TEXMATRICES+24)
#define C_NORMALMATRICES (C_TRANSFORMMATRICES+64)
#define C_POSTTRANSFORMMATRICES (C_NORMALMATRICES+32)
#define C_FOGPARAMS (C_POSTTRANSFORMMATRICES+64)
#define PS_CONST_COLORS 0
#define PS_CONST_KCOLORS 4
#define PS_CONST_CONSTALPHA 8
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VERTEXSHADER_H
#define _VERTEXSHADER_H
#include "Common.h"
const char *GenerateVertexShader();
// shader variables
#define I_POSNORMALMATRIX "cpnmtx"
#define I_PROJECTION "cproj"
#define I_MATERIALS "cmtrl"
#define I_LIGHTS "clights"
#define I_TEXMATRICES "ctexmtx"
#define I_TRANSFORMMATRICES "ctrmtx"
#define I_NORMALMATRICES "cnmtx"
#define I_POSTTRANSFORMMATRICES "cpostmtx"
#define I_FOGPARAMS "cfog"
#define C_POSNORMALMATRIX 0
#define C_PROJECTION (C_POSNORMALMATRIX+6)
#define C_MATERIALS (C_PROJECTION+4)
#define C_LIGHTS (C_MATERIALS+4)
#define C_TEXMATRICES (C_LIGHTS+40)
#define C_TRANSFORMMATRICES (C_TEXMATRICES+24)
#define C_NORMALMATRICES (C_TRANSFORMMATRICES+64)
#define C_POSTTRANSFORMMATRICES (C_NORMALMATRICES+32)
#define C_FOGPARAMS (C_POSTTRANSFORMMATRICES+64)
#define PS_CONST_COLORS 0
#define PS_CONST_KCOLORS 4
#define PS_CONST_CONSTALPHA 8
#endif

View File

@ -1,12 +1,12 @@
#pragma once
#include <windows.h>
class DialogManager
{
public:
static void AddDlg(HWND hDialog);
static bool IsDialogMessage(LPMSG message);
static void EnableAll(BOOL enable);
};
#pragma once
#include <windows.h>
class DialogManager
{
public:
static void AddDlg(HWND hDialog);
static bool IsDialogMessage(LPMSG message);
static void EnableAll(BOOL enable);
};

View File

@ -1,61 +1,61 @@
#ifndef __LAMEFILE_H__
#define __LAMEFILE_H__
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
namespace W32Util
{
enum eFileMode
{
FILE_READ=5,
FILE_WRITE=6,
FILE_ERROR=0xff
};
class File
{
HANDLE fileHandle;
eFileMode mode;
bool isOpen;
public:
File();
virtual ~File();
bool Open(const TCHAR *filename, eFileMode mode);
void Adopt(HANDLE h) { fileHandle = h;}
void Close();
void WriteInt(int i);
void WriteChar(char i);
int Write(void *data, int size);
int ReadInt();
char ReadChar();
int Read(void *data, int size);
int WR(void *data, int size); //write or read depending on open mode
bool MagicCookie(int cookie);
int GetSize();
eFileMode GetMode() {return mode;}
void SeekBeg(int pos)
{
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_BEGIN);
}
void SeekEnd(int pos)
{
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_END);
}
void SeekCurrent(int pos)
{
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_CURRENT);
}
};
}
#ifndef __LAMEFILE_H__
#define __LAMEFILE_H__
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
namespace W32Util
{
enum eFileMode
{
FILE_READ=5,
FILE_WRITE=6,
FILE_ERROR=0xff
};
class File
{
HANDLE fileHandle;
eFileMode mode;
bool isOpen;
public:
File();
virtual ~File();
bool Open(const TCHAR *filename, eFileMode mode);
void Adopt(HANDLE h) { fileHandle = h;}
void Close();
void WriteInt(int i);
void WriteChar(char i);
int Write(void *data, int size);
int ReadInt();
char ReadChar();
int Read(void *data, int size);
int WR(void *data, int size); //write or read depending on open mode
bool MagicCookie(int cookie);
int GetSize();
eFileMode GetMode() {return mode;}
void SeekBeg(int pos)
{
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_BEGIN);
}
void SeekEnd(int pos)
{
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_END);
}
void SeekCurrent(int pos)
{
if (isOpen) SetFilePointer(fileHandle,pos,0,FILE_CURRENT);
}
};
}
#endif //__LAMEFILE_H__

View File

@ -1,9 +1,9 @@
#pragma once
namespace W32Util
{
void CenterWindow(HWND hwnd);
HBITMAP CreateBitmapFromARGB(HWND someHwnd, DWORD *image, int w, int h);
void NiceSizeFormat(size_t size, char *out);
BOOL CopyTextToClipboard(HWND hwnd, TCHAR *text);
#pragma once
namespace W32Util
{
void CenterWindow(HWND hwnd);
HBITMAP CreateBitmapFromARGB(HWND someHwnd, DWORD *image, int w, int h);
void NiceSizeFormat(size_t size, char *out);
BOOL CopyTextToClipboard(HWND hwnd, TCHAR *text);
}

View File

@ -1,86 +1,86 @@
#pragma once
#include <vector>
namespace W32Util
{
class PropSheet;
class Tab
{
public:
PropSheet *sheet; //back pointer ..
virtual void Init(HWND hDlg) {}
virtual void Command(HWND hDlg, WPARAM wParam) {}
virtual void Apply(HWND hDlg) {}
virtual bool HasPrev() {return true;}
virtual bool HasFinish() {return false;}
virtual bool HasNext() {return true;}
static INT_PTR __stdcall TabDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
};
class WizExteriorPage : public Tab
{
int captionID;
public:
WizExteriorPage(int caption) {captionID = caption;}
void Init(HWND hDlg);
};
class WizFirstPage : public WizExteriorPage
{
public:
WizFirstPage(int caption) : WizExteriorPage(caption) {}
bool HasPrev() {return false;}
};
class WizLastPage : public WizExteriorPage
{
public:
WizLastPage(int caption) : WizExteriorPage(caption) {}
bool HasNext() {return false;}
bool HasFinish() {return true;}
};
class WizInteriorPage : public Tab
{
public:
};
class PropSheet
{
LPCTSTR watermark;
LPCTSTR header;
HFONT hTitleFont;
HFONT hDialogFont;
HICON icon;
struct Page
{
Page(Tab *_tab, LPCTSTR _resource, LPCTSTR _title, LPCTSTR _subtitle = 0)
: tab(_tab), resource(_resource), title(_title), hdrSubTitle(_subtitle) {}
Tab *tab;
LPCTSTR resource;
LPCTSTR title;
LPCTSTR hdrSubTitle;
};
public:
PropSheet();
typedef std::vector<Page> DlgList;
DlgList list;
void SetWaterMark(LPCTSTR _watermark) {watermark=_watermark;}
void SetHeader(LPCTSTR _header) {header=_header;}
void SetIcon(HICON _icon) {icon = _icon;}
void Add(Tab *tab, LPCTSTR resource, LPCTSTR title, LPCTSTR subtitle = 0);
void Show(HINSTANCE hInstance, HWND hParent, std::string title, int startpage=0, bool floating = false, bool wizard = false);
HFONT GetTitleFont() {return hTitleFont;}
HFONT GetFont() {return hDialogFont;}
static int CALLBACK Callback(HWND hwndDlg, UINT uMsg, LPARAM lParam);
};
#pragma once
#include <vector>
namespace W32Util
{
class PropSheet;
class Tab
{
public:
PropSheet *sheet; //back pointer ..
virtual void Init(HWND hDlg) {}
virtual void Command(HWND hDlg, WPARAM wParam) {}
virtual void Apply(HWND hDlg) {}
virtual bool HasPrev() {return true;}
virtual bool HasFinish() {return false;}
virtual bool HasNext() {return true;}
static INT_PTR __stdcall TabDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
};
class WizExteriorPage : public Tab
{
int captionID;
public:
WizExteriorPage(int caption) {captionID = caption;}
void Init(HWND hDlg);
};
class WizFirstPage : public WizExteriorPage
{
public:
WizFirstPage(int caption) : WizExteriorPage(caption) {}
bool HasPrev() {return false;}
};
class WizLastPage : public WizExteriorPage
{
public:
WizLastPage(int caption) : WizExteriorPage(caption) {}
bool HasNext() {return false;}
bool HasFinish() {return true;}
};
class WizInteriorPage : public Tab
{
public:
};
class PropSheet
{
LPCTSTR watermark;
LPCTSTR header;
HFONT hTitleFont;
HFONT hDialogFont;
HICON icon;
struct Page
{
Page(Tab *_tab, LPCTSTR _resource, LPCTSTR _title, LPCTSTR _subtitle = 0)
: tab(_tab), resource(_resource), title(_title), hdrSubTitle(_subtitle) {}
Tab *tab;
LPCTSTR resource;
LPCTSTR title;
LPCTSTR hdrSubTitle;
};
public:
PropSheet();
typedef std::vector<Page> DlgList;
DlgList list;
void SetWaterMark(LPCTSTR _watermark) {watermark=_watermark;}
void SetHeader(LPCTSTR _header) {header=_header;}
void SetIcon(HICON _icon) {icon = _icon;}
void Add(Tab *tab, LPCTSTR resource, LPCTSTR title, LPCTSTR subtitle = 0);
void Show(HINSTANCE hInstance, HWND hParent, std::string title, int startpage=0, bool floating = false, bool wizard = false);
HFONT GetTitleFont() {return hTitleFont;}
HFONT GetFont() {return hDialogFont;}
static int CALLBACK Callback(HWND hwndDlg, UINT uMsg, LPARAM lParam);
};
}

View File

@ -1,15 +1,15 @@
#pragma once
#include <xstring>
#include <vector>
namespace W32Util
{
std::string BrowseForFolder(HWND parent, char *title);
bool BrowseForFileName (bool _bLoad, HWND _hParent, const char *_pTitle,
const char *_pInitialFolder,const char *_pFilter,const char *_pExtension,
std::string& _strFileName);
std::vector<std::string> BrowseForFileNameMultiSelect(bool _bLoad, HWND _hParent, const char *_pTitle,
const char *_pInitialFolder,const char *_pFilter,const char *_pExtension);
#pragma once
#include <xstring>
#include <vector>
namespace W32Util
{
std::string BrowseForFolder(HWND parent, char *title);
bool BrowseForFileName (bool _bLoad, HWND _hParent, const char *_pTitle,
const char *_pInitialFolder,const char *_pFilter,const char *_pExtension,
std::string& _strFileName);
std::vector<std::string> BrowseForFileNameMultiSelect(bool _bLoad, HWND _hParent, const char *_pTitle,
const char *_pInitialFolder,const char *_pFilter,const char *_pExtension);
}

View File

@ -1,36 +1,36 @@
#pragma once
namespace W32Util
{
#define MAX_WIN_DIALOGS 32
class TabControl
{
private:
HINSTANCE m_hInstance;
HWND m_hWndParent;
HWND m_hTabCtrl;
HWND m_WinDialogs[MAX_WIN_DIALOGS];
int m_numDialogs;
public:
TabControl(HINSTANCE _hInstance, HWND _hTabCtrl,DLGPROC _lpDialogFunc);
~TabControl(void);
//
// --- tools ---
//
HWND AddItem (char* _szText,int _iResource,DLGPROC _lpDialogFunc);
void SelectDialog (int _nDialogId);
void MessageHandler(UINT message, WPARAM wParam, LPARAM lParam);
};
}
#pragma once
namespace W32Util
{
#define MAX_WIN_DIALOGS 32
class TabControl
{
private:
HINSTANCE m_hInstance;
HWND m_hWndParent;
HWND m_hTabCtrl;
HWND m_WinDialogs[MAX_WIN_DIALOGS];
int m_numDialogs;
public:
TabControl(HINSTANCE _hInstance, HWND _hTabCtrl,DLGPROC _lpDialogFunc);
~TabControl(void);
//
// --- tools ---
//
HWND AddItem (char* _szText,int _iResource,DLGPROC _lpDialogFunc);
void SelectDialog (int _nDialogId);
void MessageHandler(UINT message, WPARAM wParam, LPARAM lParam);
};
}

View File

@ -1,36 +1,36 @@
#pragma once
namespace W32Util
{
class Thread
{
private:
HANDLE _handle;
DWORD _tid; // thread id
public:
Thread ( DWORD (WINAPI * pFun) (void* arg), void* pArg);
~Thread () ;
//
// --- tools ---
//
void Resume(void);
void Suspend(void);
void WaitForDeath(void);
void Terminate(void);
void SetPriority(int _nPriority);
bool IsActive (void);
HANDLE GetHandle(void) {return _handle;}
};
}
#pragma once
namespace W32Util
{
class Thread
{
private:
HANDLE _handle;
DWORD _tid; // thread id
public:
Thread ( DWORD (WINAPI * pFun) (void* arg), void* pArg);
~Thread () ;
//
// --- tools ---
//
void Resume(void);
void Suspend(void);
void WaitForDeath(void);
void Terminate(void);
void SetPriority(int _nPriority);
bool IsActive (void);
HANDLE GetHandle(void) {return _handle;}
};
}

View File

@ -1,30 +1,30 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _XFSTRUCTS_H
#define _XFSTRUCTS_H
#include "Common.h"
#include "Vec3.h"
#include "XFMemory.h"
void XFUpdateVP();
void XFUpdatePJ();
void LoadXFReg(u32 transferSize, u32 address, u32 *pData);
void LoadIndexedXF(u32 val, int array);
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _XFSTRUCTS_H
#define _XFSTRUCTS_H
#include "Common.h"
#include "Vec3.h"
#include "XFMemory.h"
void XFUpdateVP();
void XFUpdatePJ();
void LoadXFReg(u32 transferSize, u32 address, u32 *pData);
void LoadIndexedXF(u32 val, int array);
#endif

View File

@ -1,27 +1,27 @@
/* bmp_io.h 16 May 1999 */
#ifndef _BMP_IO_H
#define _BMP_IO_H
int bmp_read ( char *filein_name, int *xsize, int *ysize, int **rarray,
int **garray, int **barray );
int bmp_read_data ( FILE *filein, int xsize, int ysize, int *rarray,
int *garray, int *barray );
int bmp_read_header ( FILE *filein, int *xsize, int *ysize, int *psize );
int bmp_read_palette ( FILE *filein, int psize );
int bmp_read_test ( char *filein_name );
int bmp_write ( char *fileout_name, int xsize, int ysize, char* rgba );
int bmp_write_data ( FILE *fileout, int xsize, int ysize, char *rarray, char *garray, char *barray );
int bmp_write_header ( FILE *fileout, int xsize, int ysize );
int bmp_write_test ( char *fileout_name );
int read_u_long_int ( unsigned long int *u_long_int_val, FILE *filein );
int read_u_short_int ( unsigned short int *u_short_int_val, FILE *filein );
int write_u_long_int ( unsigned long int u_long_int_val, FILE *fileout );
int write_u_short_int ( unsigned short int u_short_int_val, FILE *fileout );
/* bmp_io.h 16 May 1999 */
#ifndef _BMP_IO_H
#define _BMP_IO_H
int bmp_read ( char *filein_name, int *xsize, int *ysize, int **rarray,
int **garray, int **barray );
int bmp_read_data ( FILE *filein, int xsize, int ysize, int *rarray,
int *garray, int *barray );
int bmp_read_header ( FILE *filein, int *xsize, int *ysize, int *psize );
int bmp_read_palette ( FILE *filein, int psize );
int bmp_read_test ( char *filein_name );
int bmp_write ( char *fileout_name, int xsize, int ysize, char* rgba );
int bmp_write_data ( FILE *fileout, int xsize, int ysize, char *rarray, char *garray, char *barray );
int bmp_write_header ( FILE *fileout, int xsize, int ysize );
int bmp_write_test ( char *fileout_name );
int read_u_long_int ( unsigned long int *u_long_int_val, FILE *filein );
int read_u_short_int ( unsigned short int *u_short_int_val, FILE *filein );
int write_u_long_int ( unsigned long int u_long_int_val, FILE *fileout );
int write_u_short_int ( unsigned short int u_short_int_val, FILE *fileout );
#endif

View File

@ -1,28 +1,28 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef MAIN_H
#define MAIN_H
#include "PluginSpecs_Video.h"
#include "Render.h"
extern SVideoInitialize g_VideoInitialize;
void DebugLog(const char* _fmt, ...);
#endif
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef MAIN_H
#define MAIN_H
#include "PluginSpecs_Video.h"
#include "Render.h"
extern SVideoInitialize g_VideoInitialize;
void DebugLog(const char* _fmt, ...);
#endif

View File

@ -1,67 +1,67 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by resource.rc
//
#define IDD_ABOUT 101
#define IDD_SETTINGS 102
#define IDD_DEBUGGER 103
#define IDD_ADVANCED 104
#define IDD_ENHANCEMENTS 105
#define IDC_ENABLETEXTURING 1001
#define IDC_CHECK2 1002
#define IDC_WIREFRAME 1002
#define IDC_USESHADERS 1002
#define IDC_FORCEANISOTROPY 1002
#define IDC_FULLSCREENENABLE 1002
#define IDC_LIST1 1003
#define IDC_FULLSCREENENABLE2 1003
#define IDC_VSYNC 1003
#define IDC_DEBUGSTEP 1004
#define IDC_RENDER_TO_MAINWINDOW 1004
#define IDC_REGISTERS 1005
#define IDC_ENABLEDEBUGGING 1006
#define IDC_TAB1 1007
#define IDC_REGISTERSELECT 1007
#define IDC_ADAPTER 1008
#define IDC_DEVICE 1009
#define IDC_RESOLUTION 1010
#define IDC_RESOLUTIONWINDOWED 1011
#define IDC_ANTIALIASMODE 1012
#define IDC_PPPARAM1 1013
#define IDC_SHADERVERSION 1013
#define IDC_PPPARAM2 1014
#define IDC_CHECK1 1015
#define IDC_POSTPROCESS 1016
#define IDC_TRUFORM 1016
#define IDC_PPPARAM1LABEL 1017
#define IDC_POSTPROCESSEFFECT 1017
#define IDC_PPPARAM2LABEL 1018
#define IDC_PPPARAM1LABEL2 1018
#define IDC_ANTIALIASQUALITY 1019
#define IDC_ENABLEPOSTPROCESS 1020
#define IDC_ANIMATE1 1021
#define IDC_OVERLAYSTATS 1022
#define IDC_DLOPTLEVEL 1023
#define IDC_PREUPSCALETYPE 1024
#define IDC_TRUFORMLEVEL 1025
#define IDC_PREUPSCALE 1026
#define IDC_SLIDER1 1027
#define IDC_TEXDUMPPATH 1028
#define IDC_TEXDUMP 1029
#define IDC_FORCEFILTERING 1030
#define IDC_BROWSETEXDUMPPATH 1031
#define IDC_SHOWSHADERERRORS 1033
#define IDC_CHECK3 1034
#define IDC_TEXFMT_CENTER 1034
#define IDC_TEXFMT_OVERLAY 1035
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1036
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by resource.rc
//
#define IDD_ABOUT 101
#define IDD_SETTINGS 102
#define IDD_DEBUGGER 103
#define IDD_ADVANCED 104
#define IDD_ENHANCEMENTS 105
#define IDC_ENABLETEXTURING 1001
#define IDC_CHECK2 1002
#define IDC_WIREFRAME 1002
#define IDC_USESHADERS 1002
#define IDC_FORCEANISOTROPY 1002
#define IDC_FULLSCREENENABLE 1002
#define IDC_LIST1 1003
#define IDC_FULLSCREENENABLE2 1003
#define IDC_VSYNC 1003
#define IDC_DEBUGSTEP 1004
#define IDC_RENDER_TO_MAINWINDOW 1004
#define IDC_REGISTERS 1005
#define IDC_ENABLEDEBUGGING 1006
#define IDC_TAB1 1007
#define IDC_REGISTERSELECT 1007
#define IDC_ADAPTER 1008
#define IDC_DEVICE 1009
#define IDC_RESOLUTION 1010
#define IDC_RESOLUTIONWINDOWED 1011
#define IDC_ANTIALIASMODE 1012
#define IDC_PPPARAM1 1013
#define IDC_SHADERVERSION 1013
#define IDC_PPPARAM2 1014
#define IDC_CHECK1 1015
#define IDC_POSTPROCESS 1016
#define IDC_TRUFORM 1016
#define IDC_PPPARAM1LABEL 1017
#define IDC_POSTPROCESSEFFECT 1017
#define IDC_PPPARAM2LABEL 1018
#define IDC_PPPARAM1LABEL2 1018
#define IDC_ANTIALIASQUALITY 1019
#define IDC_ENABLEPOSTPROCESS 1020
#define IDC_ANIMATE1 1021
#define IDC_OVERLAYSTATS 1022
#define IDC_DLOPTLEVEL 1023
#define IDC_PREUPSCALETYPE 1024
#define IDC_TRUFORMLEVEL 1025
#define IDC_PREUPSCALE 1026
#define IDC_SLIDER1 1027
#define IDC_TEXDUMPPATH 1028
#define IDC_TEXDUMP 1029
#define IDC_FORCEFILTERING 1030
#define IDC_BROWSETEXDUMPPATH 1031
#define IDC_SHOWSHADERERRORS 1033
#define IDC_CHECK3 1034
#define IDC_TEXFMT_CENTER 1034
#define IDC_TEXFMT_OVERLAY 1035
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1036
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -1,26 +1,26 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#define _WIN32_WINNT 0x501
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
#include <tchar.h>
#include <windows.h>
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#pragma once
#define _WIN32_WINNT 0x501
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500 // Default value is 0x0400
#endif
#include <tchar.h>
#include <windows.h>