Devilution
Diablo devolved - magic behind the 1996 computer game
|
Go to the documentation of this file.
2 #include "../SourceX/display.h"
3 #include "../3rdParty/Storm/Source/storm.h"
20 if (SDLC_SetSurfaceAndPaletteColors(pal_surface, palette,
system_palette, 0, 256) < 0) {
23 pal_surface_palette_version++;
26 void ApplyGamma(SDL_Color *dst,
const SDL_Color *src,
int n)
33 for (i = 0; i < n; i++) {
34 dst->r = pow(src->r / 256.0, g) * 256.0;
35 dst->g = pow(src->g / 256.0, g) * 256.0;
36 dst->b = pow(src->b / 256.0, g) * 256.0;
55 if (!SRegLoadValue(
"Diablo",
"Gamma Correction", 0, &value))
60 }
else if (value > 100) {
64 if (!SRegLoadValue(
"Diablo",
"Color Cycling", 0, &value))
85 WReadFile(pBuf, (
char *)PalData,
sizeof(PalData), pszFileName);
88 for (i = 0; i < 256; i++) {
101 char szFileName[MAX_PATH];
107 sprintf(szFileName,
"Levels\\L%iData\\L%i_%i.PAL", l, l, rv);
153 for (i = 0; i < 255; i++) {
171 DWORD tc = SDL_GetTicks();
172 for (i = 0; i < 256; i = (SDL_GetTicks() - tc) / 2.083) {
188 DWORD tc = SDL_GetTicks();
189 for (i = 256; i > 0; i = 256 - (SDL_GetTicks() - tc) / 2.083) {
206 for (i = 1; i < 31; i++) {
219 for (i = 32 - n; i >= 0; i--) {
SDL_Color system_palette[256]
void ApplyGamma(SDL_Color *dst, const SDL_Color *src, int n)
BOOL palette_get_color_cycling()
void PaletteFadeIn(int fr)
void SetFadeLevel(DWORD fadeval)
void BltFast(SDL_Rect *src_rect, SDL_Rect *dst_rect)
BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist)
void LoadRndLvlPal(int l)
void palette_update_quest_palette(int n)
BOOL palette_set_color_cycling(BOOL enabled)
#define DEVILUTION_END_NAMESPACE
void palette_update_caves()
int UpdateGamma(int gamma)
BOOL color_cycling_enabled
DEVILUTION_BEGIN_NAMESPACE BOOL WCloseFile(HANDLE file)
void LoadPalette(char *pszFileName)
void PaletteFadeOut(int fr)
int random_(BYTE idx, int v)
Main RNG function.
SDL_Color orig_palette[256]
DEVILUTION_BEGIN_NAMESPACE SDL_Color logical_palette[256]
void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read, const char *FileName)