fix merge

This commit is contained in:
j3d1 2016-10-06 03:52:36 +02:00
parent 6e6a28c9ff
commit 34d2c82fd9
2 changed files with 48 additions and 49 deletions

View file

@ -38,7 +38,7 @@ void RendererPolygon3d::setup() {
addModel("../data/mesh/ship_ufo.stl", &m_shipModel);
m_texture = nullptr;
m_backgroundTexturePath = "../data/img/stars_nebular.png";
m_backgroundTexturePath = "../data/img/background_3.png";
loadBackgroundTexture();
m_postprocess_shader.init();
@ -520,7 +520,7 @@ void RendererPolygon3d::renderPlanets() {
m_planetModel->render();
}
}
/*
void RendererPolygon3d::renderSun() {
m_planetModel->bind();
@ -546,7 +546,7 @@ void RendererPolygon3d::renderSun() {
m_planetModel->render();
}
}
*/
void RendererPolygon3d::renderMissiles() {
// TODO: add fire trail for missiles near the sun
@ -573,7 +573,7 @@ void RendererPolygon3d::renderMissiles() {
glm::mat4 model = computeModelMatrix(ship);
glUniformMatrix4fv(m_shader_game_objects.location("model"), 1, GL_FALSE, glm::value_ptr(model));
glm::vec3 c = glm::vec3(0.1, 1.0, 0.2);
glm::vec3 c = ship->color;
glUniform3f(m_shader_game_objects.location("materialColor"), c.x, c.y, c.z);
m_shipModel->render();

View file

@ -139,7 +139,7 @@ namespace game {
return false;
}
Ship *ship = new Ship(generateId(), spawnPos, m_shipRadius);
Ship *ship = new Ship(generateId(), spawnPos, player->color, m_shipRadius);
player->ship = ship;
ships.push_back(ship);
@ -234,9 +234,8 @@ namespace game {
(void) dt;
for (Player *player : players) {
if (player->alive) {
player->energy += dt;
player->energy += dt * ENERGY_PER_DT;
}
// try to execute as much queued commands as possible.
while (player->hasCommandInQueue()) {
Command *command = player->peekCommand();