Skip to content

Commit

Permalink
* Now I really did fix the lines when resizing. Yay!
Browse files Browse the repository at this point in the history
* Took care of one easy FIXME
  • Loading branch information
Nate Fries committed May 18, 2009
1 parent c8192da commit a06ff98
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
1 change: 0 additions & 1 deletion creatureui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ void CreatureUI::Blit(int x, int y, float scale, int map_x, int map_y) const
g_engine->drawRectangleLines(x + walkoffx, y + walkoffy, 32*scale, 32*scale, oRGBA(0,0,0,0));
}

// FIXME (nfries88): RGBA colors aren't as expected for me.
//Pink square around the attacked creature
if(n->getID() == GlobalVariables::getAttackID()) {
// "Deep Pink" - may not be the right color
Expand Down
1 change: 0 additions & 1 deletion engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ void Engine::drawText(const char* text, const char* font, int x, int y, oRGBA co
{
if (color.r == color.g && color.g == color.b && color.b == 1.)
{

f->resetColor();
}
else
Expand Down
7 changes: 4 additions & 3 deletions mapui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ void MapUI::renderMap()
//TODO: center game area horizontally (cipsoft's client does this)
// FIXME (ivucica#2#) make renderMap use m_x,m_y and m_w,m_h


// set up scale
if(!options.stretchGameWindow)
m_scale = MIN(m_w/(15.*32), m_h/(11.*32));
else
m_scale = 1.f;
// printf("m_w: %d, m_h: %d, m_scale: %g\n", m_w, m_h, m_scale);
float scaledSize = 32*m_scale;
// NOTE (nfries88): By flooring scaledSize, we assure a full pixel value for scaledSize.
// by then setting m_scale to this full pixel value / 32, we assure that all things are scaled equally.
float scaledSize = std::floor(32*m_scale);
m_scale = scaledSize/32;

m_x = -scaledSize*2; m_y = -scaledSize*2;
g_engine->setClipping(/*scaledSize*2 + m_x,scaledSize*2 + m_y,*/0,0,15*scaledSize,11*scaledSize);
Expand Down
25 changes: 12 additions & 13 deletions ui/charlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,30 +163,29 @@ class winCharlist_t {
std::stringstream s;

s << chr.name << " (" << chr.world << ")";
// FIXME (ivucica#5#) change "res" into "pnl"
glictPanel *res = new glictPanel;
glictPanel *pnl = new glictPanel;
CharacterList_t *data = new CharacterList_t;
*data = chr;
data->extra = this;

res->SetBGActiveness(false);
res->SetBGColor(.4,.4,.4,1.);
res->SetOnClick(winCharlist_t::OnListbox);
res->SetCustomData(data);
res->SetCaption(s.str());
res->SetFont("aafont");
res->SetFocusable(false);
pnl->SetBGActiveness(false);
pnl->SetBGColor(.4,.4,.4,1.);
pnl->SetOnClick(winCharlist_t::OnListbox);
pnl->SetCustomData(data);
pnl->SetCaption(s.str());
pnl->SetFont("aafont");
pnl->SetFocusable(false);
#if GLICT_APIREV < 68
#warning Aesthetic corrections on listboxes wont work without GLICT of apirev 68+
#else
res->SetTextOffset(4,2);
pnl->SetTextOffset(4,2);
#endif

lsiChars.push_back(res);
lstChars.AddObject(res);
lsiChars.push_back(pnl);
lstChars.AddObject(pnl);

if (lsiChars.size() == 1) {
OnListbox(NULL, res);
OnListbox(NULL, pnl);
}
}

Expand Down

0 comments on commit a06ff98

Please sign in to comment.