My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "MipMap.h"
#include <Painter/Painter.h>

void MipMapItem::Render(Draw* w, const Rect& r)
{
if (w)
w->DrawImage(r, _mipMap);
}

void MipMapItem::Prepare(const char* fp, const Size& sz)
{
if (_ready)
return;
_ready = true;

FileIn in(fp);
One<StreamRaster> r = StreamRaster::OpenAny(in);
if (!r)
{
LOG(NFormat("Ошибка при загрузке файла карты: %s", fp));
ImageBuffer ib(sz);
BufferPainter sw(ib);
sw.DrawRect(sz, Yellow());
_mipMap = ib;
return;
}

_mipMap = r->GetImage();
}

void MipMapItem::Release()
{
if (!_ready)
return;
_mipMap.Clear();
_ready = false;
}

Change log

r4180 by Sc0rch on Nov 17, 2011   Diff
MapRender: First release
(FormEditorCommon, FormEditorProperties,
Map, MapBG, MapCommon, MapEditor,
MapRenderTest.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 663 bytes, 37 lines
Powered by Google Project Hosting