src/gfx_func.h
author peter1138
Tue, 22 Jan 2008 07:27:06 +0000
changeset 8374 7a1b6c89cb89
parent 8349 e61105cb1f87
child 8433 33899f3d6b5c
permissions -rw-r--r--
(svn r11940) -Codechange: Store short filename once per open file instead of once per sprite cache entry. Not all file types need this, but most of the time no sprite cache entry needed it either.
8123
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     1
/* $Id$ */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     2
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     3
/** @file gfx_func.h Functions related to the gfx engine. */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     4
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     5
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     6
 * @defgroup dirty Dirty
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     7
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     8
 * Handles the repaint of some part of the screen.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
     9
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    10
 * Some places in the code are called functions which makes something "dirty".
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    11
 * This has nothing to do with making a Tile or Window darker or less visible.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    12
 * This term comes from memory caching and is used to define an object must
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    13
 * be repaint. If some data of an object (like a Tile, Window, Vehicle, whatever)
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    14
 * are changed which are so extensive the object must be repaint its marked
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    15
 * as "dirty". The video driver repaint this object instead of the whole screen
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    16
 * (this is btw. also possible if needed). This is used to avoid a
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    17
 * flickering of the screen by the video driver constantly repainting it.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    18
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    19
 * This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    20
 * rectangle defines the area on the screen which must be repaint. If a new object
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    21
 * needs to be repainted this rectangle is extended to 'catch' the object on the
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    22
 * screen. At some point (which is normaly uninteressted for patch writers) this
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    23
 * rectangle is send to the video drivers method
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    24
 * VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    25
 * later point (which is uninteressted, too) the video driver
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    26
 * repaints all these saved rectangle instead of the whole screen and drop the
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    27
 * rectangle informations. Then a new round begins by marking objects "dirty".
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    28
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    29
 * @see VideoDriver::MakeDirty
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    30
 * @see _invalid_rect
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    31
 * @see _screen
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    32
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    33
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    34
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    35
#ifndef GFX_FUNC_H
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    36
#define GFX_FUNC_H
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    37
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    38
#include "gfx_type.h"
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    39
#include "strings_type.h"
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    40
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    41
void GameLoop();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    42
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    43
void CreateConsole();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    44
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    45
extern byte _dirkeys;        ///< 1 = left, 2 = up, 4 = right, 8 = down
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    46
extern bool _fullscreen;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    47
extern CursorVars _cursor;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    48
extern bool _ctrl_pressed;   ///< Is Ctrl pressed?
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    49
extern bool _shift_pressed;  ///< Is Shift pressed?
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    50
extern byte _fast_forward;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    51
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    52
extern bool _left_button_down;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    53
extern bool _left_button_clicked;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    54
extern bool _right_button_down;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    55
extern bool _right_button_clicked;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    56
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    57
extern DrawPixelInfo _screen;
8249
90bd3316062f (svn r11813) -Fix [FS#1602]: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots.
frosch
parents: 8171
diff changeset
    58
extern bool _screen_disable_anim;   ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot)
8123
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    59
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    60
extern int _pal_first_dirty;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    61
extern int _pal_count_dirty;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    62
extern int _num_resolutions;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    63
extern uint16 _resolutions[32][2];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    64
extern uint16 _cur_resolution[2];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    65
extern Colour _cur_palette[256];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    66
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    67
void HandleKeypress(uint32 key);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    68
void HandleMouseEvents();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    69
void CSleep(int milliseconds);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    70
void UpdateWindows();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    71
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    72
uint32 InteractiveRandom(); //< Used for random sequences that are not the same on the other end of the multiplayer link
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    73
uint InteractiveRandomRange(uint max);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    74
void DrawChatMessage();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    75
void DrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    76
void ScreenSizeChanged();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    77
void HandleExitGameRequest();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    78
void GameSizeChanged();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    79
void UndrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    80
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    81
void RedrawScreenRect(int left, int top, int right, int bottom);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    82
void GfxScroll(int left, int top, int width, int height, int xo, int yo);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    83
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    84
void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    85
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    86
int DrawStringCentered(int x, int y, StringID str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    87
int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    88
int DoDrawStringCentered(int x, int y, const char *str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    89
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    90
int DrawString(int x, int y, StringID str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    91
int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    92
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    93
int DoDrawString(const char *string, int x, int y, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    94
int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    95
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    96
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    97
void DrawStringCenterUnderlineTruncated(int xl, int xr, int y, StringID str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    98
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    99
int DrawStringRightAligned(int x, int y, StringID str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   100
void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   101
void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   102
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   103
void GfxFillRect(int left, int top, int right, int bottom, int color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   104
void GfxDrawLine(int left, int top, int right, int bottom, int color);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   105
void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   106
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   107
Dimension GetStringBoundingBox(const char *str);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   108
uint32 FormatStringLinebreaks(char *str, int maxw);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   109
void LoadStringWidthTable();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   110
void DrawStringMultiCenter(int x, int y, StringID str, int maxw);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   111
uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh = -1);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   112
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   113
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   114
 * Let the dirty blocks repainting by the video driver.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   115
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   116
 * @ingroup dirty
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   117
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   118
void DrawDirtyBlocks();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   119
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   120
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   121
 * Set a new dirty block.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   122
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   123
 * @ingroup dirty
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   124
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   125
void SetDirtyBlocks(int left, int top, int right, int bottom);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   126
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   127
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   128
 * Marks the whole screen as dirty.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   129
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   130
 * @ingroup dirty
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   131
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   132
void MarkWholeScreenDirty();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   133
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   134
void GfxInitPalettes();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   135
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   136
bool FillDrawPixelInfo(DrawPixelInfo* n, int left, int top, int width, int height);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   137
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   138
/* window.cpp */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   139
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   140
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   141
void SetMouseCursor(SpriteID sprite, SpriteID pal);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   142
void SetAnimatedMouseCursor(const AnimCursor *table);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   143
void CursorTick();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   144
void DrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   145
void ScreenSizeChanged();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   146
void UndrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   147
bool ChangeResInGame(int w, int h);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   148
void SortResolutions(int count);
8171
3fb9d1f8ac3b (svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
belugas
parents: 8123
diff changeset
   149
bool ToggleFullScreen(bool fs);
8123
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   150
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   151
/* gfx.cpp */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   152
#define ASCII_LETTERSTART 32
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   153
extern FontSize _cur_fontsize;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   154
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   155
byte GetCharacterWidth(FontSize size, uint32 key);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   156
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   157
static inline byte GetCharacterHeight(FontSize size)
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   158
{
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   159
	switch (size) {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   160
		default: NOT_REACHED();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   161
		case FS_NORMAL: return 10;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   162
		case FS_SMALL:  return 6;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   163
		case FS_LARGE:  return 18;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   164
	}
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   165
}
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   166
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   167
extern DrawPixelInfo *_cur_dpi;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   168
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   169
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   170
 * All 16 colour gradients
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   171
 * 8 colours per gradient from darkest (0) to lightest (7)
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   172
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   173
extern byte _colour_gradient[16][8];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   174
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   175
extern bool _use_dos_palette;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   176
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   177
#endif /* GFX_FUNC_H */