black decoration preset, improve look of deco buttons a little

This commit is contained in:
jacob1 2013-07-17 16:53:14 -04:00
parent 9628a11245
commit 4243987acd
3 changed files with 19 additions and 16 deletions

View File

@ -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); // 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) if (toolID == DECO_SMUDGE)
newTexture->SetPixel(x, y, 0, 255-5*x, 255+5*x, 255); 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); 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) 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++) for (int y=4; y<12; y++)
{ {
newTexture->SetPixel(y+5, y-1, reverseRed, reverseGreen, reverseBlue, 255); newTexture->SetPixel(y+5, y-1, reverseRed, reverseGreen, reverseBlue, 255);
@ -44,13 +46,13 @@ public:
} }
} }
else if (toolID == DECO_ADD) 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) 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) 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) else if (toolID == DECO_DIVIDE)
newTexture->AddCharacter(11, 4, '/', reverseRed, reverseGreen, reverseBlue, 255); newTexture->AddCharacter(11, 4, '/', Red, Green, Blue, 255);
return newTexture; return newTexture;
} }

View File

@ -145,6 +145,7 @@ GameModel::GameModel():
colourPresets.push_back(ui::Colour(255, 0, 0)); colourPresets.push_back(ui::Colour(255, 0, 0));
colourPresets.push_back(ui::Colour(0, 255, 0)); colourPresets.push_back(ui::Colour(0, 255, 0));
colourPresets.push_back(ui::Colour(0, 0, 255)); colourPresets.push_back(ui::Colour(0, 0, 255));
colourPresets.push_back(ui::Colour(0, 0, 0));
} }
GameModel::~GameModel() GameModel::~GameModel()
@ -327,13 +328,13 @@ void GameModel::BuildMenus()
menuList[SC_TOOL]->AddTool(new SampleTool(this)); menuList[SC_TOOL]->AddTool(new SampleTool(this));
//Add decoration tools to menu //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_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_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_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_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_SMUDGE, "SMDG", "Smudge tool, blends surrounding deco together.", 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_DRAW, "SET", "Draw decoration (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_CLEAR, "CLR", "Erase any set decoration.", 0, 0, 0, "DEFAULT_DECOR_CLR"));
decoToolset[0] = GetToolFromIdentifier("DEFAULT_DECOR_SET"); decoToolset[0] = GetToolFromIdentifier("DEFAULT_DECOR_SET");
decoToolset[1] = GetToolFromIdentifier("DEFAULT_DECOR_CLR"); decoToolset[1] = GetToolFromIdentifier("DEFAULT_DECOR_CLR");
decoToolset[2] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE"); decoToolset[2] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE");

View File

@ -776,7 +776,7 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender)
int i = 0; int i = 0;
for(std::vector<ui::Colour>::iterator iter = colours.begin(), end = colours.end(); iter != end; ++iter) for(std::vector<ui::Colour>::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->Appearance.BackgroundInactive = *iter;
tempButton->SetActionCallback(new ColourPresetAction(this, i)); tempButton->SetActionCallback(new ColourPresetAction(this, i));