if(ui::mouse.x > player->loc.x && ui::mouse.y < player->loc.y+player->height/2 && handAngle <= 0) handAngle = 360+handAngle;
//if(ui::mouse.x < player->loc.x + (player->width/2)){player->left = true;player->right=false;}
//if(ui::mouse.x >= player->loc.x + (player->width/2)){player->right = true;player->left=false;}
- if(player->light){
+ /*if(player->light){
vec2 light;
int lightStr = 150;
vec2 curCoord;
}
}
}
- /*if(curCoord.x > player->loc.x && curCoord.x < player->loc.x + player->width){
+ if(curCoord.x > player->loc.x && curCoord.x < player->loc.x + player->width){
if(curCoord.y > player->loc.y && curCoord .y < player->loc.y + player->height){
r.end = curCoord;
l=lightStr;
}
- }*/if(l==lightStr)r.end = curCoord;
+ }if(l==lightStr)r.end = curCoord;
}//end length
glBegin(GL_LINES);
glVertex2f(r.start.x,r.start.y);
glEnd();
}
glUseProgramObjectARB(0);
- }
+ }*/
player->inv->draw();
glUseProgram(shaderProgram);
glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
glUniform1f(glGetUniformLocation(shaderProgram, "amb"), float(shade+50.0f)/100.0f);
- if(light.size() == 0){
+ if(p->light){
+ glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), p->loc.x - offset.x+SCREEN_WIDTH/2,p->loc.y);
+ glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 1.0f,1.0f,1.0f);
+ }else if(light.size() == 0){
glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), 0,-1000);
glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 0.0f,0.0f,0.0f);
}else{
glUseProgram(shaderProgram);
glUniform1i(glGetUniformLocation(shaderProgram, "sampler"), 0);
glUniform1f(glGetUniformLocation(shaderProgram, "amb"), 0.0f);
- if(light.size() == 0){
+ if(p->light){
+ glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), p->loc.x - offset.x+SCREEN_WIDTH/2,p->loc.y);
+ glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 1.0f,1.0f,1.0f);
+ }else if(light.size() == 0){
glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), 0,-1000);
glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 0.0f,0.0f,0.0f);
}else{