46 for (
int b = 0; b <= 255; b++) {
48 (*tab)[b] = (Uint8) (offset + size - 1 - ( 0.299 * (*pal)[b][0] + 0.587 * (*pal)[b][1] + 0.114 * (*pal)[b][2]) * size / 64 );
55 if (hd->
id == 16973) {
60 height = hd->
size + 1;
70 return hd->
size +
sizeof(*hd);
73 height = hd->
size + 1;
74 return height*width+4;
91 line(x1, y1, x1, y2, col);
92 line(x1, y1, x2, y1, col);
95 line(x2, y1, x2, y2, col);
96 line(x1, y2, x2, y2, col);
101 int i, deltax, deltay, numpixels, d, dinc1, dinc2, x, xinc1, xinc2, y, yinc1, yinc2;
115 if (deltax >= deltay)
119 numpixels = deltax + 1;
120 d = (2 * deltay) - deltax;
122 dinc2 = (deltay - deltax) << 1;
132 numpixels = deltay + 1;
133 d = (2 * deltax) - deltay;
135 dinc2 = (deltax - deltay) << 1;
159 for (i = 1; i <= numpixels; i++)
190 float yy1, yy2, xx1, xx2;
195 for (w=y1;w<=y2 ;w++ )
200 for (w=x1;w<=x2 ;w++ )
207 m = (yy2 - yy1) / (xx2 - xx1);
209 if ((m <= 1) && (m >= -1)) {
218 for (w = x1; w <= x2; w++)
219 putpixel(w, (
int) (m * w + b), actcol);
230 for (w = y1; w <= y2; w++) {
231 putpixel((
int) ((w - b) / m), w, actcol);
251 float yy1, yy2, xx1, xx2;
254 for (w=y1;w<=y2 ;w++ ) {
262 m = (yy2 - yy1) / (xx2 - xx1);
264 if ((m <= 1) && (m >= -1)) {
273 for (w = x1; w <= x2; w++) {
285 for (w = y1; w <= y2; w++) {
286 putpixel((
int) ((w - b) / m), w,
getpixel ( (
int) ((w - b) / m), w ) ^ actcol);
305 line(x1, y1, x1, y2, color);
306 line(x1, y1, x2, y1, color);
307 line(x2, y1, x2, y2, color);
308 line(x1, y2, x2, y2, color);
339 Uint8* buf = (Uint8*) vbuf;
346 if ( hd->
id == 16973 ) {
355 buf +=
sizeof ( *hd );
361 for (
int c = 0; c < hd->
size; c++ ) {
362 if ( *buf == hd->
rle ) {
363 for (
int i = buf[1]; i > 0; i-- ) {
364 if ( !(linecount & 1) && !(rowcount & 1)) {
369 if ( rowcount > hd->
x ) {
379 if ( !(linecount & 1) && !(rowcount & 1)) {
385 if ( rowcount > hd->
x ) {
398 Uint16* wp2 = (Uint16*) vbuf;
409 for (
int c = (wp2[0] + 1) * (wp2[1] + 1); c > 0; c-- ) {
410 if ( !(linecount & 1) && !(rowcount & 1)) {
416 if ( rowcount > wp2[0] ) {
429 Uint16* w = (Uint16*) ptr;
430 Uint8* c = (Uint8*) ptr + 4;
436 for (
int y = w[1] + 1; y > 0; y-- ) {
437 for (
int x = w[0]+1; x > 0; x-- ) {
449 void putpicturemix (
int x1,
int y1,
void* ptr,
int rotation, Uint8* mixbuf )
451 Uint16* w = (Uint16*) ptr;
452 Uint8* c = (Uint8*) ptr + 4;
458 for (
int y = w[1] + 1; y > 0; y-- ) {
459 for (
int x = w[0]+1; x > 0; x-- ) {
462 if ( *c >= 16 && *c < 24 )
463 *buf = mixbuf[o + *c + rotation];
465 *buf = mixbuf[o + *c];
479 Uint16* w = (Uint16*) ptr;
480 Uint8* c = (Uint8*) ptr + 4;
486 for (
int y = w[1] + 1; y > 0; y-- ) {
487 for (
int x = w[0]+1; x > 0; x-- ) {
490 if ( *c >= 16 && *c < 24 )
491 *buf = *c + rotation;
508 Uint16* sw = (Uint16*) s;
509 Uint8* sc = (Uint8*) s + 4;
511 Uint16* dw = (Uint16*) d;
512 Uint8* dc = (Uint8*) d + 4;
523 for (
int y = 0; y <= dw[1]; y++)
524 for (
int x = 0; x <= dw[0]; x++)
525 dc[ y * dl + x] = sc[ ( sh - x - 1 ) * sl + y];
543 if ( x < 0 || x >= xs || y < 0 || y >= ys )
546 Uint8* pc = (Uint8*) image;
547 return pc[ 4 + y * xs + x];
551 const float pi = 3.14159265;
558 float angle = ((float)organgle) / 360 * 2 * pi +
pi;
560 Uint8* dst =
new Uint8[
imagesize ( 0, 0, fieldxsize, fieldysize ) ];
561 Uint16* wp = (Uint16*) dst;
562 wp[0] = fieldxsize-1;
563 wp[1] = fieldysize-1;
565 Uint8* pnt = dst + 4;
569 int dx = x - fieldxsize/2 ;
570 int dy = fieldysize/2 - y;
573 if ( organgle != 0 && organgle != -180 && organgle != 180) {
576 wnk = atan2 (
double(dy),
double(dx) );
584 float radius = sqrt (
double(dx * dx + dy * dy ));
586 nx = radius * cos ( wnk );
587 ny = radius * sin ( wnk );
589 if ( organgle == 0 ) {
593 if ( organgle == 180 || organgle == -180) {
618 float angle = ((float)organgle) / 360 * 2 * pi +
pi;
620 int d = int(sqrt(
double(fieldxsize*fieldxsize + fieldysize*fieldysize )));
622 Uint8* dst =
new Uint8[
imagesize ( 0, 0, d,d ) ];
623 Uint16* wp = (Uint16*) dst;
627 Uint8* pnt = dst + 4;
629 for (
int y = 0; y < d; y++ ) {
630 for (
int x = 0; x < d; x++ ) {
635 if ( organgle != 0 && organgle != -180 && organgle != 180) {
638 wnk = atan2 (
double(dy),
double(dx) );
646 float radius = sqrt (
double(dx * dx + dy * dy ));
648 nx = radius * cos ( wnk );
649 ny = radius * sin ( wnk );
651 if ( organgle == 0 ) {
655 if ( organgle == 180 || organgle == -180) {
677 Uint16* sw = (Uint16*) s;
678 Uint8* sc = (Uint8*) s + 4;
680 Uint16* dw = (Uint16*) d;
681 Uint8* dc = (Uint8*) d + 4;
690 for (
int y = 0; y <= dw[1]; y++)
691 for (
int x = 0; x <= dw[0]; x++)
692 dc[ y * sl + x] = sc[ y * sl + ( sl - 1 - x ) ];
694 for (
int y = 0; y <= dw[1]; y++)
695 for (
int x = 0; x <= dw[0]; x++)
696 dc[ y * sl + x] = sc[ ( sh - 1 - y) * sl + x ];
725 int alpha = color >> 24;
800 Uint16* wp = (Uint16*) buf;
801 if ( x > wp[0] || y > wp[1] || x < 0 || y < 0 )
804 Uint8* pc = (Uint8*) buf;
805 return pc[4 + x + y * (wp[0]+1) ];
819 pix[ x + y * xsize ] = _pix;
825 return pix[ x + y * xsize ];
841 #define f2i(x) (int(x))
842 #define f2i2(x) (int(x+0.5))
856 for (
int y = 0; y < src->
getysize(); y++ )
857 for (
int x = 0; x < src->
getxsize(); x++ ) {
863 for (
int a = -1; a <= 1; a++ )
864 for (
int bb = -1; bb <= 1; bb++ ) {
867 if ( nx >= 0 && ny >= 0 && nx < src->getxsize() && ny < src->
getysize()) {
878 dst->
setpix ( x, y, r/cnt, g/cnt, b/cnt, 0 );
886 #define sqr(a) (a)*(a)
887 #define cub(a) abs ((a)*(a)*(a))
898 return ((x2 - x1 + 1) * (y2 - y1 + 1) + 4);
905 if ( truecolor2pal_table[0] == 255 ) {
907 if ( !ff.getnextname().empty() ) {
909 stream.readdata ( truecolor2pal_table,
sizeof ( truecolor2pal_table ));
911 for (
int r = 0; r < 64; r++ )
912 for (
int g = 0; g < 64; g++ )
913 for (
int b = 0; b < 64; b++ ) {
914 int sml = r + ( g << 6) + ( b << 12 );
916 int diff = 0xFFFFFFF;
919 for (
int k=0;k<256 ;k++ ) {
920 int actdif =
sqr( pal[k][0] - r ) +
sqr( pal[k][1] - g ) +
sqr( pal[k][2] - b );
927 truecolor2pal_table[sml] = pix1;
937 Uint8* newimg =
new Uint8[ size ] ;
938 Uint8* start = newimg;
939 Uint16* wp = (Uint16*) newimg;
945 for (
int y = 0; y <= wp[1]; y++ )
946 for (
int x = 0; x <= wp[0]; x++ ) {
953 *newimg = truecolor2pal_table[sml];
961 if ( newimg - start > size )
968 strcpy ( st, strng );
975 void putmask (
int x1,
int y1,
void* vbuf,
int newtransparence )
980 Uint16* wp = (Uint16*) vbuf;
983 Uint8* img = (Uint8*) vbuf + 4;
985 for (
int y = 0; y <= wp[1]; y++ ) {
988 for (
int x = 0; x <= wp[0]; x++ ) {
989 if ( *img != newtransparence )
1004 if (hd->
id == 16973) {
1010 void* newbuf =
malloc ( w * h + 4 );
1011 Uint16* wp = (Uint16*) newbuf;
1012 Uint8* dest = (Uint8*) newbuf;
1017 Uint8* buf = (Uint8*) pict;
1018 buf +=
sizeof ( *hd );
1020 for (
int c = 0; c < hd->
size; c++ ) {
1021 if ( *buf == hd->
rle ) {
1022 for (
int i = buf[1]; i > 0; i-- ) {
1043 void ellipse (
int x1,
int y1,
int x2,
int y2,
int color,
float tolerance )
1047 int midx = (x1 + x2) / 2;
1048 int midy = (y1 + y2) / 2;
1052 tolerance = tolerance / (xr+yr) * 80;
1057 for (
int y = y1; y <= y2; y++ )
1058 for (
int x = x1; x <= x2; x++ ) {
1059 float dx = x - midx;
1060 float dy = y - midy;
1061 float tmp = dx*dx/xr + dy*dy/yr;
1063 if ( tmp <= 1 + tolerance && tmp >= 1 - tolerance )
1084 #ifdef use_truecolor2pal
1085 memset ( truecolor2pal_table, 255,
sizeof ( truecolor2pal_table ));
1094 void tvirtualdisplay :: init (
int x,
int y,
int color,
int depth )
1098 Uint8* cbuf = (Uint8*)
malloc ( x * y * depth/8 );
1103 for (
int i = 0; i < (x*y*depth/8); i++ )
1116 if ( depth ==24 || depth==32 ) {
1123 surface = agmp->
surface =
new Surface ( Surface::CreateSurface( buf, x, y, depth, 0xff, 0xff00, 0xff0000) );
1138 init ( x, y, 0, 8 );
1143 init ( x, y, color, depth );
1239 void bar(
int x1,
int y1,
int x2,
int y2, Uint8 color)
1245 for (
int y = y1; y <= y2; y++ ) {
1246 for (
int x = x1; x <= x2; x++ )
1256 void getimage(
int x1,
int y1,
int x2,
int y2,
void *buffer)
1262 Uint8* cb = (Uint8*) buffer;
1263 Uint16* wb = (Uint16*) buffer;
1269 for (
int y = y1; y <= y2; y++ ) {
1270 for (
int x = x1; x <= x2; x++ )
1282 Uint8* src = (Uint8*) img;
1289 if ( hd->
id == 16973 ) {
1295 src +=
sizeof ( *hd );
1298 for (
int c = 0; c < hd->
size; c++ ) {
1299 if ( *src == hd->
rle ) {
1301 for (
int i = src[1]; i > 0; i-- )
1308 *(buf++) = *(src++);
1318 Uint16* w = (Uint16*) img;
1322 for (
int y = w[1] + 1; y > 0; y-- ) {
1323 for (
int x = w[0]+1; x > 0; x-- )
1324 *(buf++) = *(src++);
1336 for (
int y = 0; y < tci->
getysize(); y++ )
1337 for (
int x = 0; x < tci->
getxsize(); x++ ) {
1345 for (
int y = 0; y < tci->
getysize(); y++ )
1346 for (
int x = 0; x < tci->
getxsize(); x++ ) {
1363 for (
int y = 0; y < tci->
getysize(); y++ )
1364 for (
int x = 0; x < tci->
getxsize(); x++ ) {
1377 Uint8* src = (Uint8*) pic;
1383 if ( hd->
id == 16973 ) {
1387 src +=
sizeof ( *hd );
1390 for (
int c = 0; c < hd->
size; c++ ) {
1391 if ( *src == hd->
rle ) {
1393 for (
int i = src[1]; i > 0; i-- ) {
1394 if ( src[2] != 255 )
1395 *buf = xlattables[ src[2] * 256 + *buf ];
1404 *buf = xlattables[ *(src++) * 256 + *buf ];
1417 Uint16* w = (Uint16*) pic;
1422 for (
int y = w[1] + 1; y > 0; y-- ) {
1423 for (
int x = w[0]+1; x > 0; x-- ) {
1425 *buf = xlattables[ *(src++) * 256 + *buf ];
1441 Uint8* src = (Uint8*) pic;
1446 if ( hd->
id == 16973 ) {
1449 src +=
sizeof ( *hd );
1452 for (
int c = 0; c < hd->
size; c++ ) {
1453 if ( *src == hd->
rle ) {
1455 if ( src[2] != 255 ) {
1456 for (
int i = src[1]; i > 0; i-- )
1477 Uint16* w = (Uint16*) pic;
1481 for (
int y = w[1] + 1; y > 0; y-- ) {
1482 for (
int x = w[0]+1; x > 0; x-- ) {
1498 Uint8* src = (Uint8*) pic;
1504 if ( hd->
id == 16973 ) {
1508 src +=
sizeof ( *hd );
1511 for (
int c = 0; c < hd->
size; c++ ) {
1512 if ( *src == hd->
rle ) {
1516 if ( d >= 16 && d < 24 )
1518 for (
int i = src[1]; i > 0; i-- )
1529 if ( d >= 16 && d < 24 )
1544 Uint16* w = (Uint16*) pic;
1548 for (
int y = w[1] + 1; y > 0; y-- ) {
1549 for (
int x = w[0]+1; x > 0; x-- ) {
1552 if ( d >= 16 && d < 24 )
1569 Uint16* w = (Uint16*) pic;
1576 for (
int y = 0; y <= w[0] ; y++ ) {
1577 for (
int x = 0; x <= w[1]; x++ ) {
1579 if ( d != 255 && d != -1) {
1580 if ( d >= 16 && d < 24 )
1596 Uint16* w = (Uint16*) pic;
1603 for (
int y = 0; y <= w[1] ; y++ ) {
1604 for (
int x = 0; x <= w[0]; x++ ) {
1606 if ( d != 255 && d != -1) {
1607 if ( d >= 16 && d < 24 )
1623 Uint16* w = (Uint16*) pic;
1630 for (
int y = 0; y <= w[1] ; y++ ) {
1631 for (
int x = 0; x <= w[0]; x++ ) {
1633 if ( d != 255 && d != -1) {
1634 if ( d >= 16 && d < 24 )
1648 void puttexture (
int x1,
int y1,
int x2,
int y2,
void *texture )
1651 Uint8* c = (Uint8*) texture;
1657 for (
int y = y1 ; y <= y2; y++ ) {
1658 for (
int x = x1; x <= x2 ; x++ ) {
1659 buf[offset] = c[offset];
1663 offset+=spacelength;
1673 Uint8* c = (Uint8*) texture;
1679 for (
int y = y1 ; y <= y2; y++ ) {
1680 for (
int x = x1; x <= x2 ; x++ ) {
1681 Uint8 d = c[offset];
1687 offset+=spacelength;
1693 void putimageprt (
int x1,
int y1,
int x2,
int y2,
void *texture,
int dx,
int dy )
1700 for (
int y = y1; y <= y2 ; y++ ) {
1701 for (
int x = x1; x <= x2; x++ ) {
1735 Uint8* buf = (Uint8*) vbuf;
1737 Uint16* wp = (Uint16*) xlatbuffer;
1738 Uint8* dest = (Uint8*) xlatbuffer;
1742 if ( hd->
id == 16973 ) {
1743 memcpy ( xlatbuffer, vbuf,
sizeof ( *hd ));
1748 dest +=
sizeof ( *hd );
1749 buf +=
sizeof ( *hd );
1751 for (
int c = 0; c < hd->
size; c++ )
1752 if ( *buf == hd->
rle ) {
1753 *(dest++) = *(buf++);
1754 *(dest++) = *(buf++);
1755 *(dest++) = (*xl)[ *(buf++) ];
1760 int newpix = (*xl)[ *(buf++) ];
1761 if ( newpix == hd->
rle ) {
1762 *(dest++) = hd->
rle;
1764 *(dest++) = hd->
rle;
1765 desthead->
size += 2;
1771 Uint16* wp2 = (Uint16*) vbuf;
1782 for (
int c = (wp2[0] + 1) * (wp2[1] + 1); c > 0; c-- ) {
1783 *dest = (*xl)[ *buf ];
1797 while ( ! (a & 1)) {
1806 void showtext (
const char* text,
int x,
int y,
int textcol )
1816 int extraheight = 0;
1826 const Uint8* t = (Uint8*) text;
1829 Uint8* characterpointer[1024];
1830 int characterwidth[1024];
1831 int characterdist[1024];
1840 characterdist[ps] = 0;
1842 length += characterdist[ps];
1847 int leftextralength = 0;
1848 int rightextralength = 0;
1851 leftextralength = rightextralength = 0;
1854 leftextralength = 0;
1858 rightextralength = 0;
1867 rightextralength = 0;
1868 leftextralength = 0;
1873 rightextralength = 0;
1877 leftextralength = 0;
1883 collategraphicoperations cgo ( x, y, x +length + leftextralength + rightextralength, y + fontheight + extraheight );
1885 int suppressbkgr = 0;
1886 int spacelength = agmp->
scanlinelength - (length + leftextralength + rightextralength);
1888 spacelength += leftextralength + rightextralength;
1889 fb += leftextralength;
1890 leftextralength = rightextralength = 0;
1893 for (
int yl = 0; yl < fontheight; yl++ ) {
1894 if ( leftextralength )
1895 for (
int i = 0; i < leftextralength; i++ )
1900 while ( x < length ) {
1902 for ( cx = characterwidth[ps]; cx > 0 && x < length; cx--) {
1903 int pix = *(characterpointer[ps]++);
1905 if ( textcol != -1 )
1920 if ( characterdist[ps] > 0 ) {
1921 for (
int i = characterdist[ps]; i && x < length; i-- ) {
1928 fb += characterdist[ps];
1929 x += characterdist[ps];
1930 suppressbkgr = -characterdist[ps];
1933 characterpointer[ps] += cx;
1938 if ( rightextralength )
1939 for (
int i = 0; i < rightextralength; i++ )
1945 for (
int yl = extraheight; yl > 0; yl-- ) {
1946 for (
int x = length + leftextralength + rightextralength; x > 0; x-- )
1960 showtext ( text.c_str(), x, y, -1 );
1963 #ifdef use_truecolor2pal
1964 void* convertSurface ( SDLmm::Surface& s,
bool paletteTranslation )
1968 Uint8* buf =
new Uint8[
imagesize ( 1, 1, s.w(), s.h())];
1969 Uint16* wp = (Uint16*) buf;
1972 SDLmm::PixelFormat fmt = s.GetPixelFormat();
1973 if ( fmt.BytesPerPixel() == 1 && !paletteTranslation ) {
1974 for (
int y = 0; y < s.h(); y++ )
1975 for (
int x = 0; x < s.w(); x++ )
1976 buf[4 + s.w()*y+x] = s.GetPixel ( x, y );
1980 for (
int y = 0; y < s.h(); y++ )
1981 for (
int x = 0; x < s.w(); x++ ) {
1983 fmt.GetRGBA ( s.GetPixel ( x, y ),
red,
green,
blue, alpha);
1986 buf[4 + s.w()*y+x] = 255;
1988 buf[4 + s.w()*y+x] = truecolor2pal_table[ (red >> 2) +
1989 (( green >> 2) << 6) +
1990 (( blue >> 2) << 12) ];
2001 const float pi = 3.14159265;
2002 double angle = double(-degrees) / 360 * 2 *
pi;
2004 double dx = pos.x - width/2 ;
2005 double dy = height/2 - pos.y;
2007 if ( degrees == 0 ) {
2011 if ( degrees == 180 || degrees == -180) {
2017 wnk = atan2 ( -dx, dy );
2025 float radius = sqrt ( dx * dx + dy * dy );
2027 nx = -radius * sin ( wnk );
2028 ny = radius * cos ( wnk );
2031 return SPoint(
int( width/2 + nx),
int ( -ny + height/2));
tgraphmodeparameters activegraphmodeparameters
void xorline(int x1, int y1, int x2, int y2, Uint8 actcol)
draws a simple line on the screen, but performs a XOR operation between the pixel already on screen a...
int loga2(int a)
returns the position of the lowest bit of a which is set. This equals an inter logarithm to the base ...
tfontsettings activefontsettings
collategraphicoperations(void)
void * halfpict(void *vbuf)
reduces a pictures size.
tgraphmodeparameters * hgmp
miscellaneous functions which are used by ASC and all its tools
void putrotspriteimage270(int x1, int y1, void *pic, int rotationvalue)
like putspriteimage, but rotates the image by 270 clock-wise
char * convertimage(TrueColorImage *img, dacpalette256 pal)
the truecolor image img is reduced to 8 bit color using the palette pal.
void showtext2c(const ASCString &text, int x, int y)
void putimage_noalpha(int x1, int y1, TrueColorImage *tci)
Uint8 bitperpix
the size of a pixel(?) in bits
void putimage(int x1, int y1, void *img)
puts the image pointed to by buffer to the screen
trgbpixel getpix(int x, int y)
void putrotspriteimage90(int x1, int y1, void *pic, int rotationvalue)
like putspriteimage, but rotates the image by 90 clock-wise
void putrotspriteimage180(int x1, int y1, void *pic, int rotationvalue)
like putspriteimage, but rotates the image by 180 clock-wise
void xorrectangle(int x1, int y1, int x2, int y2, Uint8 color)
draws a simple rectangle on the screen, but performs a XOR operation between the pixel already on scr...
dacpalette256 activepalette
Uint8 bluefieldposition
RGB only: the position of the first blue bit relative to the start of the pixel.
void putmask(int x1, int y1, void *vbuf, int newtransparence)
puts an image on the screen , with all pixels of newtransparence treated as transparent.
void putspritetexture(int x1, int y1, int x2, int y2, void *texture)
Puts a part of texture on the screen.
Uint8 * rotatepict_grw(void *image, int organgle)
rotates the picture image by angle clockwise.
Uint8 bluemasksize
RGB only: the number of bits in the blue component.
void start(int x1, int y1, int x2, int y2)
void putinterlacedrotimage(int x1, int y1, void *ptr, int rotation)
obsolete. not used any more. can be removed.
void bar(int x1, int y1, int x2, int y2, Uint8 color)
paints a colored bar
int resolutiony
the number of visible pixels in y direction
unsigned long PointerSizedInt
struct trgbpixel::@1::@3 channel
Global platform dependant definitions. This file just branches to the platform specific files in thei...
tgraphmodeparameters * agmp
int getpixelfromimage(void *buf, int x, int y)
returns the pixel at position x/y of the image buf or -1 if the pixel does not exist ...
The ASCString class provides an abstract way to manipulate strings.
void flippict(void *s, void *d, int dir)
mirrors a picture horizontally (dir=1) or vertically (dir=0).
void copybuf2displaymemory(int size, void *buf)
int directscreenaccess
if 0 no call to an update function (which copies the buffer to the screen) is performed ...
int getpixel8(int x1, int y1)
void putspriteimage(int x1, int y1, void *pic)
puts the image pointed to by buffer on the screen. All pixels with color #255 are treated as transpar...
void rahmen(bool invers, int x1, int y1, int x2, int y2)
paints a pseudo-3D rectangle on the screen.
int getpixel(int x1, int y1)
gets the color of a single pixel from the screen. This is one of the few functions that work in truec...
virtual void putpix(int x, int y)=0
void copySurface2screen(void)
when using SDL, all operations are not performed on the displaymemory itself (as is the case with DOS...
TrueColorImage * smoothimage(TrueColorImage *src)
Uint8 redmasksize
RGB only: the number of bits in the red component.
int scanlinenumber
the number of lines (may be larger than resolutiony due to offscreen memory)
void puttexture(int x1, int y1, int x2, int y2, void *texture)
function not used any more and obsolete. Use putimageprt instead
TrueColorImage(int x, int y)
Uint8 greenfieldposition
RGB only: the position of the first green bit relative to the start of the pixel. ...
~collategraphicoperations()
signed char kerning[256][256]
A class for a single pixel.
PointerSizedInt linearaddress
the pointer to the actual memory (typecast to char* )
Uint8 greenmasksize
RGB only: the number of bits in the green component.
void putpixel(int x1, int y1, int color)
puts a single pixel on the screen. This is one of the few functions that work in truecolor mode too ...
The interface for the various streams that ASC offers, like file and memory streams.
void putxlatfilter(int x1, int y1, void *pic, Uint8 *xlattables)
int byteperpix
the distance between two pixel
void generategrayxlattable(ppixelxlattable tab, Uint8 offset, Uint8 size, dacpalette256 *pal)
A translation table ( to be used by xlatpict ) is generated to translate any color of palette pal to ...
void putpixel8(int x1, int y1, int color)
void putimageprt(int x1, int y1, int x2, int y2, void *texture, int dx, int dy)
copies a part of texture to the screen.
tpixelxlattable * ppixelxlattable
void showtext2(const ASCString &text, int x, int y)
void assignDefaultPalette()
assigns the default ASC palette to the surface (only for 8 Bit surfaces)
basegfx.h is the interface for the legacy graphic routines (of which some are platform dependent)...
int imagesize(int x1, int y1, int x2, int y2)
returns the size for a buffer that can contain an image of the given size.
void rotatepict90(void *s, void *d)
rotates the image s by 90 clockwise and writes it to d.
void * uncompress_rlepict(void *pict)
uncompresses the RLE-compressed image pict.
void putpicturemix(int x1, int y1, void *ptr, int rotation, Uint8 *mixbuf)
void ellipse(int x1, int y1, int x2, int y2, int color, float tolerance)
paints an ellipse on the screen that fills the rectangle x1/y1 - x2/y2.
void showtext(const char *text, int x, int y, int textcol)
void setpix(int x, int y, int r, int g, int b, int alpha=0)
void putrotspriteimage(int x1, int y1, void *pic, int rotationvalue)
like putspriteimage, but all color with an 16 <= colorIndex <= 23 are increased by rotationvalue...
int resolutionx
the number of visible pixels in x direction
int getimagepixel(void *image, int x, int y)
Uint8 redfieldposition
RGB only: the position of the first red bit relative to the start of the pixel.
class tinitgfxengine initgfx
tcharacter character[256]
int getpicsize2(void *hd2)
returns the size that the picture p occupies in memory
dacpalette256 * activepalette256
int scanlinelength
the size of a line in byte (may be larger than resolutionx due to offscreen memory) ...
void getimage(int x1, int y1, int x2, int y2, void *buffer)
copy an image to a buffer. buffer must have been alloced before with malloc ( imagesize ( x1...
Uint8 dacpalette256[256][3]
int windowstatus
determines whether the memory is a linear (windowstatus==100) or paged. When using SDL...
Uint8 * rotatepict(void *image, int organgle)
rotates the picture image by angle clockwise.
a class that is thrown as exception. Should be moved to error.h ...
void getpicsize(void *hd2, int &width, int &height)
write the dimension of the image p to width and height
SPoint getPixelRotationLocation(SPoint pos, int width, int height, int degrees)
transforms the coordinate for an image rotation
tgraphmodeparameters hardwaregraphmodeparameters
Collects all graphic operations and updates the screen on destruction When porting ASC from DOS to SD...
tvirtualdisplay(int x, int y)
void rectangle(int x1, int y1, int x2, int y2, Uint8 color)
draws a simple rectangl
int bytesperscanline
the size of a line in byte
void line(int x1, int y1, int x2, int y2, Uint8 actcol)
draws a simple line on the screen. Not very fast...
A class for a RGB image. Was an attempt to rewrite the graphics engine, but should be scrapped...