diff --git a/source/glest_game/game/game_constants.h b/source/glest_game/game/game_constants.h index 476af46bb..0556d5276 100644 --- a/source/glest_game/game/game_constants.h +++ b/source/glest_game/game/game_constants.h @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2008 Martiño Figueroa +// Copyright (C) 2001-2008 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -30,7 +30,7 @@ enum ControlType{ class GameConstants{ public: - static const int maxPlayers= 4; + static const int maxPlayers= 8; static const int serverPort= 61357; static const int updateFps= 40; static const int cameraFps= 100; diff --git a/source/glest_game/main/battle_end.cpp b/source/glest_game/main/battle_end.cpp index 9cc72e49d..ab5081763 100644 --- a/source/glest_game/main/battle_end.cpp +++ b/source/glest_game/main/battle_end.cpp @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2008 Martiño Figueroa +// Copyright (C) 2001-2008 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -60,12 +60,12 @@ void BattleEnd::render(){ textRenderer->begin(CoreData::getInstance().getMenuFontBig()); - int lm= 80; + int lm= 20; int bm= 100; for(int i=0; irender(intToStr(score).c_str(), textX, bm+20); } - textRenderer->render(lang.get("Result"), lm+50, bm+360); - textRenderer->render(lang.get("Control"), lm+50, bm+320); - textRenderer->render(lang.get("Faction"), lm+50, bm+280); - textRenderer->render(lang.get("Team"), lm+50, bm+240); - textRenderer->render(lang.get("Kills"), lm+50, bm+200); - textRenderer->render(lang.get("Deaths"), lm+50, bm+160); - textRenderer->render(lang.get("UnitsProduced"), lm+50, bm+120); - textRenderer->render(lang.get("ResourcesHarvested"), lm+50, bm+80); - textRenderer->render(lang.get("Score"), lm+50, bm+20); + textRenderer->render(lang.get("Result"), lm, bm+360); + textRenderer->render(lang.get("Control"), lm, bm+320); + textRenderer->render(lang.get("Faction"), lm, bm+280); + textRenderer->render(lang.get("Team"), lm, bm+240); + textRenderer->render(lang.get("Kills"), lm, bm+200); + textRenderer->render(lang.get("Deaths"), lm, bm+160); + textRenderer->render(lang.get("UnitsProduced"), lm, bm+120); + textRenderer->render(lang.get("ResourcesHarvested"), lm, bm+80); + textRenderer->render(lang.get("Score"), lm, bm+20); textRenderer->end(); diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index f063f0b7d..5a33f90b1 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest (www.glest.org) // -// Copyright (C) 2001-2005 Martiño Figueroa +// Copyright (C) 2001-2005 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -47,8 +47,8 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b vector results, teamItems, controlItems; //create - buttonReturn.init(350, 200, 125); - buttonPlayNow.init(525, 200, 125); + buttonReturn.init(350, 140, 125); + buttonPlayNow.init(525, 140, 125); //map listBox findAll("maps/*.gbm", results, true); @@ -59,10 +59,10 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, b for(int i= 0; iAppendCheckItem(miBrushStartLocation+2, wxT("2 - Player 2 ")); menuBrushStartLocation->AppendCheckItem(miBrushStartLocation+3, wxT("3 - Player 3 ")); menuBrushStartLocation->AppendCheckItem(miBrushStartLocation+4, wxT("4 - Player 4 ")); + menuBrushStartLocation->AppendCheckItem(miBrushStartLocation+5, wxT("5 - Player 5 ")); + menuBrushStartLocation->AppendCheckItem(miBrushStartLocation+6, wxT("6 - Player 6 ")); + menuBrushStartLocation->AppendCheckItem(miBrushStartLocation+7, wxT("7 - Player 7 ")); + menuBrushStartLocation->AppendCheckItem(miBrushStartLocation+8, wxT("8 - Player 8 ")); menuBrush->Append(miBrushStartLocation, wxT("Player"), menuBrushStartLocation); menuBar->Append(menuBrush, wxT("Brush")); @@ -145,6 +149,9 @@ MainWindow::MainWindow(): menuBar->Append(menuRadius, wxT("Radius")); SetMenuBar(menuBar); + + timer = new wxTimer(this); + timer->Start(50); } void MainWindow::init(){ @@ -414,6 +421,11 @@ void MainWindow::onMenuRadius(wxCommandEvent &event){ radius= event.GetId() - miRadius + 1; } +void MainWindow::onTimer(wxTimerEvent &event) { + wxPaintEvent paintEvent; + onPaint(paintEvent); +} + void MainWindow::change(int x, int y){ switch(enabledGroup){ case 0: @@ -459,6 +471,7 @@ void MainWindow::uncheckRadius(){ } BEGIN_EVENT_TABLE(MainWindow, wxFrame) + EVT_TIMER(-1, MainWindow::onTimer) EVT_CLOSE(MainWindow::onClose) EVT_LEFT_DOWN(MainWindow::onMouseDown) EVT_MOTION(MainWindow::onMouseMove) diff --git a/source/glest_map_editor/main.h b/source/glest_map_editor/main.h index 6b8ba7514..681d83dd7 100644 --- a/source/glest_map_editor/main.h +++ b/source/glest_map_editor/main.h @@ -32,7 +32,7 @@ private: static const int surfaceCount= 5; static const int objectCount= 11; static const int resourceCount= 6; - static const int startLocationCount= 4; + static const int startLocationCount= 8; static const int radiusCount= 9; private: @@ -71,6 +71,8 @@ private: Program *program; int lastX, lastY; + wxTimer *timer; + wxMenuBar *menuBar; wxMenu *menuFile; wxMenu *menuEdit; @@ -131,6 +133,8 @@ public: void onMenuBrushStartLocation(wxCommandEvent &event); void onMenuRadius(wxCommandEvent &event); + void onTimer(wxTimerEvent &event); + void change(int x, int y); void uncheckBrush(); diff --git a/source/glest_map_editor/map.cpp b/source/glest_map_editor/map.cpp index 4c316d3b6..4e5cf0629 100644 --- a/source/glest_map_editor/map.cpp +++ b/source/glest_map_editor/map.cpp @@ -320,8 +320,8 @@ void Map::resize(int w, int h, float alt, int surf){ } void Map::resetPlayers(int maxPlayers){ - if (maxPlayers<1 || maxPlayers>4){ - throw runtime_error("Max Players must be in the range 1-4"); + if (maxPlayers<1 || maxPlayers>8){ + throw runtime_error("Max Players must be in the range 1-8"); return; } diff --git a/source/glest_map_editor/renderer.cpp b/source/glest_map_editor/renderer.cpp index 79039221a..ef3ead1ee 100644 --- a/source/glest_map_editor/renderer.cpp +++ b/source/glest_map_editor/renderer.cpp @@ -155,6 +155,10 @@ void Renderer::renderMap(Map *map, int x, int y, int clientW, int clientH, int c case 1: glColor3f(0.f, 0.f, 1.f); break; case 2: glColor3f(0.f, 1.f, 0.f); break; case 3: glColor3f(1.f, 1.f, 0.f); break; + case 4: glColor3f(1.f, 1.f, 1.f); break; + case 5: glColor3f(0.f, 1.f, 0.8f); break; + case 6: glColor3f(1.f, 0.8f, 0.f); break; + case 7: glColor3f(1.f, 0.8f, 1.f); break; } glBegin(GL_LINES); glVertex2i((map->getStartLocationX(i)-1)*cellSize, clientH- (map->getStartLocationY(i)-1)*cellSize); diff --git a/source/shared_lib/include/platform/posix/socket.h b/source/shared_lib/include/platform/posix/socket.h index 9fbdecd00..6cdcc5b20 100644 --- a/source/shared_lib/include/platform/posix/socket.h +++ b/source/shared_lib/include/platform/posix/socket.h @@ -38,7 +38,8 @@ private: public: Ip(); - Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3); + Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3, + unsigned char byte4, unsigned char byte5, unsigned char byte6, unsigned char byte7); Ip(const string& ipString); unsigned char getByte(int byteIndex) {return bytes[byteIndex];} diff --git a/source/shared_lib/include/platform/win32/socket.h b/source/shared_lib/include/platform/win32/socket.h index 041645769..eea863b4f 100644 --- a/source/shared_lib/include/platform/win32/socket.h +++ b/source/shared_lib/include/platform/win32/socket.h @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest Shared Library (www.glest.org) // -// Copyright (C) 2001-2008 Martiño Figueroa +// Copyright (C) 2001-2008 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -32,7 +32,8 @@ private: public: Ip(); - Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3); + Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3, + unsigned char byte4, unsigned char byte5, unsigned char byte6, unsigned char byte7); Ip(const string& ipString); unsigned char getByte(int byteIndex) {return bytes[byteIndex];} diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 8191ad6a9..12234f230 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -39,13 +39,22 @@ Ip::Ip(){ bytes[1]= 0; bytes[2]= 0; bytes[3]= 0; + bytes[4]= 0; + bytes[5]= 0; + bytes[6]= 0; + bytes[7]= 0; } -Ip::Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3){ +Ip::Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3, + unsigned char byte4, unsigned char byte5, unsigned char byte6, unsigned char byte7){ bytes[0]= byte0; bytes[1]= byte1; bytes[2]= byte2; bytes[3]= byte3; + bytes[4]= byte4; + bytes[5]= byte5; + bytes[6]= byte6; + bytes[7]= byte7; } @@ -53,7 +62,7 @@ Ip::Ip(const string& ipString){ int offset= 0; int byteIndex= 0; - for(byteIndex= 0; byteIndex<4; ++byteIndex){ + for(byteIndex= 0; byteIndex<8; ++byteIndex){ int dotPos= ipString.find_first_of('.', offset); bytes[byteIndex]= atoi(ipString.substr(offset, dotPos-offset).c_str()); diff --git a/source/shared_lib/sources/platform/win32/socket.cpp b/source/shared_lib/sources/platform/win32/socket.cpp index 5503779b0..693c5e036 100644 --- a/source/shared_lib/sources/platform/win32/socket.cpp +++ b/source/shared_lib/sources/platform/win32/socket.cpp @@ -1,7 +1,7 @@ // ============================================================== // This file is part of Glest Shared Library (www.glest.org) // -// Copyright (C) 2001-2007 Martiño Figueroa +// Copyright (C) 2001-2007 Marti�o Figueroa // // You can redistribute this code and/or modify it under // the terms of the GNU General Public License as published @@ -165,21 +165,29 @@ Ip::Ip(){ bytes[1]= 0; bytes[2]= 0; bytes[3]= 0; + bytes[4]= 4; + bytes[5]= 5; + bytes[6]= 6; + bytes[7]= 7; } -Ip::Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3){ +Ip::Ip(unsigned char byte0, unsigned char byte1, unsigned char byte2, unsigned char byte3, + unsigned char byte4, unsigned char byte5, unsigned char byte6, unsigned char byte7){ bytes[0]= byte0; bytes[1]= byte1; bytes[2]= byte2; bytes[3]= byte3; + bytes[4]= byte4; + bytes[5]= byte5; + bytes[6]= byte6; + bytes[7]= byte7; } - Ip::Ip(const string& ipString){ int offset= 0; int byteIndex= 0; - for(byteIndex= 0; byteIndex<4; ++byteIndex){ + for(byteIndex= 0; byteIndex<8; ++byteIndex){ int dotPos= ipString.find_first_of('.', offset); bytes[byteIndex]= atoi(ipString.substr(offset, dotPos-offset).c_str()); @@ -188,7 +196,8 @@ Ip::Ip(const string& ipString){ } string Ip::getString() const{ - return intToStr(bytes[0]) + "." + intToStr(bytes[1]) + "." + intToStr(bytes[2]) + "." + intToStr(bytes[3]); + return intToStr(bytes[0]) + "." + intToStr(bytes[1]) + "." + intToStr(bytes[2]) + "." + intToStr(bytes[3]) + + "." +intToStr(bytes[4]) + "." + intToStr(bytes[5]) + "." + intToStr(bytes[6]) + "." + intToStr(bytes[7]); } // =====================================================