Changes in client/Client/GameRender.cpp [5c7f28d:1e250bf] in network-game


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/Client/GameRender.cpp

    r5c7f28d r1e250bf  
    11#include "GameRender.h"
     2
     3#include <cmath>
    24
    35#include <allegro5/allegro_primitives.h>
     
    1618      for (int y=0; y<gameMap->height; y++)
    1719      {
    18          TerrainType terrain = gameMap->getElement(x, y);
     20         TerrainType el = gameMap->getElement(x, y);
    1921         StructureType structure = gameMap->getStructure(x, y);
    2022
    21          switch(terrain) {
    22          case TERRAIN_GRASS:
     23         if (el == TERRAIN_GRASS)
    2324            al_draw_filled_rectangle(x*25+mapPos.x, y*25+mapPos.y, x*25+25+mapPos.x, y*25+25+mapPos.y, al_map_rgb(0, 255, 0));
    24             break;
    25          case TERRAIN_OCEAN:
     25         else if (el == TERRAIN_OCEAN)
    2626            al_draw_filled_rectangle(x*25+mapPos.x, y*25+mapPos.y, x*25+25+mapPos.x, y*25+25+mapPos.y, al_map_rgb(0, 0, 255));
    27             break;
    28          case TERRAIN_ROCK:
     27         else if (el == TERRAIN_ROCK)
    2928            al_draw_filled_rectangle(x*25+mapPos.x, y*25+mapPos.y, x*25+25+mapPos.x, y*25+25+mapPos.y, al_map_rgb(100, 100, 0));
    30             break;
    31          case TERRAIN_NONE:
    32             break;
    33          } 
    3429
    35          switch(structure) {
    36          case STRUCTURE_BLUE_FLAG:
     30         if (structure == STRUCTURE_BLUE_FLAG) {
    3731            al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
    3832            //al_draw_filled_rectangle(x*25+5+mapPos.x, y*25+5+mapPos.y, x*25+20+mapPos.x, y*25+20+mapPos.y, al_map_rgb(0, 0, 255));
    39             break;
    40          case STRUCTURE_RED_FLAG:
     33         }else if (structure == STRUCTURE_RED_FLAG) {
    4134            al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
    4235            //al_draw_filled_rectangle(x*25+5+mapPos.x, y*25+5+mapPos.y, x*25+20+mapPos.x, y*25+20+mapPos.y, al_map_rgb(255, 0, 0));
    43             break;
    44          case STRUCTURE_NONE:
    45             break;
    4636         }
    4737      }
     
    6252               case OBJECT_RED_FLAG:
    6353                  al_draw_filled_rectangle(it->pos.x-8+mapPos.x, it->pos.y-8+mapPos.y, it->pos.x+8+mapPos.x, it->pos.y+8+mapPos.y, al_map_rgb(255, 0, 0));
     54                  break;
     55               case OBJECT_NONE:
    6456                  break;
    6557            }
Note: See TracChangeset for help on using the changeset viewer.