From 4243987acdbd7f105366df55ef3a958181148c90 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Wed, 17 Jul 2013 16:53:14 -0400 Subject: [PATCH] black decoration preset, improve look of deco buttons a little --- src/gui/game/DecorationTool.h | 18 ++++++++++-------- src/gui/game/GameModel.cpp | 15 ++++++++------- src/gui/game/GameView.cpp | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/gui/game/DecorationTool.h b/src/gui/game/DecorationTool.h index 67ab915a8..2edb201f3 100644 --- a/src/gui/game/DecorationTool.h +++ b/src/gui/game/DecorationTool.h @@ -26,15 +26,17 @@ public: // vid_buf[(XRES+BARSIZE)*(y+j)+(x+i)] = PIXRGB(PIXR(pc)+10*j, PIXG(pc)+10*j, PIXB(pc)+10*j); if (toolID == DECO_SMUDGE) newTexture->SetPixel(x, y, 0, 255-5*x, 255+5*x, 255); - else + else if (toolID == DECO_DRAW || toolID == DECO_CLEAR) newTexture->SetPixel(x, y, Red, Green, Blue, Alpha); + else + newTexture->SetPixel(x, y, 50, 50, 50, 255); } } - int reverseRed = (Red+127)%256; - int reverseGreen = (Green+127)%256; - int reverseBlue = (Blue+127)%256; if (toolID == DECO_CLEAR) { + int reverseRed = (Red+127)%256; + int reverseGreen = (Green+127)%256; + int reverseBlue = (Blue+127)%256; for (int y=4; y<12; y++) { newTexture->SetPixel(y+5, y-1, reverseRed, reverseGreen, reverseBlue, 255); @@ -44,13 +46,13 @@ public: } } else if (toolID == DECO_ADD) - newTexture->AddCharacter(11, 4, '+', reverseRed, reverseGreen, reverseBlue, 255); + newTexture->AddCharacter(11, 4, '+', Red, Green, Blue, 255); else if (toolID == DECO_SUBTRACT) - newTexture->AddCharacter(11, 4, '-', reverseRed, reverseGreen, reverseBlue, 255); + newTexture->AddCharacter(11, 4, '-', Red, Green, Blue, 255); else if (toolID == DECO_MULTIPLY) - newTexture->AddCharacter(11, 3, 'x', reverseRed, reverseGreen, reverseBlue, 255); + newTexture->AddCharacter(11, 3, 'x', Red, Green, Blue, 255); else if (toolID == DECO_DIVIDE) - newTexture->AddCharacter(11, 4, '/', reverseRed, reverseGreen, reverseBlue, 255); + newTexture->AddCharacter(11, 4, '/', Red, Green, Blue, 255); return newTexture; } diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp index 0852e7110..fdd70dc89 100644 --- a/src/gui/game/GameModel.cpp +++ b/src/gui/game/GameModel.cpp @@ -145,6 +145,7 @@ GameModel::GameModel(): colourPresets.push_back(ui::Colour(255, 0, 0)); colourPresets.push_back(ui::Colour(0, 255, 0)); colourPresets.push_back(ui::Colour(0, 0, 255)); + colourPresets.push_back(ui::Colour(0, 0, 0)); } GameModel::~GameModel() @@ -327,13 +328,13 @@ void GameModel::BuildMenus() menuList[SC_TOOL]->AddTool(new SampleTool(this)); //Add decoration tools to menu - menuList[SC_DECO]->AddTool(new DecorationTool(DECO_ADD, "ADD", "Colour blending: Add", 0, 0, 0, "DEFAULT_DECOR_ADD")); - menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SUBTRACT, "SUB", "Colour blending: Subtract", 0, 0, 0, "DEFAULT_DECOR_SUB")); - menuList[SC_DECO]->AddTool(new DecorationTool(DECO_MULTIPLY, "MUL", "Colour blending: Multiply", 0, 0, 0, "DEFAULT_DECOR_MUL")); - menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DIVIDE, "DIV", "Colour blending: Divide" , 0, 0, 0, "DEFAULT_DECOR_DIV")); - menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SMUDGE, "SMDG", "Smudge colour", 0, 0, 0, "DEFAULT_DECOR_SMDG")); - menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DRAW, "SET", "Set colour (No blending)", 0, 0, 0, "DEFAULT_DECOR_SET")); - menuList[SC_DECO]->AddTool(new DecorationTool(DECO_CLEAR, "CLR", "Clear any set decoration", 0, 0, 0, "DEFAULT_DECOR_CLR")); + menuList[SC_DECO]->AddTool(new DecorationTool(DECO_ADD, "ADD", "Colour blending: Add.", 0, 0, 0, "DEFAULT_DECOR_ADD")); + menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SUBTRACT, "SUB", "Colour blending: Subtract.", 0, 0, 0, "DEFAULT_DECOR_SUB")); + menuList[SC_DECO]->AddTool(new DecorationTool(DECO_MULTIPLY, "MUL", "Colour blending: Multiply.", 0, 0, 0, "DEFAULT_DECOR_MUL")); + menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DIVIDE, "DIV", "Colour blending: Divide." , 0, 0, 0, "DEFAULT_DECOR_DIV")); + menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SMUDGE, "SMDG", "Smudge tool, blends surrounding deco together.", 0, 0, 0, "DEFAULT_DECOR_SMDG")); + menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DRAW, "SET", "Draw decoration (No blending).", 0, 0, 0, "DEFAULT_DECOR_SET")); + menuList[SC_DECO]->AddTool(new DecorationTool(DECO_CLEAR, "CLR", "Erase any set decoration.", 0, 0, 0, "DEFAULT_DECOR_CLR")); decoToolset[0] = GetToolFromIdentifier("DEFAULT_DECOR_SET"); decoToolset[1] = GetToolFromIdentifier("DEFAULT_DECOR_CLR"); decoToolset[2] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE"); diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 027f06bf5..5bbcb3a9c 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -776,7 +776,7 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender) int i = 0; for(std::vector::iterator iter = colours.begin(), end = colours.end(); iter != end; ++iter) { - ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), ""); + ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), "", "Decoration Presets."); tempButton->Appearance.BackgroundInactive = *iter; tempButton->SetActionCallback(new ColourPresetAction(this, i));