![]() |
ManaPlus
|
#include <surfacegraphics.h>
Public Member Functions | |
| SurfaceGraphics () | |
| ~SurfaceGraphics () | |
| void | setTarget (SDL_Surface *const target) |
| SDL_Surface * | getTarget () const |
| void | beginDraw () |
| void | endDraw () |
| void | pushClipArea (const Rect &rect) |
| void | popClipArea () |
| void | drawRescaledImage (const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight) |
| void | drawPattern (const Image *const image, const int x, const int y, const int w, const int h) |
| void | drawRescaledPattern (const Image *const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight) |
| void | calcPattern (ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const |
| void | calcPattern (ImageCollection *const vert, const Image *const image, const int x, const int y, const int w, const int h) const |
| void | calcTileVertexes (ImageVertexes *const vert, const Image *const image, int x, int y) const |
| void | calcTileSDL (ImageVertexes *const vert, int x, int y) const |
| void | calcTileCollection (ImageCollection *const vertCol, const Image *const image, int x, int y) |
| void | drawTileVertexes (const ImageVertexes *const vert) |
| void | drawTileCollection (const ImageCollection *const vertCol) |
| void | updateScreen () |
| void | drawNet (const int x1, const int y1, const int x2, const int y2, const int width, const int height) |
| void | calcWindow (ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) |
| void | setBlitMode (const BlitModeT mode) |
| BlitModeT | getBlitMode () const |
| void | fillRectangle (const Rect &rect) |
| void | drawRectangle (const Rect &rect) |
| void | drawPoint (int x, int y) |
| void | drawLine (int x1, int y1, int x2, int y2) |
| bool | setVideoMode (const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI) |
| void | drawImage (const Image *const image, int dstX, int dstY) |
| void | copyImage (const Image *const image, int dstX, int dstY) |
| void | drawImageCached (const Image *const image, int x, int y) |
| void | drawPatternCached (const Image *const image, const int x, const int y, const int w, const int h) |
| void | completeCache () |
| void | drawImageRect (const int x, const int y, const int w, const int h, const ImageRect &imgRect) |
Public Member Functions inherited from Graphics | |
| virtual | ~Graphics () |
| void | setWindow (SDL_Surface *const window, const int width, const int height) |
| SDL_Surface * | getWindow () const |
| void | setSync (const bool sync) |
| bool | getSync () const |
| bool | setFullscreen (const bool fs) |
| virtual bool | resizeScreen (const int width, const int height) |
| virtual void | restoreContext () |
| void | setWindowSize (const int width, const int height) |
| int | getWidth () const |
| int | getHeight () const |
| int | getMemoryUsage () const |
| ClipRect & | getTopClip () const |
| void | setRedraw (const bool n) |
| bool | getRedraw () const |
| void | setSecure (const bool n) |
| bool | getSecure () const |
| int | getBpp () const |
| bool | getFullScreen () const |
| bool | getHWAccel () const |
| bool | getDoubleBuffer () const |
| RenderType | getOpenGL () const |
| void | setNoFrame (const bool n) |
| const std::string & | getName () const |
| virtual void | initArrays (const int vertCount) |
| virtual void | setColor (const Color &color) |
| const Color & | getColor () const |
| int | getScale () const |
| virtual bool | isAllowScale () const |
| void | setScale (int scale) |
| virtual void | createGLContext (const bool custom) |
| virtual void | clearScreen () const |
| virtual void | deleteArrays () |
| virtual void | postInit () |
| virtual void | finalize (ImageCollection *const col) |
| virtual void | finalize (ImageVertexes *const vert) |
| virtual void | testDraw () |
| virtual void | removeArray (const uint32_t sz, uint32_t *const arr) |
| virtual void | screenResized () |
Protected Attributes | |
| BlitModeT | mBlitMode |
| SDL_Surface * | mTarget |
Protected Attributes inherited from Graphics | |
| MStack< ClipRect > | mClipStack |
| SDL_Surface * | mWindow |
| int | mBpp |
| bool | mAlpha |
| bool | mFullscreen |
| bool | mHWAccel |
| bool | mRedraw |
| bool | mDoubleBuffer |
| SDL_Rect | mRect |
| bool | mSecure |
| RenderType | mOpenGL |
| bool | mEnableResize |
| bool | mNoFrame |
| bool | mAllowHighDPI |
| std::string | mName |
| int | mStartFreeMem |
| bool | mSync |
| int | mScale |
| Color | mColor |
Additional Inherited Members | |
Public Types inherited from Graphics | |
| enum | Alignment { LEFT = 0 , CENTER , RIGHT } |
Static Public Member Functions inherited from Graphics | |
| static void | cleanUp () |
Data Fields inherited from Graphics | |
| int | mWidth |
| int | mHeight |
| int | mActualWidth |
| int | mActualHeight |
Protected Member Functions inherited from Graphics | |
| Graphics () | |
| void | setMainFlags (const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI) |
| int | getOpenGLFlags () const |
| int | getSoftwareFlags () const |
| bool | setOpenGLMode () |
| void | updateMemoryInfo () |
| bool | videoInfo () |
| void | setOpenGLFlags () |
Static Protected Attributes inherited from Graphics | |
| static void * | mGLContext = 0 |
A central point of control for graphics.
Definition at line 40 of file surfacegraphics.h.
| SurfaceGraphics::SurfaceGraphics | ( | ) |
Definition at line 34 of file surfacegraphics.cpp.
References Graphics::mName, Graphics::mOpenGL, and RENDER_SOFTWARE.
| SurfaceGraphics::~SurfaceGraphics | ( | ) |
Definition at line 43 of file surfacegraphics.cpp.
|
inlinevirtual |
Initializes drawing. Called by the Gui when Gui::draw() is called. It is needed by some implementations of Graphics to perform preparations before drawing. An example of such an implementation is the OpenGLGraphics.
NOTE: You will never need to call this function yourself, unless you use a Graphics object outside of Guichan.
Reimplemented from Graphics.
Definition at line 55 of file surfacegraphics.h.
Referenced by CompoundSprite::redraw().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
|
virtual |
Implements Graphics.
Definition at line 85 of file surfacegraphics.cpp.
References CAST_S16, CAST_U16, and FUNC_BLOCK.
|
virtual |
Blits an image onto the screen.
true if the image was blitted properly false otherwise. Implements Graphics.
Definition at line 47 of file surfacegraphics.cpp.
References BlitMode::BLIT_NORMAL, CAST_S16, CAST_U16, and FUNC_BLOCK.
|
virtual |
Implements Graphics.
Definition at line 116 of file surfacegraphics.cpp.
References BlitMode::BLIT_NORMAL, CAST_S16, CAST_U16, FUNC_BLOCK, x, and y.
|
inlinevirtual |
Draws a rectangle using images. 4 corner images, 4 side images and 1 image for the inside.
Implements Graphics.
Definition at line 208 of file surfacegraphics.h.
|
inlinevirtual |
Ddraws a line.
| x1 | The first x coordinate. |
| y1 | The first y coordinate. |
| x2 | The second x coordinate. |
| y2 | The second y coordinate. |
Implements Graphics.
Definition at line 171 of file surfacegraphics.h.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Draws a single point/pixel.
| x | The x coordinate. |
| y | The y coordinate. |
Implements Graphics.
Definition at line 168 of file surfacegraphics.h.
|
inlinevirtual |
Draws a simple, non-filled, rectangle with a one pixel width.
| rectangle | The rectangle to draw. |
Implements Graphics.
Definition at line 164 of file surfacegraphics.h.
|
inlinevirtual |
Draws a resclaled version of the image
Implements Graphics.
Definition at line 68 of file surfacegraphics.h.
|
inlinevirtual |
Draw a pattern based on a rescaled version of the given image...
Implements Graphics.
Definition at line 82 of file surfacegraphics.h.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Deinitializes drawing. Called by the Gui when a Gui::draw() is done. done. It should reset any state changes made by beginDraw().
NOTE: You will never need to call this function yourself, unless you use a Graphics object outside of Guichan.
Reimplemented from Graphics.
Definition at line 58 of file surfacegraphics.h.
|
inlinevirtual |
|
inline |
|
inline |
|
inlinevirtual |
Removes the top most clip area from the stack.
| Exception | if the stack is empty. |
Reimplemented from Graphics.
Definition at line 65 of file surfacegraphics.h.
|
inlinevirtual |
Pushes a clip area onto the stack. The x and y coordinates in the rectangle is relative to the last pushed clip area. If the new area falls outside the current clip area, it will be clipped as necessary.
If a clip area is outside of the top clip area a clip area with zero width and height will be pushed.
| area | The clip area to be pushed onto the stack. |
Reimplemented from Graphics.
Definition at line 61 of file surfacegraphics.h.
|
inline |
Definition at line 154 of file surfacegraphics.h.
References mBlitMode.
Referenced by CompoundSprite::redraw().
|
inline |
Definition at line 49 of file surfacegraphics.h.
References mTarget.
Referenced by CompoundSprite::redraw().
|
inlinevirtual |
Try to create a window with the given settings.
Implements Graphics.
Definition at line 176 of file surfacegraphics.h.
|
inlinevirtual |
Updates the screen. This is done by either copying the buffer to the screen or swapping pages.
Implements Graphics.
Definition at line 136 of file surfacegraphics.h.
|
protected |
Definition at line 215 of file surfacegraphics.h.
Referenced by getBlitMode(), and setBlitMode().
|
protected |
Definition at line 216 of file surfacegraphics.h.
Referenced by getTarget(), and setTarget().