mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-25 14:22:54 -06:00
Draw, CtrlCore: Major refactor of Draw
git-svn-id: svn://ultimatepp.org/upp/trunk@5545 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fa5f9ec55e
commit
bd87a04fda
37 changed files with 2704 additions and 2655 deletions
|
|
@ -15,17 +15,16 @@ static StaticCriticalSection sDataDrawer;
|
|||
|
||||
void DataDrawer::AddFormat(const char *id, Factory factory)
|
||||
{
|
||||
INTERLOCKED_(sDataDrawer)
|
||||
Map().Add(id, (void *)factory);
|
||||
Mutex::Lock __(sDataDrawer);
|
||||
Map().Add(id, (void *)factory);
|
||||
}
|
||||
|
||||
One<DataDrawer> DataDrawer::Create(const String& id)
|
||||
{
|
||||
INTERLOCKED_(sDataDrawer) {
|
||||
Factory q = (Factory) Map().Get(id, NULL);
|
||||
if(q)
|
||||
return (*q)();
|
||||
}
|
||||
Mutex::Lock __(sDataDrawer);
|
||||
Factory q = (Factory) Map().Get(id, NULL);
|
||||
if(q)
|
||||
return (*q)();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -92,7 +91,6 @@ void DrawImageBandRLE(Draw& w, int x, int y, const Image& m, int minp)
|
|||
|
||||
void Draw::DrawDataOp(int x, int y, int cx, int cy, const String& data, const char *id)
|
||||
{
|
||||
DrawLock __;
|
||||
bool tonative = !IsNative();
|
||||
if(tonative) {
|
||||
BeginNative();
|
||||
|
|
@ -102,7 +100,7 @@ void Draw::DrawDataOp(int x, int y, int cx, int cy, const String& data, const ch
|
|||
One<DataDrawer> dd = DataDrawer::Create(id);
|
||||
if(dd) {
|
||||
dd->Open(data, cx, cy);
|
||||
if((cx > 2048 || cy > 2048) && GetInfo() & DATABANDS) {
|
||||
if((cx > 2048 || cy > 2048) && (GetInfo() & DATABANDS)) {
|
||||
int yy = 0;
|
||||
while(yy < cy) {
|
||||
int ccy = min(cy - yy, 32);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue