Reso piu' tosto il resize delle figure
git-svn-id: svn://10.65.10.50/trunk@2913 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8f527d27da
commit
0ffa77cc9a
23
ba/ba0.cpp
23
ba/ba0.cpp
@ -43,7 +43,13 @@ TPicture_mask::TPicture_mask(const char* name, int dx, int dy, TImage& image)
|
||||
void TPicture_mask::update()
|
||||
{
|
||||
if (_image.ok())
|
||||
_image.draw(win());
|
||||
{
|
||||
RCT cli; fld(1).get_rect(cli);
|
||||
const short maxx = cli.left;
|
||||
const short maxy = short((long)maxx*_image.height()/_image.width());
|
||||
RCT dst; xvt_rect_set(&dst, 1, 1, maxx, maxy);
|
||||
_image.draw(win(), dst);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -353,7 +359,6 @@ int TMenu_application::do_level()
|
||||
const int width = 78;
|
||||
const int height = 18;
|
||||
const int bwidth = 20;
|
||||
const int x = width / 2;
|
||||
short id = (short)row.get_int();
|
||||
|
||||
if (_images.objptr(id) == NULL)
|
||||
@ -362,21 +367,15 @@ int TMenu_application::do_level()
|
||||
if (id > 0 && !fexist(n))
|
||||
n = format("ba%02d.bmp", id = 0);
|
||||
|
||||
TImage orig(n);
|
||||
RCT src; xvt_rect_set(&src, 0, 0, orig.width(), orig.height());
|
||||
const short maxx = width * CHARX / 2 - 4;
|
||||
const short maxy = short((long)maxx*src.bottom/src.right);
|
||||
|
||||
TImage* image = new TImage(orig, maxx, maxy);
|
||||
if (id == 0 && MASK_BACK_COLOR != COLOR_DKCYAN)
|
||||
TImage* image = new TImage(n);
|
||||
if (MASK_BACK_COLOR != COLOR_DKCYAN)
|
||||
image->set_clut(6, MASK_BACK_COLOR);
|
||||
image->set_pos(1, 1);
|
||||
|
||||
_images.add(image, id);
|
||||
}
|
||||
|
||||
TPicture_mask menu(head, width, height, (TImage &) _images[id]);
|
||||
TPicture_mask menu(head, width, height, (TImage&)_images[id]);
|
||||
|
||||
const int x = width / 2;
|
||||
int y = 1;
|
||||
|
||||
for (int i = first+1; i < last; i++, y++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user