Misc bits

This commit is contained in:
2014-11-29 03:21:28 -05:00
parent 6f73841764
commit 1cdc7ddb7c
3 changed files with 5 additions and 0 deletions

View File

@@ -823,6 +823,7 @@ void handle_talk_event(location p)
strnum1 = -1; strnum1 = -1;
return; return;
case 12: //healer case 12: //healer
// TODO: extra1 and extra2 are actually never used! So remove them.
start_shop_mode(3,univ.town.monst[store_m_num].extra1, start_shop_mode(3,univ.town.monst[store_m_num].extra1,
univ.town.monst[store_m_num].extra2,a,place_string1.c_str()); univ.town.monst[store_m_num].extra2,a,place_string1.c_str());
strnum1 = -1; strnum1 = -1;

View File

@@ -467,6 +467,7 @@ void start_town_mode(short which_town, short entry_dir)
// Not use the items data flags, starting with forcing an ability // Not use the items data flags, starting with forcing an ability
if (univ.town->preset_items[i].ability >= 0) { if (univ.town->preset_items[i].ability >= 0) {
switch (univ.town.items[j].variety) { switch (univ.town.items[j].variety) {
// TODO: It looks like this will never be reached?
case 3: case 11: // If gold or food, this value is amount case 3: case 11: // If gold or food, this value is amount
if (univ.town->preset_items[i].ability > 0) if (univ.town->preset_items[i].ability > 0)
univ.town.items[j].item_level = univ.town->preset_items[i].ability; univ.town.items[j].item_level = univ.town->preset_items[i].ability;

View File

@@ -1023,6 +1023,7 @@ void Region::setStencil(sf::RenderWindow& where) {
} }
void clip_rect(sf::RenderTarget& where, RECT rect) { void clip_rect(sf::RenderTarget& where, RECT rect) {
rect |= RECT(where); // Make sure we don't draw out of bounds
// TODO: Make sure this works for the scissor test... // TODO: Make sure this works for the scissor test...
setActiveRenderTarget(where); setActiveRenderTarget(where);
glEnable(GL_SCISSOR_TEST); glEnable(GL_SCISSOR_TEST);
@@ -1066,6 +1067,7 @@ void tileImage(sf::RenderTarget& target, RECT area, sf::Texture& img, sf::BlendM
RECT clipArea = area; RECT clipArea = area;
area.left -= area.left % imgSz.x; area.left -= area.left % imgSz.x;
area.top -= area.top % imgSz.y; area.top -= area.top % imgSz.y;
area |= RECT(target); // Make sure we don't draw out of bounds
unsigned int hrep = int((double(area.width())/imgSz.x)+0.5); unsigned int hrep = int((double(area.width())/imgSz.x)+0.5);
unsigned int vrep = int((double(area.height())/imgSz.y)+0.5); unsigned int vrep = int((double(area.height())/imgSz.y)+0.5);
@@ -1091,6 +1093,7 @@ void tileImage(sf::RenderTarget& target, RECT area, sf::Texture& img, RECT srcRe
RECT clipArea = area; RECT clipArea = area;
area.left -= area.left % tesselRect.width(); area.left -= area.left % tesselRect.width();
area.top -= area.top % tesselRect.height(); area.top -= area.top % tesselRect.height();
area |= RECT(target); // Make sure we don't draw out of bounds
sf::RectangleShape tessel(sf::Vector2f(area.width(),area.height())); sf::RectangleShape tessel(sf::Vector2f(area.width(),area.height()));
tessel.setTexture(&temp.getTexture()); tessel.setTexture(&temp.getTexture());