#include <cstring>
#include <cstdlib>
#include <math.h>
#include "global.h"
#include "basegfx.h"
#include "misc.h"
#include "newfont.h"
#include "sdl/graphics.h"
#include "basestrm.h"
Include dependency graph for basegfx.cpp:

Go to the source code of this file.
Classes | |
| union | tpix |
| class | tinitgfxengine |
Defines | |
| #define | f2i(x) (int(x)) |
| #define | f2i2(x) (int(x+0.5)) |
| #define | sqr(a) (a)*(a) |
| #define | cub(a) abs ((a)*(a)*(a)) |
Typedefs | |
| typedef tpix | timage [100][100] |
Functions | |
| void | generategrayxlattable (ppixelxlattable tab, char offset, char size, dacpalette256 *pal) |
| A translation table ( to be used by xlatpict ) is generated to translate any color of palette pal to its gray value. | |
| void | getpicsize (void *hd2, int &width, int &height) |
| write the dimension of the image p to width and height | |
| int | getpicsize2 (void *hd2) |
| returns the size that the picture p occupies in memory | |
| void | rahmen (bool invers, int x1, int y1, int x2, int y2) |
| paints a pseudo-3D rectangle on the screen. | |
| void | line (int x1, int y1, int x2, int y2, char actcol) |
| draws a simple line on the screen. Not very fast... | |
| void | xorline (int x1, int y1, int x2, int y2, char actcol) |
| draws a simple line on the screen, but performs a XOR operation between the pixel already on screen and color. | |
| void | rectangle (int x1, int y1, int x2, int y2, char color) |
| draws a simple rectangl | |
| void | xorrectangle (int x1, int y1, int x2, int y2, char color) |
| draws a simple rectangle on the screen, but performs a XOR operation between the pixel already on screen and color. | |
| void * | halfpict (void *vbuf) |
| reduces a pictures size. | |
| void | putpicturemix (int x1, int y1, void *ptr, int rotation, char *mixbuf) |
| puts the image ptr on the screen, mixing it with the colors there. | |
| void | putinterlacedrotimage (int x1, int y1, void *ptr, int rotation) |
| obsolete. not used any more. can be removed. | |
| void | rotatepict90 (void *s, void *d) |
| rotates the image s by 90 clockwise and writes it to d. | |
| int | getimagepixel (void *image, int x, int y) |
| char * | rotatepict (void *image, int organgle) |
| rotates the picture image by angle clockwise. | |
| char * | rotatepict_grw (void *image, int organgle) |
| rotates the picture image by angle clockwise. | |
| void | flippict (void *s, void *d, int dir) |
| mirrors a picture horizontally (dir=1) or vertically (dir=0). | |
| void | putpixel8 (int x1, int y1, int color) |
| int | getpixel8 (int x1, int y1) |
| 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 | |
| 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 truecolor mode too | |
| 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 | |
| TrueColorImage * | smoothimage (TrueColorImage *src) |
| 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 | putmask (int x1, int y1, void *vbuf, int newtransparence) |
| puts an image on the screen , with all pixels of newtransparence treated as transparent. | |
| void * | uncompress_rlepict (void *pict) |
| uncompresses the RLE-compressed image pict. | |
| 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 | copySurface2screen (void) |
| when using SDL, all operations are not performed on the displaymemory itself (as is the case with DOS), but on a buffer. | |
| void | copySurface2screen (int x1, int y1, int x2, int y2) |
| void | bar (int x1, int y1, int x2, int y2, char color) |
| paints a colored bar | |
| 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,y1,x2,y2 )) | |
| void | putimage (int x1, int y1, void *img) |
| puts the image pointed to by buffer to the screen | |
| void | putimage (int x1, int y1, TrueColorImage *tci) |
| puts the image pointed to by tci to the screen. Both must be truecolor images. This function is a quick and unoptimized hack! | |
| void | putimage_noalpha (int x1, int y1, TrueColorImage *tci) |
| TrueColorImage * | getimage (int x1, int y1, int x2, int y2) |
| void | putxlatfilter (int x1, int y1, void *pic, char *xlattables) |
| puts the image in pictbuffer on the screen performing a color translation. | |
| 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 transparent | |
| void | putrotspriteimage (int x1, int y1, void *pic, int rotationvalue) |
| like putspriteimage, but all color with an 16 <= colorIndex <= 23 are increased by rotationvalue. | |
| 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 | putrotspriteimage270 (int x1, int y1, void *pic, int rotationvalue) |
| like putspriteimage, but rotates the image by 270 clock-wise | |
| void | puttexture (int x1, int y1, int x2, int y2, void *texture) |
| function not used any more and obsolete. Use putimageprt instead | |
| void | putspritetexture (int x1, int y1, int x2, int y2, void *texture) |
| Puts a part of texture on the screen. | |
| void | putimageprt (int x1, int y1, int x2, int y2, void *texture, int dx, int dy) |
| copies a part of texture to the screen. | |
| void | copybuf2displaymemory (int size, void *buf) |
| int | loga2 (int a) |
| returns the position of the lowest bit of a which is set. This equals an inter logarithm to the base of 2 | |
| void | showtext (const char *text, int x, int y, int textcol) |
| void | showtext2 (const ASCString &text, int x, int y) |
| void | showtext2c (const ASCString &text, int x, int y) |
| SPoint | getPixelRotationLocation (SPoint pos, int width, int height, int degrees) |
| transforms the coordinate for an image rotation | |
Variables | |
| tgraphmodeparameters * | agmp = (tgraphmodeparameters *) & activegraphmodeparameters |
| tgraphmodeparameters * | hgmp = (tgraphmodeparameters *) & hardwaregraphmodeparameters |
| int | xlatbuffersize = 66000 |
| const float | pi = 3.14159265 |
| int | newpalgenerated = 0 |
| dacpalette256 | ppal |
| int | graphicinitialized = 0 |
| dacpalette256 * | activepalette256 |
| tinitgfxengine | initgfx |
| tgraphmodeparameters | activegraphmodeparameters |
| tgraphmodeparameters | hardwaregraphmodeparameters |
| int | dpmscapabilities |
| int | actdpmsmode |
| dacpalette256 | activepalette |
| void * | xlatbuffer |
Definition in file basegfx.cpp.
| #define cub | ( | a | ) | abs ((a)*(a)*(a)) |
Definition at line 887 of file basegfx.cpp.
| #define f2i | ( | x | ) | (int(x)) |
Definition at line 841 of file basegfx.cpp.
| #define f2i2 | ( | x | ) | (int(x+0.5)) |
Definition at line 842 of file basegfx.cpp.
| #define sqr | ( | a | ) | (a)*(a) |
Definition at line 886 of file basegfx.cpp.
Definition at line 533 of file basegfx.cpp.
| void bar | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| char | color | |||
| ) |
paints a colored bar
Definition at line 1239 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
Referenced by tparagraph::checkscrolldown(), tviewtext::displaytext(), tviewtext::fillline(), PlayerColorPanel::PlayerColorPanel(), and tviewtext::setnewlineheight().
| void copybuf2displaymemory | ( | int | size, | |
| void * | buf | |||
| ) |
Definition at line 1725 of file basegfx.cpp.
References agmp, and tgraphmodeparameters::linearaddress.
| void copySurface2screen | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2 | |||
| ) |
Definition at line 1214 of file basegfx.cpp.
References agmp, copy2screen(), and tgraphmodeparameters::directscreenaccess.
| void copySurface2screen | ( | void | ) |
when using SDL, all operations are not performed on the displaymemory itself (as is the case with DOS), but on a buffer.
This function copies the buffer to the screen, performing a color conversion if necessary
Definition at line 1208 of file basegfx.cpp.
| 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.
The thickness of the ellipse depends on tolerance. This function is just for highlighting elements on the screen, not for drawing nice and mathematically correct ellipse
Definition at line 1043 of file basegfx.cpp.
References putpixel().
| void flippict | ( | void * | s, | |
| void * | d, | |||
| int | dir = 1 | |||
| ) |
mirrors a picture horizontally (dir=1) or vertically (dir=0).
d must point to a buffer with the size of imagesize2(s)
Definition at line 675 of file basegfx.cpp.
| void generategrayxlattable | ( | ppixelxlattable | tab, | |
| char | offset, | |||
| char | size, | |||
| dacpalette256 * | pal | |||
| ) |
A translation table ( to be used by xlatpict ) is generated to translate any color of palette pal to its gray value.
The new pixels after the translation are still to be used with the palette pal. offset and size specify a range of colors that are assumed to be a linear transition from white to black. So all colors are mapped to one of the colors of the offset-size range.
Definition at line 44 of file basegfx.cpp.
Referenced by loadpalette().
| TrueColorImage* getimage | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2 | |||
| ) |
Definition at line 1360 of file basegfx.cpp.
References alphabase, getpixel(), TrueColorImage::getxsize(), TrueColorImage::getysize(), and TrueColorImage::setpix().
| 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,y1,x2,y2 ))
Definition at line 1256 of file basegfx.cpp.
Referenced by tdialogbox::buildgraphics(), tdialogbox::execbutton(), tdialogbox::knopfdruck(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), tdialogbox::newknopfdruck3(), and tdialogbox::newknopfdruck4().
| int getimagepixel | ( | void * | image, | |
| int | x, | |||
| int | y | |||
| ) |
Definition at line 535 of file basegfx.cpp.
References getpicsize().
Referenced by rotatepict(), and rotatepict_grw().
| void getpicsize | ( | void * | hd2, | |
| int & | width, | |||
| int & | height | |||
| ) |
write the dimension of the image p to width and height
Definition at line 52 of file basegfx.cpp.
References trleheader::id, trleheader::size, trleheader::x, and trleheader::y.
Referenced by getimagepixel(), UnitPropertyEditor::init(), rotatepict(), rotatepict_grw(), and uncompress_rlepict().
| int getpicsize2 | ( | void * | hd2 | ) |
returns the size that the picture p occupies in memory
Definition at line 64 of file basegfx.cpp.
References trleheader::id, and trleheader::size.
| 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 truecolor mode too
Definition at line 760 of file basegfx.cpp.
References agmp, tgraphmodeparameters::bluefieldposition, tgraphmodeparameters::byteperpix, trgbpixel::channel, getpixel8(), tgraphmodeparameters::greenfieldposition, tgraphmodeparameters::linearaddress, tgraphmodeparameters::redfieldposition, trgbpixel::rgb, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
Referenced by getimage(), writepcx(), and xorline().
| int getpixel8 | ( | int | x1, | |
| int | y1 | |||
| ) |
Definition at line 710 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, tgraphmodeparameters::linearaddress, and tgraphmodeparameters::scanlinelength.
Referenced by getpixel().
| 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
Definition at line 798 of file basegfx.cpp.
Referenced by putimageprt(), putrotspriteimage180(), putrotspriteimage270(), and putrotspriteimage90().
transforms the coordinate for an image rotation
Definition at line 1999 of file basegfx.cpp.
Referenced by SourcePixelSelector_Rotation< pixelsize >::getPixel(), SourcePixelSelector_CacheRotation< pixelsize >::nextPixel(), rotateSurface(), and SourcePixelSelector_CacheRotation< pixelsize >::setAngle().
| void* halfpict | ( | void * | vbuf | ) |
reduces a pictures size.
The new picture will have half the size in x and y direction, resulting in a quarting of the area. The new image will be written to a static buffer that is overwritten the next time halfpict or xlatpict is called. The address of the buffer is returned.
Definition at line 337 of file basegfx.cpp.
References trleheader::id, trleheader::rle, trleheader::size, trleheader::x, xlatbuffer, xlatbuffersize, and trleheader::y.
| 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.
Definition at line 896 of file basegfx.cpp.
Referenced by tdialogbox::buildgraphics(), tdialogbox::execbutton(), tdialogbox::knopfdruck(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), tdialogbox::newknopfdruck3(), tdialogbox::newknopfdruck4(), rotatepict(), rotatepict_grw(), and Surface::toBGI().
| void line | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| char | actcol | |||
| ) |
draws a simple line on the screen. Not very fast...
Definition at line 181 of file basegfx.cpp.
References putpixel().
Referenced by tdialogbox::disablebutton(), tdialogbox::enablebutton(), ASC_PBEM::getCurrentGamesInfo(), ASC_PBEM::getUserList(), BuildingValues::init(), lines(), MailOptionsDialog::MailOptionsDialog(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), LuaCommandListWriter< list< ASCString > >::outputLine(), TextFormatParser::parseLine(), tdialogbox::rahmen(), rahmen(), tdialogbox::rahmen3(), rectangle(), LuaRunner::runFile(), showplayerstat(), tdialogbox::toggleswitch(), tshowhistorypaintstat(), and WeaponInfoPanel::WeaponInfoPanel().
| int loga2 | ( | int | a | ) |
returns the position of the lowest bit of a which is set. This equals an inter logarithm to the base of 2
Definition at line 1793 of file basegfx.cpp.
| void putimage | ( | int | x1, | |
| int | y1, | |||
| TrueColorImage * | tci | |||
| ) |
puts the image pointed to by tci to the screen. Both must be truecolor images. This function is a quick and unoptimized hack!
The 6 most significant bits of each color component (RGB) form the the index.
Definition at line 1334 of file basegfx.cpp.
References TrueColorImage::getpix(), TrueColorImage::getxsize(), TrueColorImage::getysize(), and putpixel().
| void putimage | ( | int | x1, | |
| int | y1, | |||
| void * | img | |||
| ) |
puts the image pointed to by buffer to the screen
Definition at line 1280 of file basegfx.cpp.
Referenced by tdialogbox::done(), tdialogbox::execbutton(), UnitPropertyEditor::init(), tdialogbox::knopfdruck(), tdialogbox::newknopfdruck(), tdialogbox::newknopfdruck2(), tdialogbox::newknopfdruck3(), and tdialogbox::newknopfdruck4().
| void putimage_noalpha | ( | int | x1, | |
| int | y1, | |||
| TrueColorImage * | tci | |||
| ) |
Definition at line 1343 of file basegfx.cpp.
References alphabase, TrueColorImage::getpix(), TrueColorImage::getxsize(), TrueColorImage::getysize(), putpixel(), and TCalpha.
| void putimageprt | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| void * | texture, | |||
| int | dx, | |||
| int | dy | |||
| ) |
copies a part of texture to the screen.
Texture and the screen may have different size. x1/y1 and x2/y2 is the rectangle of the screen that texture is copied to. dx/dy is the offset between x1/y1 and the upper left corner of texture. If dx==0 and dy==1, the uppermost line of texture would not be displayed. The rectangle x1/y1 - x2/y2 may be larger than texture.
Definition at line 1693 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, getpixelfromimage(), tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
Referenced by tviewtext::displaysingleline().
| void putinterlacedrotimage | ( | int | x1, | |
| int | y1, | |||
| void * | ptr, | |||
| int | rotation | |||
| ) |
obsolete. not used any more. can be removed.
Definition at line 477 of file basegfx.cpp.
References agmp, tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
| void putmask | ( | int | x1, | |
| int | y1, | |||
| void * | vbuf, | |||
| int | newtransparence | |||
| ) |
puts an image on the screen , with all pixels of newtransparence treated as transparent.
Definition at line 975 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, tgraphmodeparameters::bytesperscanline, and tgraphmodeparameters::linearaddress.
| void putpicturemix | ( | int | x1, | |
| int | y1, | |||
| void * | ptr, | |||
| int | rotation, | |||
| char * | mixbuf | |||
| ) |
puts the image ptr on the screen, mixing it with the colors there.
Mixbuf must point to 256*256 byte large structure, where mixbuf[a][b] contains the colors that results from mixing a and b.
Definition at line 449 of file basegfx.cpp.
References agmp, tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
| 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
Definition at line 717 of file basegfx.cpp.
References agmp, alphabase, tgraphmodeparameters::bluefieldposition, tgraphmodeparameters::byteperpix, tgraphmodeparameters::greenfieldposition, tgraphmodeparameters::linearaddress, putpixel8(), tgraphmodeparameters::redfieldposition, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
Referenced by ellipse(), line(), putimage(), putimage_noalpha(), tmapgenerator::showmontlayer(), and xorline().
| void putpixel8 | ( | int | x1, | |
| int | y1, | |||
| int | color | |||
| ) |
Definition at line 703 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, tgraphmodeparameters::linearaddress, and tgraphmodeparameters::scanlinelength.
Referenced by putpixel().
| void putrotspriteimage | ( | int | x1, | |
| int | y1, | |||
| void * | buffer, | |||
| int | rotationvalue | |||
| ) |
like putspriteimage, but all color with an 16 <= colorIndex <= 23 are increased by rotationvalue.
This is used to display colored units. The mentioned color range are the red colors, which can be made blue by adding 8 to them, 16 makes them brown, etc..
Definition at line 1496 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, trleheader::id, tgraphmodeparameters::linearaddress, trleheader::rle, tgraphmodeparameters::scanlinelength, trleheader::size, tgraphmodeparameters::windowstatus, trleheader::x, and trleheader::y.
| void putrotspriteimage180 | ( | int | x1, | |
| int | y1, | |||
| void * | pic, | |||
| int | rotationvalue | |||
| ) |
like putspriteimage, but rotates the image by 180 clock-wise
Definition at line 1594 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, getpixelfromimage(), tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
| void putrotspriteimage270 | ( | int | x1, | |
| int | y1, | |||
| void * | pic, | |||
| int | rotationvalue | |||
| ) |
like putspriteimage, but rotates the image by 270 clock-wise
Definition at line 1621 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, getpixelfromimage(), tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
| void putrotspriteimage90 | ( | int | x1, | |
| int | y1, | |||
| void * | pic, | |||
| int | rotationvalue | |||
| ) |
like putspriteimage, but rotates the image by 90 clock-wise
Definition at line 1567 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, getpixelfromimage(), tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
| 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 transparent
Definition at line 1439 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, trleheader::id, tgraphmodeparameters::linearaddress, trleheader::rle, tgraphmodeparameters::scanlinelength, trleheader::size, tgraphmodeparameters::windowstatus, trleheader::x, and trleheader::y.
Referenced by UnitPropertyEditor::init().
| void putspritetexture | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| void * | texture | |||
| ) |
Puts a part of texture on the screen.
Texture must be the same size as the screen, so the coordinates x1/y1 and x2/y2 describe the same rectangle on texture and the screen. This rectangle is copied from texture to the screen. color #255 is treated as transparent
Definition at line 1670 of file basegfx.cpp.
References agmp, tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
Referenced by tdialogbox::copyvirtualframebuf().
| void puttexture | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| void * | texture | |||
| ) |
function not used any more and obsolete. Use putimageprt instead
Definition at line 1648 of file basegfx.cpp.
References agmp, tgraphmodeparameters::linearaddress, tgraphmodeparameters::scanlinelength, and tgraphmodeparameters::windowstatus.
Referenced by tdialogbox::paintsurface2().
| void putxlatfilter | ( | int | x1, | |
| int | y1, | |||
| void * | pictbuffer, | |||
| char * | xlattables | |||
| ) |
puts the image in pictbuffer on the screen performing a color translation.
xlattables points to an array of n*256 byte. n must be equal or greater than the highest pixel in pictbuffer. Example: you want to paint the tracks on the screen which are left by heavy vehicles. There is an image of a track which contains just pixels of 0, 1 and two. You now provide a set of 3 tables each 256 bytes large. The first one just counts from 0 to 255 The second one has color values that are a bit darker than the original: If color #2 was blue, table[2] would have the index of a dark blue color. The third table is like the second one, but points to even darker colors. If you now paint the track using this function: where there is color #0 in the track image, the pixel on the screen would be unchanged where there is color #1 in the track image, the pixel on the screen is made darker and where there is color #2, the pixel on the screen is becoming even more darker Ok, that's all. A very specialized function. I just checked and noticed that it is not used any more by ASC. Damn, why did I write this description instead of just deleting this procedure ;-)
Definition at line 1375 of file basegfx.cpp.
References agmp, tgraphmodeparameters::byteperpix, trleheader::id, tgraphmodeparameters::linearaddress, trleheader::rle, tgraphmodeparameters::scanlinelength, trleheader::size, tgraphmodeparameters::windowstatus, trleheader::x, and trleheader::y.
| void rahmen | ( | bool | invers, | |
| int | x1, | |||
| int | y1, | |||
| int | x2, | |||
| int | y2 | |||
| ) |
paints a pseudo-3D rectangle on the screen.
invers specifies wheather the rectangle seems to be pressed into the screen or coming out
Definition at line 82 of file basegfx.cpp.
References darkgray, line(), and white.
Referenced by tshowhistoryinit().
| void rectangle | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| char | color | |||
| ) |
draws a simple rectangl
Definition at line 297 of file basegfx.cpp.
Referenced by tplayerselall::anzeige(), tplayerchange::anzeige(), tdialogbox::disablebutton(), tdialogbox::execbutton(), ttributepayments::init(), and MultilineEdit::init().
| char* rotatepict | ( | void * | image, | |
| int | angle | |||
| ) |
rotates the picture image by angle clockwise.
The resulting image will have exactly the same size as the original image, resulting in the image being clipped
Definition at line 553 of file basegfx.cpp.
References fieldxsize, fieldysize, getimagepixel(), getpicsize(), and imagesize().
Referenced by UnitPropertyEditor::init().
| void rotatepict90 | ( | void * | s, | |
| void * | d | |||
| ) |
rotates the image s by 90 clockwise and writes it to d.
d must point to a buffer with the size of imagesize2(s)
Definition at line 506 of file basegfx.cpp.
| char* rotatepict_grw | ( | void * | image, | |
| int | organgle | |||
| ) |
rotates the picture image by angle clockwise.
The resulting image will be larger than the original one
Definition at line 613 of file basegfx.cpp.
References fieldxsize, fieldysize, getimagepixel(), getpicsize(), and imagesize().
| void showtext | ( | const char * | text, | |
| int | x, | |||
| int | y, | |||
| int | textcol | |||
| ) |
Definition at line 1806 of file basegfx.cpp.
References activefontsettings, agmp, tfontsettings::background, tgraphmodeparameters::byteperpix, tfont::character, tfontsettings::font, tfont::height, tfontsettings::height, tfontsettings::justify, tfont::kerning, tfontsettings::length, tgraphmodeparameters::linearaddress, tcharacter::memposition, tgraphmodeparameters::scanlinelength, and tcharacter::width.
Referenced by showtext2(), and showtext2c().
| void showtext2 | ( | const ASCString & | text, | |
| int | x, | |||
| int | y | |||
| ) |
Definition at line 1953 of file basegfx.cpp.
References activefontsettings, tfontsettings::color, and showtext().
Referenced by tplayerchange::anzeige(), tmapgenerator::buttonpressed(), tdialogbox::disablebutton(), tdialogbox::dispeditstring(), tparagraph::display(), tviewtext::displaysingleline(), tdialogbox::enablebutton(), tdialogbox::execbutton(), tresearchinfo::init(), ttributepayments::init(), MirrorMap::init(), UnitPropertyEditor::init(), BuildingValues::init(), tmapgenerator::init(), ResizeMap::init(), tbi3preferences::init(), tchoice_dlg::init(), tdialogbox::rahmen3(), tdialogbox::redraw(), showtext3(), showtext4(), tshowhistorypaintstat(), and tstringselect::viewtext().
| void showtext2c | ( | const ASCString & | text, | |
| int | x, | |||
| int | y | |||
| ) |
Definition at line 1958 of file basegfx.cpp.
References showtext().
Referenced by showtext3c(), and showtext4c().
| TrueColorImage* smoothimage | ( | TrueColorImage * | src | ) |
Definition at line 853 of file basegfx.cpp.
References alphabase, trgbpixel::channel, TrueColorImage::getpix(), TrueColorImage::getxsize(), TrueColorImage::getysize(), and TrueColorImage::setpix().
| void* uncompress_rlepict | ( | void * | pict | ) |
uncompresses the RLE-compressed image pict.
A buffer for the uncompressed image is allocated and returned, so it must be freed later
Definition at line 1001 of file basegfx.cpp.
References getpicsize(), trleheader::id, malloc(), trleheader::rle, and trleheader::size.
Referenced by Surface::read().
| void xorline | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| char | color | |||
| ) |
draws a simple line on the screen, but performs a XOR operation between the pixel already on screen and color.
Thus the line will always have a color different then the one that was previously there. And it can be undone by displaying it a second time.
Definition at line 241 of file basegfx.cpp.
References getpixel(), and putpixel().
Referenced by tparagraph::displaycursor(), tdialogbox::lne(), and xorrectangle().
| void xorrectangle | ( | int | x1, | |
| int | y1, | |||
| int | x2, | |||
| int | y2, | |||
| char | color | |||
| ) |
draws a simple rectangle on the screen, but performs a XOR operation between the pixel already on screen and color.
Thus the rectangle will always have a color different then the one that was previously there. And it can be undone by displaying it a second time.
Definition at line 313 of file basegfx.cpp.
References xorline().
Referenced by tdialogbox::run(), and tdialogbox::showtabmark().
| int actdpmsmode |
Definition at line 1227 of file basegfx.cpp.
Definition at line 1074 of file basegfx.cpp.
Definition at line 39 of file basegfx.cpp.
Referenced by bar(), tdialogbox::buildgraphics(), collategraphicoperations::collategraphicoperations(), copybuf2displaymemory(), copySurface2screen(), tdialogbox::copyvirtualframebuf(), tviewtext::displaysingleline(), tdialogbox::execbutton(), getActiveSurface(), getimage(), getpixel(), getpixel8(), infomessage(), tdisplaymessage::init(), initASCGraphicSubsystem(), collategraphicoperations::off(), collategraphicoperations::on(), tdialogbox::paint(), putimage(), putimageprt(), putinterlacedrotimage(), putmask(), putpicturemix(), putpixel(), putpixel8(), putrotspriteimage(), putrotspriteimage180(), putrotspriteimage270(), putrotspriteimage90(), putspriteimage(), putspritetexture(), puttexture(), putxlatfilter(), tdialogbox::run(), tdialogbox::setvirtualframebuf(), showtext(), shutdownASCGraphicSubsystem(), tinitgfxengine::tinitgfxengine(), writepcx(), collategraphicoperations::~collategraphicoperations(), and tvirtualdisplay::~tvirtualdisplay().
| int dpmscapabilities |
Definition at line 1226 of file basegfx.cpp.
| int graphicinitialized = 0 |
Definition at line 997 of file basegfx.cpp.
Definition at line 40 of file basegfx.cpp.
Referenced by copy2screen(), tdialogbox::copyvirtualframebuf(), tvirtualscreenbuf::init(), initASCGraphicSubsystem(), tdialogbox::paint(), tdialogbox::setvirtualframebuf(), and tinitgfxengine::tinitgfxengine().
| class tinitgfxengine initgfx |
| int newpalgenerated = 0 |
Definition at line 845 of file basegfx.cpp.
| const float pi = 3.14159265 |
Definition at line 551 of file basegfx.cpp.
Referenced by MoveUnitCommand::calcPath(), UnitPropertyEditor::init(), readOldEvent(), WindMovement::WindMovement(), and tdrawgettempline::winkelcomp().
Definition at line 846 of file basegfx.cpp.
| void* xlatbuffer |
Definition at line 1231 of file basegfx.cpp.
Referenced by halfpict(), and tinitgfxengine::tinitgfxengine().
| int xlatbuffersize = 66000 |
Definition at line 42 of file basegfx.cpp.
Referenced by halfpict(), and tinitgfxengine::tinitgfxengine().
1.5.1