mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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:
@ -1,27 +1,27 @@
|
||||
// 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
|
||||
|
||||
#include "BPMemory.h"
|
||||
|
||||
void BPInit();
|
||||
void LoadBPReg(u32 value0);
|
||||
void BPReload();
|
||||
|
||||
#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 _BPSTRUCTS_H
|
||||
#define _BPSTRUCTS_H
|
||||
|
||||
#include "BPMemory.h"
|
||||
|
||||
void BPInit();
|
||||
void LoadBPReg(u32 value0);
|
||||
void BPReload();
|
||||
|
||||
#endif
|
||||
|
@ -1,81 +1,81 @@
|
||||
// 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 _CONFIG_H
|
||||
#define _CONFIG_H
|
||||
|
||||
// Log in two categories, andsave three other options in the same byte
|
||||
#define CONF_LOG 1
|
||||
#define CONF_PRIMLOG 2
|
||||
#define CONF_SAVETEXTURES 4
|
||||
#define CONF_SAVETARGETS 8
|
||||
#define CONF_SAVESHADERS 16
|
||||
|
||||
struct Config
|
||||
{
|
||||
Config();
|
||||
void Load();
|
||||
void Save();
|
||||
|
||||
// General
|
||||
bool bFullscreen;
|
||||
bool renderToMainframe;
|
||||
char iFSResolution[16];
|
||||
char iWindowedRes[16];
|
||||
bool bStretchToFit;
|
||||
bool bKeepAR;
|
||||
bool bHideCursor;
|
||||
bool bSafeTextureCache;
|
||||
|
||||
// Enhancements
|
||||
int iMultisampleMode;
|
||||
bool bForceFiltering;
|
||||
int iMaxAnisotropy;
|
||||
|
||||
// Information
|
||||
bool bShowFPS;
|
||||
bool bOverlayStats;
|
||||
bool bTexFmtOverlayEnable;
|
||||
bool bTexFmtOverlayCenter;
|
||||
|
||||
// Render
|
||||
bool bUseXFB;
|
||||
bool bWireFrame;
|
||||
bool bDisableLighting;
|
||||
bool bDisableTexturing;
|
||||
|
||||
// Utility
|
||||
char texDumpPath[280];
|
||||
bool bDumpTextures;
|
||||
|
||||
// Hacks
|
||||
bool bEFBToTextureDisable;
|
||||
bool bEFBToTextureDisableHotKey;
|
||||
bool bProjectionHax1;
|
||||
bool bProjectionHax2;
|
||||
|
||||
int iLog; // CONF_ bits
|
||||
int iSaveTargetId;
|
||||
|
||||
//currently unused:
|
||||
int iCompileDLsLevel;
|
||||
bool bShowShaderErrors;
|
||||
};
|
||||
|
||||
extern Config g_Config;
|
||||
|
||||
#endif // _CONFIG_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/
|
||||
|
||||
#ifndef _CONFIG_H
|
||||
#define _CONFIG_H
|
||||
|
||||
// Log in two categories, andsave three other options in the same byte
|
||||
#define CONF_LOG 1
|
||||
#define CONF_PRIMLOG 2
|
||||
#define CONF_SAVETEXTURES 4
|
||||
#define CONF_SAVETARGETS 8
|
||||
#define CONF_SAVESHADERS 16
|
||||
|
||||
struct Config
|
||||
{
|
||||
Config();
|
||||
void Load();
|
||||
void Save();
|
||||
|
||||
// General
|
||||
bool bFullscreen;
|
||||
bool renderToMainframe;
|
||||
char iFSResolution[16];
|
||||
char iWindowedRes[16];
|
||||
bool bStretchToFit;
|
||||
bool bKeepAR;
|
||||
bool bHideCursor;
|
||||
bool bSafeTextureCache;
|
||||
|
||||
// Enhancements
|
||||
int iMultisampleMode;
|
||||
bool bForceFiltering;
|
||||
int iMaxAnisotropy;
|
||||
|
||||
// Information
|
||||
bool bShowFPS;
|
||||
bool bOverlayStats;
|
||||
bool bTexFmtOverlayEnable;
|
||||
bool bTexFmtOverlayCenter;
|
||||
|
||||
// Render
|
||||
bool bUseXFB;
|
||||
bool bWireFrame;
|
||||
bool bDisableLighting;
|
||||
bool bDisableTexturing;
|
||||
|
||||
// Utility
|
||||
char texDumpPath[280];
|
||||
bool bDumpTextures;
|
||||
|
||||
// Hacks
|
||||
bool bEFBToTextureDisable;
|
||||
bool bEFBToTextureDisableHotKey;
|
||||
bool bProjectionHax1;
|
||||
bool bProjectionHax2;
|
||||
|
||||
int iLog; // CONF_ bits
|
||||
int iSaveTargetId;
|
||||
|
||||
//currently unused:
|
||||
int iCompileDLsLevel;
|
||||
bool bShowShaderErrors;
|
||||
};
|
||||
|
||||
extern Config g_Config;
|
||||
|
||||
#endif // _CONFIG_H
|
||||
|
@ -1,143 +1,143 @@
|
||||
// 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 __CDebugger_h__
|
||||
#define __CDebugger_h__
|
||||
|
||||
|
||||
// wx stuff, I'm not sure if we use all these
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dialog.h>
|
||||
#else
|
||||
#include <wx/wxprec.h>
|
||||
#endif
|
||||
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/statbmp.h>
|
||||
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/imaglist.h>
|
||||
#include <wx/notebook.h> // notebook
|
||||
|
||||
#include "../Globals.h"
|
||||
|
||||
class CPBView;
|
||||
class IniFile;
|
||||
|
||||
// Window settings - I'm not sure what these do. I just copied them gtom elsewhere basically.
|
||||
#undef CDebugger_STYLE
|
||||
|
||||
#define CDebugger_STYLE wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE
|
||||
|
||||
class CDebugger : public wxDialog
|
||||
{
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
public:
|
||||
CDebugger(wxWindow *parent, wxWindowID id = 1, const wxString &title = _("Sound Debugger"),
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = CDebugger_STYLE);
|
||||
|
||||
virtual ~CDebugger();
|
||||
|
||||
void Save(IniFile& _IniFile) const;
|
||||
void Load(IniFile& _IniFile);
|
||||
void DoHide(); void DoShow();
|
||||
|
||||
void NotifyUpdate();
|
||||
void OnUpdate(wxCommandEvent& event);
|
||||
|
||||
void GeneralSettings(wxCommandEvent& event);
|
||||
void LogSettings(wxCommandEvent& event);
|
||||
void DoShowHideConsole();
|
||||
void ChangeFrequency(wxCommandEvent& event);
|
||||
void DoChangeFrequency();
|
||||
void ChangePreset(wxCommandEvent& event);
|
||||
void DoChangePreset();
|
||||
|
||||
void Ap(wxCommandEvent& event);
|
||||
void Am(wxCommandEvent& event);
|
||||
void Bp(wxCommandEvent& event);
|
||||
void Bm(wxCommandEvent& event);
|
||||
|
||||
CPBView* m_GPRListView;
|
||||
|
||||
int gUpdFreq;
|
||||
bool bInfoLog;
|
||||
bool bPrimLog;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// declarations
|
||||
wxNotebook *m_Notebook; // notebook
|
||||
wxPanel *m_PageMain;
|
||||
|
||||
wxCheckBox *m_Check[7];
|
||||
wxCheckListBox * m_options, * m_settings;
|
||||
wxRadioButton *m_Radio[5];
|
||||
wxRadioBox *m_RadioBox[3];
|
||||
wxStaticBox *m_Label[2];
|
||||
wxPanel *m_Controller;
|
||||
|
||||
// WARNING: Make sure these are not also elsewhere, for example in resource.h.
|
||||
enum
|
||||
{
|
||||
ID_NOTEBOOK = 2000, ID_PAGEMAIN, // notebook
|
||||
|
||||
ID_SAVETOFILE, ID_SHOWCONSOLE, // options
|
||||
IDC_CHECK2,
|
||||
IDC_CHECK3,
|
||||
IDC_CHECK4,
|
||||
IDC_CHECK5,
|
||||
IDC_CHECK6,
|
||||
IDC_CHECK7,
|
||||
IDC_CHECK8,
|
||||
IDC_CHECK9,
|
||||
|
||||
ID_CHECKLIST1,
|
||||
|
||||
IDC_RADIO0,
|
||||
IDC_RADIO1,
|
||||
IDC_RADIO2,
|
||||
IDC_RADIO3,
|
||||
|
||||
IDG_LABEL1,
|
||||
IDG_LABEL2,
|
||||
|
||||
ID_UPD,
|
||||
ID_AP,
|
||||
ID_AM,
|
||||
ID_BP,
|
||||
ID_BM,
|
||||
ID_GPR,
|
||||
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
|
||||
|
||||
};
|
||||
|
||||
void OnShow(wxShowEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControls();
|
||||
};
|
||||
|
||||
#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 __CDebugger_h__
|
||||
#define __CDebugger_h__
|
||||
|
||||
|
||||
// wx stuff, I'm not sure if we use all these
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dialog.h>
|
||||
#else
|
||||
#include <wx/wxprec.h>
|
||||
#endif
|
||||
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/statbmp.h>
|
||||
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/imaglist.h>
|
||||
#include <wx/notebook.h> // notebook
|
||||
|
||||
#include "../Globals.h"
|
||||
|
||||
class CPBView;
|
||||
class IniFile;
|
||||
|
||||
// Window settings - I'm not sure what these do. I just copied them gtom elsewhere basically.
|
||||
#undef CDebugger_STYLE
|
||||
|
||||
#define CDebugger_STYLE wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE
|
||||
|
||||
class CDebugger : public wxDialog
|
||||
{
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
public:
|
||||
CDebugger(wxWindow *parent, wxWindowID id = 1, const wxString &title = _("Sound Debugger"),
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = CDebugger_STYLE);
|
||||
|
||||
virtual ~CDebugger();
|
||||
|
||||
void Save(IniFile& _IniFile) const;
|
||||
void Load(IniFile& _IniFile);
|
||||
void DoHide(); void DoShow();
|
||||
|
||||
void NotifyUpdate();
|
||||
void OnUpdate(wxCommandEvent& event);
|
||||
|
||||
void GeneralSettings(wxCommandEvent& event);
|
||||
void LogSettings(wxCommandEvent& event);
|
||||
void DoShowHideConsole();
|
||||
void ChangeFrequency(wxCommandEvent& event);
|
||||
void DoChangeFrequency();
|
||||
void ChangePreset(wxCommandEvent& event);
|
||||
void DoChangePreset();
|
||||
|
||||
void Ap(wxCommandEvent& event);
|
||||
void Am(wxCommandEvent& event);
|
||||
void Bp(wxCommandEvent& event);
|
||||
void Bm(wxCommandEvent& event);
|
||||
|
||||
CPBView* m_GPRListView;
|
||||
|
||||
int gUpdFreq;
|
||||
bool bInfoLog;
|
||||
bool bPrimLog;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// declarations
|
||||
wxNotebook *m_Notebook; // notebook
|
||||
wxPanel *m_PageMain;
|
||||
|
||||
wxCheckBox *m_Check[7];
|
||||
wxCheckListBox * m_options, * m_settings;
|
||||
wxRadioButton *m_Radio[5];
|
||||
wxRadioBox *m_RadioBox[3];
|
||||
wxStaticBox *m_Label[2];
|
||||
wxPanel *m_Controller;
|
||||
|
||||
// WARNING: Make sure these are not also elsewhere, for example in resource.h.
|
||||
enum
|
||||
{
|
||||
ID_NOTEBOOK = 2000, ID_PAGEMAIN, // notebook
|
||||
|
||||
ID_SAVETOFILE, ID_SHOWCONSOLE, // options
|
||||
IDC_CHECK2,
|
||||
IDC_CHECK3,
|
||||
IDC_CHECK4,
|
||||
IDC_CHECK5,
|
||||
IDC_CHECK6,
|
||||
IDC_CHECK7,
|
||||
IDC_CHECK8,
|
||||
IDC_CHECK9,
|
||||
|
||||
ID_CHECKLIST1,
|
||||
|
||||
IDC_RADIO0,
|
||||
IDC_RADIO1,
|
||||
IDC_RADIO2,
|
||||
IDC_RADIO3,
|
||||
|
||||
IDG_LABEL1,
|
||||
IDG_LABEL2,
|
||||
|
||||
ID_UPD,
|
||||
ID_AP,
|
||||
ID_AM,
|
||||
ID_BP,
|
||||
ID_BM,
|
||||
ID_GPR,
|
||||
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
|
||||
|
||||
};
|
||||
|
||||
void OnShow(wxShowEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControls();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,42 +1,42 @@
|
||||
// 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 __PBView_h__
|
||||
#define __PBView_h__
|
||||
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/dcclient.h>
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
class CPBView : public wxListCtrl
|
||||
{
|
||||
public:
|
||||
CPBView(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
|
||||
void Update();
|
||||
u32 m_CachedRegs[10][10];
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
bool m_CachedRegHasChanged[64];
|
||||
|
||||
#ifdef _WIN32
|
||||
virtual bool MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem);
|
||||
#endif
|
||||
};
|
||||
|
||||
#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 __PBView_h__
|
||||
#define __PBView_h__
|
||||
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/dcclient.h>
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
class CPBView : public wxListCtrl
|
||||
{
|
||||
public:
|
||||
CPBView(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
|
||||
void Update();
|
||||
u32 m_CachedRegs[10][10];
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
bool m_CachedRegHasChanged[64];
|
||||
|
||||
#ifdef _WIN32
|
||||
virtual bool MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,137 +1,137 @@
|
||||
// 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 _GLINIT_H
|
||||
#define _GLINIT_H
|
||||
|
||||
#include "pluginspecs_video.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define GLEW_STATIC
|
||||
|
||||
#include <GLew/glew.h>
|
||||
#include <GLew/wglew.h>
|
||||
#include <GLew/gl.h>
|
||||
#include <GLew/glext.h>
|
||||
|
||||
#else // linux basic definitions
|
||||
|
||||
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
|
||||
#define I_NEED_OS2_H // HAXXOR
|
||||
//#include <GL/glew.h>
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#include <GL/glxew.h>
|
||||
#else
|
||||
#undef BOOL
|
||||
#include <GL/glew.h>
|
||||
#include "cocoaGL.h"
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#endif
|
||||
//#include <GL/glx.h>
|
||||
#define __inline inline
|
||||
|
||||
#include <sys/timeb.h> // ftime(), struct timeb
|
||||
|
||||
inline unsigned long timeGetTime()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
_timeb t;
|
||||
_ftime(&t);
|
||||
#else
|
||||
timeb t;
|
||||
ftime(&t);
|
||||
#endif
|
||||
|
||||
return (unsigned long)(t.time*1000+t.millitm);
|
||||
}
|
||||
|
||||
#endif // linux basic definitions
|
||||
|
||||
#ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils
|
||||
#define GL_DEPTH_STENCIL_EXT 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8_EXT 0x88F0
|
||||
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
|
||||
#endif
|
||||
|
||||
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
||||
#else
|
||||
#define GL_REPORT_ERRORD()
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#undef I_NEED_OS2_H
|
||||
#undef BOOL
|
||||
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/xf86vmode.h>
|
||||
//#include <gtk/gtk.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct {
|
||||
int screen;
|
||||
#if defined(OSX64)
|
||||
NSWindow *cocoaWin;
|
||||
NSOpenGLContext *cocoaCtx;
|
||||
#else //linux
|
||||
Window win;
|
||||
Display *dpy;
|
||||
GLXContext ctx;
|
||||
XSetWindowAttributes attr;
|
||||
Bool fs;
|
||||
Bool doubleBuffered;
|
||||
XF86VidModeModeInfo deskMode;
|
||||
#endif
|
||||
int x, y;
|
||||
unsigned int width, height;
|
||||
unsigned int depth;
|
||||
} GLWindow;
|
||||
|
||||
extern GLWindow GLWin;
|
||||
|
||||
#endif
|
||||
|
||||
// yeah yeah, these should be hidden
|
||||
extern int nBackbufferWidth, nBackbufferHeight;
|
||||
extern int nXoff, nYoff;
|
||||
|
||||
bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _width, int _height);
|
||||
bool OpenGL_MakeCurrent();
|
||||
void OpenGL_SwapBuffers();
|
||||
void OpenGL_SetWindowText(const char *text);
|
||||
void OpenGL_Shutdown();
|
||||
void OpenGL_Update();
|
||||
|
||||
#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 _GLINIT_H
|
||||
#define _GLINIT_H
|
||||
|
||||
#include "pluginspecs_video.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define GLEW_STATIC
|
||||
|
||||
#include <GLew/glew.h>
|
||||
#include <GLew/wglew.h>
|
||||
#include <GLew/gl.h>
|
||||
#include <GLew/glext.h>
|
||||
|
||||
#else // linux basic definitions
|
||||
|
||||
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
|
||||
#define I_NEED_OS2_H // HAXXOR
|
||||
//#include <GL/glew.h>
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#include <GL/glxew.h>
|
||||
#else
|
||||
#undef BOOL
|
||||
#include <GL/glew.h>
|
||||
#include "cocoaGL.h"
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <OpenGL/gl.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#endif
|
||||
//#include <GL/glx.h>
|
||||
#define __inline inline
|
||||
|
||||
#include <sys/timeb.h> // ftime(), struct timeb
|
||||
|
||||
inline unsigned long timeGetTime()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
_timeb t;
|
||||
_ftime(&t);
|
||||
#else
|
||||
timeb t;
|
||||
ftime(&t);
|
||||
#endif
|
||||
|
||||
return (unsigned long)(t.time*1000+t.millitm);
|
||||
}
|
||||
|
||||
#endif // linux basic definitions
|
||||
|
||||
#ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils
|
||||
#define GL_DEPTH_STENCIL_EXT 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8_EXT 0x88F0
|
||||
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
|
||||
#endif
|
||||
|
||||
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
||||
#else
|
||||
#define GL_REPORT_ERRORD()
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
#undef I_NEED_OS2_H
|
||||
#undef BOOL
|
||||
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/extensions/xf86vmode.h>
|
||||
//#include <gtk/gtk.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct {
|
||||
int screen;
|
||||
#if defined(OSX64)
|
||||
NSWindow *cocoaWin;
|
||||
NSOpenGLContext *cocoaCtx;
|
||||
#else //linux
|
||||
Window win;
|
||||
Display *dpy;
|
||||
GLXContext ctx;
|
||||
XSetWindowAttributes attr;
|
||||
Bool fs;
|
||||
Bool doubleBuffered;
|
||||
XF86VidModeModeInfo deskMode;
|
||||
#endif
|
||||
int x, y;
|
||||
unsigned int width, height;
|
||||
unsigned int depth;
|
||||
} GLWindow;
|
||||
|
||||
extern GLWindow GLWin;
|
||||
|
||||
#endif
|
||||
|
||||
// yeah yeah, these should be hidden
|
||||
extern int nBackbufferWidth, nBackbufferHeight;
|
||||
extern int nXoff, nYoff;
|
||||
|
||||
bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _width, int _height);
|
||||
bool OpenGL_MakeCurrent();
|
||||
void OpenGL_SwapBuffers();
|
||||
void OpenGL_SetWindowText(const char *text);
|
||||
void OpenGL_Shutdown();
|
||||
void OpenGL_Update();
|
||||
|
||||
#endif
|
||||
|
@ -1,156 +1,156 @@
|
||||
// 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 __CONFIGDIALOG_h__
|
||||
#define __CONFIGDIALOG_h__
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/gbsizer.h>
|
||||
|
||||
|
||||
#undef ConfigDialog_STYLE
|
||||
#define ConfigDialog_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
|
||||
|
||||
|
||||
class ConfigDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("OpenGL Plugin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigDialog_STYLE);
|
||||
virtual ~ConfigDialog();
|
||||
void CloseClick(wxCommandEvent& event);
|
||||
|
||||
void AddFSReso(char *reso);
|
||||
void AddWindowReso(char *reso);
|
||||
void AddAAMode(int mode);
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
wxBoxSizer* sGeneral;
|
||||
wxStaticBoxSizer* sbBasic;
|
||||
wxGridBagSizer* sBasic;
|
||||
wxStaticBoxSizer* sbEnhancements;
|
||||
wxGridBagSizer* sEnhancements;
|
||||
wxBoxSizer* sAdvanced;
|
||||
wxStaticBoxSizer* sbInfo;
|
||||
wxGridBagSizer* sInfo;
|
||||
wxStaticBoxSizer* sbRendering;
|
||||
wxGridBagSizer* sRendering;
|
||||
wxStaticBoxSizer* sbUtilities;
|
||||
wxGridBagSizer* sUtilities;
|
||||
wxStaticBoxSizer* sbHacks;
|
||||
wxGridBagSizer* sHacks;
|
||||
|
||||
wxButton *m_About;
|
||||
wxButton *m_Close;
|
||||
wxNotebook *m_Notebook;
|
||||
wxPanel *m_PageGeneral;
|
||||
wxPanel *m_PageAdvanced;
|
||||
wxCheckBox *m_Fullscreen;
|
||||
wxCheckBox *m_RenderToMainWindow;
|
||||
wxCheckBox *m_StretchToFit;
|
||||
wxCheckBox *m_KeepAR;
|
||||
wxCheckBox *m_HideCursor;
|
||||
wxArrayString arrayStringFor_FullscreenCB;
|
||||
wxComboBox *m_FullscreenCB;
|
||||
wxArrayString arrayStringFor_WindowResolutionCB;
|
||||
wxComboBox *m_WindowResolutionCB;
|
||||
|
||||
wxCheckBox *m_ForceFiltering; // advanced
|
||||
wxChoice *m_MaxAnisotropyCB;
|
||||
wxArrayString arrayStringFor_MaxAnisotropyCB;
|
||||
wxComboBox *m_AliasModeCB;
|
||||
wxCheckBox *m_ShowFPS;
|
||||
wxCheckBox *m_ShaderErrors;
|
||||
wxCheckBox *m_Statistics;
|
||||
wxCheckBox *m_TexFmtOverlay;
|
||||
wxCheckBox *m_TexFmtCenter;
|
||||
wxCheckBox *m_UseXFB;
|
||||
wxCheckBox *m_Wireframe;
|
||||
wxCheckBox *m_DisableLighting;
|
||||
wxCheckBox *m_DisableTexturing;
|
||||
wxCheckBox *m_DumpTextures;
|
||||
wxDirPickerCtrl *m_TexturePath;
|
||||
wxCheckBox *m_EFBToTextureDisable, *m_EFBToTextureDisableHotKey;
|
||||
wxCheckBox *m_ProjectionHax1;
|
||||
wxCheckBox *m_ProjectionHax2;
|
||||
wxCheckBox *m_SafeTextureCache;
|
||||
|
||||
enum
|
||||
{
|
||||
ID_CLOSE = 1000,
|
||||
ID_ABOUTOGL,
|
||||
|
||||
ID_NOTEBOOK,
|
||||
ID_PAGEGENERAL,
|
||||
ID_PAGEADVANCED,
|
||||
|
||||
ID_FULLSCREEN,
|
||||
ID_RENDERTOMAINWINDOW,
|
||||
ID_STRETCHTOFIT,
|
||||
ID_KEEPAR,
|
||||
ID_HIDECURSOR,
|
||||
ID_FSTEXT,
|
||||
ID_FULLSCREENCB,
|
||||
ID_WMTEXT,
|
||||
ID_WINDOWRESOLUTIONCB,
|
||||
|
||||
ID_FORCEFILTERING,
|
||||
ID_MAXANISOTROPY,
|
||||
ID_AATEXT,
|
||||
ID_ALIASMODECB,
|
||||
|
||||
ID_SHOWFPS,
|
||||
ID_SHADERERRORS,
|
||||
ID_STATISTICS,
|
||||
ID_TEXFMTOVERLAY,
|
||||
ID_TEXFMTCENTER,
|
||||
|
||||
ID_USEXFB,
|
||||
ID_WIREFRAME,
|
||||
ID_DISABLELIGHTING,
|
||||
ID_DISABLETEXTURING,
|
||||
ID_SAFETEXTURECACHE,
|
||||
|
||||
ID_DUMPTEXTURES,
|
||||
ID_TEXTUREPATH,
|
||||
|
||||
ID_EFBTOTEXTUREDISABLE, ID_EFBTOTEXTUREDISABLEHOTKEY,
|
||||
ID_PROJECTIONHACK1,
|
||||
ID_PROJECTIONHACK2
|
||||
};
|
||||
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControls();
|
||||
|
||||
void AboutClick(wxCommandEvent& event);
|
||||
void GeneralSettingsChanged(wxCommandEvent& event);
|
||||
void AdvancedSettingsChanged(wxCommandEvent& event);
|
||||
void TexturePathChange(wxFileDirPickerEvent& event);
|
||||
};
|
||||
|
||||
#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 __CONFIGDIALOG_h__
|
||||
#define __CONFIGDIALOG_h__
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/gbsizer.h>
|
||||
|
||||
|
||||
#undef ConfigDialog_STYLE
|
||||
#define ConfigDialog_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX
|
||||
|
||||
|
||||
class ConfigDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("OpenGL Plugin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigDialog_STYLE);
|
||||
virtual ~ConfigDialog();
|
||||
void CloseClick(wxCommandEvent& event);
|
||||
|
||||
void AddFSReso(char *reso);
|
||||
void AddWindowReso(char *reso);
|
||||
void AddAAMode(int mode);
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
wxBoxSizer* sGeneral;
|
||||
wxStaticBoxSizer* sbBasic;
|
||||
wxGridBagSizer* sBasic;
|
||||
wxStaticBoxSizer* sbEnhancements;
|
||||
wxGridBagSizer* sEnhancements;
|
||||
wxBoxSizer* sAdvanced;
|
||||
wxStaticBoxSizer* sbInfo;
|
||||
wxGridBagSizer* sInfo;
|
||||
wxStaticBoxSizer* sbRendering;
|
||||
wxGridBagSizer* sRendering;
|
||||
wxStaticBoxSizer* sbUtilities;
|
||||
wxGridBagSizer* sUtilities;
|
||||
wxStaticBoxSizer* sbHacks;
|
||||
wxGridBagSizer* sHacks;
|
||||
|
||||
wxButton *m_About;
|
||||
wxButton *m_Close;
|
||||
wxNotebook *m_Notebook;
|
||||
wxPanel *m_PageGeneral;
|
||||
wxPanel *m_PageAdvanced;
|
||||
wxCheckBox *m_Fullscreen;
|
||||
wxCheckBox *m_RenderToMainWindow;
|
||||
wxCheckBox *m_StretchToFit;
|
||||
wxCheckBox *m_KeepAR;
|
||||
wxCheckBox *m_HideCursor;
|
||||
wxArrayString arrayStringFor_FullscreenCB;
|
||||
wxComboBox *m_FullscreenCB;
|
||||
wxArrayString arrayStringFor_WindowResolutionCB;
|
||||
wxComboBox *m_WindowResolutionCB;
|
||||
|
||||
wxCheckBox *m_ForceFiltering; // advanced
|
||||
wxChoice *m_MaxAnisotropyCB;
|
||||
wxArrayString arrayStringFor_MaxAnisotropyCB;
|
||||
wxComboBox *m_AliasModeCB;
|
||||
wxCheckBox *m_ShowFPS;
|
||||
wxCheckBox *m_ShaderErrors;
|
||||
wxCheckBox *m_Statistics;
|
||||
wxCheckBox *m_TexFmtOverlay;
|
||||
wxCheckBox *m_TexFmtCenter;
|
||||
wxCheckBox *m_UseXFB;
|
||||
wxCheckBox *m_Wireframe;
|
||||
wxCheckBox *m_DisableLighting;
|
||||
wxCheckBox *m_DisableTexturing;
|
||||
wxCheckBox *m_DumpTextures;
|
||||
wxDirPickerCtrl *m_TexturePath;
|
||||
wxCheckBox *m_EFBToTextureDisable, *m_EFBToTextureDisableHotKey;
|
||||
wxCheckBox *m_ProjectionHax1;
|
||||
wxCheckBox *m_ProjectionHax2;
|
||||
wxCheckBox *m_SafeTextureCache;
|
||||
|
||||
enum
|
||||
{
|
||||
ID_CLOSE = 1000,
|
||||
ID_ABOUTOGL,
|
||||
|
||||
ID_NOTEBOOK,
|
||||
ID_PAGEGENERAL,
|
||||
ID_PAGEADVANCED,
|
||||
|
||||
ID_FULLSCREEN,
|
||||
ID_RENDERTOMAINWINDOW,
|
||||
ID_STRETCHTOFIT,
|
||||
ID_KEEPAR,
|
||||
ID_HIDECURSOR,
|
||||
ID_FSTEXT,
|
||||
ID_FULLSCREENCB,
|
||||
ID_WMTEXT,
|
||||
ID_WINDOWRESOLUTIONCB,
|
||||
|
||||
ID_FORCEFILTERING,
|
||||
ID_MAXANISOTROPY,
|
||||
ID_AATEXT,
|
||||
ID_ALIASMODECB,
|
||||
|
||||
ID_SHOWFPS,
|
||||
ID_SHADERERRORS,
|
||||
ID_STATISTICS,
|
||||
ID_TEXFMTOVERLAY,
|
||||
ID_TEXFMTCENTER,
|
||||
|
||||
ID_USEXFB,
|
||||
ID_WIREFRAME,
|
||||
ID_DISABLELIGHTING,
|
||||
ID_DISABLETEXTURING,
|
||||
ID_SAFETEXTURECACHE,
|
||||
|
||||
ID_DUMPTEXTURES,
|
||||
ID_TEXTUREPATH,
|
||||
|
||||
ID_EFBTOTEXTUREDISABLE, ID_EFBTOTEXTUREDISABLEHOTKEY,
|
||||
ID_PROJECTIONHACK1,
|
||||
ID_PROJECTIONHACK2
|
||||
};
|
||||
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CreateGUIControls();
|
||||
|
||||
void AboutClick(wxCommandEvent& event);
|
||||
void GeneralSettingsChanged(wxCommandEvent& event);
|
||||
void AdvancedSettingsChanged(wxCommandEvent& event);
|
||||
void TexturePathChange(wxFileDirPickerEvent& event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,87 +1,87 @@
|
||||
// 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/
|
||||
|
||||
// This file should DIE.
|
||||
|
||||
#ifndef _GLOBALS_H
|
||||
#define _GLOBALS_H
|
||||
|
||||
// #define LOGGING
|
||||
|
||||
#include "Common.h"
|
||||
#include "x64Emitter.h"
|
||||
#include "Config.h"
|
||||
|
||||
#define ERROR_LOG __Log
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
#define INFO_LOG if( g_Config.iLog & CONF_LOG ) __Log
|
||||
#define PRIM_LOG if( g_Config.iLog & CONF_PRIMLOG ) __Log
|
||||
#define DEBUG_LOG __Log
|
||||
#else
|
||||
#define INFO_LOG(...)
|
||||
#define PRIM_LOG(...)
|
||||
#define DEBUG_LOG(...)
|
||||
#endif
|
||||
|
||||
void DebugLog(const char* _fmt, ...);
|
||||
void __Log(const char *format, ...);
|
||||
void __Log(int type, const char *format, ...);
|
||||
void HandleGLError();
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__x86_64__) && !defined(_M_X64)
|
||||
void * memcpy_amd(void *dest, const void *src, size_t n);
|
||||
unsigned char memcmp_mmx(const void* src1, const void* src2, int cmpsize);
|
||||
#define memcpy_gc memcpy_amd
|
||||
#define memcmp_gc memcmp_mmx
|
||||
#else
|
||||
#define memcpy_gc memcpy
|
||||
#define memcmp_gc memcmp
|
||||
#endif
|
||||
|
||||
#include "main.h"
|
||||
|
||||
inline u8 *Memory_GetPtr(u32 _uAddress)
|
||||
{
|
||||
return g_VideoInitialize.pGetMemoryPointer(_uAddress);//&g_pMemory[_uAddress & RAM_MASK];
|
||||
}
|
||||
|
||||
inline u8 Memory_Read_U8(u32 _uAddress)
|
||||
{
|
||||
return *(u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);//g_pMemory[_uAddress & RAM_MASK];
|
||||
}
|
||||
|
||||
inline u16 Memory_Read_U16(u32 _uAddress)
|
||||
{
|
||||
return Common::swap16(*(u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
|
||||
//return _byteswap_ushort(*(u16*)&g_pMemory[_uAddress & RAM_MASK]);
|
||||
}
|
||||
|
||||
inline u32 Memory_Read_U32(u32 _uAddress)
|
||||
{
|
||||
return Common::swap32(*(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
|
||||
//return _byteswap_ulong(*(u32*)&g_pMemory[_uAddress & RAM_MASK]);
|
||||
}
|
||||
|
||||
inline float Memory_Read_Float(u32 _uAddress)
|
||||
{
|
||||
union {u32 i; float f;} temp;
|
||||
temp.i = Memory_Read_U32(_uAddress);
|
||||
return temp.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/
|
||||
|
||||
// This file should DIE.
|
||||
|
||||
#ifndef _GLOBALS_H
|
||||
#define _GLOBALS_H
|
||||
|
||||
// #define LOGGING
|
||||
|
||||
#include "Common.h"
|
||||
#include "x64Emitter.h"
|
||||
#include "Config.h"
|
||||
|
||||
#define ERROR_LOG __Log
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
#define INFO_LOG if( g_Config.iLog & CONF_LOG ) __Log
|
||||
#define PRIM_LOG if( g_Config.iLog & CONF_PRIMLOG ) __Log
|
||||
#define DEBUG_LOG __Log
|
||||
#else
|
||||
#define INFO_LOG(...)
|
||||
#define PRIM_LOG(...)
|
||||
#define DEBUG_LOG(...)
|
||||
#endif
|
||||
|
||||
void DebugLog(const char* _fmt, ...);
|
||||
void __Log(const char *format, ...);
|
||||
void __Log(int type, const char *format, ...);
|
||||
void HandleGLError();
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__x86_64__) && !defined(_M_X64)
|
||||
void * memcpy_amd(void *dest, const void *src, size_t n);
|
||||
unsigned char memcmp_mmx(const void* src1, const void* src2, int cmpsize);
|
||||
#define memcpy_gc memcpy_amd
|
||||
#define memcmp_gc memcmp_mmx
|
||||
#else
|
||||
#define memcpy_gc memcpy
|
||||
#define memcmp_gc memcmp
|
||||
#endif
|
||||
|
||||
#include "main.h"
|
||||
|
||||
inline u8 *Memory_GetPtr(u32 _uAddress)
|
||||
{
|
||||
return g_VideoInitialize.pGetMemoryPointer(_uAddress);//&g_pMemory[_uAddress & RAM_MASK];
|
||||
}
|
||||
|
||||
inline u8 Memory_Read_U8(u32 _uAddress)
|
||||
{
|
||||
return *(u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);//g_pMemory[_uAddress & RAM_MASK];
|
||||
}
|
||||
|
||||
inline u16 Memory_Read_U16(u32 _uAddress)
|
||||
{
|
||||
return Common::swap16(*(u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
|
||||
//return _byteswap_ushort(*(u16*)&g_pMemory[_uAddress & RAM_MASK]);
|
||||
}
|
||||
|
||||
inline u32 Memory_Read_U32(u32 _uAddress)
|
||||
{
|
||||
return Common::swap32(*(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
|
||||
//return _byteswap_ulong(*(u32*)&g_pMemory[_uAddress & RAM_MASK]);
|
||||
}
|
||||
|
||||
inline float Memory_Read_Float(u32 _uAddress)
|
||||
{
|
||||
union {u32 i; float f;} temp;
|
||||
temp.i = Memory_Read_U32(_uAddress);
|
||||
return temp.f;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,25 +1,25 @@
|
||||
// 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 _IMAGEWRITE_H
|
||||
#define _IMAGEWRITE_H
|
||||
|
||||
bool SaveTGA(const char* filename, int width, int height, void* pdata);
|
||||
bool SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height);
|
||||
bool SaveData(const char* filename, const char* pdata);
|
||||
|
||||
// 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 _IMAGEWRITE_H
|
||||
#define _IMAGEWRITE_H
|
||||
|
||||
bool SaveTGA(const char* filename, int width, int height, void* pdata);
|
||||
bool SaveTexture(const char* filename, u32 textarget, u32 tex, int width, int height);
|
||||
bool SaveData(const char* filename, const char* pdata);
|
||||
|
||||
#endif // _IMAGEWRITE_H
|
@ -1,27 +1,27 @@
|
||||
// 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/
|
||||
|
||||
|
||||
void startConsoleWin(int width, int height, char* fname);
|
||||
int aprintf(int a, char *fmt, ...);
|
||||
void ClearScreen();
|
||||
void OpenConsole();
|
||||
void CloseConsole();
|
||||
|
||||
#ifdef _WIN32
|
||||
HWND GetConsoleHwnd(void);
|
||||
#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/
|
||||
|
||||
|
||||
void startConsoleWin(int width, int height, char* fname);
|
||||
int aprintf(int a, char *fmt, ...);
|
||||
void ClearScreen();
|
||||
void OpenConsole();
|
||||
void CloseConsole();
|
||||
|
||||
#ifdef _WIN32
|
||||
HWND GetConsoleHwnd(void);
|
||||
#endif
|
||||
|
@ -1,21 +1,21 @@
|
||||
// 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/
|
||||
|
||||
|
||||
// functions
|
||||
void Logging(int a);
|
||||
|
||||
// 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/
|
||||
|
||||
|
||||
// functions
|
||||
void Logging(int a);
|
||||
|
||||
|
@ -1,32 +1,32 @@
|
||||
// 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 "stdafx.h"
|
||||
|
||||
namespace EmuWindow
|
||||
{
|
||||
extern int g_winstyle;
|
||||
|
||||
HWND GetWnd();
|
||||
HWND GetParentWnd();
|
||||
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title);
|
||||
void Show();
|
||||
void Close();
|
||||
void SetSize(int displayWidth, int displayHeight);
|
||||
}
|
||||
// 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 "stdafx.h"
|
||||
|
||||
namespace EmuWindow
|
||||
{
|
||||
extern int g_winstyle;
|
||||
|
||||
HWND GetWnd();
|
||||
HWND GetParentWnd();
|
||||
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title);
|
||||
void Show();
|
||||
void Close();
|
||||
void SetSize(int displayWidth, int displayHeight);
|
||||
}
|
||||
|
@ -1,145 +1,145 @@
|
||||
// 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 _PIXELSHADERMANAGER_H
|
||||
#define _PIXELSHADERMANAGER_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "BPMemory.h"
|
||||
|
||||
struct FRAGMENTSHADER
|
||||
{
|
||||
FRAGMENTSHADER() : glprogid(0) { }
|
||||
GLuint glprogid; // opengl program id
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
std::string strprog;
|
||||
#endif
|
||||
};
|
||||
|
||||
class PIXELSHADERUID
|
||||
{
|
||||
public:
|
||||
u32 values[4+32+6+11];
|
||||
u16 tevstages, indstages;
|
||||
|
||||
PIXELSHADERUID() {
|
||||
memset(values, 0, (4+32+6+11) * 4);
|
||||
tevstages = indstages = 0;
|
||||
}
|
||||
PIXELSHADERUID(const PIXELSHADERUID& r)
|
||||
{
|
||||
tevstages = r.tevstages;
|
||||
indstages = r.indstages;
|
||||
int N = tevstages + indstages + 3;
|
||||
_assert_(N <= 4+32+6+11);
|
||||
for (int i = 0; i < N; ++i)
|
||||
values[i] = r.values[i];
|
||||
}
|
||||
int GetNumValues() const {
|
||||
return tevstages + indstages + 3; // numTevStages*3/2+1
|
||||
}
|
||||
bool operator <(const PIXELSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] < _Right.values[0])
|
||||
return true;
|
||||
else if (values[0] > _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] < _Right.values[i])
|
||||
return true;
|
||||
else if (values[i] > _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool operator ==(const PIXELSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] != _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] != _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class PixelShaderMngr
|
||||
{
|
||||
struct PSCacheEntry
|
||||
{
|
||||
FRAGMENTSHADER shader;
|
||||
int frameCount;
|
||||
PSCacheEntry() : frameCount(0) {}
|
||||
~PSCacheEntry() {}
|
||||
void Destroy() {
|
||||
// printf("Destroying ps %i\n", shader.glprogid);
|
||||
glDeleteProgramsARB(1, &shader.glprogid);
|
||||
shader.glprogid = 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::map<PIXELSHADERUID, PSCacheEntry> PSCache;
|
||||
|
||||
static FRAGMENTSHADER* pShaderLast; // last used shader
|
||||
static PSCache pshaders;
|
||||
|
||||
static void GetPixelShaderId(PIXELSHADERUID&);
|
||||
static PIXELSHADERUID s_curuid; // the current pixel shader uid (progressively changed as memory is written)
|
||||
|
||||
static void SetPSConstant4f(int const_number, float f1, float f2, float f3, float f4);
|
||||
static void SetPSConstant4fv(int const_number, const float *f);
|
||||
|
||||
static void SetPSTextureDims(int texid);
|
||||
|
||||
public:
|
||||
static void Init();
|
||||
static void Cleanup();
|
||||
static void Shutdown();
|
||||
static FRAGMENTSHADER* GetShader();
|
||||
static bool CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrprogram);
|
||||
|
||||
static void SetConstants(); // sets pixel shader constants
|
||||
|
||||
// constant management, should be called after memory is committed
|
||||
static void SetColorChanged(int type, int index);
|
||||
static void SetAlpha(const AlphaFunc& alpha);
|
||||
static void SetDestAlpha(const ConstantAlpha& alpha);
|
||||
static void SetTexDims(int texmapid, u32 width, u32 height, u32 wraps, u32 wrapt);
|
||||
static void SetZTetureBias(u32 bias);
|
||||
static void SetIndTexScaleChanged();
|
||||
static void SetIndMatrixChanged(int matrixidx);
|
||||
|
||||
static void SetGenModeChanged();
|
||||
static void SetTevCombinerChanged(int id);
|
||||
static void SetTevKSelChanged(int id);
|
||||
static void SetTevOrderChanged(int id);
|
||||
static void SetTevIndirectChanged(int id);
|
||||
static void SetZTetureOpChanged();
|
||||
static void SetTexturesUsed(u32 nonpow2tex);
|
||||
static void SetTexDimsChanged(int texmapid);
|
||||
|
||||
static void SetColorMatrix(const float* pmatrix, const float* pfConstAdd);
|
||||
static GLuint GetColorMatrixProgram();
|
||||
};
|
||||
|
||||
|
||||
#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 _PIXELSHADERMANAGER_H
|
||||
#define _PIXELSHADERMANAGER_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "BPMemory.h"
|
||||
|
||||
struct FRAGMENTSHADER
|
||||
{
|
||||
FRAGMENTSHADER() : glprogid(0) { }
|
||||
GLuint glprogid; // opengl program id
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
std::string strprog;
|
||||
#endif
|
||||
};
|
||||
|
||||
class PIXELSHADERUID
|
||||
{
|
||||
public:
|
||||
u32 values[4+32+6+11];
|
||||
u16 tevstages, indstages;
|
||||
|
||||
PIXELSHADERUID() {
|
||||
memset(values, 0, (4+32+6+11) * 4);
|
||||
tevstages = indstages = 0;
|
||||
}
|
||||
PIXELSHADERUID(const PIXELSHADERUID& r)
|
||||
{
|
||||
tevstages = r.tevstages;
|
||||
indstages = r.indstages;
|
||||
int N = tevstages + indstages + 3;
|
||||
_assert_(N <= 4+32+6+11);
|
||||
for (int i = 0; i < N; ++i)
|
||||
values[i] = r.values[i];
|
||||
}
|
||||
int GetNumValues() const {
|
||||
return tevstages + indstages + 3; // numTevStages*3/2+1
|
||||
}
|
||||
bool operator <(const PIXELSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] < _Right.values[0])
|
||||
return true;
|
||||
else if (values[0] > _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] < _Right.values[i])
|
||||
return true;
|
||||
else if (values[i] > _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool operator ==(const PIXELSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] != _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] != _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class PixelShaderMngr
|
||||
{
|
||||
struct PSCacheEntry
|
||||
{
|
||||
FRAGMENTSHADER shader;
|
||||
int frameCount;
|
||||
PSCacheEntry() : frameCount(0) {}
|
||||
~PSCacheEntry() {}
|
||||
void Destroy() {
|
||||
// printf("Destroying ps %i\n", shader.glprogid);
|
||||
glDeleteProgramsARB(1, &shader.glprogid);
|
||||
shader.glprogid = 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::map<PIXELSHADERUID, PSCacheEntry> PSCache;
|
||||
|
||||
static FRAGMENTSHADER* pShaderLast; // last used shader
|
||||
static PSCache pshaders;
|
||||
|
||||
static void GetPixelShaderId(PIXELSHADERUID&);
|
||||
static PIXELSHADERUID s_curuid; // the current pixel shader uid (progressively changed as memory is written)
|
||||
|
||||
static void SetPSConstant4f(int const_number, float f1, float f2, float f3, float f4);
|
||||
static void SetPSConstant4fv(int const_number, const float *f);
|
||||
|
||||
static void SetPSTextureDims(int texid);
|
||||
|
||||
public:
|
||||
static void Init();
|
||||
static void Cleanup();
|
||||
static void Shutdown();
|
||||
static FRAGMENTSHADER* GetShader();
|
||||
static bool CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrprogram);
|
||||
|
||||
static void SetConstants(); // sets pixel shader constants
|
||||
|
||||
// constant management, should be called after memory is committed
|
||||
static void SetColorChanged(int type, int index);
|
||||
static void SetAlpha(const AlphaFunc& alpha);
|
||||
static void SetDestAlpha(const ConstantAlpha& alpha);
|
||||
static void SetTexDims(int texmapid, u32 width, u32 height, u32 wraps, u32 wrapt);
|
||||
static void SetZTetureBias(u32 bias);
|
||||
static void SetIndTexScaleChanged();
|
||||
static void SetIndMatrixChanged(int matrixidx);
|
||||
|
||||
static void SetGenModeChanged();
|
||||
static void SetTevCombinerChanged(int id);
|
||||
static void SetTevKSelChanged(int id);
|
||||
static void SetTevOrderChanged(int id);
|
||||
static void SetTevIndirectChanged(int id);
|
||||
static void SetZTetureOpChanged();
|
||||
static void SetTexturesUsed(u32 nonpow2tex);
|
||||
static void SetTexDimsChanged(int texmapid);
|
||||
|
||||
static void SetColorMatrix(const float* pmatrix, const float* pfConstAdd);
|
||||
static GLuint GetColorMatrixProgram();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -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/
|
||||
|
||||
#ifndef GCOGL_RENDER
|
||||
#define GCOGL_RENDER
|
||||
|
||||
#include "TextureMngr.h"
|
||||
|
||||
#include <Cg/cg.h>
|
||||
#include <Cg/cgGL.h>
|
||||
|
||||
extern CGcontext g_cgcontext;
|
||||
extern CGprofile g_cgvProf, g_cgfProf;
|
||||
|
||||
extern float MValueX, MValueY;
|
||||
extern int frameCount;
|
||||
|
||||
class Renderer
|
||||
{
|
||||
static void FlushZBufferAlphaToTarget();
|
||||
|
||||
public:
|
||||
enum RenderMode
|
||||
{
|
||||
RM_Normal=0, // normal target as color0, ztarget as color1
|
||||
RM_ZBufferOnly, // zbuffer as color 0
|
||||
RM_ZBufferAlpha // zbuffer as color0, also will dump alpha info to regular target once mode is switched
|
||||
// use stencil buffer to indicate what pixels were written
|
||||
};
|
||||
|
||||
static bool Create2();
|
||||
static void Shutdown();
|
||||
|
||||
// initialize opengl standard values (like viewport)
|
||||
static bool Initialize();
|
||||
|
||||
static void AddMessage(const char* str, u32 ms);
|
||||
static void ProcessMessages(); // draw the current messages on the screen
|
||||
static void RenderText(const char* pstr, int left, int top, u32 color);
|
||||
static void SetAA(int aa); // sets the anti-aliasing level
|
||||
|
||||
static void ReinitView(int nNewWidth, int nNewHeight);
|
||||
|
||||
static int GetTargetWidth();
|
||||
static int GetTargetHeight();
|
||||
static bool CanBlendLogicOp();
|
||||
static void SetCgErrorOutput(bool bOutput);
|
||||
|
||||
static void ResetGLState();
|
||||
static void RestoreGLState();
|
||||
static bool IsUsingATIDrawBuffers();
|
||||
static bool HaveStencilBuffer();
|
||||
|
||||
static void SetZBufferRender(); // sets rendering of the zbuffer using MRTs
|
||||
static u32 GetZBufferTarget();
|
||||
|
||||
static void SetColorMask();
|
||||
static bool SetScissorRect();
|
||||
|
||||
static void SetRenderMode(RenderMode mode);
|
||||
static RenderMode GetRenderMode();
|
||||
|
||||
static void SetRenderTarget(u32 targ); // if targ is 0, sets to original render target
|
||||
static void SetDepthTarget(u32 targ);
|
||||
static void SetFramebuffer(u32 fb);
|
||||
static u32 GetRenderTarget();
|
||||
|
||||
// Finish up the current frame, print some stats
|
||||
static void Swap(const TRectangle& rc);
|
||||
|
||||
static void SwapBuffers();
|
||||
|
||||
static bool SaveRenderTarget(const char* filename, int jpeg);
|
||||
};
|
||||
|
||||
#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 GCOGL_RENDER
|
||||
#define GCOGL_RENDER
|
||||
|
||||
#include "TextureMngr.h"
|
||||
|
||||
#include <Cg/cg.h>
|
||||
#include <Cg/cgGL.h>
|
||||
|
||||
extern CGcontext g_cgcontext;
|
||||
extern CGprofile g_cgvProf, g_cgfProf;
|
||||
|
||||
extern float MValueX, MValueY;
|
||||
extern int frameCount;
|
||||
|
||||
class Renderer
|
||||
{
|
||||
static void FlushZBufferAlphaToTarget();
|
||||
|
||||
public:
|
||||
enum RenderMode
|
||||
{
|
||||
RM_Normal=0, // normal target as color0, ztarget as color1
|
||||
RM_ZBufferOnly, // zbuffer as color 0
|
||||
RM_ZBufferAlpha // zbuffer as color0, also will dump alpha info to regular target once mode is switched
|
||||
// use stencil buffer to indicate what pixels were written
|
||||
};
|
||||
|
||||
static bool Create2();
|
||||
static void Shutdown();
|
||||
|
||||
// initialize opengl standard values (like viewport)
|
||||
static bool Initialize();
|
||||
|
||||
static void AddMessage(const char* str, u32 ms);
|
||||
static void ProcessMessages(); // draw the current messages on the screen
|
||||
static void RenderText(const char* pstr, int left, int top, u32 color);
|
||||
static void SetAA(int aa); // sets the anti-aliasing level
|
||||
|
||||
static void ReinitView(int nNewWidth, int nNewHeight);
|
||||
|
||||
static int GetTargetWidth();
|
||||
static int GetTargetHeight();
|
||||
static bool CanBlendLogicOp();
|
||||
static void SetCgErrorOutput(bool bOutput);
|
||||
|
||||
static void ResetGLState();
|
||||
static void RestoreGLState();
|
||||
static bool IsUsingATIDrawBuffers();
|
||||
static bool HaveStencilBuffer();
|
||||
|
||||
static void SetZBufferRender(); // sets rendering of the zbuffer using MRTs
|
||||
static u32 GetZBufferTarget();
|
||||
|
||||
static void SetColorMask();
|
||||
static bool SetScissorRect();
|
||||
|
||||
static void SetRenderMode(RenderMode mode);
|
||||
static RenderMode GetRenderMode();
|
||||
|
||||
static void SetRenderTarget(u32 targ); // if targ is 0, sets to original render target
|
||||
static void SetDepthTarget(u32 targ);
|
||||
static void SetFramebuffer(u32 fb);
|
||||
static u32 GetRenderTarget();
|
||||
|
||||
// Finish up the current frame, print some stats
|
||||
static void Swap(const TRectangle& rc);
|
||||
|
||||
static void SwapBuffers();
|
||||
|
||||
static bool SaveRenderTarget(const char* filename, int jpeg);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,38 +1,38 @@
|
||||
// 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 _TEXTURECONVERTER_H
|
||||
#define _TEXTURECONVERTER_H
|
||||
|
||||
#include "TextureMngr.h"
|
||||
|
||||
// Converts textures between formats
|
||||
// TODO: support multiple texture formats
|
||||
namespace TextureConverter
|
||||
{
|
||||
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
void EncodeToRam(GLuint srcTexture, const TRectangle& sourceRc,
|
||||
u8* destAddr, int dstWidth, int dstHeight);
|
||||
|
||||
void DecodeToTexture(u8* srcAddr, int srcWidth, int srcHeight, GLuint destTexture);
|
||||
|
||||
}
|
||||
|
||||
// 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 _TEXTURECONVERTER_H
|
||||
#define _TEXTURECONVERTER_H
|
||||
|
||||
#include "TextureMngr.h"
|
||||
|
||||
// Converts textures between formats
|
||||
// TODO: support multiple texture formats
|
||||
namespace TextureConverter
|
||||
{
|
||||
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
void EncodeToRam(GLuint srcTexture, const TRectangle& sourceRc,
|
||||
u8* destAddr, int dstWidth, int dstHeight);
|
||||
|
||||
void DecodeToTexture(u8* srcAddr, int srcWidth, int srcHeight, GLuint destTexture);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -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/
|
||||
|
||||
#ifndef _TextureMngr_H
|
||||
#define _TextureMngr_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "GLUtil.h"
|
||||
#include "BPStructs.h"
|
||||
|
||||
struct TRectangle
|
||||
{
|
||||
int left, top, right, bottom;
|
||||
};
|
||||
|
||||
class TextureMngr
|
||||
{
|
||||
public:
|
||||
struct TCacheEntry
|
||||
{
|
||||
TCacheEntry() : texture(0), addr(0), hash(0), w(0), h(0), isRenderTarget(false), isUpsideDown(false), isNonPow2(true), bHaveMipMaps(false) { mode.hex = 0xFCFCFCFC; }
|
||||
|
||||
GLuint texture;
|
||||
u32 addr;
|
||||
u32 hash;
|
||||
u32 paletteHash;
|
||||
u32 hashoffset;
|
||||
u32 oldpixel; // used for simple cleanup
|
||||
TexMode0 mode; // current filter and clamp modes that texture is set to
|
||||
|
||||
int frameCount;
|
||||
int w,h,fmt;
|
||||
|
||||
bool isRenderTarget; // if render texture, then rendertex is filled with the direct copy of the render target
|
||||
// later conversions would have to convert properly from rendertexfmt to texfmt
|
||||
bool isUpsideDown;
|
||||
bool isNonPow2; // if nonpow2, use GL_TEXTURE_2D, else GL_TEXTURE_RECTANGLE_NV
|
||||
bool bHaveMipMaps;
|
||||
|
||||
void SetTextureParameters(TexMode0& newmode);
|
||||
void Destroy();
|
||||
void ConvertFromRenderTarget(u32 taddr, int twidth, int theight, int tformat, int tlutaddr, int tlutfmt);
|
||||
};
|
||||
|
||||
struct DEPTHTARGET
|
||||
{
|
||||
DEPTHTARGET() : targ(0), framecount(0) {}
|
||||
GLuint targ;
|
||||
int framecount;
|
||||
};
|
||||
|
||||
private:
|
||||
typedef std::map<u32,TCacheEntry> TexCache;
|
||||
|
||||
static u8 *temp;
|
||||
static TexCache textures;
|
||||
static std::map<u32, DEPTHTARGET> mapDepthTargets;
|
||||
static int nTex2DEnabled, nTexRECTEnabled;
|
||||
|
||||
public:
|
||||
|
||||
static void Init();
|
||||
static void Cleanup();
|
||||
static void Shutdown();
|
||||
static void Invalidate();
|
||||
static TCacheEntry* Load(int texstage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
|
||||
static void CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyfmt, bool bScaleByHalf, TRectangle *source);
|
||||
|
||||
static void EnableTex2D(int stage);
|
||||
static void EnableTexRECT(int stage);
|
||||
static void DisableStage(int stage); // sets active texture
|
||||
};
|
||||
|
||||
#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 _TextureMngr_H
|
||||
#define _TextureMngr_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "GLUtil.h"
|
||||
#include "BPStructs.h"
|
||||
|
||||
struct TRectangle
|
||||
{
|
||||
int left, top, right, bottom;
|
||||
};
|
||||
|
||||
class TextureMngr
|
||||
{
|
||||
public:
|
||||
struct TCacheEntry
|
||||
{
|
||||
TCacheEntry() : texture(0), addr(0), hash(0), w(0), h(0), isRenderTarget(false), isUpsideDown(false), isNonPow2(true), bHaveMipMaps(false) { mode.hex = 0xFCFCFCFC; }
|
||||
|
||||
GLuint texture;
|
||||
u32 addr;
|
||||
u32 hash;
|
||||
u32 paletteHash;
|
||||
u32 hashoffset;
|
||||
u32 oldpixel; // used for simple cleanup
|
||||
TexMode0 mode; // current filter and clamp modes that texture is set to
|
||||
|
||||
int frameCount;
|
||||
int w,h,fmt;
|
||||
|
||||
bool isRenderTarget; // if render texture, then rendertex is filled with the direct copy of the render target
|
||||
// later conversions would have to convert properly from rendertexfmt to texfmt
|
||||
bool isUpsideDown;
|
||||
bool isNonPow2; // if nonpow2, use GL_TEXTURE_2D, else GL_TEXTURE_RECTANGLE_NV
|
||||
bool bHaveMipMaps;
|
||||
|
||||
void SetTextureParameters(TexMode0& newmode);
|
||||
void Destroy();
|
||||
void ConvertFromRenderTarget(u32 taddr, int twidth, int theight, int tformat, int tlutaddr, int tlutfmt);
|
||||
};
|
||||
|
||||
struct DEPTHTARGET
|
||||
{
|
||||
DEPTHTARGET() : targ(0), framecount(0) {}
|
||||
GLuint targ;
|
||||
int framecount;
|
||||
};
|
||||
|
||||
private:
|
||||
typedef std::map<u32,TCacheEntry> TexCache;
|
||||
|
||||
static u8 *temp;
|
||||
static TexCache textures;
|
||||
static std::map<u32, DEPTHTARGET> mapDepthTargets;
|
||||
static int nTex2DEnabled, nTexRECTEnabled;
|
||||
|
||||
public:
|
||||
|
||||
static void Init();
|
||||
static void Cleanup();
|
||||
static void Shutdown();
|
||||
static void Invalidate();
|
||||
static TCacheEntry* Load(int texstage, u32 address, int width, int height, int format, int tlutaddr, int tlutfmt);
|
||||
static void CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool bIsIntensityFmt, u32 copyfmt, bool bScaleByHalf, TRectangle *source);
|
||||
|
||||
static void EnableTex2D(int stage);
|
||||
static void EnableTexRECT(int stage);
|
||||
static void DisableStage(int stage); // sets active texture
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,100 +1,100 @@
|
||||
// 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
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "CPMemory.h"
|
||||
#include "DataReader.h"
|
||||
|
||||
#include "NativeVertexFormat.h"
|
||||
|
||||
class VertexLoaderUID
|
||||
{
|
||||
u32 vid[5];
|
||||
public:
|
||||
VertexLoaderUID() {}
|
||||
void InitFromCurrentState(int vtx_attr_group) {
|
||||
vid[0] = g_VtxDesc.Hex & 0xFFFFFFFF;
|
||||
vid[1] = g_VtxDesc.Hex >> 32;
|
||||
vid[2] = g_VtxAttr[vtx_attr_group].g0.Hex & ~VAT_0_FRACBITS;
|
||||
vid[3] = g_VtxAttr[vtx_attr_group].g1.Hex & ~VAT_1_FRACBITS;
|
||||
vid[4] = g_VtxAttr[vtx_attr_group].g2.Hex & ~VAT_2_FRACBITS;
|
||||
}
|
||||
bool operator < (const VertexLoaderUID &other) const {
|
||||
if (vid[0] < other.vid[0])
|
||||
return true;
|
||||
else if (vid[0] > other.vid[0])
|
||||
return false;
|
||||
for (int i = 1; i < 5; ++i) {
|
||||
if (vid[i] < other.vid[i])
|
||||
return true;
|
||||
else if (vid[i] > other.vid[i])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class VertexLoader
|
||||
{
|
||||
public:
|
||||
VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr);
|
||||
~VertexLoader();
|
||||
|
||||
int GetVertexSize() const {return m_VertexSize;}
|
||||
void RunVertices(int vtx_attr_group, int primitive, int count);
|
||||
|
||||
// For debugging / profiling
|
||||
void AppendToString(std::string *dest);
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
NRM_ZERO = 0,
|
||||
NRM_ONE = 1,
|
||||
NRM_THREE = 3,
|
||||
};
|
||||
|
||||
int m_VertexSize; // number of bytes of a raw GC vertex. Computed by CompileVertexTranslator.
|
||||
|
||||
// GC vertex format
|
||||
TVtxAttr m_VtxAttr; // VAT decoded into easy format
|
||||
TVtxDesc m_VtxDesc; // Not really used currently - or well it is, but could be easily avoided.
|
||||
|
||||
// PC vertex format
|
||||
NativeVertexFormat *m_NativeFmt;
|
||||
int native_stride;
|
||||
|
||||
// Pipeline. To be JIT compiled in the future.
|
||||
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
|
||||
int m_numPipelineStages;
|
||||
|
||||
u8 *m_compiledCode;
|
||||
|
||||
int m_numLoadedVertices;
|
||||
|
||||
void SetVAT(u32 _group0, u32 _group1, u32 _group2);
|
||||
|
||||
void CompileVertexTranslator();
|
||||
|
||||
void WriteCall(TPipelineFunction);
|
||||
};
|
||||
|
||||
#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 _VERTEXLOADER_H
|
||||
#define _VERTEXLOADER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "CPMemory.h"
|
||||
#include "DataReader.h"
|
||||
|
||||
#include "NativeVertexFormat.h"
|
||||
|
||||
class VertexLoaderUID
|
||||
{
|
||||
u32 vid[5];
|
||||
public:
|
||||
VertexLoaderUID() {}
|
||||
void InitFromCurrentState(int vtx_attr_group) {
|
||||
vid[0] = g_VtxDesc.Hex & 0xFFFFFFFF;
|
||||
vid[1] = g_VtxDesc.Hex >> 32;
|
||||
vid[2] = g_VtxAttr[vtx_attr_group].g0.Hex & ~VAT_0_FRACBITS;
|
||||
vid[3] = g_VtxAttr[vtx_attr_group].g1.Hex & ~VAT_1_FRACBITS;
|
||||
vid[4] = g_VtxAttr[vtx_attr_group].g2.Hex & ~VAT_2_FRACBITS;
|
||||
}
|
||||
bool operator < (const VertexLoaderUID &other) const {
|
||||
if (vid[0] < other.vid[0])
|
||||
return true;
|
||||
else if (vid[0] > other.vid[0])
|
||||
return false;
|
||||
for (int i = 1; i < 5; ++i) {
|
||||
if (vid[i] < other.vid[i])
|
||||
return true;
|
||||
else if (vid[i] > other.vid[i])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class VertexLoader
|
||||
{
|
||||
public:
|
||||
VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr);
|
||||
~VertexLoader();
|
||||
|
||||
int GetVertexSize() const {return m_VertexSize;}
|
||||
void RunVertices(int vtx_attr_group, int primitive, int count);
|
||||
|
||||
// For debugging / profiling
|
||||
void AppendToString(std::string *dest);
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
NRM_ZERO = 0,
|
||||
NRM_ONE = 1,
|
||||
NRM_THREE = 3,
|
||||
};
|
||||
|
||||
int m_VertexSize; // number of bytes of a raw GC vertex. Computed by CompileVertexTranslator.
|
||||
|
||||
// GC vertex format
|
||||
TVtxAttr m_VtxAttr; // VAT decoded into easy format
|
||||
TVtxDesc m_VtxDesc; // Not really used currently - or well it is, but could be easily avoided.
|
||||
|
||||
// PC vertex format
|
||||
NativeVertexFormat *m_NativeFmt;
|
||||
int native_stride;
|
||||
|
||||
// Pipeline. To be JIT compiled in the future.
|
||||
TPipelineFunction m_PipelineStages[64]; // TODO - figure out real max. it's lower.
|
||||
int m_numPipelineStages;
|
||||
|
||||
u8 *m_compiledCode;
|
||||
|
||||
int m_numLoadedVertices;
|
||||
|
||||
void SetVAT(u32 _group0, u32 _group1, u32 _group2);
|
||||
|
||||
void CompileVertexTranslator();
|
||||
|
||||
void WriteCall(TPipelineFunction);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,43 +1,43 @@
|
||||
// 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 _VERTEXLOADERMANAGER_H
|
||||
#define _VERTEXLOADERMANAGER_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
namespace VertexLoaderManager
|
||||
{
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
void MarkAllDirty();
|
||||
|
||||
int GetVertexSize(int vtx_attr_group);
|
||||
void RunVertices(int vtx_attr_group, int primitive, int count);
|
||||
|
||||
// For debugging
|
||||
void AppendListToString(std::string *dest);
|
||||
|
||||
// TODO - don't expose these like this.
|
||||
// static u8* s_pCurBufferPointer;
|
||||
};
|
||||
|
||||
// Might move this into its own file later.
|
||||
void LoadCPReg(u32 SubCmd, u32 Value);
|
||||
|
||||
#endif // _VERTEXLOADERMANAGER_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/
|
||||
|
||||
#ifndef _VERTEXLOADERMANAGER_H
|
||||
#define _VERTEXLOADERMANAGER_H
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
namespace VertexLoaderManager
|
||||
{
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
void MarkAllDirty();
|
||||
|
||||
int GetVertexSize(int vtx_attr_group);
|
||||
void RunVertices(int vtx_attr_group, int primitive, int count);
|
||||
|
||||
// For debugging
|
||||
void AppendListToString(std::string *dest);
|
||||
|
||||
// TODO - don't expose these like this.
|
||||
// static u8* s_pCurBufferPointer;
|
||||
};
|
||||
|
||||
// Might move this into its own file later.
|
||||
void LoadCPReg(u32 SubCmd, u32 Value);
|
||||
|
||||
#endif // _VERTEXLOADERMANAGER_H
|
||||
|
@ -1,42 +1,42 @@
|
||||
// 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
|
||||
|
||||
void LOADERDECL Color_ReadDirect_24b_888();
|
||||
void LOADERDECL Color_ReadDirect_32b_888x();
|
||||
void LOADERDECL Color_ReadDirect_16b_565();
|
||||
void LOADERDECL Color_ReadDirect_16b_4444();
|
||||
void LOADERDECL Color_ReadDirect_24b_6666();
|
||||
void LOADERDECL Color_ReadDirect_32b_8888();
|
||||
|
||||
void LOADERDECL Color_ReadIndex8_16b_565();
|
||||
void LOADERDECL Color_ReadIndex8_24b_888();
|
||||
void LOADERDECL Color_ReadIndex8_32b_888x();
|
||||
void LOADERDECL Color_ReadIndex8_16b_4444();
|
||||
void LOADERDECL Color_ReadIndex8_24b_6666();
|
||||
void LOADERDECL Color_ReadIndex8_32b_8888();
|
||||
|
||||
void LOADERDECL Color_ReadIndex16_16b_565();
|
||||
void LOADERDECL Color_ReadIndex16_24b_888();
|
||||
void LOADERDECL Color_ReadIndex16_32b_888x();
|
||||
void LOADERDECL Color_ReadIndex16_16b_4444();
|
||||
void LOADERDECL Color_ReadIndex16_24b_6666();
|
||||
void LOADERDECL Color_ReadIndex16_32b_8888();
|
||||
|
||||
#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 _VERTEXLOADERCOLOR_H
|
||||
#define _VERTEXLOADERCOLOR_H
|
||||
|
||||
void LOADERDECL Color_ReadDirect_24b_888();
|
||||
void LOADERDECL Color_ReadDirect_32b_888x();
|
||||
void LOADERDECL Color_ReadDirect_16b_565();
|
||||
void LOADERDECL Color_ReadDirect_16b_4444();
|
||||
void LOADERDECL Color_ReadDirect_24b_6666();
|
||||
void LOADERDECL Color_ReadDirect_32b_8888();
|
||||
|
||||
void LOADERDECL Color_ReadIndex8_16b_565();
|
||||
void LOADERDECL Color_ReadIndex8_24b_888();
|
||||
void LOADERDECL Color_ReadIndex8_32b_888x();
|
||||
void LOADERDECL Color_ReadIndex8_16b_4444();
|
||||
void LOADERDECL Color_ReadIndex8_24b_6666();
|
||||
void LOADERDECL Color_ReadIndex8_32b_8888();
|
||||
|
||||
void LOADERDECL Color_ReadIndex16_16b_565();
|
||||
void LOADERDECL Color_ReadIndex16_24b_888();
|
||||
void LOADERDECL Color_ReadIndex16_32b_888x();
|
||||
void LOADERDECL Color_ReadIndex16_16b_4444();
|
||||
void LOADERDECL Color_ReadIndex16_24b_6666();
|
||||
void LOADERDECL Color_ReadIndex16_32b_8888();
|
||||
|
||||
#endif
|
||||
|
@ -1,111 +1,111 @@
|
||||
// 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_NORMAL_H
|
||||
#define _VERTEXLOADER_NORMAL_H
|
||||
|
||||
#include "CommonTypes.h"
|
||||
|
||||
class VertexLoader_Normal
|
||||
{
|
||||
public:
|
||||
|
||||
// Init
|
||||
static void Init(void);
|
||||
|
||||
// GetSize
|
||||
static unsigned int GetSize(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3);
|
||||
|
||||
// GetFunction
|
||||
static TPipelineFunction GetFunction(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3);
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
enum ENormalIndices
|
||||
{
|
||||
NRM_INDICES1 = 0,
|
||||
NRM_INDICES3 = 1,
|
||||
NUM_NRM_INDICES
|
||||
};
|
||||
|
||||
struct Set {
|
||||
Set() {}
|
||||
Set(int gc_size_, TPipelineFunction function_) : gc_size(gc_size_), function(function_) {}
|
||||
int gc_size;
|
||||
TPipelineFunction function;
|
||||
// int pc_size;
|
||||
};
|
||||
|
||||
static Set m_Table[NUM_NRM_TYPE][NUM_NRM_INDICES][NUM_NRM_ELEMENTS][NUM_NRM_FORMAT];
|
||||
|
||||
// direct
|
||||
static void LOADERDECL Normal_DirectByte();
|
||||
static void LOADERDECL Normal_DirectShort();
|
||||
static void LOADERDECL Normal_DirectFloat();
|
||||
static void LOADERDECL Normal_DirectByte3();
|
||||
static void LOADERDECL Normal_DirectShort3();
|
||||
static void LOADERDECL Normal_DirectFloat3();
|
||||
|
||||
// index8
|
||||
static void LOADERDECL Normal_Index8_Byte();
|
||||
static void LOADERDECL Normal_Index8_Short();
|
||||
static void LOADERDECL Normal_Index8_Float();
|
||||
static void LOADERDECL Normal_Index8_Byte3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Short3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Float3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Byte3_Indices3();
|
||||
static void LOADERDECL Normal_Index8_Short3_Indices3();
|
||||
static void LOADERDECL Normal_Index8_Float3_Indices3();
|
||||
|
||||
// index16
|
||||
static void LOADERDECL Normal_Index16_Byte();
|
||||
static void LOADERDECL Normal_Index16_Short();
|
||||
static void LOADERDECL Normal_Index16_Float();
|
||||
static void LOADERDECL Normal_Index16_Byte3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Short3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Float3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Byte3_Indices3();
|
||||
static void LOADERDECL Normal_Index16_Short3_Indices3();
|
||||
static void LOADERDECL Normal_Index16_Float3_Indices3();
|
||||
};
|
||||
|
||||
#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 _VERTEXLOADER_NORMAL_H
|
||||
#define _VERTEXLOADER_NORMAL_H
|
||||
|
||||
#include "CommonTypes.h"
|
||||
|
||||
class VertexLoader_Normal
|
||||
{
|
||||
public:
|
||||
|
||||
// Init
|
||||
static void Init(void);
|
||||
|
||||
// GetSize
|
||||
static unsigned int GetSize(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3);
|
||||
|
||||
// GetFunction
|
||||
static TPipelineFunction GetFunction(unsigned int _type, unsigned int _format, unsigned int _elements, unsigned int _index3);
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
enum ENormalIndices
|
||||
{
|
||||
NRM_INDICES1 = 0,
|
||||
NRM_INDICES3 = 1,
|
||||
NUM_NRM_INDICES
|
||||
};
|
||||
|
||||
struct Set {
|
||||
Set() {}
|
||||
Set(int gc_size_, TPipelineFunction function_) : gc_size(gc_size_), function(function_) {}
|
||||
int gc_size;
|
||||
TPipelineFunction function;
|
||||
// int pc_size;
|
||||
};
|
||||
|
||||
static Set m_Table[NUM_NRM_TYPE][NUM_NRM_INDICES][NUM_NRM_ELEMENTS][NUM_NRM_FORMAT];
|
||||
|
||||
// direct
|
||||
static void LOADERDECL Normal_DirectByte();
|
||||
static void LOADERDECL Normal_DirectShort();
|
||||
static void LOADERDECL Normal_DirectFloat();
|
||||
static void LOADERDECL Normal_DirectByte3();
|
||||
static void LOADERDECL Normal_DirectShort3();
|
||||
static void LOADERDECL Normal_DirectFloat3();
|
||||
|
||||
// index8
|
||||
static void LOADERDECL Normal_Index8_Byte();
|
||||
static void LOADERDECL Normal_Index8_Short();
|
||||
static void LOADERDECL Normal_Index8_Float();
|
||||
static void LOADERDECL Normal_Index8_Byte3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Short3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Float3_Indices1();
|
||||
static void LOADERDECL Normal_Index8_Byte3_Indices3();
|
||||
static void LOADERDECL Normal_Index8_Short3_Indices3();
|
||||
static void LOADERDECL Normal_Index8_Float3_Indices3();
|
||||
|
||||
// index16
|
||||
static void LOADERDECL Normal_Index16_Byte();
|
||||
static void LOADERDECL Normal_Index16_Short();
|
||||
static void LOADERDECL Normal_Index16_Float();
|
||||
static void LOADERDECL Normal_Index16_Byte3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Short3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Float3_Indices1();
|
||||
static void LOADERDECL Normal_Index16_Byte3_Indices3();
|
||||
static void LOADERDECL Normal_Index16_Short3_Indices3();
|
||||
static void LOADERDECL Normal_Index16_Float3_Indices3();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,39 +1,39 @@
|
||||
// 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_POSITION_H
|
||||
#define VERTEXLOADER_POSITION_H
|
||||
|
||||
void LOADERDECL Pos_ReadDirect_UByte();
|
||||
void LOADERDECL Pos_ReadDirect_Byte();
|
||||
void LOADERDECL Pos_ReadDirect_UShort();
|
||||
void LOADERDECL Pos_ReadDirect_Short();
|
||||
void LOADERDECL Pos_ReadDirect_Float();
|
||||
|
||||
void LOADERDECL Pos_ReadIndex8_UByte();
|
||||
void LOADERDECL Pos_ReadIndex8_Byte();
|
||||
void LOADERDECL Pos_ReadIndex8_UShort();
|
||||
void LOADERDECL Pos_ReadIndex8_Short();
|
||||
void LOADERDECL Pos_ReadIndex8_Float();
|
||||
|
||||
void LOADERDECL Pos_ReadIndex16_UByte();
|
||||
void LOADERDECL Pos_ReadIndex16_Byte();
|
||||
void LOADERDECL Pos_ReadIndex16_UShort();
|
||||
void LOADERDECL Pos_ReadIndex16_Short();
|
||||
void LOADERDECL Pos_ReadIndex16_Float();
|
||||
|
||||
#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 VERTEXLOADER_POSITION_H
|
||||
#define VERTEXLOADER_POSITION_H
|
||||
|
||||
void LOADERDECL Pos_ReadDirect_UByte();
|
||||
void LOADERDECL Pos_ReadDirect_Byte();
|
||||
void LOADERDECL Pos_ReadDirect_UShort();
|
||||
void LOADERDECL Pos_ReadDirect_Short();
|
||||
void LOADERDECL Pos_ReadDirect_Float();
|
||||
|
||||
void LOADERDECL Pos_ReadIndex8_UByte();
|
||||
void LOADERDECL Pos_ReadIndex8_Byte();
|
||||
void LOADERDECL Pos_ReadIndex8_UShort();
|
||||
void LOADERDECL Pos_ReadIndex8_Short();
|
||||
void LOADERDECL Pos_ReadIndex8_Float();
|
||||
|
||||
void LOADERDECL Pos_ReadIndex16_UByte();
|
||||
void LOADERDECL Pos_ReadIndex16_Byte();
|
||||
void LOADERDECL Pos_ReadIndex16_UShort();
|
||||
void LOADERDECL Pos_ReadIndex16_Short();
|
||||
void LOADERDECL Pos_ReadIndex16_Float();
|
||||
|
||||
#endif
|
||||
|
@ -1,53 +1,53 @@
|
||||
// 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_TEXCOORD_H
|
||||
#define VERTEXLOADER_TEXCOORD_H
|
||||
|
||||
void LOADERDECL TexCoord_Read_Dummy();
|
||||
void LOADERDECL TexCoord_ReadDirect_UByte1();
|
||||
void LOADERDECL TexCoord_ReadDirect_UByte2();
|
||||
void LOADERDECL TexCoord_ReadDirect_Byte1();
|
||||
void LOADERDECL TexCoord_ReadDirect_Byte2();
|
||||
void LOADERDECL TexCoord_ReadDirect_UShort1();
|
||||
void LOADERDECL TexCoord_ReadDirect_UShort2();
|
||||
void LOADERDECL TexCoord_ReadDirect_Short1();
|
||||
void LOADERDECL TexCoord_ReadDirect_Short2();
|
||||
void LOADERDECL TexCoord_ReadDirect_Float1();
|
||||
void LOADERDECL TexCoord_ReadDirect_Float2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UByte1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UByte2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Byte1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Byte2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UShort1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UShort2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Short1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Short2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Float1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Float2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UByte1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UByte2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Byte1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Byte2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UShort1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UShort2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Short1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Short2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Float1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Float2();
|
||||
|
||||
#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 VERTEXLOADER_TEXCOORD_H
|
||||
#define VERTEXLOADER_TEXCOORD_H
|
||||
|
||||
void LOADERDECL TexCoord_Read_Dummy();
|
||||
void LOADERDECL TexCoord_ReadDirect_UByte1();
|
||||
void LOADERDECL TexCoord_ReadDirect_UByte2();
|
||||
void LOADERDECL TexCoord_ReadDirect_Byte1();
|
||||
void LOADERDECL TexCoord_ReadDirect_Byte2();
|
||||
void LOADERDECL TexCoord_ReadDirect_UShort1();
|
||||
void LOADERDECL TexCoord_ReadDirect_UShort2();
|
||||
void LOADERDECL TexCoord_ReadDirect_Short1();
|
||||
void LOADERDECL TexCoord_ReadDirect_Short2();
|
||||
void LOADERDECL TexCoord_ReadDirect_Float1();
|
||||
void LOADERDECL TexCoord_ReadDirect_Float2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UByte1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UByte2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Byte1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Byte2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UShort1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_UShort2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Short1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Short2();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Float1();
|
||||
void LOADERDECL TexCoord_ReadIndex8_Float2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UByte1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UByte2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Byte1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Byte2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UShort1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_UShort2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Short1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Short2();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Float1();
|
||||
void LOADERDECL TexCoord_ReadIndex16_Float2();
|
||||
|
||||
#endif
|
||||
|
@ -1,46 +1,46 @@
|
||||
// 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 _VERTEXMANAGER_H
|
||||
#define _VERTEXMANAGER_H
|
||||
|
||||
#include "CPMemory.h"
|
||||
|
||||
// Handles the OpenGL details of drawing lots of vertices quickly.
|
||||
// Other functionality is moving out.
|
||||
namespace VertexManager
|
||||
{
|
||||
|
||||
bool Init();
|
||||
void Shutdown();
|
||||
|
||||
void ResetBuffer();
|
||||
|
||||
void AddVertices(int primitive, int numvertices);
|
||||
void Flush(); // flushes the current buffer
|
||||
|
||||
int GetRemainingSize(); // remaining space in the current buffer.
|
||||
|
||||
void EnableComponents(u32 components); // very implementation specific - D3D9 won't need this one.
|
||||
|
||||
// TODO: move, rename.
|
||||
extern u8* s_pCurBufferPointer;
|
||||
|
||||
};
|
||||
|
||||
#endif // _VERTEXMANAGER_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/
|
||||
|
||||
|
||||
#ifndef _VERTEXMANAGER_H
|
||||
#define _VERTEXMANAGER_H
|
||||
|
||||
#include "CPMemory.h"
|
||||
|
||||
// Handles the OpenGL details of drawing lots of vertices quickly.
|
||||
// Other functionality is moving out.
|
||||
namespace VertexManager
|
||||
{
|
||||
|
||||
bool Init();
|
||||
void Shutdown();
|
||||
|
||||
void ResetBuffer();
|
||||
|
||||
void AddVertices(int primitive, int numvertices);
|
||||
void Flush(); // flushes the current buffer
|
||||
|
||||
int GetRemainingSize(); // remaining space in the current buffer.
|
||||
|
||||
void EnableComponents(u32 components); // very implementation specific - D3D9 won't need this one.
|
||||
|
||||
// TODO: move, rename.
|
||||
extern u8* s_pCurBufferPointer;
|
||||
|
||||
};
|
||||
|
||||
#endif // _VERTEXMANAGER_H
|
||||
|
@ -1,131 +1,131 @@
|
||||
// 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 _VERTEXSHADERMANAGER_H
|
||||
#define _VERTEXSHADERMANAGER_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "GLUtil.h"
|
||||
|
||||
struct VERTEXSHADER
|
||||
{
|
||||
VERTEXSHADER() : glprogid(0) {}
|
||||
GLuint glprogid; // opengl program id
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
std::string strprog;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
class VERTEXSHADERUID
|
||||
{
|
||||
public:
|
||||
u32 values[9];
|
||||
|
||||
VERTEXSHADERUID() {
|
||||
memset(values, 0, sizeof(values));
|
||||
}
|
||||
|
||||
VERTEXSHADERUID(const VERTEXSHADERUID& r) {
|
||||
for (size_t i = 0; i < sizeof(values) / sizeof(u32); ++i)
|
||||
values[i] = r.values[i];
|
||||
}
|
||||
|
||||
int GetNumValues() const {
|
||||
return (((values[0] >> 23) & 0xf)*3 + 3)/4 + 3; // numTexGens*3/4+1
|
||||
}
|
||||
|
||||
bool operator <(const VERTEXSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] < _Right.values[0])
|
||||
return true;
|
||||
else if (values[0] > _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] < _Right.values[i])
|
||||
return true;
|
||||
else if (values[i] > _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator ==(const VERTEXSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] != _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] != _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class VertexShaderMngr
|
||||
{
|
||||
struct VSCacheEntry
|
||||
{
|
||||
VERTEXSHADER shader;
|
||||
int frameCount;
|
||||
VSCacheEntry() : frameCount(0) {}
|
||||
void Destroy() {
|
||||
// printf("Destroying vs %i\n", shader.glprogid);
|
||||
glDeleteProgramsARB(1, &shader.glprogid);
|
||||
shader.glprogid = 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::map<VERTEXSHADERUID, VSCacheEntry> VSCache;
|
||||
|
||||
static VSCache vshaders;
|
||||
static VERTEXSHADER* pShaderLast;
|
||||
|
||||
static void GetVertexShaderId(VERTEXSHADERUID& uid, u32 components);
|
||||
|
||||
static void SetVSConstant4f(int const_number, float f1, float f2, float f3, float f4);
|
||||
static void SetVSConstant4fv(int const_number, const float *f);
|
||||
public:
|
||||
static void Init();
|
||||
static void Cleanup();
|
||||
static void Shutdown();
|
||||
static VERTEXSHADER* GetShader(u32 components);
|
||||
static bool CompileVertexShader(VERTEXSHADER& ps, const char* pstrprogram);
|
||||
|
||||
// constant management
|
||||
static void SetConstants();
|
||||
|
||||
static void SetViewport(float* _Viewport);
|
||||
static void SetViewportChanged();
|
||||
static void SetProjection(float* _pProjection, int constantIndex = -1);
|
||||
static void InvalidateXFRange(int start, int end);
|
||||
static void SetTexMatrixChangedA(u32 Value);
|
||||
static void SetTexMatrixChangedB(u32 Value);
|
||||
|
||||
static float* GetPosNormalMat();
|
||||
static float GetPixelAspectRatio();
|
||||
};
|
||||
|
||||
void LoadXFReg(u32 transferSize, u32 address, u32 *pData);
|
||||
void LoadIndexedXF(u32 val, int array);
|
||||
|
||||
#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 _VERTEXSHADERMANAGER_H
|
||||
#define _VERTEXSHADERMANAGER_H
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "GLUtil.h"
|
||||
|
||||
struct VERTEXSHADER
|
||||
{
|
||||
VERTEXSHADER() : glprogid(0) {}
|
||||
GLuint glprogid; // opengl program id
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
std::string strprog;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
class VERTEXSHADERUID
|
||||
{
|
||||
public:
|
||||
u32 values[9];
|
||||
|
||||
VERTEXSHADERUID() {
|
||||
memset(values, 0, sizeof(values));
|
||||
}
|
||||
|
||||
VERTEXSHADERUID(const VERTEXSHADERUID& r) {
|
||||
for (size_t i = 0; i < sizeof(values) / sizeof(u32); ++i)
|
||||
values[i] = r.values[i];
|
||||
}
|
||||
|
||||
int GetNumValues() const {
|
||||
return (((values[0] >> 23) & 0xf)*3 + 3)/4 + 3; // numTexGens*3/4+1
|
||||
}
|
||||
|
||||
bool operator <(const VERTEXSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] < _Right.values[0])
|
||||
return true;
|
||||
else if (values[0] > _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] < _Right.values[i])
|
||||
return true;
|
||||
else if (values[i] > _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator ==(const VERTEXSHADERUID& _Right) const
|
||||
{
|
||||
if (values[0] != _Right.values[0])
|
||||
return false;
|
||||
int N = GetNumValues();
|
||||
for (int i = 1; i < N; ++i) {
|
||||
if (values[i] != _Right.values[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class VertexShaderMngr
|
||||
{
|
||||
struct VSCacheEntry
|
||||
{
|
||||
VERTEXSHADER shader;
|
||||
int frameCount;
|
||||
VSCacheEntry() : frameCount(0) {}
|
||||
void Destroy() {
|
||||
// printf("Destroying vs %i\n", shader.glprogid);
|
||||
glDeleteProgramsARB(1, &shader.glprogid);
|
||||
shader.glprogid = 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::map<VERTEXSHADERUID, VSCacheEntry> VSCache;
|
||||
|
||||
static VSCache vshaders;
|
||||
static VERTEXSHADER* pShaderLast;
|
||||
|
||||
static void GetVertexShaderId(VERTEXSHADERUID& uid, u32 components);
|
||||
|
||||
static void SetVSConstant4f(int const_number, float f1, float f2, float f3, float f4);
|
||||
static void SetVSConstant4fv(int const_number, const float *f);
|
||||
public:
|
||||
static void Init();
|
||||
static void Cleanup();
|
||||
static void Shutdown();
|
||||
static VERTEXSHADER* GetShader(u32 components);
|
||||
static bool CompileVertexShader(VERTEXSHADER& ps, const char* pstrprogram);
|
||||
|
||||
// constant management
|
||||
static void SetConstants();
|
||||
|
||||
static void SetViewport(float* _Viewport);
|
||||
static void SetViewportChanged();
|
||||
static void SetProjection(float* _pProjection, int constantIndex = -1);
|
||||
static void InvalidateXFRange(int start, int end);
|
||||
static void SetTexMatrixChangedA(u32 Value);
|
||||
static void SetTexMatrixChangedB(u32 Value);
|
||||
|
||||
static float* GetPosNormalMat();
|
||||
static float GetPixelAspectRatio();
|
||||
};
|
||||
|
||||
void LoadXFReg(u32 transferSize, u32 address, u32 *pData);
|
||||
void LoadIndexedXF(u32 val, int array);
|
||||
|
||||
#endif
|
||||
|
@ -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/
|
||||
|
||||
#ifndef _XFB_H
|
||||
#define _XFB_H
|
||||
|
||||
#include "TextureMngr.h"
|
||||
|
||||
void XFB_Init();
|
||||
|
||||
// write the EFB to the XFB
|
||||
void XFB_Write(u8 *xfb_in_ram, const TRectangle& sourceRc, u32 dstWd, u32 dstHt);
|
||||
|
||||
// draw the XFB to the screen
|
||||
void XFB_Draw(u8 *xfb_in_ram, u32 width, u32 height, s32 yOffset);
|
||||
|
||||
void XFB_Shutdown();
|
||||
|
||||
#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 _XFB_H
|
||||
#define _XFB_H
|
||||
|
||||
#include "TextureMngr.h"
|
||||
|
||||
void XFB_Init();
|
||||
|
||||
// write the EFB to the XFB
|
||||
void XFB_Write(u8 *xfb_in_ram, const TRectangle& sourceRc, u32 dstWd, u32 dstHt);
|
||||
|
||||
// draw the XFB to the screen
|
||||
void XFB_Draw(u8 *xfb_in_ram, u32 width, u32 height, s32 yOffset);
|
||||
|
||||
void XFB_Shutdown();
|
||||
|
||||
#endif
|
||||
|
@ -1,25 +1,25 @@
|
||||
// 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"
|
||||
|
||||
extern SVideoInitialize g_VideoInitialize;
|
||||
|
||||
#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"
|
||||
|
||||
extern SVideoInitialize g_VideoInitialize;
|
||||
|
||||
#endif
|
||||
|
@ -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/
|
||||
|
||||
#ifndef RasterFont_Header
|
||||
#define RasterFont_Header
|
||||
|
||||
class RasterFont {
|
||||
protected:
|
||||
int fontOffset;
|
||||
|
||||
public:
|
||||
RasterFont();
|
||||
~RasterFont(void);
|
||||
static int debug;
|
||||
|
||||
// some useful constants
|
||||
enum {char_width = 10};
|
||||
enum {char_height = 15};
|
||||
|
||||
// and the happy helper functions
|
||||
void printString(const char *s, double x, double y, double z=0.0);
|
||||
void printCenteredString(const char *s, double y, int screen_width, double z=0.0);
|
||||
|
||||
void printMultilineText(const char *text, double x, double y, double z, int bbWidth, int bbHeight);
|
||||
};
|
||||
|
||||
#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 RasterFont_Header
|
||||
#define RasterFont_Header
|
||||
|
||||
class RasterFont {
|
||||
protected:
|
||||
int fontOffset;
|
||||
|
||||
public:
|
||||
RasterFont();
|
||||
~RasterFont(void);
|
||||
static int debug;
|
||||
|
||||
// some useful constants
|
||||
enum {char_width = 10};
|
||||
enum {char_height = 15};
|
||||
|
||||
// and the happy helper functions
|
||||
void printString(const char *s, double x, double y, double z=0.0);
|
||||
void printCenteredString(const char *s, double y, int screen_width, double z=0.0);
|
||||
|
||||
void printMultilineText(const char *text, double x, double y, double z, int bbWidth, int bbHeight);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user