mirror of https://github.com/PCSX2/pcsx2.git
zzogl-pg: Go with gregorys dummy key limit change for the moment. Gets rid of garbage in Grandia III. Needs more testing with other games.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3245 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
23f63c37cc
commit
344bdb8739
|
@ -35,8 +35,6 @@
|
||||||
#define RHA
|
#define RHA
|
||||||
//#define RW
|
//#define RW
|
||||||
|
|
||||||
bool nullTex = false;
|
|
||||||
|
|
||||||
using namespace ZeroGS;
|
using namespace ZeroGS;
|
||||||
extern int g_TransferredToGPU;
|
extern int g_TransferredToGPU;
|
||||||
extern bool g_bIsLost;
|
extern bool g_bIsLost;
|
||||||
|
|
|
@ -283,7 +283,7 @@ inline u32 GetFrameKeyDummy(int fbp, int fbw, int fbh, int psm)
|
||||||
|
|
||||||
#ifndef FRAME_KEY_BY_FBH
|
#ifndef FRAME_KEY_BY_FBH
|
||||||
int calc = ZZOgl_fbh_Calc(fbp, fbw, psm);
|
int calc = ZZOgl_fbh_Calc(fbp, fbw, psm);
|
||||||
if (/*fbp > 0x2000 && */calc < 0x300)
|
if (/*fbp > 0x2000 && */calc < /*0x300*/0x2E0)
|
||||||
return ((fbw << 16) | calc);
|
return ((fbw << 16) | calc);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -304,36 +304,17 @@ inline u32 GetFrameKeyDummy(CRenderTarget* frame)
|
||||||
|
|
||||||
#include "Mem.h"
|
#include "Mem.h"
|
||||||
|
|
||||||
// Naive attempt at preventing texures from being drawn if their data is null. (which is undefined behavior.)
|
|
||||||
// Gets rid of garbage at the beginning of Grandia III.
|
|
||||||
// And messes up Kingdom Hearts opening. I need to read up more on OpenGL. :(
|
|
||||||
//#define NO_NULL_TEXTURES
|
|
||||||
|
|
||||||
static __forceinline void DrawTriangleArray()
|
static __forceinline void DrawTriangleArray()
|
||||||
{
|
{
|
||||||
#ifdef NO_NULL_TEXTURES
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||||
if (nullTex)
|
GL_REPORT_ERRORD();
|
||||||
{
|
|
||||||
ZZLog::Debug_Log("Drawing triangle arrays without a texture!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
|
||||||
GL_REPORT_ERRORD();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void DrawBuffers(GLenum *buffer)
|
static __forceinline void DrawBuffers(GLenum *buffer)
|
||||||
{
|
{
|
||||||
if (glDrawBuffers != NULL)
|
if (glDrawBuffers != NULL)
|
||||||
{
|
{
|
||||||
#ifdef NO_NULL_TEXTURES
|
glDrawBuffers(1, buffer);
|
||||||
if (nullTex)
|
|
||||||
ZZLog::Debug_Log("Drawing buffers without a texture!");
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
glDrawBuffers(1, buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_REPORT_ERRORD();
|
GL_REPORT_ERRORD();
|
||||||
|
@ -348,25 +329,21 @@ static __forceinline void FBTexture(int attach, int id = 0)
|
||||||
static __forceinline void Texture2D(GLint iFormat, GLint width, GLint height, GLenum format, GLenum type, const GLvoid* pixels)
|
static __forceinline void Texture2D(GLint iFormat, GLint width, GLint height, GLenum format, GLenum type, const GLvoid* pixels)
|
||||||
{
|
{
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, iFormat, width, height, 0, format, type, pixels);
|
glTexImage2D(GL_TEXTURE_2D, 0, iFormat, width, height, 0, format, type, pixels);
|
||||||
nullTex = (pixels == NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void Texture2D(GLint iFormat, GLenum format, GLenum type, const GLvoid* pixels)
|
static __forceinline void Texture2D(GLint iFormat, GLenum format, GLenum type, const GLvoid* pixels)
|
||||||
{
|
{
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, iFormat, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, format, type, pixels);
|
glTexImage2D(GL_TEXTURE_2D, 0, iFormat, BLOCK_TEXWIDTH, BLOCK_TEXHEIGHT, 0, format, type, pixels);
|
||||||
nullTex = (pixels == NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void Texture3D(GLint iFormat, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLvoid* pixels)
|
static __forceinline void Texture3D(GLint iFormat, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLvoid* pixels)
|
||||||
{
|
{
|
||||||
glTexImage3D(GL_TEXTURE_2D, 0, iFormat, width, height, depth, 0, format, type, pixels);
|
glTexImage3D(GL_TEXTURE_2D, 0, iFormat, width, height, depth, 0, format, type, pixels);
|
||||||
nullTex = (pixels == NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void TextureRect(GLint iFormat, GLint width, GLint height, GLenum format, GLenum type, const GLvoid* pixels)
|
static __forceinline void TextureRect(GLint iFormat, GLint width, GLint height, GLenum format, GLenum type, const GLvoid* pixels)
|
||||||
{
|
{
|
||||||
glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, iFormat, width, height, 0, format, type, pixels);
|
glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, iFormat, width, height, 0, format, type, pixels);
|
||||||
nullTex = (pixels == NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void TextureRect(GLenum attach, GLuint id = 0)
|
static __forceinline void TextureRect(GLenum attach, GLuint id = 0)
|
||||||
|
|
Loading…
Reference in New Issue