Permalink
Browse files

fix a ton more errors in the interface code, including all the -Wreor…

…der ones
  • Loading branch information...
jacob1 committed Jan 17, 2015
1 parent 54d985f commit efd69b208dd0656c7d36e0aefaf0cb1dd5639108
Showing with 298 additions and 296 deletions.
  1. +1 −1 src/client/HTTP.cpp
  2. +3 −3 src/gui/console/ConsoleController.cpp
  3. +4 −4 src/gui/console/ConsoleModel.cpp
  4. +3 −3 src/gui/console/ConsoleModel.h
  5. +1 −1 src/gui/console/ConsoleView.cpp
  6. +1 −1 src/gui/elementsearch/ElementSearchActivity.cpp
  7. +6 −6 src/gui/filebrowser/FileBrowserActivity.cpp
  8. +16 −16 src/gui/game/GameController.cpp
  9. +0 −2 src/gui/game/GameController.h
  10. +43 −45 src/gui/game/GameModel.cpp
  11. +5 −5 src/gui/game/GameModel.h
  12. +48 −42 src/gui/game/GameView.cpp
  13. +9 −10 src/gui/game/GameView.h
  14. +1 −1 src/gui/game/PropertyTool.cpp
  15. +7 −6 src/gui/game/SignTool.cpp
  16. +5 −5 src/gui/game/Tool.cpp
  17. +2 −1 src/gui/game/Tool.h
  18. +5 −5 src/gui/interface/Appearance.cpp
  19. +3 −3 src/gui/interface/AvatarButton.cpp
  20. +4 −4 src/gui/interface/Button.cpp
  21. +1 −2 src/gui/interface/Button.h
  22. +1 −1 src/gui/interface/Checkbox.cpp
  23. +18 −18 src/gui/interface/Component.cpp
  24. +2 −2 src/gui/interface/ContextMenu.cpp
  25. +1 −1 src/gui/interface/ContextMenu.h
  26. +1 −1 src/gui/interface/DropDown.cpp
  27. +14 −14 src/gui/interface/Engine.cpp
  28. +1 −2 src/gui/interface/Label.cpp
  29. +0 −1 src/gui/interface/Label.h
  30. +2 −2 src/gui/interface/ProgressBar.cpp
  31. +13 −13 src/gui/interface/SaveButton.cpp
  32. +3 −3 src/gui/interface/ScrollPanel.cpp
  33. +6 −6 src/gui/interface/Textbox.cpp
  34. +6 −6 src/gui/interface/Window.cpp
  35. +3 −3 src/gui/interface/Window.h
  36. +1 −1 src/gui/options/OptionsController.cpp
  37. +1 −1 src/gui/options/OptionsModel.cpp
  38. +2 −2 src/gui/preview/PreviewController.cpp
  39. +1 −1 src/gui/preview/PreviewController.h
  40. +4 −4 src/gui/preview/PreviewView.cpp
  41. +2 −2 src/gui/render/RenderView.cpp
  42. +1 −1 src/gui/save/LocalSaveActivity.cpp
  43. +3 −3 src/gui/save/ServerSaveActivity.h
  44. +6 −6 src/gui/search/SearchModel.cpp
  45. +1 −1 src/gui/search/SearchView.cpp
  46. +1 −1 src/gui/search/Thumbnail.h
  47. +1 −1 src/gui/update/UpdateActivity.cpp
  48. +2 −2 src/simulation/Sign.cpp
  49. +32 −30 src/simulation/Simulation.cpp
  50. +1 −1 src/tasks/TaskWindow.cpp
@@ -936,7 +936,7 @@ char *http_multipart_post(const char *uri, const char *const *names, const char
memset(map, 0, 62*sizeof(int));
for (i=0; names[i]; i++)
{
for (unsigned int j=0; j<plens[i]-blen; j++)
for (size_t j=0; j<plens[i]-blen; j++)
if (!blen || !memcmp(parts[i]+j, boundary, blen))
{
ch = parts[i][j+blen];
@@ -39,14 +39,14 @@ std::string ConsoleController::FormatCommand(std::string command)
void ConsoleController::NextCommand()
{
int cIndex = consoleModel->GetCurrentCommandIndex();
if(cIndex < consoleModel->GetPreviousCommands().size())
size_t cIndex = consoleModel->GetCurrentCommandIndex();
if (cIndex < consoleModel->GetPreviousCommands().size())
consoleModel->SetCurrentCommandIndex(cIndex+1);
}
void ConsoleController::PreviousCommand()
{
int cIndex = consoleModel->GetCurrentCommandIndex();
size_t cIndex = consoleModel->GetCurrentCommandIndex();
if(cIndex > 0)
consoleModel->SetCurrentCommandIndex(cIndex-1);
}
@@ -19,12 +19,12 @@ void ConsoleModel::AddObserver(ConsoleView * observer)
observer->NotifyPreviousCommandsChanged(this);
}
int ConsoleModel::GetCurrentCommandIndex()
size_t ConsoleModel::GetCurrentCommandIndex()
{
return currentCommandIndex;
}
void ConsoleModel::SetCurrentCommandIndex(int index)
void ConsoleModel::SetCurrentCommandIndex(size_t index)
{
currentCommandIndex = index;
notifyCurrentCommandChanged();
@@ -55,15 +55,15 @@ std::deque<ConsoleCommand> ConsoleModel::GetPreviousCommands()
void ConsoleModel::notifyPreviousCommandsChanged()
{
for(int i = 0; i < observers.size(); i++)
for (size_t i = 0; i < observers.size(); i++)
{
observers[i]->NotifyPreviousCommandsChanged(this);
}
}
void ConsoleModel::notifyCurrentCommandChanged()
{
for(int i = 0; i < observers.size(); i++)
for (size_t i = 0; i < observers.size(); i++)
{
observers[i]->NotifyCurrentCommandChanged(this);
}
@@ -8,14 +8,14 @@
class ConsoleView;
class ConsoleModel {
int currentCommandIndex;
size_t currentCommandIndex;
std::vector<ConsoleView*> observers;
std::deque<ConsoleCommand> previousCommands;
void notifyPreviousCommandsChanged();
void notifyCurrentCommandChanged();
public:
int GetCurrentCommandIndex();
void SetCurrentCommandIndex(int index);
size_t GetCurrentCommandIndex();
void SetCurrentCommandIndex(size_t index);
ConsoleCommand GetCurrentCommand();
std::deque<ConsoleCommand> GetPreviousCommands();
@@ -55,7 +55,7 @@ void ConsoleView::DoKeyPress(int key, Uint16 character, bool shift, bool ctrl, b
void ConsoleView::NotifyPreviousCommandsChanged(ConsoleModel * sender)
{
for(int i = 0; i < commandList.size(); i++)
for (size_t i = 0; i < commandList.size(); i++)
{
RemoveComponent(commandList[i]);
delete commandList[i];
@@ -23,9 +23,9 @@ class ElementSearchActivity::ToolAction: public ui::ButtonAction
ElementSearchActivity::ElementSearchActivity(GameController * gameController, std::vector<Tool*> tools) :
WindowActivity(ui::Point(-1, -1), ui::Point(236, 302)),
firstResult(NULL),
gameController(gameController),
tools(tools),
firstResult(NULL),
exit(false)
{
ui::Label * title = new ui::Label(ui::Point(4, 5), ui::Point(Size.X-8, 15), "Element Search");
@@ -204,19 +204,19 @@ void FileBrowserActivity::RenameSave(SaveFile * file)
void FileBrowserActivity::loadDirectory(std::string directory, std::string search)
{
for(int i = 0; i < components.size(); i++)
for (size_t i = 0; i < components.size(); i++)
{
RemoveComponent(components[i]);
itemList->RemoveChild(components[i]);
}
for(std::vector<ui::Component*>::iterator iter = componentsQueue.begin(), end = componentsQueue.end(); iter != end; ++iter)
for (std::vector<ui::Component*>::iterator iter = componentsQueue.begin(), end = componentsQueue.end(); iter != end; ++iter)
{
delete *iter;
}
componentsQueue.clear();
for(std::vector<SaveFile*>::iterator iter = files.begin(), end = files.end(); iter != end; ++iter)
for (std::vector<SaveFile*>::iterator iter = files.begin(), end = files.end(); iter != end; ++iter)
{
delete *iter;
}
@@ -239,12 +239,12 @@ void FileBrowserActivity::NotifyDone(Task * task)
totalFiles = files.size();
delete loadFiles;
loadFiles = NULL;
if(!files.size())
if (!files.size())
{
progressBar->Visible = false;
infoText->Visible = true;
}
for(int i = 0; i < components.size(); i++)
for (size_t i = 0; i < components.size(); i++)
{
delete components[i];
}
@@ -253,7 +253,7 @@ void FileBrowserActivity::NotifyDone(Task * task)
void FileBrowserActivity::OnMouseDown(int x, int y, unsigned button)
{
if(!(x > Position.X && y > Position.Y && y < Position.Y+Size.Y && x < Position.X+Size.X)) //Clicked outside window
if (!(x > Position.X && y > Position.Y && y < Position.Y+Size.Y && x < Position.X+Size.X)) //Clicked outside window
Exit();
}
@@ -119,18 +119,18 @@ class GameController::StampsCallback: public ControllerCallback
};
GameController::GameController():
search(NULL),
renderOptions(NULL),
loginWindow(NULL),
console(NULL),
tagsWindow(NULL),
options(NULL),
activePreview(NULL),
localBrowser(NULL),
foundSign(NULL),
HasDone(false),
firstTick(true),
debugFlags(0)
firstTick(true),
foundSign(NULL),
activePreview(NULL),
search(NULL),
renderOptions(NULL),
loginWindow(NULL),
console(NULL),
tagsWindow(NULL),
localBrowser(NULL),
options(NULL),
debugFlags(0),
HasDone(false)
{
gameView = new GameView();
gameModel = new GameModel();
@@ -583,7 +583,7 @@ bool GameController::MouseDown(int x, int y, unsigned button)
ui::Point point = gameModel->AdjustZoomCoords(ui::Point(x, y));
x = point.X;
y = point.Y;
if (gameModel->GetActiveTool(0) && gameModel->GetActiveTool(0)->GetIdentifier() != "DEFAULT_UI_SIGN" || button != BUTTON_LEFT) //If it's not a sign tool or you are right/middle clicking
if (!gameModel->GetActiveTool(0) || gameModel->GetActiveTool(0)->GetIdentifier() != "DEFAULT_UI_SIGN" || button != BUTTON_LEFT) //If it's not a sign tool or you are right/middle clicking
{
foundSign = GetSignAt(x, y);
if(foundSign && splitsign(foundSign->text.c_str()))
@@ -601,7 +601,7 @@ bool GameController::MouseUp(int x, int y, unsigned button)
ui::Point point = gameModel->AdjustZoomCoords(ui::Point(x, y));
x = point.X;
y = point.Y;
if (gameModel->GetActiveTool(0) && gameModel->GetActiveTool(0)->GetIdentifier() != "DEFAULT_UI_SIGN" || button != BUTTON_LEFT) //If it's not a sign tool or you are right/middle clicking
if (!gameModel->GetActiveTool(0) || gameModel->GetActiveTool(0)->GetIdentifier() != "DEFAULT_UI_SIGN" || button != BUTTON_LEFT) //If it's not a sign tool or you are right/middle clicking
{
sign * foundSign = GetSignAt(x, y);
if(foundSign) {
@@ -1455,7 +1455,7 @@ void GameController::NotifyNewNotification(Client * sender, std::pair<std::strin
{
std::string link;
public:
LinkNotification(std::string link_, std::string message) : link(link_), Notification(message) {}
LinkNotification(std::string link_, std::string message) : Notification(message), link(link_) {}
virtual ~LinkNotification() {}
virtual void Action()
@@ -1485,7 +1485,7 @@ void GameController::NotifyUpdateAvailable(Client * sender)
{
GameController * c;
public:
UpdateNotification(GameController * c, std::string message) : c(c), Notification(message) {}
UpdateNotification(GameController * c, std::string message) : Notification(message), c(c) {}
virtual ~UpdateNotification() {}
virtual void Action()
@@ -29,9 +29,7 @@ class ConsoleController;
class GameController: public ClientListener
{
private:
//Simulation * sim;
bool firstTick;
int screenshotIndex;
sign * foundSign;
PreviewController * activePreview;
Oops, something went wrong.

0 comments on commit efd69b2

Please sign in to comment.