mirror of
https://github.com/glest/glest-source.git
synced 2025-08-28 10:19:55 +02:00
- disable color picking by default, and add error codes for selection buffer
This commit is contained in:
@@ -5776,7 +5776,7 @@ void Renderer::computeSelected( Selection::UnitContainer &units, const Object *&
|
|||||||
h = 1;
|
h = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool newPickingSelection = Config::getInstance().getBool("EnableColorPicking","true");
|
const bool newPickingSelection = Config::getInstance().getBool("EnableColorPicking","false");
|
||||||
if(newPickingSelection == true) {
|
if(newPickingSelection == true) {
|
||||||
int x1 = posDown.x;
|
int x1 = posDown.x;
|
||||||
int y1 = posDown.y;
|
int y1 = posDown.y;
|
||||||
@@ -5970,9 +5970,18 @@ void Renderer::computeSelected( Selection::UnitContainer &units, const Object *&
|
|||||||
glSelectBuffer(Gui::maxSelBuff, selectBuffer);
|
glSelectBuffer(Gui::maxSelBuff, selectBuffer);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
GLint view[]= {0, 0, metrics.getVirtualW(), metrics.getVirtualH()};
|
|
||||||
glRenderMode(GL_SELECT);
|
GLint renderModeResult = glRenderMode(GL_SELECT);
|
||||||
|
if(renderModeResult < 0) {
|
||||||
|
const char *errorString= reinterpret_cast<const char*>(gluErrorString(renderModeResult));
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"OpenGL error #%d [0x%X] : [%s] at file: [%s], line: %d",renderModeResult,renderModeResult,errorString,__FILE__,__LINE__);
|
||||||
|
|
||||||
|
printf("%s\n",szBuf);
|
||||||
|
}
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
|
||||||
|
GLint view[]= {0, 0, metrics.getVirtualW(), metrics.getVirtualH()};
|
||||||
gluPickMatrix(x, y, w, h, view);
|
gluPickMatrix(x, y, w, h, view);
|
||||||
gluPerspective(perspFov, metrics.getAspectRatio(), perspNearPlane, perspFarPlane);
|
gluPerspective(perspFov, metrics.getAspectRatio(), perspNearPlane, perspFarPlane);
|
||||||
loadGameCameraMatrix();
|
loadGameCameraMatrix();
|
||||||
@@ -6014,6 +6023,14 @@ void Renderer::computeSelected( Selection::UnitContainer &units, const Object *&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(selCount < 0) {
|
||||||
|
const char *errorString= reinterpret_cast<const char*>(gluErrorString(selCount));
|
||||||
|
char szBuf[4096]="";
|
||||||
|
sprintf(szBuf,"OpenGL error #%d [0x%X] : [%s] at file: [%s], line: %d",selCount,selCount,errorString,__FILE__,__LINE__);
|
||||||
|
|
||||||
|
printf("%s\n",szBuf);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1195,7 +1195,7 @@ vector<int> BaseColorPickEntity::getPickedList(int x,int y,int w,int h, const ve
|
|||||||
//printf("In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
//printf("In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
static Chrono lastSnapshot(true);
|
static Chrono lastSnapshot(true);
|
||||||
const int selectionMillisecondUpdate = 350;
|
const int selectionMillisecondUpdate = 100;
|
||||||
|
|
||||||
if(PixelBufferWrapper::getIsPBOEnable() == true) {
|
if(PixelBufferWrapper::getIsPBOEnable() == true) {
|
||||||
// Only update the pixel buffer every x milliseconds or as required
|
// Only update the pixel buffer every x milliseconds or as required
|
||||||
|
Reference in New Issue
Block a user