fixes to make Space Junk work with both core and compat profiles
This commit is contained in:
parent
68a81df576
commit
ba3bb78e03
5 changed files with 63 additions and 43 deletions
|
|
@ -7,6 +7,10 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
430443F016F1656A0078C0F9 /* RegalXfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 430443EE16F1656A0078C0F9 /* RegalXfer.cpp */; };
|
||||
430443F116F1656A0078C0F9 /* RegalXfer.h in Headers */ = {isa = PBXBuildFile; fileRef = 430443EF16F1656A0078C0F9 /* RegalXfer.h */; };
|
||||
430443F416F1658F0078C0F9 /* RegalMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 430443F216F1658F0078C0F9 /* RegalMac.h */; };
|
||||
430443F516F1658F0078C0F9 /* RegalScopedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 430443F316F1658F0078C0F9 /* RegalScopedPtr.h */; };
|
||||
431D3C0D15C9B6F0009DD04F /* RegalEnum.h in Headers */ = {isa = PBXBuildFile; fileRef = 431D3C0915C9B6F0009DD04F /* RegalEnum.h */; };
|
||||
431D3C0E15C9B6F0009DD04F /* RegalFavicon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */; };
|
||||
431D3C0F15C9B6F0009DD04F /* RegalFavicon.h in Headers */ = {isa = PBXBuildFile; fileRef = 431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */; };
|
||||
|
|
@ -95,6 +99,10 @@
|
|||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
430443EE16F1656A0078C0F9 /* RegalXfer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalXfer.cpp; path = ../../../src/regal/RegalXfer.cpp; sourceTree = "<group>"; };
|
||||
430443EF16F1656A0078C0F9 /* RegalXfer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalXfer.h; path = ../../../src/regal/RegalXfer.h; sourceTree = "<group>"; };
|
||||
430443F216F1658F0078C0F9 /* RegalMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalMac.h; path = ../../../src/regal/RegalMac.h; sourceTree = "<group>"; };
|
||||
430443F316F1658F0078C0F9 /* RegalScopedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalScopedPtr.h; path = ../../../src/regal/RegalScopedPtr.h; sourceTree = "<group>"; };
|
||||
431D3C0915C9B6F0009DD04F /* RegalEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalEnum.h; path = ../../../src/regal/RegalEnum.h; sourceTree = "<group>"; };
|
||||
431D3C0A15C9B6F0009DD04F /* RegalFavicon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegalFavicon.cpp; path = ../../../src/regal/RegalFavicon.cpp; sourceTree = "<group>"; };
|
||||
431D3C0B15C9B6F0009DD04F /* RegalFavicon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegalFavicon.h; path = ../../../src/regal/RegalFavicon.h; sourceTree = "<group>"; };
|
||||
|
|
@ -269,6 +277,7 @@
|
|||
43A6C1F115C48D200063667E /* RegalLookup.cpp */,
|
||||
43A6C1F215C48D200063667E /* RegalLookup.h */,
|
||||
431D3C0C15C9B6F0009DD04F /* RegalMac.cpp */,
|
||||
430443F216F1658F0078C0F9 /* RegalMac.h */,
|
||||
BC02094D160D1BA3003FAB99 /* RegalMarker.cpp */,
|
||||
43A6C1F315C48D200063667E /* RegalMarker.h */,
|
||||
43A6C1F415C48D200063667E /* RegalObj.h */,
|
||||
|
|
@ -282,6 +291,7 @@
|
|||
43A6C1F715C48D200063667E /* RegalPrecompile.h */,
|
||||
43A6C1F815C48D200063667E /* RegalPrivate.h */,
|
||||
BCBEC6FF167AD72700B38E16 /* RegalPush.h */,
|
||||
430443F316F1658F0078C0F9 /* RegalScopedPtr.h */,
|
||||
BCBEC700167AD72700B38E16 /* RegalShaderCache.cpp */,
|
||||
BCBEC701167AD72700B38E16 /* RegalShaderCache.h */,
|
||||
BCBEC702167AD72700B38E16 /* RegalSharedList.h */,
|
||||
|
|
@ -300,6 +310,8 @@
|
|||
43A6C1FC15C48D200063667E /* RegalUtil.cpp */,
|
||||
43A6C1FD15C48D200063667E /* RegalUtil.h */,
|
||||
43A6C1FE15C48D200063667E /* RegalVao.h */,
|
||||
430443EE16F1656A0078C0F9 /* RegalXfer.cpp */,
|
||||
430443EF16F1656A0078C0F9 /* RegalXfer.h */,
|
||||
);
|
||||
name = Regal;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -373,6 +385,9 @@
|
|||
438D2C3716DE6699005E03F6 /* Regal.h in Headers */,
|
||||
BC94B98C16DFDC6200116D55 /* RegalBreak.h in Headers */,
|
||||
BC94B99816DFDF1F00116D55 /* RegalFilt.h in Headers */,
|
||||
430443F116F1656A0078C0F9 /* RegalXfer.h in Headers */,
|
||||
430443F416F1658F0078C0F9 /* RegalMac.h in Headers */,
|
||||
430443F516F1658F0078C0F9 /* RegalScopedPtr.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
@ -466,6 +481,7 @@
|
|||
438D2C3216DE668A005E03F6 /* RegalTexC.cpp in Sources */,
|
||||
BC94B98B16DFDC6200116D55 /* RegalBreak.cpp in Sources */,
|
||||
BC94B99716DFDF1F00116D55 /* RegalFilt.cpp in Sources */,
|
||||
430443F016F1656A0078C0F9 /* RegalXfer.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ formulae = {
|
|||
'glEvalMesh(1|2)',
|
||||
'glEvalPoint(1|2)',
|
||||
'glGenLists',
|
||||
'glGenTextures',
|
||||
'glGetTexLevelParameter(f|i)v',
|
||||
'glHint',
|
||||
'glLineStipple',
|
||||
|
|
|
|||
|
|
@ -16454,9 +16454,6 @@ static void REGAL_CALL emu_glGenTextures(GLsizei n, GLuint *textures)
|
|||
if (_context->texc) break;
|
||||
#endif
|
||||
case 1 :
|
||||
#if REGAL_EMU_FILTER
|
||||
if (_context->filt) break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -16504,21 +16501,6 @@ static void REGAL_CALL emu_glGenTextures(GLsizei n, GLuint *textures)
|
|||
}
|
||||
#endif
|
||||
case 1 :
|
||||
#if REGAL_EMU_FILTER
|
||||
if (_context->filt)
|
||||
{
|
||||
Push<int> pushLevel(_context->emuLevel);
|
||||
_context->emuLevel = 0;
|
||||
if (_context->isES2() || _context->isCore())
|
||||
{
|
||||
Warning("Regal does not support glGenTextures for core or ES2 profiles - skipping.");
|
||||
#if REGAL_BREAK
|
||||
Break::Filter();
|
||||
#endif
|
||||
return ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
DispatchTable *_next = _context->dispatcher.emulation._next;
|
||||
|
|
|
|||
|
|
@ -2185,34 +2185,51 @@ void Iff::UseShaderProgram( RegalContext * ctx )
|
|||
UpdateUniforms( ctx );
|
||||
}
|
||||
|
||||
static int remove_version(GLchar *str)
|
||||
{
|
||||
GLchar version[4];
|
||||
|
||||
if (!str)
|
||||
return -1;
|
||||
|
||||
GLchar *i = str;
|
||||
while ((i = strstr(i,"#version ")))
|
||||
static int remove_version(GLchar *str)
|
||||
{
|
||||
if (i==str || i[-1]=='\n')
|
||||
GLchar version[4];
|
||||
|
||||
if (!str)
|
||||
return -1;
|
||||
|
||||
GLchar *i = str;
|
||||
while ((i = strstr(i,"#version ")))
|
||||
{
|
||||
i[0] = '/';
|
||||
i[1] = '/';
|
||||
|
||||
// return version number
|
||||
i+=9;
|
||||
while (*i == ' ') i++;
|
||||
for (int j=0; j<3; i++,j++)
|
||||
version[j] = *i;
|
||||
version[3] = '\0';
|
||||
return atoi(version);
|
||||
if (i==str || i[-1]=='\n')
|
||||
{
|
||||
i[0] = '/';
|
||||
i[1] = '/';
|
||||
|
||||
// return version number
|
||||
i+=9;
|
||||
while (*i == ' ') i++;
|
||||
for (int j=0; j<3; i++,j++)
|
||||
version[j] = *i;
|
||||
version[3] = '\0';
|
||||
return atoi(version);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
++i;
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static void remove_precision(GLchar *str)
|
||||
{
|
||||
if (!str)
|
||||
return;
|
||||
|
||||
GLchar *i = str;
|
||||
while ((i = strstr(i,"precision ")))
|
||||
{
|
||||
if (i==str || i[-1]=='\n')
|
||||
{
|
||||
i[0] = '/';
|
||||
i[1] = '/';
|
||||
}
|
||||
i+=9;
|
||||
}
|
||||
}
|
||||
|
||||
// replace ftransform with "rgl_ftform" in order to avoid conflict with possibly deprecated ftransform
|
||||
static void replace_ftransform(GLchar *str)
|
||||
{
|
||||
|
|
@ -2275,8 +2292,11 @@ void Iff::ShaderSource( RegalContext *ctx, GLuint shader, GLsizei count, const G
|
|||
version = remove_version(s[i+1]);
|
||||
if (uses_ftransform && gles )
|
||||
replace_ftransform(s[i+1]);
|
||||
if( legacy )
|
||||
remove_precision(s[i+1]);
|
||||
}
|
||||
|
||||
|
||||
// Preamble
|
||||
|
||||
string_list ss;
|
||||
|
|
@ -2285,6 +2305,7 @@ void Iff::ShaderSource( RegalContext *ctx, GLuint shader, GLsizei count, const G
|
|||
// hack around #version 100 on x86 failing compilation
|
||||
if( ctx->info->gl_version_major >= 3 ) {
|
||||
ss << "#version 120\n";
|
||||
ss << "#define precision\n";
|
||||
} else {
|
||||
ss << "#version 100\n";
|
||||
}
|
||||
|
|
@ -2292,6 +2313,7 @@ void Iff::ShaderSource( RegalContext *ctx, GLuint shader, GLsizei count, const G
|
|||
else if (legacy)
|
||||
{
|
||||
ss << "#version 120\n";
|
||||
ss << "#define precision\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ _glBlendFunciARB
|
|||
_glBlitFramebuffer
|
||||
_glBlitFramebufferANGLE
|
||||
_glBlitFramebufferEXT
|
||||
_glBlitFramebufferNV
|
||||
_glBufferAddressRangeNV
|
||||
_glBufferData
|
||||
_glBufferDataARB
|
||||
|
|
|
|||
Loading…
Reference in a new issue