Changeset f66d04f in network-game


Ignore:
Timestamp:
Jan 24, 2014, 12:37:10 AM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
99cf349
Parents:
7f884ea
Message:

Client update for map structs refactoring

Location:
client/Client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • client/Client/GameRender.cpp

    r7f884ea rf66d04f  
    1616      for (int y=0; y<gameMap->height; y++)
    1717      {
    18          WorldMap::TerrainType el = gameMap->getElement(x, y);
    19          WorldMap::StructureType structure = gameMap->getStructure(x, y);
     18         TerrainType el = gameMap->getElement(x, y);
     19         StructureType structure = gameMap->getStructure(x, y);
    2020
    21          if (el == WorldMap::TERRAIN_GRASS)
     21         if (el == TERRAIN_GRASS)
    2222            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 == WorldMap::TERRAIN_OCEAN)
     23         else if (el == TERRAIN_OCEAN)
    2424            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 == WorldMap::TERRAIN_ROCK)
     25         else if (el == TERRAIN_ROCK)
    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(100, 100, 0));
    2727
    28          if (structure == WorldMap::STRUCTURE_BLUE_FLAG) {
     28         if (structure == STRUCTURE_BLUE_FLAG) {
    2929            al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
    3030            //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 == WorldMap::STRUCTURE_RED_FLAG) {
     31         }else if (structure == STRUCTURE_RED_FLAG) {
    3232            al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3);
    3333            //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));
     
    4545         for(it = vctObjects.begin(); it != vctObjects.end(); it++) {
    4646            switch(it->type) {
    47                case WorldMap::OBJECT_BLUE_FLAG:
     47               case OBJECT_BLUE_FLAG:
    4848                  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(0, 0, 255));
    4949                  break;
    50                case WorldMap::OBJECT_RED_FLAG:
     50               case OBJECT_RED_FLAG:
    5151                  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));
    5252                  break;
  • client/Client/main.cpp

    r7f884ea rf66d04f  
    377377
    378378                  if (p != NULL) {
    379                      int flagType = WorldMap::OBJECT_NONE;
     379                     int flagType = OBJECT_NONE;
    380380
    381381                     if (p->hasBlueFlag)
    382                         flagType = WorldMap::OBJECT_BLUE_FLAG;
     382                        flagType = OBJECT_BLUE_FLAG;
    383383                     else if (p->hasRedFlag)
    384                         flagType = WorldMap::OBJECT_RED_FLAG;
    385 
    386                      if (flagType != WorldMap::OBJECT_NONE) {
     384                        flagType = OBJECT_RED_FLAG;
     385
     386                     if (flagType != OBJECT_NONE) {
    387387                        msgTo.type = MSG_TYPE_DROP_FLAG;
    388388                        memcpy(msgTo.buffer, &curPlayerId, 4);
     
    10291029               cout << "Received object message in STATE_GAME" << endl;
    10301030
    1031                WorldMap::Object o(0, WorldMap::OBJECT_NONE, 0, 0);
     1031               WorldMap::Object o(0, OBJECT_NONE, 0, 0);
    10321032               o.deserialize(msg.buffer);
    10331033               cout << "object id: " << o.id << endl;
Note: See TracChangeset for help on using the changeset viewer.