Changeset f66d04f in network-game
- Timestamp:
- Jan 24, 2014, 12:37:10 AM (11 years ago)
- Branches:
- master
- Children:
- 99cf349
- Parents:
- 7f884ea
- Location:
- client/Client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/GameRender.cpp
r7f884ea rf66d04f 16 16 for (int y=0; y<gameMap->height; y++) 17 17 { 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); 20 20 21 if (el == WorldMap::TERRAIN_GRASS)21 if (el == TERRAIN_GRASS) 22 22 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) 24 24 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) 26 26 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)); 27 27 28 if (structure == WorldMap::STRUCTURE_BLUE_FLAG) {28 if (structure == STRUCTURE_BLUE_FLAG) { 29 29 al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3); 30 30 //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) { 32 32 al_draw_circle(x*25+12+mapPos.x, y*25+12+mapPos.y, 12, al_map_rgb(0, 0, 0), 3); 33 33 //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)); … … 45 45 for(it = vctObjects.begin(); it != vctObjects.end(); it++) { 46 46 switch(it->type) { 47 case WorldMap::OBJECT_BLUE_FLAG:47 case OBJECT_BLUE_FLAG: 48 48 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)); 49 49 break; 50 case WorldMap::OBJECT_RED_FLAG:50 case OBJECT_RED_FLAG: 51 51 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)); 52 52 break; -
client/Client/main.cpp
r7f884ea rf66d04f 377 377 378 378 if (p != NULL) { 379 int flagType = WorldMap::OBJECT_NONE;379 int flagType = OBJECT_NONE; 380 380 381 381 if (p->hasBlueFlag) 382 flagType = WorldMap::OBJECT_BLUE_FLAG;382 flagType = OBJECT_BLUE_FLAG; 383 383 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) { 387 387 msgTo.type = MSG_TYPE_DROP_FLAG; 388 388 memcpy(msgTo.buffer, &curPlayerId, 4); … … 1029 1029 cout << "Received object message in STATE_GAME" << endl; 1030 1030 1031 WorldMap::Object o(0, WorldMap::OBJECT_NONE, 0, 0);1031 WorldMap::Object o(0, OBJECT_NONE, 0, 0); 1032 1032 o.deserialize(msg.buffer); 1033 1033 cout << "object id: " << o.id << endl;
Note:
See TracChangeset
for help on using the changeset viewer.