2015-02-16 17:36:18 +00:00
|
|
|
/*
|
|
|
|
* OpenClonk, http://www.openclonk.org
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014-2015, The OpenClonk Team and contributors
|
|
|
|
*
|
|
|
|
* Distributed under the terms of the ISC license; see accompanying file
|
|
|
|
* "COPYING" for details.
|
|
|
|
*
|
|
|
|
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
|
|
|
|
* See accompanying file "TRADEMARK" for details.
|
|
|
|
*
|
|
|
|
* To redistribute this file separately, substitute the full license texts
|
|
|
|
* for the above references.
|
|
|
|
*/
|
|
|
|
|
2014-10-11 21:13:10 +00:00
|
|
|
#ifndef C4FOWREGION_H
|
|
|
|
#define C4FOWREGION_H
|
|
|
|
|
|
|
|
#include "C4Rect.h"
|
|
|
|
#include "C4Surface.h"
|
|
|
|
#include "C4FacetEx.h"
|
|
|
|
#include "C4Player.h"
|
|
|
|
#include "C4FoW.h"
|
|
|
|
|
|
|
|
class C4FoWRegion
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
C4FoWRegion(C4FoW *pFoW, C4Player *pPlayer);
|
|
|
|
~C4FoWRegion();
|
|
|
|
|
|
|
|
private:
|
|
|
|
C4FoW *pFoW;
|
|
|
|
C4Player *pPlayer;
|
2015-06-17 19:30:56 +00:00
|
|
|
C4Surface *pSurface, *pBackSurface;
|
2014-10-11 21:13:10 +00:00
|
|
|
C4Rect Region, OldRegion;
|
2015-01-07 16:29:48 +00:00
|
|
|
FLOAT_RECT ViewportRegion; // Region covered by visible viewport
|
2015-06-17 19:30:56 +00:00
|
|
|
|
|
|
|
#ifndef USE_CONSOLE
|
2014-10-11 21:13:10 +00:00
|
|
|
GLuint hFrameBufDraw, hFrameBufRead;
|
2015-06-17 19:30:56 +00:00
|
|
|
#endif
|
2014-10-11 21:13:10 +00:00
|
|
|
|
|
|
|
public:
|
2014-11-17 14:35:50 +00:00
|
|
|
const C4FoW* getFoW() const { return pFoW; }
|
2014-10-11 21:13:10 +00:00
|
|
|
const C4Rect &getRegion() const { return Region; }
|
2015-01-07 16:29:48 +00:00
|
|
|
const FLOAT_RECT &getViewportRegion() const { return ViewportRegion; }
|
2014-10-11 21:13:10 +00:00
|
|
|
const C4Surface *getSurface() const { return pSurface; }
|
|
|
|
const C4Surface *getBackSurface() const { return pBackSurface; }
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
|
2015-01-07 16:29:48 +00:00
|
|
|
void Update(C4Rect r, const FLOAT_RECT& vp);
|
2014-10-11 21:13:10 +00:00
|
|
|
void Render(const C4TargetFacet *pOnScreen = NULL);
|
|
|
|
|
2014-12-22 16:15:46 +00:00
|
|
|
// Fills a 2x3 matrix to transform fragment coordinates to light texture coordinates
|
2014-12-26 15:16:09 +00:00
|
|
|
void GetFragTransform(const C4Rect& clipRect, const C4Rect& outRect, float lightTransform[6]) const;
|
2014-10-11 21:13:10 +00:00
|
|
|
private:
|
|
|
|
bool BindFramebuf();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2014-11-06 16:19:41 +00:00
|
|
|
#endif
|