____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"#include <video.h>
Public Member Functions | |
| CVideo () | |
| void | LockScreen () |
| void | UnlockScreen () |
| void | ClearScreen () |
| bool | ResizeScreen (int x, int y) |
| void | DrawPixelClip (Uint32 color, int x, int y) |
| void | DrawTransPixelClip (Uint32 color, int x, int y, unsigned char alpha) |
| void | DrawVLine (Uint32 color, int x, int y, int height) |
| void | DrawTransVLine (Uint32 color, int x, int y, int height, unsigned char alpha) |
| void | DrawVLineClip (Uint32 color, int x, int y, int height) |
| void | DrawTransVLineClip (Uint32 color, int x, int y, int height, unsigned char alpha) |
| void | DrawHLine (Uint32 color, int x, int y, int width) |
| void | DrawTransHLine (Uint32 color, int x, int y, int width, unsigned char alpha) |
| void | DrawHLineClip (Uint32 color, int x, int y, int width) |
| void | DrawTransHLineClip (Uint32 color, int x, int y, int width, unsigned char alpha) |
| void | DrawLine (Uint32 color, int sx, int sy, int dx, int dy) |
| void | DrawTransLine (Uint32 color, int sx, int sy, int dx, int dy, unsigned char alpha) |
| void | DrawLineClip (Uint32 color, int sx, int sy, int dx, int dy) |
| void | DrawTransLineClip (Uint32 color, int sx, int sy, int dx, int dy, unsigned char alpha) |
| void | DrawRectangle (Uint32 color, int x, int y, int w, int h) |
| void | DrawTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha) |
| void | DrawRectangleClip (Uint32 color, int x, int y, int w, int h) |
| void | DrawTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha) |
| void | FillRectangle (Uint32 color, int x, int y, int w, int h) |
| void | FillTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha) |
| void | FillRectangleClip (Uint32 color, int x, int y, int w, int h) |
| void | FillTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha) |
| void | DrawCircle (Uint32 color, int x, int y, int r) |
| void | DrawTransCircle (Uint32 color, int x, int y, int r, unsigned char alpha) |
| void | DrawCircleClip (Uint32 color, int x, int y, int r) |
| void | DrawTransCircleClip (Uint32 color, int x, int y, int r, unsigned char alpha) |
| void | FillCircle (Uint32 color, int x, int y, int radius) |
| void | FillTransCircle (Uint32 color, int x, int y, int radius, unsigned char alpha) |
| void | FillCircleClip (Uint32 color, int x, int y, int radius) |
| void | FillTransCircleClip (Uint32 color, int x, int y, int radius, unsigned char alpha) |
| Uint32 | MapRGB (SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b) |
| Uint32 | MapRGBA (SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
| void | GetRGB (Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b) |
| void | GetRGBA (Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) |
Public Attributes | |
| int | Width |
| int | Height |
| int | Depth |
| bool | FullScreen |
Definition at line 211 of file video.h.
| void CVideo::LockScreen | ( | void | ) |
Lock the screen for write access.
Definition at line 211 of file video.cpp.
References SdlLockScreen().
Referenced by linedraw_sdl::DrawCircle(), linedraw_sdl::DrawCircleClip(), linedraw_sdl::DrawHLine(), linedraw_sdl::DrawLine(), linedraw_sdl::DrawLineClip(), linedraw_sdl::DrawPixelClip(), linedraw_sdl::DrawTransCircle(), linedraw_sdl::DrawTransCircleClip(), linedraw_sdl::DrawTransHLine(), linedraw_sdl::DrawTransHLineClip(), linedraw_sdl::DrawTransPixelClip(), linedraw_sdl::DrawTransVLine(), linedraw_sdl::DrawTransVLineClip(), linedraw_sdl::DrawVLine(), linedraw_sdl::FillTransRectangle(), SaveScreenshotPNG(), linedraw_sdl::VideoDrawPixel16(), linedraw_sdl::VideoDrawPixel32(), linedraw_sdl::VideoDrawTransPixel16(), and linedraw_sdl::VideoDrawTransPixel32().
| void CVideo::UnlockScreen | ( | void | ) |
Unlock the screen for write access.
Definition at line 219 of file video.cpp.
References SdlUnlockScreen().
Referenced by linedraw_sdl::DrawCircle(), linedraw_sdl::DrawCircleClip(), linedraw_sdl::DrawHLine(), linedraw_sdl::DrawLine(), linedraw_sdl::DrawLineClip(), linedraw_sdl::DrawPixelClip(), linedraw_sdl::DrawTransCircle(), linedraw_sdl::DrawTransCircleClip(), linedraw_sdl::DrawTransHLine(), linedraw_sdl::DrawTransHLineClip(), linedraw_sdl::DrawTransPixelClip(), linedraw_sdl::DrawTransVLine(), linedraw_sdl::DrawTransVLineClip(), linedraw_sdl::DrawVLine(), linedraw_sdl::FillTransRectangle(), SaveScreenshotPNG(), linedraw_sdl::VideoDrawPixel16(), linedraw_sdl::VideoDrawPixel32(), linedraw_sdl::VideoDrawTransPixel16(), and linedraw_sdl::VideoDrawTransPixel32().
| void CVideo::ClearScreen | ( | void | ) |
Clear the video screen.
Definition at line 227 of file video.cpp.
References ColorBlack, FillRectangle(), Height, and Width.
Referenced by CreateGame(), EditorMainLoop(), main1(), MenuLoop(), ShowTitleScreens(), StartEditor(), StartMap(), and WaitEventsOneFrame().
| bool CVideo::ResizeScreen | ( | int | w, | |
| int | h | |||
| ) |
Resize the video screen.
Definition at line 237 of file video.cpp.
References CMinimap::FreeOpenGL(), FreeOpenGLFonts(), FreeOpenGLGraphics(), Height, CUserInterface::Minimap, ReloadOpenGL(), SetClipping(), TheScreen, UI, UseOpenGL, VideoValidResolution(), and Width.
Referenced by SdlDoEvent().
| void CVideo::DrawPixelClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y | |||
| ) |
Definition at line 1927 of file linedraw.cpp.
References linedraw_sdl::DrawPixelClip(), linedraw_gl::DrawPixelClip(), and UseOpenGL.
Referenced by MyOpenGLGraphics::drawPoint().
| void CVideo::DrawTransPixelClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 1935 of file linedraw.cpp.
References linedraw_sdl::DrawTransPixelClip(), linedraw_gl::DrawTransPixelClip(), and UseOpenGL.
| void CVideo::DrawVLine | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | height | |||
| ) |
Definition at line 1944 of file linedraw.cpp.
References linedraw_sdl::DrawVLine(), linedraw_gl::DrawVLine(), and UseOpenGL.
| void CVideo::DrawTransVLine | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | height, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 1952 of file linedraw.cpp.
References linedraw_sdl::DrawTransVLine(), linedraw_gl::DrawTransVLine(), and UseOpenGL.
| void CVideo::DrawVLineClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | height | |||
| ) |
Definition at line 1960 of file linedraw.cpp.
References linedraw_sdl::DrawVLineClip(), linedraw_gl::DrawVLineClip(), and UseOpenGL.
Referenced by DrawGrids(), and DrawSelection().
| void CVideo::DrawTransVLineClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | height, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 1968 of file linedraw.cpp.
References linedraw_sdl::DrawTransVLineClip(), linedraw_gl::DrawTransVLineClip(), and UseOpenGL.
| void CVideo::DrawHLine | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | width | |||
| ) |
Definition at line 1977 of file linedraw.cpp.
References linedraw_sdl::DrawHLine(), linedraw_gl::DrawHLine(), and UseOpenGL.
Referenced by DrawPopup().
| void CVideo::DrawTransHLine | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | width, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 1985 of file linedraw.cpp.
References linedraw_sdl::DrawTransHLine(), linedraw_gl::DrawTransHLine(), and UseOpenGL.
| void CVideo::DrawHLineClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | width | |||
| ) |
Definition at line 1993 of file linedraw.cpp.
References linedraw_sdl::DrawHLineClip(), linedraw_gl::DrawHLineClip(), and UseOpenGL.
Referenced by DrawGrids(), and DrawSelection().
| void CVideo::DrawTransHLineClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | width, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2001 of file linedraw.cpp.
References linedraw_sdl::DrawTransHLineClip(), linedraw_gl::DrawTransHLineClip(), and UseOpenGL.
| void CVideo::DrawLine | ( | Uint32 | color, | |
| int | sx, | |||
| int | sy, | |||
| int | dx, | |||
| int | dy | |||
| ) |
Definition at line 2010 of file linedraw.cpp.
References linedraw_sdl::DrawLine(), linedraw_gl::DrawLine(), and UseOpenGL.
| void CVideo::DrawTransLine | ( | Uint32 | color, | |
| int | sx, | |||
| int | sy, | |||
| int | dx, | |||
| int | dy, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2018 of file linedraw.cpp.
References linedraw_sdl::DrawTransLine(), linedraw_gl::DrawTransLine(), and UseOpenGL.
| void CVideo::DrawLineClip | ( | Uint32 | color, | |
| int | sx, | |||
| int | sy, | |||
| int | dx, | |||
| int | dy | |||
| ) |
Definition at line 2026 of file linedraw.cpp.
References linedraw_sdl::DrawLineClip(), linedraw_gl::DrawLineClip(), and UseOpenGL.
Referenced by MyOpenGLGraphics::drawLine(), and ShowSingleOrder().
| void CVideo::DrawTransLineClip | ( | Uint32 | color, | |
| int | sx, | |||
| int | sy, | |||
| int | dx, | |||
| int | dy, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2034 of file linedraw.cpp.
References linedraw_sdl::DrawTransLineClip(), linedraw_gl::DrawTransLineClip(), and UseOpenGL.
| void CVideo::DrawRectangle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) |
Definition at line 2043 of file linedraw.cpp.
References linedraw_sdl::DrawRectangle(), linedraw_gl::DrawRectangle(), and UseOpenGL.
Referenced by CViewport::DrawBorder(), DrawInfoPanelNoneSelected(), DrawPlayers(), and DrawPopup().
| void CVideo::DrawTransRectangle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2051 of file linedraw.cpp.
References linedraw_sdl::DrawTransRectangle(), linedraw_gl::DrawTransRectangle(), and UseOpenGL.
Referenced by CMinimap::DrawCursor(), and MyOpenGLGraphics::drawRectangle().
| void CVideo::DrawRectangleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) |
Definition at line 2059 of file linedraw.cpp.
References linedraw_sdl::DrawRectangleClip(), linedraw_gl::DrawRectangleClip(), and UseOpenGL.
Referenced by CChunkParticle::draw(), DrawIcons(), CViewport::DrawMapBackgroundInViewport(), DrawMapCursor(), DrawMenuButton(), DrawPatchIcons(), DrawUnitIcons(), and DrawVisibleRectangleCursor().
| void CVideo::DrawTransRectangleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2067 of file linedraw.cpp.
References linedraw_sdl::DrawTransRectangleClip(), linedraw_gl::DrawTransRectangleClip(), and UseOpenGL.
| void CVideo::FillRectangle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) |
Definition at line 2076 of file linedraw.cpp.
References linedraw_sdl::FillRectangle(), linedraw_gl::FillRectangle(), and UseOpenGL.
Referenced by ClearScreen(), DrawInfoPanelNoneSelected(), DrawPlayers(), DrawPopup(), PatchEditorUpdateDisplay(), and ShowLoadProgress().
| void CVideo::FillTransRectangle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2084 of file linedraw.cpp.
References linedraw_sdl::FillTransRectangle(), linedraw_gl::FillTransRectangle(), and UseOpenGL.
Referenced by MyOpenGLGraphics::fillRectangle(), and gcn::SDLGraphics::fillRectangle().
| void CVideo::FillRectangleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h | |||
| ) |
Definition at line 2092 of file linedraw.cpp.
References linedraw_sdl::FillRectangleClip(), linedraw_gl::FillRectangleClip(), and UseOpenGL.
Referenced by CViewport::DrawMapFogOfWar(), UiDrawLifeBar(), UiDrawManaBar(), and VideoDrawOnlyFog().
| void CVideo::FillTransRectangleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | w, | |||
| int | h, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2100 of file linedraw.cpp.
References linedraw_sdl::FillTransRectangleClip(), linedraw_gl::FillTransRectangleClip(), and UseOpenGL.
Referenced by DrawBuildingCursor(), and MessagesDisplay::DrawMessages().
| void CVideo::DrawCircle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | r | |||
| ) |
Definition at line 2109 of file linedraw.cpp.
References linedraw_sdl::DrawCircle(), linedraw_gl::DrawCircle(), and UseOpenGL.
| void CVideo::DrawTransCircle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | r, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2117 of file linedraw.cpp.
References linedraw_sdl::DrawTransCircle(), linedraw_gl::DrawTransCircle(), and UseOpenGL.
| void CVideo::DrawCircleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | r | |||
| ) |
Definition at line 2125 of file linedraw.cpp.
References linedraw_sdl::DrawCircleClip(), linedraw_gl::DrawCircleClip(), and UseOpenGL.
Referenced by DrawInformations().
| void CVideo::DrawTransCircleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | r, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2133 of file linedraw.cpp.
References linedraw_sdl::DrawTransCircleClip(), linedraw_gl::DrawTransCircleClip(), and UseOpenGL.
Referenced by DrawEvents().
| void CVideo::FillCircle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | radius | |||
| ) |
Definition at line 2142 of file linedraw.cpp.
References linedraw_sdl::FillCircle(), linedraw_gl::FillCircle(), and UseOpenGL.
| void CVideo::FillTransCircle | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | radius, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2150 of file linedraw.cpp.
References linedraw_sdl::FillTransCircle(), linedraw_gl::FillTransCircle(), and UseOpenGL.
| void CVideo::FillCircleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | radius | |||
| ) |
Definition at line 2158 of file linedraw.cpp.
References linedraw_sdl::FillCircleClip(), linedraw_gl::FillCircleClip(), and UseOpenGL.
Referenced by ShowSingleOrder().
| void CVideo::FillTransCircleClip | ( | Uint32 | color, | |
| int | x, | |||
| int | y, | |||
| int | radius, | |||
| unsigned char | alpha | |||
| ) |
Definition at line 2166 of file linedraw.cpp.
References linedraw_sdl::FillTransCircleClip(), linedraw_gl::FillTransCircleClip(), and UseOpenGL.
| Uint32 CVideo::MapRGB | ( | SDL_PixelFormat * | f, | |
| Uint8 | r, | |||
| Uint8 | g, | |||
| Uint8 | b | |||
| ) | [inline] |
Definition at line 260 of file video.h.
References MapRGBA(), and UseOpenGL.
Referenced by CclPlayer(), DrawMenuButton(), MessagesDisplay::DrawMessages(), DrawPopup(), MyOpenGLGraphics::drawRectangle(), DrawUnitOn(), MyOpenGLGraphics::fillRectangle(), InitPlayers(), InitUserInterface(), and InitVideoSdl().
| Uint32 CVideo::MapRGBA | ( | SDL_PixelFormat * | f, | |
| Uint8 | r, | |||
| Uint8 | g, | |||
| Uint8 | b, | |||
| Uint8 | a | |||
| ) | [inline] |
Definition at line 267 of file video.h.
References ASHIFT, BSHIFT, GSHIFT, RSHIFT, and UseOpenGL.
Referenced by MyOpenGLGraphics::drawLine(), MyOpenGLGraphics::drawPoint(), linedraw_gl::DrawTransCircle(), linedraw_gl::DrawTransCircleClip(), linedraw_gl::DrawTransHLine(), linedraw_gl::DrawTransHLineClip(), linedraw_gl::DrawTransPixel(), linedraw_gl::DrawTransPixelClip(), linedraw_gl::DrawTransRectangle(), linedraw_gl::DrawTransRectangleClip(), linedraw_gl::DrawTransVLine(), linedraw_gl::DrawTransVLineClip(), linedraw_gl::FillTransCircle(), linedraw_gl::FillTransCircleClip(), linedraw_gl::FillTransRectangle(), linedraw_gl::FillTransRectangleClip(), MapRGB(), SetMinimapTerrainPixel(), and VideoDrawOnlyFog().
| void CVideo::GetRGB | ( | Uint32 | c, | |
| SDL_PixelFormat * | f, | |||
| Uint8 * | r, | |||
| Uint8 * | g, | |||
| Uint8 * | b | |||
| ) | [inline] |
Definition at line 274 of file video.h.
References BSHIFT, GSHIFT, RSHIFT, and UseOpenGL.
Referenced by linedraw_gl::DrawTransCircle(), linedraw_gl::DrawTransCircleClip(), linedraw_gl::DrawTransHLine(), linedraw_gl::DrawTransHLineClip(), linedraw_gl::DrawTransPixel(), linedraw_gl::DrawTransPixelClip(), linedraw_gl::DrawTransRectangle(), linedraw_gl::DrawTransRectangleClip(), linedraw_gl::DrawTransVLine(), linedraw_gl::DrawTransVLineClip(), linedraw_gl::FillTransCircle(), linedraw_gl::FillTransCircleClip(), linedraw_gl::FillTransRectangle(), and linedraw_gl::FillTransRectangleClip().
| void CVideo::GetRGBA | ( | Uint32 | c, | |
| SDL_PixelFormat * | f, | |||
| Uint8 * | r, | |||
| Uint8 * | g, | |||
| Uint8 * | b, | |||
| Uint8 * | a | |||
| ) | [inline] |
Definition at line 283 of file video.h.
References ASHIFT, BSHIFT, GSHIFT, RSHIFT, and UseOpenGL.
Referenced by linedraw_gl::DrawHLine(), linedraw_gl::DrawLine(), linedraw_gl::DrawPixel(), linedraw_gl::DrawRectangle(), linedraw_gl::DrawVLine(), and linedraw_gl::FillRectangle().
| int CVideo::Width |
Definition at line 294 of file video.h.
Referenced by MyOpenGLGraphics::_beginDraw(), CclGetVideoResolution(), CclSetVideoResolution(), ClearScreen(), DoScroll(), DrawCoordinates(), DrawCosts(), MyOpenGLGraphics::drawImage(), MessagesDisplay::DrawMessages(), DrawPopup(), CFont::drawString(), EditorMainLoop(), HandleCursorMove(), HandleMouseExit(), InitOpenGL(), InitUserInterface(), InitVideoSdl(), Invalidate(), InvalidateArea(), main(), main1(), MenuScreen::MenuScreen(), PatchEditorCallbackMouse(), PatchEditorMainLoop(), PatchEditorUpdateDisplay(), PatchLoadIcons(), PlayMovie(), ResizeScreen(), SaveScreenshotPNG(), SdlDoEvent(), SetClipping(), ShowLoadProgress(), ShowTitleImage(), StartMap(), UiToggleBigMap(), linedraw_sdl::VideoDoDrawPixel16(), linedraw_sdl::VideoDoDrawPixel32(), linedraw_sdl::VideoDoDrawTransPixel16(), and linedraw_sdl::VideoDoDrawTransPixel32().
| int CVideo::Height |
Definition at line 295 of file video.h.
Referenced by MyOpenGLGraphics::_beginDraw(), CclGetVideoResolution(), CclSetVideoResolution(), ClearScreen(), DoScroll(), CStatusLine::Draw(), DrawCoordinates(), MyOpenGLGraphics::drawImage(), MessagesDisplay::DrawMessages(), CFont::drawString(), EditorMainLoop(), HandleCursorMove(), HandleMouseExit(), CEditor::Init(), InitOpenGL(), InitUserInterface(), InitVideoSdl(), Invalidate(), InvalidateArea(), main(), main1(), MenuScreen::MenuScreen(), PatchEditorCallbackMouse(), PatchEditorMainLoop(), PatchEditorUpdateDisplay(), PlayMovie(), ResizeScreen(), SaveScreenshotPNG(), SdlDoEvent(), SetClipping(), ShowLoadProgress(), ShowTitleImage(), StartMap(), and UiToggleBigMap().
| int CVideo::Depth |
Definition at line 296 of file video.h.
Referenced by linedraw_sdl::InitLineDraw(), InitVideoSdl(), main(), SaveScreenshotPNG(), and ShowLoadProgress().
| bool CVideo::FullScreen |
Definition at line 297 of file video.h.
Referenced by CclGetVideoFullScreen(), CclSetVideoFullScreen(), InitVideoSdl(), main(), and ToggleFullScreen().
1.5.6