summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/game/GameController.cpp5
-rw-r--r--src/gui/game/GameModel.cpp13
-rw-r--r--src/gui/game/Tool.cpp18
-rw-r--r--src/gui/game/Tool.h2
-rw-r--r--src/gui/interface/Keys.h2
5 files changed, 28 insertions, 12 deletions
diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp
index 852a433..815c7a4 100644
--- a/src/gui/game/GameController.cpp
+++ b/src/gui/game/GameController.cpp
@@ -150,6 +150,8 @@ GameController::GameController():
gameView->AttachController(this);
gameModel->AddObserver(gameView);
+ gameView->SetDebugHUD(Client::Ref().GetPrefBool("Renderer.DebugMode", false));
+
#ifdef LUACONSOLE
commandInterface = new LuaScriptInterface(this, gameModel);
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
@@ -1016,6 +1018,7 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
gameSave->legacyEnable = sim->legacy_enable;
gameSave->waterEEnabled = sim->water_equal_test;
gameSave->gravityEnable = sim->grav->ngrav_enable;
+ gameSave->aheatEnable = sim->aheat_enable;
if(!gameSave)
{
new ErrorMessage("Error", "Unable to build save.");
@@ -1227,6 +1230,7 @@ void GameController::OpenSaveWindow()
gameSave->legacyEnable = sim->legacy_enable;
gameSave->waterEEnabled = sim->water_equal_test;
gameSave->gravityEnable = sim->grav->ngrav_enable;
+ gameSave->aheatEnable = sim->aheat_enable;
if(!gameSave)
{
new ErrorMessage("Error", "Unable to build save.");
@@ -1278,6 +1282,7 @@ void GameController::SaveAsCurrent()
gameSave->legacyEnable = sim->legacy_enable;
gameSave->waterEEnabled = sim->water_equal_test;
gameSave->gravityEnable = sim->grav->ngrav_enable;
+ gameSave->aheatEnable = sim->aheat_enable;
if(!gameSave)
{
new ErrorMessage("Error", "Unable to build save.");
diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp
index 4353316..efb7d78 100644
--- a/src/gui/game/GameModel.cpp
+++ b/src/gui/game/GameModel.cpp
@@ -83,6 +83,11 @@ GameModel::GameModel():
//Load config into simulation
edgeMode = Client::Ref().GetPrefInteger("Simulation.EdgeMode", 0);
sim->SetEdgeMode(edgeMode);
+ int ngrav_enable = Client::Ref().GetPrefInteger("Simulation.NewtonianGravity", 0);
+ if (ngrav_enable)
+ sim->grav->start_grav_async();
+ sim->aheat_enable = Client::Ref().GetPrefInteger("Simulation.AmbientHeat", 0);
+ sim->pretty_powder = Client::Ref().GetPrefInteger("Simulation.PrettyPowder", 0);
//Load last user
if(Client::Ref().GetAuthUser().ID)
@@ -155,8 +160,12 @@ GameModel::~GameModel()
Client::Ref().SetPref("Renderer.GravityField", (bool)ren->gravityFieldEnabled);
Client::Ref().SetPref("Renderer.Decorations", (bool)ren->decorations_enable);
+ Client::Ref().SetPref("Renderer.DebugMode", ren->debugLines); //These two should always be equivalent, even though they are different things
Client::Ref().SetPref("Simulation.EdgeMode", sim->edgeMode);
+ Client::Ref().SetPref("Simulation.NewtonianGravity", sim->grav->ngrav_enable);
+ Client::Ref().SetPref("Simulation.AmbientHeat", sim->aheat_enable);
+ Client::Ref().SetPref("Simulation.PrettyPowder", sim->pretty_powder);
Client::Ref().SetPref("Decoration.Red", (int)colour.Red);
Client::Ref().SetPref("Decoration.Green", (int)colour.Green);
@@ -312,7 +321,7 @@ void GameModel::BuildMenus()
menuList[SC_TOOL]->AddTool(tempTool);
}
//Add special sign and prop tools
- menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND", "Create air movement.", 64, 64, 64, "DEFAULT_UI_WIND"));
+ menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND", "Creates air movement.", 64, 64, 64, "DEFAULT_UI_WIND"));
menuList[SC_TOOL]->AddTool(new PropertyTool());
menuList[SC_TOOL]->AddTool(new SignTool());
menuList[SC_TOOL]->AddTool(new SampleTool(this));
@@ -566,6 +575,7 @@ void GameModel::SetSave(SaveInfo * newSave)
sim->air->airMode = saveData->airMode;
sim->legacy_enable = saveData->legacyEnable;
sim->water_equal_test = saveData->waterEEnabled;
+ sim->aheat_enable = saveData->aheatEnable;
if(saveData->gravityEnable)
sim->grav->start_grav_async();
else
@@ -607,6 +617,7 @@ void GameModel::SetSaveFile(SaveFile * newSave)
sim->air->airMode = saveData->airMode;
sim->legacy_enable = saveData->legacyEnable;
sim->water_equal_test = saveData->waterEEnabled;
+ sim->aheat_enable = saveData->aheatEnable;
if(saveData->gravityEnable && !sim->grav->ngrav_enable)
{
sim->grav->start_grav_async();
diff --git a/src/gui/game/Tool.cpp b/src/gui/game/Tool.cpp
index 2ff1a1b..bdc1801 100644
--- a/src/gui/game/Tool.cpp
+++ b/src/gui/game/Tool.cpp
@@ -62,10 +62,10 @@ void ElementTool::DrawLine(Simulation * sim, Brush * brush, ui::Point position1,
sim->CreateLine(position1.X, position1.Y, position2.X, position2.Y, toolID, brush);
}
void ElementTool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
- sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, toolID, 0);
+ sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, toolID);
}
void ElementTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
- sim->FloodParts(position.X, position.Y, toolID, -1, -1, 0);
+ sim->FloodParts(position.X, position.Y, toolID, -1, -1);
}
@@ -75,8 +75,8 @@ Tool(id, name, description, r, g, b, identifier, textureGen)
resolution = CELL;
}
WallTool::~WallTool() {}
-void WallTool::Draw(Simulation * sim, Brush * brush, ui::Point position){
- sim->CreateWalls(position.X, position.Y, 1, 1, toolID, 0, brush);
+void WallTool::Draw(Simulation * sim, Brush * brush, ui::Point position) {
+ sim->CreateWalls(position.X, position.Y, 1, 1, toolID, brush);
}
void WallTool::DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) {
int wallX = position1.X/CELL;
@@ -99,15 +99,15 @@ void WallTool::DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui
}
else
{
- sim->CreateWallLine(position1.X, position1.Y, position2.X, position2.Y, 1, 1, toolID, 0, brush);
+ sim->CreateWallLine(position1.X, position1.Y, position2.X, position2.Y, 1, 1, toolID, brush);
}
}
void WallTool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
- sim->CreateWallBox(position1.X, position1.Y, position2.X, position2.Y, toolID, 0);
+ sim->CreateWallBox(position1.X, position1.Y, position2.X, position2.Y, toolID);
}
void WallTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
if (toolID != WL_STREAM)
- sim->FloodWalls(position.X, position.Y, toolID, -1, -1, 0);
+ sim->FloodWalls(position.X, position.Y, toolID, -1, -1);
}
WindTool::WindTool(int id, string name, string description, int r, int g, int b, std::string identifier, VideoBuffer * (*textureGen)(int, int, int)):
@@ -181,11 +181,11 @@ void Element_TESC_Tool::DrawLine(Simulation * sim, Brush * brush, ui::Point posi
}
void Element_TESC_Tool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
int radiusInfo = brush->GetRadius().X*4+brush->GetRadius().Y*4+7;
- sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, toolID | (radiusInfo << 8), 0);
+ sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, toolID | (radiusInfo << 8));
}
void Element_TESC_Tool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
int radiusInfo = brush->GetRadius().X*4+brush->GetRadius().Y*4+7;
- sim->FloodParts(position.X, position.Y, toolID | (radiusInfo << 8), -1, -1, 0);
+ sim->FloodParts(position.X, position.Y, toolID | (radiusInfo << 8), -1, -1);
}
diff --git a/src/gui/game/Tool.h b/src/gui/game/Tool.h
index 8b75f3f..7ee105f 100644
--- a/src/gui/game/Tool.h
+++ b/src/gui/game/Tool.h
@@ -45,7 +45,7 @@ class SignTool: public Tool
{
public:
SignTool():
- Tool(0, "SIGN", "Sign. Click a sign to edit or anywhere else to create a new one.", 0, 0, 0, "DEFAULT_UI_SIGN", SignTool::GetIcon)
+ Tool(0, "SIGN", "Sign. Displays text. Click on a sign to edit it or anywhere else to place a new one.", 0, 0, 0, "DEFAULT_UI_SIGN", SignTool::GetIcon)
{
}
static VideoBuffer * GetIcon(int toolID, int width, int height);
diff --git a/src/gui/interface/Keys.h b/src/gui/interface/Keys.h
index cd265f9..424dd86 100644
--- a/src/gui/interface/Keys.h
+++ b/src/gui/interface/Keys.h
@@ -1,6 +1,6 @@
#if defined(USE_SDL)
-#include "SDL/SDL.h"
+#include "SDL.h"
#define KEY_UP SDLK_UP
#define KEY_DOWN SDLK_DOWN
#define KEY_RIGHT SDLK_RIGHT