mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.rainbow fixed for newdraw
git-svn-id: svn://ultimatepp.org/upp/trunk@5509 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c738f635dd
commit
7bfe89a4bc
2 changed files with 133 additions and 166 deletions
|
|
@ -1,121 +1,92 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_FB
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LTIMING(x) // RTIMING(x)
|
||||
|
||||
void SetSurface(SystemDraw& w, int x, int y, int cx, int cy, const RGBA *pixels)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
void SetSurface(SystemDraw& w, const Rect& dest, const RGBA *pixels, Size psz, Point poff)
|
||||
{
|
||||
GuiLock __;
|
||||
}
|
||||
|
||||
struct Image::Data::SystemData {
|
||||
};
|
||||
|
||||
void Image::Data::SysInitImp()
|
||||
{
|
||||
SystemData& sd = Sys();
|
||||
}
|
||||
|
||||
void Image::Data::SysReleaseImp()
|
||||
{
|
||||
SystemData& sd = Sys();
|
||||
}
|
||||
|
||||
Image::Data::SystemData& Image::Data::Sys() const
|
||||
{
|
||||
ASSERT(sizeof(system_buffer) >= sizeof(SystemData));
|
||||
return *(SystemData *)system_buffer;
|
||||
}
|
||||
|
||||
int Image::Data::GetResCountImp() const
|
||||
{
|
||||
SystemData& sd = Sys();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Image::Data::PaintImp(SystemDraw& w, int x, int y, const Rect& src, Color c)
|
||||
{
|
||||
GuiLock __;
|
||||
SystemData& sd = Sys();
|
||||
}
|
||||
|
||||
Image ImageDraw::Get(bool pm) const
|
||||
{
|
||||
ImageBuffer result(image.GetSize());
|
||||
const RGBA *e = image.End();
|
||||
const RGBA *p = ~image;
|
||||
RGBA *t = ~result;
|
||||
if(has_alpha) {
|
||||
const RGBA *a = ~alpha;
|
||||
while(p < e) {
|
||||
*t = *p++;
|
||||
(t++)->a = (a++)->r;
|
||||
}
|
||||
if(pm)
|
||||
Premultiply(result);
|
||||
result.SetKind(IMAGE_ALPHA);
|
||||
}
|
||||
else {
|
||||
while(p < e) {
|
||||
*t = *p++;
|
||||
(t++)->a = 255;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Draw& ImageDraw::Alpha()
|
||||
{
|
||||
has_alpha = true;
|
||||
return alpha_painter;
|
||||
}
|
||||
|
||||
|
||||
ImageDraw::ImageDraw(Size sz)
|
||||
: ImageDraw__(sz.cx, sz.cy),
|
||||
BufferPainter(image),
|
||||
alpha_painter(alpha)
|
||||
{
|
||||
has_alpha = false;
|
||||
}
|
||||
|
||||
ImageDraw::ImageDraw(int cx, int cy)
|
||||
: ImageDraw__(cx, cy),
|
||||
BufferPainter(image),
|
||||
alpha_painter(alpha)
|
||||
{
|
||||
has_alpha = false;
|
||||
}
|
||||
|
||||
#define IMAGECLASS FBImg
|
||||
#define IMAGEFILE <Framebuffer/FB.iml>
|
||||
#include <Draw/iml_source.h>
|
||||
|
||||
Image Image::Arrow() { return FBImg::arrow(); }
|
||||
Image Image::Wait() { return FBImg::wait(); }
|
||||
Image Image::IBeam() { return FBImg::ibeam(); }
|
||||
Image Image::No() { return FBImg::no(); }
|
||||
Image Image::SizeAll() { return FBImg::sizeall(); }
|
||||
Image Image::SizeHorz() { return FBImg::sizehorz(); }
|
||||
Image Image::SizeVert() { return FBImg::sizevert(); }
|
||||
Image Image::SizeTopLeft() { return FBImg::sizetopleft(); }
|
||||
Image Image::SizeTop() { return FBImg::sizetop(); }
|
||||
Image Image::SizeTopRight() { return FBImg::sizetopright(); }
|
||||
Image Image::SizeLeft() { return FBImg::sizeleft(); }
|
||||
Image Image::SizeRight() { return FBImg::sizeright(); }
|
||||
Image Image::SizeBottomLeft() { return FBImg::sizebottomleft(); }
|
||||
Image Image::SizeBottom() { return FBImg::sizebottom(); }
|
||||
Image Image::SizeBottomRight() { return FBImg::sizebottomright(); }
|
||||
Image Image::Hand() { return FBImg::hand(); }
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_FB
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LTIMING(x) // RTIMING(x)
|
||||
|
||||
void SetSurface(SystemDraw& w, int x, int y, int cx, int cy, const RGBA *pixels)
|
||||
{
|
||||
GuiLock __;
|
||||
// Empty as CanSetSurface is false
|
||||
}
|
||||
|
||||
void SetSurface(SystemDraw& w, const Rect& dest, const RGBA *pixels, Size psz, Point poff)
|
||||
{
|
||||
GuiLock __;
|
||||
// Empty as CanSetSurface is false
|
||||
}
|
||||
|
||||
Image ImageDraw::Get(bool pm) const
|
||||
{
|
||||
ImageBuffer result(image.GetSize());
|
||||
const RGBA *e = image.End();
|
||||
const RGBA *p = ~image;
|
||||
RGBA *t = ~result;
|
||||
if(has_alpha) {
|
||||
const RGBA *a = ~alpha;
|
||||
while(p < e) {
|
||||
*t = *p++;
|
||||
(t++)->a = (a++)->r;
|
||||
}
|
||||
if(pm)
|
||||
Premultiply(result);
|
||||
result.SetKind(IMAGE_ALPHA);
|
||||
}
|
||||
else {
|
||||
while(p < e) {
|
||||
*t = *p++;
|
||||
(t++)->a = 255;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Draw& ImageDraw::Alpha()
|
||||
{
|
||||
has_alpha = true;
|
||||
return alpha_painter;
|
||||
}
|
||||
|
||||
|
||||
ImageDraw::ImageDraw(Size sz)
|
||||
: ImageDraw__(sz.cx, sz.cy),
|
||||
BufferPainter(image),
|
||||
alpha_painter(alpha)
|
||||
{
|
||||
has_alpha = false;
|
||||
}
|
||||
|
||||
ImageDraw::ImageDraw(int cx, int cy)
|
||||
: ImageDraw__(cx, cy),
|
||||
BufferPainter(image),
|
||||
alpha_painter(alpha)
|
||||
{
|
||||
has_alpha = false;
|
||||
}
|
||||
|
||||
#define IMAGECLASS FBImg
|
||||
#define IMAGEFILE <Framebuffer/FB.iml>
|
||||
#include <Draw/iml_source.h>
|
||||
|
||||
Image Image::Arrow() { return FBImg::arrow(); }
|
||||
Image Image::Wait() { return FBImg::wait(); }
|
||||
Image Image::IBeam() { return FBImg::ibeam(); }
|
||||
Image Image::No() { return FBImg::no(); }
|
||||
Image Image::SizeAll() { return FBImg::sizeall(); }
|
||||
Image Image::SizeHorz() { return FBImg::sizehorz(); }
|
||||
Image Image::SizeVert() { return FBImg::sizevert(); }
|
||||
Image Image::SizeTopLeft() { return FBImg::sizetopleft(); }
|
||||
Image Image::SizeTop() { return FBImg::sizetop(); }
|
||||
Image Image::SizeTopRight() { return FBImg::sizetopright(); }
|
||||
Image Image::SizeLeft() { return FBImg::sizeleft(); }
|
||||
Image Image::SizeRight() { return FBImg::sizeright(); }
|
||||
Image Image::SizeBottomLeft() { return FBImg::sizebottomleft(); }
|
||||
Image Image::SizeBottom() { return FBImg::sizebottom(); }
|
||||
Image Image::SizeBottomRight() { return FBImg::sizebottomright(); }
|
||||
Image Image::Hand() { return FBImg::hand(); }
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,45 +1,41 @@
|
|||
#ifndef _SDLFb_Local_h_
|
||||
#define _SDLFb_Local_h_
|
||||
|
||||
void FBInit();
|
||||
void FBDeInit();
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
#define GUI_APP_MAIN \
|
||||
void GuiMainFn_(); \
|
||||
\
|
||||
extern "C" int main(int argc, char *argv[]) { \
|
||||
UPP::AppInit__(argc, (const char **)argv); \
|
||||
FBInit(); \
|
||||
GuiMainFn_(); \
|
||||
UPP::Ctrl::CloseTopCtrls(); \
|
||||
FBDeInit(); \
|
||||
UPP::UsrLog("---------- About to delete this log of SDLFB..."); \
|
||||
UPP::DeleteUsrLog(); \
|
||||
return UPP::GetExitCode(); \
|
||||
} \
|
||||
\
|
||||
void GuiMainFn_()
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
#define GUI_APP_MAIN \
|
||||
void GuiMainFn_(); \
|
||||
\
|
||||
extern "C" int main(int argc, const char **argv, const char **envptr) { \
|
||||
UPP::AppInit__(argc, argv, envptr); \
|
||||
FBInit(); \
|
||||
GuiMainFn_(); \
|
||||
UPP::Ctrl::CloseTopCtrls(); \
|
||||
FBDeInit(); \
|
||||
UPP::UsrLog("---------- About to delete this log of SDLFB..."); \
|
||||
UPP::DeleteUsrLog(); \
|
||||
return UPP::GetExitCode(); \
|
||||
} \
|
||||
\
|
||||
void GuiMainFn_()
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#ifndef _SDLFb_Local_h_
|
||||
#define _SDLFb_Local_h_
|
||||
|
||||
void FBInit();
|
||||
void FBDeInit();
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
#define GUI_APP_MAIN \
|
||||
void GuiMainFn_(); \
|
||||
\
|
||||
extern "C" int main(int argc, char *argv[]) { \
|
||||
UPP::AppInit__(argc, (const char **)argv); \
|
||||
FBInit(); \
|
||||
GuiMainFn_(); \
|
||||
UPP::Ctrl::CloseTopCtrls(); \
|
||||
FBDeInit(); \
|
||||
return UPP::GetExitCode(); \
|
||||
} \
|
||||
\
|
||||
void GuiMainFn_()
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
#define GUI_APP_MAIN \
|
||||
void GuiMainFn_(); \
|
||||
\
|
||||
extern "C" int main(int argc, const char **argv, const char **envptr) { \
|
||||
UPP::AppInit__(argc, argv, envptr); \
|
||||
FBInit(); \
|
||||
GuiMainFn_(); \
|
||||
UPP::Ctrl::CloseTopCtrls(); \
|
||||
FBDeInit(); \
|
||||
return UPP::GetExitCode(); \
|
||||
} \
|
||||
\
|
||||
void GuiMainFn_()
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue