1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* hopefully fixed #46

* minor improvements
This commit is contained in:
Michał W. Urbańczyk 2007-12-23 16:25:14 +00:00
parent 7db86e5f9e
commit 6c2cf4ba29
5 changed files with 26 additions and 23 deletions

View File

@ -47,11 +47,11 @@ void CInfoWindow::close()
}
components.clear();
okb.deactivate();
SDL_FreeSurface(bitmap);
bitmap = NULL;
//SDL_FreeSurface(bitmap);
//bitmap = NULL;
LOCPLINT->removeObjToBlit(this);
//delete this;
LOCPLINT->adventureInt->show();
delete this;
}
CInfoWindow::~CInfoWindow()
{
@ -116,8 +116,8 @@ void CSelectableComponent::clickLeft(tribool down)
}
}
CSelectableComponent::CSelectableComponent(Etype Type, int Sub, int Val, SDL_Surface * Border)
:SComponent(Type,Sub,Val)
CSelectableComponent::CSelectableComponent(Etype Type, int Sub, int Val, CSelWindow * Owner=NULL, SDL_Surface * Border)
:SComponent(Type,Sub,Val),owner(Owner)
{
if (Border) //use custom border
{
@ -163,7 +163,7 @@ void CSelectableComponent::select(bool on)
blitAt(SComponent::getImg(),1,1,myBitmap);
if (on)
{
blitAt(SComponent::getImg(),0,0,border);
blitAt(border,0,0,myBitmap);
}
selected = on;
return;
@ -236,9 +236,9 @@ template <typename T> void CSCButton<T>::clickLeft (tribool down)
state=0;
}
show();
pressedL=state;
if (delg)
(delg->*func)(down);
pressedL=state;
}
template <typename T> void CSCButton<typename T>::activate()
{

View File

@ -162,8 +162,11 @@ class CSelectableComponent : public SComponent, public ClickableL
public:
bool selected;
SDL_Surface * border, *myBitmap;
CSelWindow * owner;
void clickLeft(tribool down);
CSelectableComponent(Etype Type, int Sub, int Val, SDL_Surface * Border=NULL);
CSelectableComponent(Etype Type, int Sub, int Val, CSelWindow * Owner, SDL_Surface * Border=NULL);
void activate();
void deactivate();
void select(bool on);

Binary file not shown.

View File

@ -83,19 +83,19 @@ void CArtHandler::loadArtifacts()
switch (pom[0])
{
case 'S':
nart.aClass=EartClass::SartClass;
nart.aClass=SartClass;
break;
case 'T':
nart.aClass=EartClass::TartClass;
nart.aClass=TartClass;
break;
case 'N':
nart.aClass=EartClass::NartClass;
nart.aClass=NartClass;
break;
case 'J':
nart.aClass=EartClass::JartClass;
nart.aClass=JartClass;
break;
case 'R':
nart.aClass=EartClass::RartClass;
nart.aClass=RartClass;
break;
}
CGeneralTextHandler::loadToIt(nart.description,buf,it,3);

View File

@ -72,16 +72,16 @@ void CPCXConv::convert()
else
check2=false;
if (check1)
format=Epcxformat::PCX24B;
format=PCX24B;
else if (check2)
format=Epcxformat::PCX8B;
format=PCX8B;
else
return;
add=(int)(4*(((float)1)-(((float)bh.x/(float)4)-((int)((float)bh.x/(float)4)))));
if (add==4)
add=0;
bh._h3=bh.x*bh.y;
if (format==Epcxformat::PCX8B)
if (format==PCX8B)
{
bh._c1=0x436;
bh._c2=0x28;
@ -104,7 +104,7 @@ void CPCXConv::convert()
bh.fullSize=(bh.x+add)*bh.y*3+36+18;
bh._h3*=3;
}
if (format==Epcxformat::PCX8B)
if (format==PCX8B)
{
it = pcxs-256*3;
for (int i=0;i<256;i++)
@ -117,7 +117,7 @@ void CPCXConv::convert()
}
out<<"BM";
bh.print(out);
if (format==Epcxformat::PCX8B)
if (format==PCX8B)
{
for (int i=0;i<256;i++)
{
@ -185,15 +185,15 @@ SDL_Surface * CPCXConv::getSurface()
else
check2=false;
if (check1)
format=Epcxformat::PCX24B;
format=PCX24B;
else if (check2)
format=Epcxformat::PCX8B;
format=PCX8B;
else
return NULL;
add = 4 - bh.x%4;
if (add==4)
add=0;
if (format==Epcxformat::PCX8B)
if (format==PCX8B)
{
ret = SDL_CreateRGBSurface(SDL_SWSURFACE, bh.x+add, bh.y, 8, 0, 0, 0, 0);
}
@ -204,7 +204,7 @@ SDL_Surface * CPCXConv::getSurface()
int rmask = 0xff0000;
ret = SDL_CreateRGBSurface(SDL_SWSURFACE, bh.x+add, bh.y, 24, rmask, gmask, bmask, 0);
}
if (format==Epcxformat::PCX8B)
if (format==PCX8B)
{
it = pcxs-256*3;
for (int i=0;i<256;i++)
@ -215,7 +215,7 @@ SDL_Surface * CPCXConv::getSurface()
pal[i].F='\0';
}
}
if (format==Epcxformat::PCX8B)
if (format==PCX8B)
{
for(int i=0; i<256; ++i)