1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

some fixes

This commit is contained in:
paracelsus
2013-03-03 19:28:01 +00:00
parent 1e0f473761
commit 34427b9e43
6 changed files with 39 additions and 40 deletions

View File

@ -895,24 +895,24 @@ void CBattleInterface::show(SDL_Surface * to)
if(tacticsMode) if(tacticsMode)
{ {
btactNext->showAll(to); btactNext->showAll();
btactEnd->showAll(to); btactEnd->showAll();
} }
else else
{ {
console->showAll(to); console->showAll();
bConsoleUp->showAll(to); bConsoleUp->showAll();
bConsoleDown->showAll(to); bConsoleDown->showAll();
} }
//showing buttons //showing buttons
bOptions->showAll(to); bOptions->showAll();
bSurrender->showAll(to); bSurrender->showAll();
bFlee->showAll(to); bFlee->showAll();
bAutofight->showAll(to); bAutofight->showAll();
bSpell->showAll(to); bSpell->showAll();
bWait->showAll(to); bWait->showAll();
bDefence->showAll(to); bDefence->showAll();
//showing in-game console //showing in-game console
LOCPLINT->cingconsole->show(to); LOCPLINT->cingconsole->show(to);
@ -929,7 +929,7 @@ void CBattleInterface::show(SDL_Surface * to)
//showing queue //showing queue
if(!bresult) if(!bresult)
queue->showAll(to); queue->showAll();
else else
queue->blitBg(to); queue->blitBg(to);
} }

View File

@ -469,10 +469,10 @@ void CBattleResultWindow::activate()
CIntObject::activate(); CIntObject::activate();
} }
void CBattleResultWindow::show(SDL_Surface * to) void CBattleResultWindow::show()
{ {
CIntObject::show(to); CIntObject::show();
CCS->videoh->update(pos.x + 107, pos.y + 70, screen, true, false); CCS->videoh->update(pos.x + 107, pos.y + 70, true, false);
} }
void CBattleResultWindow::bExitf() void CBattleResultWindow::bExitf()
@ -658,11 +658,11 @@ CStackQueue::~CStackQueue()
SDL_FreeSurface(bg); SDL_FreeSurface(bg);
} }
void CStackQueue::showAll(SDL_Surface * to) void CStackQueue::showAll()
{ {
blitBg(to); //* blitBg(to);
CIntObject::showAll(to); CIntObject::showAll();
} }
void CStackQueue::blitBg( SDL_Surface * to ) void CStackQueue::blitBg( SDL_Surface * to )
@ -675,16 +675,16 @@ void CStackQueue::blitBg( SDL_Surface * to )
} }
} }
void CStackQueue::StackBox::showAll(SDL_Surface * to) void CStackQueue::StackBox::showAll()
{ {
assert(stack); assert(stack);
bg->colorize(stack->owner); bg->colorize(stack->owner);
CIntObject::showAll(to); CIntObject::showAll();
if(small) //* if(small)
printAtMiddleLoc(makeNumberShort(stack->count), pos.w/2, pos.h - 7, FONT_SMALL, Colors::WHITE, to); //* printAtMiddleLoc(makeNumberShort(stack->count), pos.w/2, pos.h - 7, FONT_SMALL, Colors::WHITE, to);
else //* else
printAtMiddleLoc(makeNumberShort(stack->count), pos.w/2, pos.h - 8, FONT_MEDIUM, Colors::WHITE, to); //* printAtMiddleLoc(makeNumberShort(stack->count), pos.w/2, pos.h - 8, FONT_MEDIUM, Colors::WHITE, to);
} }
void CStackQueue::StackBox::setStack( const CStack *stack ) void CStackQueue::StackBox::setStack( const CStack *stack )

View File

@ -95,7 +95,7 @@ public:
void bExitf(); //exit button callback void bExitf(); //exit button callback
void activate(); void activate();
void show(SDL_Surface * to = 0); void show();
}; };
/// Class which stands for a single hex field on a battlefield /// Class which stands for a single hex field on a battlefield
@ -130,7 +130,7 @@ class CStackQueue : public CIntObject
const CStack *stack; const CStack *stack;
bool small; bool small;
void showAll(SDL_Surface * to); void showAll();
void setStack(const CStack *nStack); void setStack(const CStack *nStack);
StackBox(bool small); StackBox(bool small);
}; };
@ -148,6 +148,6 @@ public:
CStackQueue(bool Embedded, CBattleInterface * _owner); CStackQueue(bool Embedded, CBattleInterface * _owner);
~CStackQueue(); ~CStackQueue();
void update(); void update();
void showAll(SDL_Surface *to); void showAll();
void blitBg(SDL_Surface * to); void blitBg(SDL_Surface * to);
}; };

View File

@ -60,10 +60,10 @@ CCreatureAnimation::CCreatureAnimation(std::string name) : internalFrame(0), onc
i=0x10; i=0x10;
for (int it=0;it<256;it++) for (int it=0;it<256;it++)
{ {
palette[it].R = FDef[i++]; // palette[it].R = FDef[i++];
palette[it].G = FDef[i++]; // palette[it].G = FDef[i++];
palette[it].B = FDef[i++]; // palette[it].B = FDef[i++];
palette[it].F = 0; // palette[it].F = 0;
} }
i=0x310; i=0x310;
totalEntries=0; totalEntries=0;
@ -237,7 +237,7 @@ int CCreatureAnimation::nextFrameT(SDL_Surface * dest, int x, int y, bool attack
if(!destRect || (destRect->x <= xB && destRect->x + destRect->w > xB && destRect->y <= yB && destRect->y + destRect->h > yB)) if(!destRect || (destRect->x <= xB && destRect->x + destRect->w > xB && destRect->y <= yB && destRect->y + destRect->h > yB))
{ {
const ui8 colorNr = SegmentType == 0xff ? FDef[BaseOffset+k] : SegmentType; const ui8 colorNr = SegmentType == 0xff ? FDef[BaseOffset+k] : SegmentType;
putPixel<bpp>(dest, xB, yB, palette[colorNr], colorNr, yellowBorder, blueBorder, aCountMod); //putPixel<bpp>(dest, xB, yB, palette[colorNr], colorNr, yellowBorder, blueBorder, aCountMod);
} }
} }
ftcp++; //increment pos ftcp++; //increment pos

View File

@ -23,7 +23,6 @@ class CCreatureAnimation : public CIntObject
{ {
private: private:
int totalEntries, DEFType, totalBlocks; int totalEntries, DEFType, totalBlocks;
BMPPalette palette[256];
struct SEntry struct SEntry
{ {
int offset; int offset;

View File

@ -120,7 +120,7 @@ void CMapLoaderH3M::init()
times.push_back(MapLoadingTime("events", sw.getDiff())); times.push_back(MapLoadingTime("events", sw.getDiff()));
// Calculate blocked / visitable positions // Calculate blocked / visitable positions
for(int f = 0; f < map->objects.size(); ++f) for(size_t f = 0; f < map->objects.size(); ++f)
{ {
if(!map->objects[f]->defInfo) continue; if(!map->objects[f]->defInfo) continue;
map->addBlockVisTiles(map->objects[f]); map->addBlockVisTiles(map->objects[f]);
@ -177,7 +177,7 @@ void CMapLoaderH3M::readHeader()
void CMapLoaderH3M::readPlayerInfo() void CMapLoaderH3M::readPlayerInfo()
{ {
for(int i = 0; i < mapHeader->players.size(); ++i) for(size_t i = 0; i < mapHeader->players.size(); ++i)
{ {
mapHeader->players[i].canHumanPlay = reader.readBool(); mapHeader->players[i].canHumanPlay = reader.readBool();
mapHeader->players[i].canComputerPlay = reader.readBool(); mapHeader->players[i].canComputerPlay = reader.readBool();
@ -1535,7 +1535,7 @@ CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven)
PlayerColor owner = PlayerColor(reader.readUInt8()); PlayerColor owner = PlayerColor(reader.readUInt8());
nhi->subID = reader.readUInt8(); nhi->subID = reader.readUInt8();
for(int j = 0; j < map->predefinedHeroes.size(); ++j) for(size_t j = 0; j < map->predefinedHeroes.size(); ++j)
{ {
if(map->predefinedHeroes[j]->subID == nhi->subID) if(map->predefinedHeroes[j]->subID == nhi->subID)
{ {
@ -1549,7 +1549,7 @@ CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven)
nhi->portrait = nhi->subID; nhi->portrait = nhi->subID;
for(int j = 0; j < map->disposedHeroes.size(); ++j) for(size_t j = 0; j < map->disposedHeroes.size(); ++j)
{ {
if(map->disposedHeroes[j].heroId == nhi->subID) if(map->disposedHeroes[j].heroId == nhi->subID)
{ {
@ -2120,7 +2120,7 @@ void CMapLoaderH3M::readSpells(std::set<SpellID>& dest)
void CMapLoaderH3M::readResourses(TResources& resources) void CMapLoaderH3M::readResourses(TResources& resources)
{ {
resources.resize(GameConstants::RESOURCE_QUANTITY); //needed? resources.resize(GameConstants::RESOURCE_QUANTITY); //needed?
for(int x = 0; x < 7; ++x) for(size_t x = 0; x < 7; ++x)
{ {
resources[x] = reader.readUInt32(); resources[x] = reader.readUInt32();
} }
@ -2133,7 +2133,7 @@ void CMapLoaderH3M::readBitmask(std::set<Indenifier>& dest, const int byteCount,
temp.resize(limit,true); temp.resize(limit,true);
readBitmask(temp, byteCount, limit, negate); readBitmask(temp, byteCount, limit, negate);
for(int i = 0; i< std::min(temp.size(), static_cast<size_t>(limit)); i++) for(size_t i = 0; i< std::min(temp.size(), static_cast<size_t>(limit)); i++)
{ {
if(temp[i]) if(temp[i])
{ {