From 18377e3c0efe9359c341c0c330f6de1697afb788 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Thu, 16 Jun 2016 08:49:43 -0400 Subject: Changes --- src/items.cpp | 28 ++++++---------------------- src/ui.cpp | 2 +- src/world.cpp | 10 +++++----- 3 files changed, 12 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/items.cpp b/src/items.cpp index eacf5a9..f0b2f84 100644 --- a/src/items.cpp +++ b/src/items.cpp @@ -74,28 +74,9 @@ int Sword::useItem() else e->takeHit(damage, 600); - static GLuint sColor = Texture::genColor(Color(255,0,0)); - GLfloat t[] = {0.0, 0.0, - 1.0, 1.0}; - GLfloat v[] = {hitbox.start.x, hitbox.start.y, 1.0, - hitbox.end.x, hitbox.end.y, 1.0}; - - - glBindTexture(GL_TEXTURE_2D, sColor); - glUseProgram(worldShader); - glEnableVertexAttribArray(worldShader_attribute_coord); - glEnableVertexAttribArray(worldShader_attribute_tex); - - glVertexAttribPointer(worldShader_attribute_coord, 3, GL_FLOAT, GL_FALSE, 0, v); - glVertexAttribPointer(worldShader_attribute_tex, 2, GL_FLOAT, GL_FALSE, 0, t); - glDrawArrays(GL_LINES, 0, 2); - - glDisableVertexAttribArray(worldShader_attribute_coord); - glDisableVertexAttribArray(worldShader_attribute_tex); - glUseProgram(0); // add some blood - // for(int r = 0; r < (rand()%5);r++) - // currentWorld->addParticle(rand()%game::HLINE*3 + e->loc.x - .05f,e->loc.y + e->height*.5, game::HLINE,game::HLINE, -(rand()%10)*.01,((rand()%4)*.001-.002), {(rand()%75+10)/100.0f,0,0}, 10000); + //for(int r = 0; r < (rand()%5);r++) + //currentWorld->addParticle(rand()%game::HLINE*3 + e->loc.x - .05f,e->loc.y + e->height*.5, game::HLINE,game::HLINE, -(rand()%10)*.01,((rand()%4)*.001-.002), {(rand()%75+10)/100.0f,0,0}, 10000); } } @@ -160,7 +141,10 @@ int Food::useItem() int ItemLight::useItem() { - std::cout << "fsdfsdf" << std::endl; + if (player->light.radius > 0) + player->light.radius = 0; + else + player->light.radius = 500; return 0; } diff --git a/src/ui.cpp b/src/ui.cpp index 8f234df..392cb13 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -1093,7 +1093,7 @@ namespace ui { drawNiceBox(vec2 {x, y}, vec2 {x + SCREEN_WIDTH - HLINES(16), y - SCREEN_HEIGHT / 4}, -7.0); rtext = typeOut(dialogBoxText); - putString(x + game::HLINE, y - fontSize - game::HLINE, rtext); + putString(x + (2*game::HLINE), y - fontSize - game::HLINE, rtext); for(i=0;i