Changeset 5c7f28d in network-game for client/Client/GameRender.cpp


Ignore:
Timestamp:
Jan 26, 2014, 9:45:30 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
c51da03
Parents:
9ee50ce
Message:

The global projectile map and related code is gone from main.cpp, the client processes LOGOUT messages about other players from STATE_GAME, and the map drawing code in GameRender uses switches instead of ifs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/Client/GameRender.cpp

    r9ee50ce r5c7f28d  
    1616      for (int y=0; y<gameMap->height; y++)
    1717      {
    18          TerrainType el = gameMap->getElement(x, y);
     18         TerrainType terrain = gameMap->getElement(x, y);
    1919         StructureType structure = gameMap->getStructure(x, y);
    2020
    21          if (el == TERRAIN_GRASS)
     21         switch(terrain) {
     22         case TERRAIN_GRASS:
    2223            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));
    23          else if (el == TERRAIN_OCEAN)
     24            break;
     25         case TERRAIN_OCEAN:
    2426            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));
    25          else if (el == TERRAIN_ROCK)
     27            break;
     28         case TERRAIN_ROCK:
    2629            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         } 
    2734
    28          if (structure == STRUCTURE_BLUE_FLAG) {
     35         switch(structure) {
     36         case STRUCTURE_BLUE_FLAG:
    2937            al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
    3038            //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));
    31          }else if (structure == STRUCTURE_RED_FLAG) {
     39            break;
     40         case STRUCTURE_RED_FLAG:
    3241            al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
    3342            //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;
    3446         }
    3547      }
Note: See TracChangeset for help on using the changeset viewer.