src/gfx_func.h
author rubidium
Tue, 25 Dec 2007 11:26:07 +0000
changeset 8131 160939e24ed3
parent 8123 ce31d2843a95
child 8171 3fb9d1f8ac3b
permissions -rw-r--r--
(svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h'
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;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    58
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    59
extern int _pal_first_dirty;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    60
extern int _pal_count_dirty;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    61
extern int _num_resolutions;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    62
extern uint16 _resolutions[32][2];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    63
extern uint16 _cur_resolution[2];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    64
extern Colour _cur_palette[256];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    65
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    66
void HandleKeypress(uint32 key);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    67
void HandleMouseEvents();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    68
void CSleep(int milliseconds);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    69
void UpdateWindows();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    70
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    71
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
    72
uint InteractiveRandomRange(uint max);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    73
void DrawChatMessage();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    74
void DrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    75
void ScreenSizeChanged();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    76
void HandleExitGameRequest();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    77
void GameSizeChanged();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    78
void UndrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    79
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    80
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
    81
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
    82
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    83
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
    84
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    85
/* XXX doesn't really belong here, but the only
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    86
 * consumers always use it in conjunction with DoDrawString() */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    87
#define UPARROW   "\xEE\x8A\x80"
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    88
#define DOWNARROW "\xEE\x8A\xAA"
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
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    91
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
    92
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
    93
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
    94
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    95
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
    96
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
    97
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
    98
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
    99
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
   100
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   101
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
   102
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
   103
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   104
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
   105
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
   106
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
   107
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   108
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
   109
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
   110
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
   111
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   112
Dimension GetStringBoundingBox(const char *str);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   113
uint32 FormatStringLinebreaks(char *str, int maxw);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   114
void LoadStringWidthTable();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   115
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
   116
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
   117
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   118
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   119
 * 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
   120
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   121
 * @ingroup dirty
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
void DrawDirtyBlocks();
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
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   126
 * Set a new dirty block.
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
 * @ingroup 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
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
   131
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   132
/**
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   133
 * Marks the whole screen as dirty.
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   134
 *
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   135
 * @ingroup dirty
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   136
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   137
void MarkWholeScreenDirty();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   138
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   139
void GfxInitPalettes();
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
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
   142
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   143
/* window.cpp */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   144
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
   145
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   146
void SetMouseCursor(SpriteID sprite, SpriteID pal);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   147
void SetAnimatedMouseCursor(const AnimCursor *table);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   148
void CursorTick();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   149
void DrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   150
void ScreenSizeChanged();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   151
void UndrawMouseCursor();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   152
bool ChangeResInGame(int w, int h);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   153
void SortResolutions(int count);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   154
void ToggleFullScreen(bool fs);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   155
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   156
/* gfx.cpp */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   157
#define ASCII_LETTERSTART 32
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   158
extern FontSize _cur_fontsize;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   159
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   160
byte GetCharacterWidth(FontSize size, uint32 key);
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   161
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   162
static inline byte GetCharacterHeight(FontSize size)
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   163
{
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   164
	switch (size) {
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   165
		default: NOT_REACHED();
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   166
		case FS_NORMAL: return 10;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   167
		case FS_SMALL:  return 6;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   168
		case FS_LARGE:  return 18;
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
}
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   171
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   172
extern DrawPixelInfo *_cur_dpi;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   173
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
 * All 16 colour gradients
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   176
 * 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
   177
 */
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   178
extern byte _colour_gradient[16][8];
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   179
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   180
extern bool _use_dos_palette;
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   181
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff changeset
   182
#endif /* GFX_FUNC_H */