More accurate audio interrupts (preparation for homebrew audio support). some minor cleanup in gl plugin.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@226 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-16 10:49:08 +00:00
parent 7962ab4713
commit dcd5ffeb7a
16 changed files with 177 additions and 101 deletions

View File

@ -1048,6 +1048,10 @@
RelativePath=".\Src\Render.h"
>
</File>
<File
RelativePath=".\Src\SConscript"
>
</File>
<File
RelativePath=".\Src\XFB.cpp"
>

View File

@ -15,6 +15,13 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <wx/wx.h>
#include <wx/filepicker.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
#include <wx/aboutdlg.h>
#include "Globals.h"
#include "pluginspecs_video.h"

View File

@ -19,12 +19,6 @@
#ifndef _GLOBALS_H
#define _GLOBALS_H
#include <wx/wx.h>
#include <wx/filepicker.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
#include <wx/aboutdlg.h>
#define LOGGING
#include "Common.h"
@ -32,13 +26,6 @@
#ifdef _WIN32
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h>
void OpenConsole();
void CloseConsole();
#define GLEW_STATIC
#include "GLew/glew.h"
@ -97,16 +84,8 @@ struct RECT
#define GL_DEPTH24_STENCIL8_EXT 0x88F0
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
#endif
extern float MValue;
// several macros
// PLEASE DO NOT USE THE FOLLOWING SAFE*
// They only encourage sloppy coding, and hide bugs.
#define SAFE_RELEASE_CGPROG(x) { if( (x) != NULL ) { cgDestroyProgram(x); x = NULL; } }
#define SAFE_RELEASE_PROG(x) { if( (x) != 0 ) { glDeleteProgramsARB(1, &(x)); x = 0; } }
#define SAFE_RELEASE_TEX(x) { if( (x) != 0 ) { glDeleteTextures(1, &(x)); x = 0; } }
#define SAFE_RELEASE_BUF(x) { if( (x) != 0 ) { glDeleteBuffers(1, &(x)); x = 0; } }
#define FORIT(it, v) for(it = (v).begin(); it != (v).end(); ++(it))
extern float MValue;
#define ERROR_LOG __Log

View File

@ -18,11 +18,20 @@
#include <windows.h>
#include <wx/wx.h>
#include <wx/filepicker.h>
#include <wx/notebook.h>
#include <wx/dialog.h>
#include <wx/aboutdlg.h>
#include "../Globals.h"
#include "../../Core/Src/Core.h"
#include "Win32.h"
void OpenConsole();
void CloseConsole();
HINSTANCE g_hInstance;
class wxDLLApp : public wxApp

View File

@ -94,16 +94,17 @@ void PixelShaderMngr::Init()
GL_REPORT_ERROR();
if( err != GL_NO_ERROR ) {
ERROR_LOG("Failed to create color matrix fragment program\n");
SAFE_RELEASE_PROG(s_ColorMatrixProgram);
glDeleteProgramsARB(1, &s_ColorMatrixProgram);
s_ColorMatrixProgram = 0;
}
}
void PixelShaderMngr::Shutdown()
{
SAFE_RELEASE_PROG(s_ColorMatrixProgram);
glDeleteProgramsARB(1, &s_ColorMatrixProgram);
s_ColorMatrixProgram = 0;
PSCache::iterator iter = pshaders.begin();
for (;iter!=pshaders.end();iter++)
for (; iter != pshaders.end(); iter++)
iter->second.Destroy();
pshaders.clear();
}

View File

@ -80,14 +80,15 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0& newmode)
void TextureMngr::TCacheEntry::Destroy()
{
SAFE_RELEASE_TEX(texture);
glDeleteTextures(1, &texture);
texture = 0;
}
void TextureMngr::Init()
{
temp = (u8*)AllocateMemoryPages(TEMP_SIZE);
nTex2DEnabled = nTexRECTEnabled = 0;
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable, g_Config.bTexFmtOverlayCenter);
}
void TextureMngr::Invalidate()
@ -96,7 +97,7 @@ void TextureMngr::Invalidate()
for (;iter!=textures.end();iter++)
iter->second.Destroy();
textures.clear();
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable, g_Config.bTexFmtOverlayCenter);
}
void TextureMngr::Shutdown()

View File

@ -1087,7 +1087,7 @@ void VertexManager::Flush()
int offset = 0;
vector< pair<int, int> >::iterator it;
FORIT (it, s_vStoredPrimitives) {
for (it = s_vStoredPrimitives.begin(); it != s_vStoredPrimitives.end(); ++it) {
glDrawArrays(it->first, offset, it->second);
offset += it->second;
}