2006-02-24 04:48:15 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// Refresh module, data I/O, caching, retrieval of graphics
|
|
|
|
// by name.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __R_DATA__
|
|
|
|
#define __R_DATA__
|
|
|
|
|
|
|
|
#include "r_defs.h"
|
|
|
|
#include "r_state.h"
|
|
|
|
#include "v_video.h"
|
|
|
|
|
2006-08-24 18:30:34 +00:00
|
|
|
class FWadLump;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-08-17 22:10:50 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
// A texture that doesn't really exist
|
|
|
|
class FDummyTexture : public FTexture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FDummyTexture ();
|
|
|
|
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
|
|
|
|
const BYTE *GetPixels ();
|
|
|
|
void Unload ();
|
|
|
|
void SetSize (int width, int height);
|
|
|
|
};
|
|
|
|
|
|
|
|
// A texture that returns a wiggly version of another texture.
|
|
|
|
class FWarpTexture : public FTexture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FWarpTexture (FTexture *source);
|
|
|
|
~FWarpTexture ();
|
|
|
|
|
2009-09-30 10:41:24 +00:00
|
|
|
virtual int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate=0, FCopyInfo *inf = NULL);
|
2006-02-24 04:48:15 +00:00
|
|
|
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
|
|
|
|
const BYTE *GetPixels ();
|
|
|
|
void Unload ();
|
|
|
|
bool CheckModified ();
|
2008-08-14 19:08:38 +00:00
|
|
|
|
|
|
|
float GetSpeed() const { return Speed; }
|
2007-12-28 11:17:52 +00:00
|
|
|
int GetSourceLump() { return SourcePic->GetSourceLump(); }
|
2008-04-26 08:46:55 +00:00
|
|
|
void SetSpeed(float fac) { Speed = fac; }
|
2008-08-14 19:08:38 +00:00
|
|
|
FTexture *GetRedirect(bool wantwarped);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-08-14 19:08:38 +00:00
|
|
|
DWORD GenTime;
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
FTexture *SourcePic;
|
|
|
|
BYTE *Pixels;
|
|
|
|
Span **Spans;
|
2008-04-26 08:46:55 +00:00
|
|
|
float Speed;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-06-23 08:20:08 +00:00
|
|
|
virtual void MakeTexture (DWORD time);
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// [GRB] Eternity-like warping
|
|
|
|
class FWarp2Texture : public FWarpTexture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FWarp2Texture (FTexture *source);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void MakeTexture (DWORD time);
|
|
|
|
};
|
|
|
|
|
|
|
|
// A texture that can be drawn to.
|
|
|
|
class DSimpleCanvas;
|
|
|
|
class FCanvasTexture : public FTexture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FCanvasTexture (const char *name, int width, int height);
|
|
|
|
~FCanvasTexture ();
|
|
|
|
|
|
|
|
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
|
|
|
|
const BYTE *GetPixels ();
|
|
|
|
void Unload ();
|
|
|
|
bool CheckModified ();
|
|
|
|
void RenderView (AActor *viewpoint, int fov);
|
2009-10-25 15:26:19 +00:00
|
|
|
void NeedUpdate() { bNeedsUpdate=true; }
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
DSimpleCanvas *Canvas;
|
|
|
|
BYTE *Pixels;
|
|
|
|
Span DummySpans[2];
|
|
|
|
BYTE bNeedsUpdate:1;
|
|
|
|
BYTE bDidUpdate:1;
|
2006-06-18 15:49:00 +00:00
|
|
|
BYTE bFirstUpdate:1;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
void MakeTexture ();
|
|
|
|
|
|
|
|
friend struct FCanvasTextureInfo;
|
|
|
|
};
|
|
|
|
|
|
|
|
// This list keeps track of the cameras that draw into canvas textures.
|
|
|
|
struct FCanvasTextureInfo
|
|
|
|
{
|
|
|
|
FCanvasTextureInfo *Next;
|
2008-03-16 00:54:53 +00:00
|
|
|
TObjPtr<AActor> Viewpoint;
|
2006-02-24 04:48:15 +00:00
|
|
|
FCanvasTexture *Texture;
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID PicNum;
|
2006-02-24 04:48:15 +00:00
|
|
|
int FOV;
|
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
static void Add (AActor *viewpoint, FTextureID picnum, int fov);
|
2006-02-24 04:48:15 +00:00
|
|
|
static void UpdateAll ();
|
|
|
|
static void EmptyList ();
|
|
|
|
static void Serialize (FArchive &arc);
|
2008-03-16 00:54:53 +00:00
|
|
|
static void Mark();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static FCanvasTextureInfo *List;
|
|
|
|
};
|
|
|
|
|
|
|
|
// I/O, setting up the stuff.
|
|
|
|
void R_InitData (void);
|
2006-05-12 03:14:40 +00:00
|
|
|
void R_DeinitData ();
|
2006-02-24 04:48:15 +00:00
|
|
|
void R_PrecacheLevel (void);
|
|
|
|
|
|
|
|
|
|
|
|
// Retrieval.
|
|
|
|
|
|
|
|
|
|
|
|
DWORD R_ColormapNumForName(const char *name); // killough 4/4/98
|
|
|
|
void R_SetDefaultColormap (const char *name); // [RH] change normal fadetable
|
|
|
|
DWORD R_BlendForColormap (DWORD map); // [RH] return calculated blend for a colormap
|
2006-09-14 00:02:31 +00:00
|
|
|
extern BYTE *realcolormaps; // [RH] make the colormaps externally visible
|
2006-02-24 04:48:15 +00:00
|
|
|
extern size_t numfakecmaps;
|
|
|
|
|
2006-07-13 10:17:56 +00:00
|
|
|
int R_FindSkin (const char *name, int pclass); // [RH] Find a skin
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2011-01-02 18:02:27 +00:00
|
|
|
FVoxel *R_LoadKVX(int lumpnum);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#endif
|