aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-05-16 08:43:29 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-05-16 08:43:29 -0400
commit3815da82430df2c1ed44858da3d8425946539b04 (patch)
tree21033ce707a1cf0f2aea222b8927b9525496a303 /src/entities.cpp
parente786f4a546fd9b08d83cd3e4058a93b26e7ae6ab (diff)
added jump page, quest light
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index 73e7808..8dc32e2 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -336,9 +336,28 @@ bool Entity::isNear(Entity e) {
void NPC::drawThingy(void) const
{
if (dialogCount) {
- auto w = width / 3;
- glColor3ub(255, 255, 0);
- glRectf(loc.x + w, loc.y + height, loc.x + w * 2, loc.y + height + w);
+ const auto w = width / 3;
+ GLfloat tex_coord[] = {
+ 0, 0, 1, 0, 1, 1,
+ 1, 1, 0, 1, 0, 0
+ };
+ const GLfloat c[4] = {
+ loc.x + w, loc.y + height, loc.x + w * 2, loc.y + height + w
+ };
+ GLfloat coords[] = {
+ c[0], c[1], z, c[2], c[1], z, c[2], c[3], z,
+ c[2], c[3], z, c[0], c[3], z, c[0], c[1], z
+ };
+
+ glUseProgram(worldShader);
+ glEnableVertexAttribArray(worldShader_attribute_coord);
+ glEnableVertexAttribArray(worldShader_attribute_tex);
+ glVertexAttribPointer(worldShader_attribute_coord, 3, GL_FLOAT, GL_FALSE, 0, coords);
+ glVertexAttribPointer(worldShader_attribute_tex, 2, GL_FLOAT, GL_FALSE, 0, tex_coord);
+ glDrawArrays(GL_TRIANGLES, 0, 6);
+ glDisableVertexAttribArray(worldShader_attribute_coord);
+ glDisableVertexAttribArray(worldShader_attribute_tex);
+ glUseProgram(0);
}
}
@@ -874,6 +893,11 @@ unsigned int Structures::spawn(BUILD_SUB sub, float x, float y) {
return 0;
}
+/*Particles::Particles(const Structures *&s, vec2 vell, Color c, float d, )
+{
+
+}*/
+
Particles::Particles(float x, float y, float w, float h, float vx, float vy, Color c, float d)
{
loc = vec2 {x, y};