29 #include "saga2/rect.h" 52 return size.x * size.y;
67 return _size.x * _size.y;
78 _size.x = _size.y = 0;
102 if (_data) free(_data);
104 static void remap(gPen[]);
116 uint16 charXOffset[256];
128 gFont *LoadFont(
char *fontname);
129 void DisposeFont(
gFont *font);
130 int16 TextWidth(
gFont *font,
const char *s, int16 length, int16 styles);
131 int16 WhichChar(
gFont *font, uint8 *s, int16 length, int16 maxLen);
132 int16 WhichIChar(
gFont *font, uint8 *s, int16 length, int16 maxLen);
133 int32 GTextWrap(
gFont *font,
char *mark, uint16 &count, uint16 width, int16 styles);
161 kTextStyleOutline = (1 << 0),
162 kTextStyleShadow = (1 << 1),
163 kTextStyleUnderScore = (1 << 2),
164 kTextStyleUnderBar = (1 << 3),
165 kTextStyleHiLiteBar = (1 << 4),
166 kTextStyleThickOutline = (1 << 5),
167 kTextStyleBold = (1 << 6),
168 kTextStyleItalics = (1 << 7)
172 kTextPosLeft = (1 << 0),
173 kTextPosRight = (1 << 1),
174 kTextPosHigh = (1 << 2),
175 kTextPosLow = (1 << 3)
208 _drawMode = kDrawModeMatte;
212 _fgPen = _bgPen = _olPen = _shPen = 0;
219 virtual void setMap(
gPixelMap *newmap,
bool inverted =
false);
223 void setColor(gPen color) {
226 void setBgColor(gPen color) {
229 void setShadowColor(gPen color) {
232 void setOutlineColor(gPen color) {
238 void setPenMap(gPen *pmap) {
241 void setIndirectColor(uint8 color) {
242 _fgPen = _penMap[color];
244 void setIndirectBgColor(uint8 color) {
245 _bgPen = _penMap[color];
247 void setIndirectShColor(uint8 color) {
248 _shPen = _penMap[color];
250 void setIndirectOLColor(uint8 color) {
251 _olPen = _penMap[color];
256 void setMode(DrawModes mode) {
259 void setStyle(
int style) {
270 void setClip(
const Rect16 &newclip) {
286 void move(int16 x, int16 y) {
293 void moveTo(int16 x, int16 y) {
304 virtual void clear() {
305 memset(_map->_data, (
int)_fgPen, (
int)_map->bytes());
312 virtual void setPixel(int16 x, int16 y, gPen color) {
313 if (x >= _clip.x && x < _clip.x + _clip.width
314 && y >= _clip.y && y < _clip.y + _clip.height) {
315 _baseRow[(y + _origin.y) * _rowMod + x + _origin.x] = color;
318 void setPixel(int16 x, int16 y) {
319 setPixel(x, y, _fgPen);
321 void setPixel(
Point16 p, gPen color) {
322 setPixel(p.x, p.y, color);
325 setPixel(p.x, p.y, _fgPen);
330 virtual gPen getPixel(int16 x, int16 y) {
331 return _baseRow[(y + _origin.y) * _rowMod + x + _origin.x];
333 virtual gPen getPixel(
Point16 p) {
334 return _baseRow[(p.y + _origin.y) * _rowMod + p.x + _origin.x];
339 virtual void fillRect(
const Rect16 r);
340 void fillRect(int16 x, int16 y, int16 w, int16 h) {
341 fillRect(
Rect16(x, y, w, h));
345 virtual void frameRect(
const Rect16 r, int16 thick);
346 void frameRect(int16 x, int16 y, int16 w, int16 h, int16 thick) {
347 frameRect(
Rect16(x, y, w, h), thick);
352 virtual void hLine(int16 x, int16 y, int16 width);
353 virtual void vLine(int16 x, int16 y, int16 height);
357 virtual void line(int16 x1, int16 y1, int16 x2, int16 y2);
359 line(from.x, from.y, to.x, to.y);
361 void drawTo(int16 x, int16 y) {
362 line(_penPos.x, _penPos.y, x, y);
370 void draw(int16 x, int16 y) {
371 line(_penPos.x, _penPos.y, _penPos.x + x, _penPos.y + y);
382 virtual void bltPixels(
const gPixelMap &src,
383 int src_x,
int src_y,
384 int dst_x,
int dst_y,
385 int width,
int height);
387 virtual void bltPixelMask(
gPixelMap &src,
389 int src_x,
int src_y,
390 int dst_x,
int dst_y,
391 int width,
int height);
393 virtual void scrollPixels(
const Rect16 r,
int dx,
int dy);
397 void setFont(
gFont *newFont) {
400 void setTextSpacing(int16 fs) {
406 void drawStringChars(
const char *, int16,
gPixelMap &,
int,
int);
408 int16 drawClippedString(
const char *str, int16 len,
int xpos,
int ypos);
414 void drawText(
const char *str, int16 length = -1);
415 void drawTextInBox(
const char *str, int16 length,
416 const Rect16 &r, int16 pos,
420 void mapImage(
gPort &from,
gPort &to, gPen map[]);
423 bool NewTempPort(
gPort &,
int width,
int height);
424 void DisposeTempPort(
gPort &);
436 port.getState(state);
439 port.setState(state);
443 #define SAVE_GPORT_STATE(p) gSavePort sp( p )
Out move(In first, In last, Out dst)
Definition: algorithm.h:109