Removed unneeded code, GL_TRIANGLE_STRIP is more than enough.
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@230 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
31e5d61273
commit
9f97116e06
|
@ -176,12 +176,6 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
|
||||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST, OnUpdateOptionsVideoRenderoptionsGlnearest)
|
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST, OnUpdateOptionsVideoRenderoptionsGlnearest)
|
||||||
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnOptionsVideoRenderoptionsGlbilinear)
|
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnOptionsVideoRenderoptionsGlbilinear)
|
||||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnUpdateOptionsVideoRenderoptionsGlbilinear)
|
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnUpdateOptionsVideoRenderoptionsGlbilinear)
|
||||||
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE, OnOptionsVideoRenderoptionsGltriangle)
|
|
||||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE, OnUpdateOptionsVideoRenderoptionsGltriangle)
|
|
||||||
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS, OnOptionsVideoRenderoptionsGlquads)
|
|
||||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS, OnUpdateOptionsVideoRenderoptionsGlquads)
|
|
||||||
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLPOLYGONS, OnOptionsVideoRenderoptionsGlpolygons)
|
|
||||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLPOLYGONS, OnUpdateOptionsVideoRenderoptionsGlpolygons)
|
|
||||||
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLSLSHADERS, OnOptionsVideoRenderingoptionsGLSLShaders)
|
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLSLSHADERS, OnOptionsVideoRenderingoptionsGLSLShaders)
|
||||||
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLSLSHADERS, OnUpdateOptionsVideoRenderingoptionsGLSLShaders)
|
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLSLSHADERS, OnUpdateOptionsVideoRenderingoptionsGLSLShaders)
|
||||||
|
|
||||||
|
|
|
@ -615,65 +615,6 @@ void MainWnd::OnUpdateOptionsVideoRenderoptionsGlbilinear(CCmdUI* pCmdUI)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWnd::OnOptionsVideoRenderoptionsGltriangle()
|
|
||||||
{
|
|
||||||
#ifndef NO_OGL
|
|
||||||
theApp.glType = 0;
|
|
||||||
if( theApp.display ) {
|
|
||||||
theApp.display->setOption( _T("glType"), theApp.glType );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWnd::OnUpdateOptionsVideoRenderoptionsGltriangle(CCmdUI* pCmdUI)
|
|
||||||
{
|
|
||||||
#ifndef NO_OGL
|
|
||||||
pCmdUI->SetCheck(theApp.glType == 0);
|
|
||||||
#else
|
|
||||||
pCmdUI->Enable( FALSE );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWnd::OnOptionsVideoRenderoptionsGlquads()
|
|
||||||
{
|
|
||||||
#ifndef NO_OGL
|
|
||||||
theApp.glType = 1;
|
|
||||||
if( theApp.display ) {
|
|
||||||
theApp.display->setOption( _T("glType"), theApp.glType );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWnd::OnUpdateOptionsVideoRenderoptionsGlquads(CCmdUI* pCmdUI)
|
|
||||||
{
|
|
||||||
#ifndef NO_OGL
|
|
||||||
pCmdUI->SetCheck(theApp.glType == 1);
|
|
||||||
#else
|
|
||||||
pCmdUI->Enable( FALSE );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWnd::OnOptionsVideoRenderoptionsGlpolygons()
|
|
||||||
{
|
|
||||||
#ifndef NO_OGL
|
|
||||||
theApp.glType = 2;
|
|
||||||
if( theApp.display ) {
|
|
||||||
theApp.display->setOption( _T("glType"), theApp.glType );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWnd::OnUpdateOptionsVideoRenderoptionsGlpolygons(CCmdUI* pCmdUI)
|
|
||||||
{
|
|
||||||
#ifndef NO_OGL
|
|
||||||
pCmdUI->SetCheck(theApp.glType == 2);
|
|
||||||
#else
|
|
||||||
pCmdUI->Enable( FALSE );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWnd::OnUpdateOptionsVideoRenderingoptionsGLSLShaders(CCmdUI* pCmdUI)
|
void MainWnd::OnUpdateOptionsVideoRenderingoptionsGLSLShaders(CCmdUI* pCmdUI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -395,63 +395,23 @@ void OpenGLDisplay::render()
|
||||||
glPixelStorei( GL_UNPACK_ROW_LENGTH, theApp.sizeX + 1 );
|
glPixelStorei( GL_UNPACK_ROW_LENGTH, theApp.sizeX + 1 );
|
||||||
}
|
}
|
||||||
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,data );
|
glTexSubImage2D(GL_TEXTURE_2D,0,0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,data );
|
||||||
|
|
||||||
|
glBegin( GL_QUADS );
|
||||||
|
|
||||||
switch( theApp.glType )
|
glTexCoord2f( 0.0f, 0.0f );
|
||||||
{
|
glVertex3i( 0, 0, 0 );
|
||||||
case 0:
|
|
||||||
glBegin( GL_TRIANGLE_STRIP );
|
|
||||||
glTexCoord2f( 0.0f, 0.0f );
|
|
||||||
glVertex3i( 0, 0, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( (float)(width) / size, 0.0f );
|
glTexCoord2f( (float)(width) / size, 0.0f );
|
||||||
glVertex3i( theApp.surfaceSizeX, 0, 0 );
|
glVertex3i( theApp.surfaceSizeX, 0, 0 );
|
||||||
|
|
||||||
glTexCoord2f( 0.0f, (float)(height) / size );
|
|
||||||
glVertex3i( 0, theApp.surfaceSizeY, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( (float)(width) / size, (float)(height) / size );
|
|
||||||
glVertex3i( theApp.surfaceSizeX, theApp.surfaceSizeY, 0 );
|
|
||||||
|
|
||||||
glEnd();
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
glBegin( GL_QUADS );
|
|
||||||
|
|
||||||
glTexCoord2f( 0.0f, 0.0f );
|
|
||||||
glVertex3i( 0, 0, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( (float)(width) / size, 0.0f );
|
|
||||||
glVertex3i( theApp.surfaceSizeX, 0, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( (float)(width) / size, (float)(height) / size );
|
|
||||||
glVertex3i( theApp.surfaceSizeX, theApp.surfaceSizeY, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( 0.0f, (float)(height) / size );
|
|
||||||
glVertex3i( 0, theApp.surfaceSizeY, 0 );
|
|
||||||
|
|
||||||
glEnd();
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
glBegin( GL_POLYGON );
|
|
||||||
|
|
||||||
glTexCoord2f( 0.0f, 0.0f );
|
|
||||||
glVertex3i( 0, 0, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( (float)(width) / size, 0.0f );
|
|
||||||
glVertex3i( theApp.surfaceSizeX, 0, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( (float)(width) / size, (float)(height) / size );
|
|
||||||
glVertex3i( theApp.surfaceSizeX, theApp.surfaceSizeY, 0 );
|
|
||||||
|
|
||||||
glTexCoord2f( 0.0f, (float)(height) / size );
|
|
||||||
glVertex3i( 0, theApp.surfaceSizeY, 0 );
|
|
||||||
|
|
||||||
glEnd();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
glTexCoord2f( (float)(width) / size, (float)(height) / size );
|
||||||
|
glVertex3i( theApp.surfaceSizeX, theApp.surfaceSizeY, 0 );
|
||||||
|
|
||||||
|
glTexCoord2f( 0.0f, (float)(height) / size );
|
||||||
|
glVertex3i( 0, theApp.surfaceSizeY, 0 );
|
||||||
|
|
||||||
|
glEnd();
|
||||||
|
|
||||||
if( theApp.showSpeed ) { // && ( theApp.videoOption > VIDEO_4X ) ) {
|
if( theApp.showSpeed ) { // && ( theApp.videoOption > VIDEO_4X ) ) {
|
||||||
char buffer[30];
|
char buffer[30];
|
||||||
if( theApp.showSpeed == 1 ) {
|
if( theApp.showSpeed == 1 ) {
|
||||||
|
|
|
@ -293,7 +293,6 @@ VBA::VBA()
|
||||||
d3dFilter = 0;
|
d3dFilter = 0;
|
||||||
glFilter = 0;
|
glFilter = 0;
|
||||||
GLSLShaders = 0;
|
GLSLShaders = 0;
|
||||||
glType = 0;
|
|
||||||
skin = NULL;
|
skin = NULL;
|
||||||
skinName = "";
|
skinName = "";
|
||||||
skinEnabled = false;
|
skinEnabled = false;
|
||||||
|
@ -1523,9 +1522,6 @@ void VBA::loadSettings()
|
||||||
if(GLSLShaders < 0 || GLSLShaders > 1)
|
if(GLSLShaders < 0 || GLSLShaders > 1)
|
||||||
GLSLShaders = 0;
|
GLSLShaders = 0;
|
||||||
|
|
||||||
glType = regQueryDwordValue("glType", 0);
|
|
||||||
if(glType < 0 || glType > 2)
|
|
||||||
glType = 0;
|
|
||||||
|
|
||||||
filterType = regQueryDwordValue("filter", 0);
|
filterType = regQueryDwordValue("filter", 0);
|
||||||
if(filterType < 0 || filterType > 17)
|
if(filterType < 0 || filterType > 17)
|
||||||
|
@ -2593,7 +2589,6 @@ void VBA::saveSettings()
|
||||||
regSetDwordValue("d3dFilter", d3dFilter);
|
regSetDwordValue("d3dFilter", d3dFilter);
|
||||||
regSetDwordValue("glFilter", glFilter);
|
regSetDwordValue("glFilter", glFilter);
|
||||||
regSetDwordValue("GLSLShaders", GLSLShaders);
|
regSetDwordValue("GLSLShaders", GLSLShaders);
|
||||||
regSetDwordValue("glType", glType);
|
|
||||||
|
|
||||||
regSetDwordValue("filter", filterType);
|
regSetDwordValue("filter", filterType);
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,6 @@ class VBA : public CWinApp
|
||||||
int d3dFilter;
|
int d3dFilter;
|
||||||
int glFilter;
|
int glFilter;
|
||||||
int GLSLShaders;
|
int GLSLShaders;
|
||||||
int glType;
|
|
||||||
bool dinputKeyFocus;
|
bool dinputKeyFocus;
|
||||||
CSkin *skin;
|
CSkin *skin;
|
||||||
CString skinName;
|
CString skinName;
|
||||||
|
|
|
@ -1595,9 +1595,6 @@ BEGIN
|
||||||
MENUITEM "&OpenGL", ID_OPTIONS_VIDEO_RENDERMETHOD_OPENGL
|
MENUITEM "&OpenGL", ID_OPTIONS_VIDEO_RENDERMETHOD_OPENGL
|
||||||
MENUITEM " Filter: Nearest", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST
|
MENUITEM " Filter: Nearest", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST
|
||||||
MENUITEM " Filter: Bilinear", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR
|
MENUITEM " Filter: Bilinear", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR
|
||||||
MENUITEM " Vertex: Triangle", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE
|
|
||||||
MENUITEM " Vertex: Quads", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS
|
|
||||||
MENUITEM " Vertex: Polygons", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLPOLYGONS
|
|
||||||
MENUITEM " GLSL Shaders", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLSLSHADERS
|
MENUITEM " GLSL Shaders", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLSLSHADERS
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&VSync", ID_OPTIONS_VIDEO_VSYNC
|
MENUITEM "&VSync", ID_OPTIONS_VIDEO_VSYNC
|
||||||
|
|
Loading…
Reference in New Issue