- again M$ compiler madness, absolute insanity, its why I love gcc and hate vc
This commit is contained in:
parent
49d7f5f036
commit
bcc82a381d
|
@ -2752,107 +2752,111 @@ void Renderer::renderMinimap(){
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
const int itemCount = attackEffects->getWaterSplashCount() * 12;
|
const int itemCount = attackEffects->getWaterSplashCount() * 12;
|
||||||
Vec2f vertices[itemCount];
|
if(itemCount > 0) {
|
||||||
Vec4f colors[itemCount];
|
vector<Vec2f> vertices;
|
||||||
|
vertices.resize(itemCount);
|
||||||
|
vector<Vec4f> colors;
|
||||||
|
colors.resize(itemCount);
|
||||||
|
|
||||||
// draw attack alarm
|
// draw attack alarm
|
||||||
int vertexIndex = 0;
|
int vertexIndex = 0;
|
||||||
//int vertexIndex1 = 0;
|
//int vertexIndex1 = 0;
|
||||||
for(int i = 0; i < attackEffects->getWaterSplashCount(); ++i) {
|
for(int i = 0; i < attackEffects->getWaterSplashCount(); ++i) {
|
||||||
const WaterSplash *ws = attackEffects->getWaterSplash(i);
|
const WaterSplash *ws = attackEffects->getWaterSplash(i);
|
||||||
float scale= (1/ws->getAnim()*ws->getSize())*5;
|
float scale= (1/ws->getAnim()*ws->getSize())*5;
|
||||||
//glColor4f(1.f, 1.f, 0.f, 1.f-ws->getAnim());
|
//glColor4f(1.f, 1.f, 0.f, 1.f-ws->getAnim());
|
||||||
float alpha=(1.f-ws->getAnim())*0.01f;
|
float alpha=(1.f-ws->getAnim())*0.01f;
|
||||||
Vec2f pos= ws->getPos()/Map::cellScale;
|
Vec2f pos= ws->getPos()/Map::cellScale;
|
||||||
float attackX=mx +pos.x*zoom.x;
|
float attackX=mx +pos.x*zoom.x;
|
||||||
float attackY=my +mh -pos.y*zoom.y;
|
float attackY=my +mh -pos.y*zoom.y;
|
||||||
if(ws->getEnabled()){
|
if(ws->getEnabled()){
|
||||||
// glBegin(GL_QUADS);
|
// glBegin(GL_QUADS);
|
||||||
// glVertex2f(attackX-scale, attackY-scale);
|
// glVertex2f(attackX-scale, attackY-scale);
|
||||||
// glVertex2f(attackX-scale, attackY+scale);
|
// glVertex2f(attackX-scale, attackY+scale);
|
||||||
// glVertex2f(attackX+scale, attackY+scale);
|
// glVertex2f(attackX+scale, attackY+scale);
|
||||||
// glVertex2f(attackX+scale, attackY-scale);
|
// glVertex2f(attackX+scale, attackY-scale);
|
||||||
// glEnd();
|
// glEnd();
|
||||||
|
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX-scale, attackY-scale);
|
vertices[vertexIndex] = Vec2f(attackX-scale, attackY-scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX-scale, attackY+scale);
|
vertices[vertexIndex] = Vec2f(attackX-scale, attackY+scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
vertices[vertexIndex] = Vec2f(attackX-scale, attackY+scale);
|
vertices[vertexIndex] = Vec2f(attackX-scale, attackY+scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX+scale, attackY+scale);
|
vertices[vertexIndex] = Vec2f(attackX+scale, attackY+scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX+scale, attackY+scale);
|
vertices[vertexIndex] = Vec2f(attackX+scale, attackY+scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
vertices[vertexIndex] = Vec2f(attackX+scale, attackY-scale);
|
vertices[vertexIndex] = Vec2f(attackX+scale, attackY-scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX+scale, attackY-scale);
|
vertices[vertexIndex] = Vec2f(attackX+scale, attackY-scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX-scale, attackY-scale);
|
vertices[vertexIndex] = Vec2f(attackX-scale, attackY-scale);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, alpha);
|
||||||
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
colors[vertexIndex] = Vec4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
vertices[vertexIndex] = Vec2f(attackX, attackY);
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
glColor4f(1.f, 1.f, 0.f, alpha);
|
glColor4f(1.f, 1.f, 0.f, alpha);
|
||||||
glVertex2f(attackX-scale, attackY-scale);
|
glVertex2f(attackX-scale, attackY-scale);
|
||||||
glVertex2f(attackX-scale, attackY+scale);
|
glVertex2f(attackX-scale, attackY+scale);
|
||||||
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
glVertex2f(attackX, attackY);
|
glVertex2f(attackX, attackY);
|
||||||
glEnd();
|
glEnd();
|
||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
glColor4f(1.f, 1.f, 0.f, alpha);
|
glColor4f(1.f, 1.f, 0.f, alpha);
|
||||||
glVertex2f(attackX-scale, attackY+scale);
|
glVertex2f(attackX-scale, attackY+scale);
|
||||||
glVertex2f(attackX+scale, attackY+scale);
|
glVertex2f(attackX+scale, attackY+scale);
|
||||||
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
glVertex2f(attackX, attackY);
|
glVertex2f(attackX, attackY);
|
||||||
glEnd();
|
glEnd();
|
||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
glColor4f(1.f, 1.f, 0.f, alpha);
|
glColor4f(1.f, 1.f, 0.f, alpha);
|
||||||
glVertex2f(attackX+scale, attackY+scale);
|
glVertex2f(attackX+scale, attackY+scale);
|
||||||
glVertex2f(attackX+scale, attackY-scale);
|
glVertex2f(attackX+scale, attackY-scale);
|
||||||
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
glVertex2f(attackX, attackY);
|
glVertex2f(attackX, attackY);
|
||||||
glEnd();
|
glEnd();
|
||||||
glBegin(GL_TRIANGLES);
|
glBegin(GL_TRIANGLES);
|
||||||
glColor4f(1.f, 1.f, 0.f, alpha);
|
glColor4f(1.f, 1.f, 0.f, alpha);
|
||||||
glVertex2f(attackX+scale, attackY-scale);
|
glVertex2f(attackX+scale, attackY-scale);
|
||||||
glVertex2f(attackX-scale, attackY-scale);
|
glVertex2f(attackX-scale, attackY-scale);
|
||||||
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
glColor4f(1.f, 1.f, 0.f, 0.8f);
|
||||||
glVertex2f(attackX, attackY);
|
glVertex2f(attackX, attackY);
|
||||||
glEnd();
|
glEnd();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(vertexIndex > 0) {
|
if(vertexIndex > 0) {
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
glColorPointer(4,GL_FLOAT, 0, &colors[0]);
|
glColorPointer(4,GL_FLOAT, 0, &colors[0]);
|
||||||
glVertexPointer(2, GL_FLOAT, 0, &vertices[0]);
|
glVertexPointer(2, GL_FLOAT, 0, &vertices[0]);
|
||||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, vertexIndex);
|
glDrawArrays(GL_TRIANGLE_STRIP, 0, vertexIndex);
|
||||||
glDisableClientState(GL_COLOR_ARRAY);
|
glDisableClientState(GL_COLOR_ARRAY);
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
@ -2861,8 +2865,10 @@ void Renderer::renderMinimap(){
|
||||||
VisibleQuadContainerCache &qCache = getQuadCache();
|
VisibleQuadContainerCache &qCache = getQuadCache();
|
||||||
if(qCache.visibleUnitList.size() > 0) {
|
if(qCache.visibleUnitList.size() > 0) {
|
||||||
uint32 unitIdx=0;
|
uint32 unitIdx=0;
|
||||||
Vec2f unit_vertices[qCache.visibleUnitList.size()*4];
|
vector<Vec2f> unit_vertices;
|
||||||
Vec3f unit_colors[qCache.visibleUnitList.size()*4];
|
unit_vertices.resize(qCache.visibleUnitList.size()*4);
|
||||||
|
vector<Vec3f> unit_colors;
|
||||||
|
unit_colors.resize(qCache.visibleUnitList.size()*4);
|
||||||
|
|
||||||
for(int visibleIndex = 0;
|
for(int visibleIndex = 0;
|
||||||
visibleIndex < qCache.visibleUnitList.size(); ++visibleIndex) {
|
visibleIndex < qCache.visibleUnitList.size(); ++visibleIndex) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user