summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-26 16:26:05 (GMT)
committerDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-26 16:26:05 (GMT)
commit036783e6a24706f7e9e668c4a6ad7db7a7d765b6 (patch)
tree0e657bb34f38ce95f0f6a8ebb46298de822d8536
parent90d88f8b0d01131ef06eca890153891a309385a0 (diff)
download2iv55-036783e6a24706f7e9e668c4a6ad7db7a7d765b6.zip
2iv55-036783e6a24706f7e9e668c4a6ad7db7a7d765b6.tar.gz
2iv55-036783e6a24706f7e9e668c4a6ad7db7a7d765b6.tar.bz2
text kleur
-rw-r--r--matchblox/engine/C_MatchBloxEngine.cpp64
1 files changed, 33 insertions, 31 deletions
diff --git a/matchblox/engine/C_MatchBloxEngine.cpp b/matchblox/engine/C_MatchBloxEngine.cpp
index 45f5a43..a78e649 100644
--- a/matchblox/engine/C_MatchBloxEngine.cpp
+++ b/matchblox/engine/C_MatchBloxEngine.cpp
@@ -262,38 +262,39 @@ void C_MatchBloxEngine::RenderPointHere()
void C_MatchBloxEngine::RenderText(GLint x, GLint y, char *string, struct ColorStruct f_sColor)
{
- glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
-
- glDisable(GL_DEPTH_TEST);
-
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, g_sFont.m_iImageId);
- glTexEnvf(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- glColor3d(f_sColor.m_dRed, f_sColor.m_dGreen, f_sColor.m_dBlue);
-
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix(); //push modelview matrix
-
- glMatrixMode(GL_PROJECTION);
- glPushMatrix(); //push projection matrix
-
- glLoadIdentity();
- glOrtho(0, glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT), 0, 0, 1);
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
+ glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, g_sFont.m_iImageId);
+ glTexEnvf(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ glColor3d(f_sColor.m_dRed, f_sColor.m_dGreen, f_sColor.m_dBlue);
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix(); //push modelview matrix
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix(); //push projection matrix
+
+ glLoadIdentity();
+ glOrtho(0, glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT), 0, 0, 1);
+
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
glTranslated(x, y, 0);
glListBase(g_iBase - 32);
- glCallLists((GLsizei)strlen(string), GL_UNSIGNED_BYTE, string);
-
- glMatrixMode(GL_PROJECTION);
- glPopMatrix(); //pop projection matrix
-
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix(); //pop modelview matrix
-
+ glCallLists((GLsizei)strlen(string), GL_UNSIGNED_BYTE, string);
+
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix(); //pop projection matrix
+
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix(); //pop modelview matrix
+
glPopAttrib();
}
@@ -595,7 +596,7 @@ bool C_MatchBloxEngine::CursorMove_PutBlock(Vect3D_t &f_NewCursorPos)
Vect3D_t l_PosDif = l_AbsHolePos - m_pBlock[(int)m_CurrentBlock]->GetPos();
double l_dXZProximity = l_PosDif.x * l_PosDif.x +
l_PosDif.y * l_PosDif.y;
- cout << "Block proximety: " << l_dXZProximity << endl;
+ //cout << "Block proximety: " << l_dXZProximity << endl;
if (l_dXZProximity < m_GameSettings.m_dMinProximity)
{
@@ -605,6 +606,7 @@ bool C_MatchBloxEngine::CursorMove_PutBlock(Vect3D_t &f_NewCursorPos)
}
else
{
+ //overlap with the correct tile but not close enough to the hole
l_bCollision = true;
}
}