Refactoring
- Mark overriding virtual functions with `override` - Get rid of warnings
This commit is contained in:
parent
b4430338f0
commit
88f03f01e9
@ -43,17 +43,17 @@ namespace spades {
|
||||
|
||||
static bool TryLoad();
|
||||
|
||||
virtual client::IAudioChunk *RegisterSound(const char *name);
|
||||
client::IAudioChunk *RegisterSound(const char *name) override;
|
||||
|
||||
virtual void SetGameMap(client::GameMap *);
|
||||
void SetGameMap(client::GameMap *) override;
|
||||
|
||||
virtual void Play(client::IAudioChunk *, const Vector3 &origin,
|
||||
const client::AudioParam &);
|
||||
virtual void PlayLocal(client::IAudioChunk *, const Vector3 &origin,
|
||||
const client::AudioParam &);
|
||||
virtual void PlayLocal(client::IAudioChunk *, const client::AudioParam &);
|
||||
void Play(client::IAudioChunk *, const Vector3 &origin,
|
||||
const client::AudioParam &) override;
|
||||
void PlayLocal(client::IAudioChunk *, const Vector3 &origin,
|
||||
const client::AudioParam &) override;
|
||||
void PlayLocal(client::IAudioChunk *, const client::AudioParam &) override;
|
||||
|
||||
virtual void Respatialize(const Vector3 &eye, const Vector3 &front, const Vector3 &up);
|
||||
void Respatialize(const Vector3 &eye, const Vector3 &front, const Vector3 &up) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace spades {
|
||||
|
||||
public:
|
||||
CTFGameMode();
|
||||
virtual ~CTFGameMode();
|
||||
~CTFGameMode();
|
||||
|
||||
Team &GetTeam(int t);
|
||||
int GetCaptureLimit() { return captureLimit; }
|
||||
|
@ -80,7 +80,7 @@ namespace spades {
|
||||
IAudioDevice *audio);
|
||||
|
||||
protected:
|
||||
virtual ~ClientPlayer();
|
||||
~ClientPlayer();
|
||||
|
||||
public:
|
||||
ClientPlayer(Player *p, Client *);
|
||||
|
@ -51,7 +51,7 @@ namespace spades {
|
||||
void AlertError(const std::string &);
|
||||
|
||||
protected:
|
||||
virtual ~ClientUI();
|
||||
~ClientUI();
|
||||
|
||||
public:
|
||||
ClientUI(IRenderer *, IAudioDevice *, FontManager *font, Client *client);
|
||||
|
@ -243,10 +243,6 @@ namespace spades {
|
||||
def.denyCameraBlur = false;
|
||||
|
||||
} else {
|
||||
Vector3 front = player->GetFront();
|
||||
Vector3 right = player->GetRight();
|
||||
Vector3 up = player->GetUp();
|
||||
|
||||
Matrix4 eyeMatrix = clientPlayers[player->GetId()]->GetEyeMatrix();
|
||||
def.viewOrigin = eyeMatrix.GetOrigin();
|
||||
def.viewAxis[0] = -eyeMatrix.GetAxis(0);
|
||||
|
@ -22,9 +22,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "ILocalEntity.h"
|
||||
#include <Core/Math.h>
|
||||
#include <Core/VoxelModel.h>
|
||||
#include "ILocalEntity.h"
|
||||
|
||||
namespace spades {
|
||||
namespace client {
|
||||
@ -42,10 +42,10 @@ namespace spades {
|
||||
|
||||
public:
|
||||
FallingBlock(Client *, std::vector<IntVector3> blocks);
|
||||
virtual ~FallingBlock();
|
||||
~FallingBlock();
|
||||
|
||||
virtual bool Update(float dt);
|
||||
virtual void Render3D();
|
||||
bool Update(float dt) override;
|
||||
void Render3D() override;
|
||||
};
|
||||
}
|
||||
}
|
@ -37,18 +37,13 @@ namespace spades {
|
||||
GameMap::GameMap() : listener(NULL) {
|
||||
SPADES_MARK_FUNCTION();
|
||||
|
||||
uint32_t rnd = mt_engine();
|
||||
rnd ^= 0x7abd4513;
|
||||
for (int x = 0; x < DefaultWidth; x++)
|
||||
for (int y = 0; y < DefaultHeight; y++) {
|
||||
solidMap[x][y] = 1; // ground only
|
||||
for (int z = 0; z < DefaultDepth; z++) {
|
||||
uint32_t col = 0x00284067;
|
||||
col ^= 0x070707 & rnd;
|
||||
col ^= 0x070707 & static_cast<uint32_t>(mt_engine());
|
||||
colorMap[x][y][z] = col + (100UL * 0x1000000UL);
|
||||
rnd = (rnd * 0x71931) + 0x981f311;
|
||||
if (rnd == 0xffffffff) // mod 2^32-1
|
||||
rnd = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Core/Math.h>
|
||||
#include "ILocalEntity.h"
|
||||
#include "IModel.h"
|
||||
#include <Core/Math.h>
|
||||
|
||||
namespace spades {
|
||||
namespace client {
|
||||
@ -48,9 +48,9 @@ namespace spades {
|
||||
public:
|
||||
GunCasing(Client *client, IModel *model, IAudioChunk *dropSound,
|
||||
IAudioChunk *waterSound, Vector3 pos, Vector3 dir, Vector3 flyDir);
|
||||
virtual ~GunCasing();
|
||||
virtual bool Update(float dt);
|
||||
virtual void Render3D();
|
||||
~GunCasing();
|
||||
bool Update(float dt) override;
|
||||
void Render3D() override;
|
||||
};
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@ namespace spades {
|
||||
class IAudioChunk : public RefCountedObject {
|
||||
protected:
|
||||
IAudioChunk() {}
|
||||
virtual ~IAudioChunk() {}
|
||||
~IAudioChunk() {}
|
||||
|
||||
public:
|
||||
};
|
||||
|
@ -98,7 +98,7 @@ namespace spades {
|
||||
return;
|
||||
size_t len(std::min(256, static_cast<int>(context.size())));
|
||||
std::memcpy(mumbleLinkedMemory->context, context.c_str(), len);
|
||||
mumbleLinkedMemory->context_len = len;
|
||||
mumbleLinkedMemory->context_len = static_cast<std::uint32_t>(len);
|
||||
}
|
||||
|
||||
void MumbleLink::setIdentity(const std::string &identity) {
|
||||
|
@ -56,10 +56,10 @@ namespace spades {
|
||||
public:
|
||||
ParticleSpriteEntity(Client *cli, IImage *image, Vector4 color);
|
||||
|
||||
virtual ~ParticleSpriteEntity();
|
||||
~ParticleSpriteEntity();
|
||||
|
||||
virtual bool Update(float dt);
|
||||
virtual void Render3D();
|
||||
bool Update(float dt) override;
|
||||
void Render3D() override;
|
||||
|
||||
void SetAdditive(bool b) { additive = b; }
|
||||
|
||||
|
@ -52,8 +52,8 @@ namespace spades {
|
||||
Quake3Font(IRenderer *, IImage *texture, const int *map, int glyphHeight,
|
||||
float spaceWidth, bool extended = false);
|
||||
|
||||
virtual Vector2 Measure(const std::string &);
|
||||
virtual void Draw(const std::string &, Vector2 offset, float scale, Vector4 color);
|
||||
Vector2 Measure(const std::string &) override;
|
||||
void Draw(const std::string &, Vector2 offset, float scale, Vector4 color) override;
|
||||
void SetGlyphYRange(float yMin, float yMax);
|
||||
};
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ namespace spades {
|
||||
|
||||
static void Preload(IRenderer *);
|
||||
|
||||
virtual bool Update(float dt);
|
||||
bool Update(float dt) override;
|
||||
};
|
||||
}
|
||||
}
|
@ -59,7 +59,7 @@ namespace spades {
|
||||
|
||||
public:
|
||||
TCGameMode(World *);
|
||||
virtual ~TCGameMode();
|
||||
~TCGameMode();
|
||||
|
||||
Team &GetTeam(int t);
|
||||
|
||||
|
@ -27,10 +27,10 @@ namespace spades {
|
||||
|
||||
public:
|
||||
Tracer(Client *, Vector3 p1, Vector3 p2, float bulletVel);
|
||||
virtual ~Tracer();
|
||||
~Tracer();
|
||||
|
||||
virtual bool Update(float dt);
|
||||
virtual void Render3D();
|
||||
bool Update(float dt) override;
|
||||
void Render3D() override;
|
||||
};
|
||||
}
|
||||
}
|
@ -65,7 +65,7 @@ namespace spades {
|
||||
public:
|
||||
ConcurrentDispatch();
|
||||
ConcurrentDispatch(std::string name);
|
||||
virtual ~ConcurrentDispatch();
|
||||
~ConcurrentDispatch();
|
||||
|
||||
void Start();
|
||||
void StartOn(DispatchQueue *);
|
||||
@ -75,7 +75,7 @@ namespace spades {
|
||||
* when the dispatch completes, this instance will be deleted. */
|
||||
void Release();
|
||||
|
||||
virtual void Run();
|
||||
void Run() override;
|
||||
|
||||
void SetRunnable(IRunnable *r) { runnable = r; }
|
||||
IRunnable *GetRunnable() const { return runnable; }
|
||||
@ -86,6 +86,6 @@ namespace spades {
|
||||
|
||||
public:
|
||||
FunctionDispatch(F f) : f(f) {}
|
||||
virtual void Run() { f(); }
|
||||
void Run() override { f(); }
|
||||
};
|
||||
}
|
@ -56,17 +56,17 @@ namespace spades {
|
||||
DeflateStream(IStream *stream, CompressMode mode, bool autoClose = false);
|
||||
virtual ~DeflateStream();
|
||||
|
||||
virtual int ReadByte();
|
||||
virtual size_t Read(void *, size_t bytes);
|
||||
int ReadByte() override;
|
||||
size_t Read(void *, size_t bytes) override;
|
||||
|
||||
virtual void WriteByte(int);
|
||||
virtual void Write(const void *, size_t bytes);
|
||||
void WriteByte(int) override;
|
||||
void Write(const void *, size_t bytes) override;
|
||||
|
||||
virtual uint64_t GetPosition();
|
||||
virtual void SetPosition(uint64_t);
|
||||
uint64_t GetPosition() override;
|
||||
void SetPosition(uint64_t) override;
|
||||
|
||||
virtual uint64_t GetLength();
|
||||
virtual void SetLength(uint64_t);
|
||||
uint64_t GetLength() override;
|
||||
void SetLength(uint64_t) override;
|
||||
|
||||
/** Must be called when all data was written, in case of compressing, or output will be
|
||||
* corrupted */
|
||||
|
@ -33,12 +33,12 @@ namespace spades {
|
||||
|
||||
public:
|
||||
DirectoryFileSystem(const std::string &root, bool canWrite = true);
|
||||
virtual ~DirectoryFileSystem();
|
||||
~DirectoryFileSystem();
|
||||
|
||||
virtual std::vector<std::string> EnumFiles(const char *);
|
||||
std::vector<std::string> EnumFiles(const char *) override;
|
||||
|
||||
virtual IStream *OpenForReading(const char *);
|
||||
virtual IStream *OpenForWriting(const char *);
|
||||
virtual bool FileExists(const char *);
|
||||
IStream *OpenForReading(const char *) override;
|
||||
IStream *OpenForWriting(const char *) override;
|
||||
bool FileExists(const char *) override;
|
||||
};
|
||||
}
|
||||
|
@ -31,20 +31,20 @@ namespace spades {
|
||||
|
||||
public:
|
||||
DynamicMemoryStream();
|
||||
virtual ~DynamicMemoryStream();
|
||||
~DynamicMemoryStream();
|
||||
|
||||
virtual int ReadByte();
|
||||
virtual size_t Read(void *, size_t bytes);
|
||||
virtual std::string Read(size_t maxBytes);
|
||||
int ReadByte() override;
|
||||
size_t Read(void *, size_t bytes) override;
|
||||
std::string Read(size_t maxBytes) override;
|
||||
|
||||
virtual void WriteByte(int);
|
||||
virtual void Write(const void *, size_t bytes);
|
||||
void WriteByte(int) override;
|
||||
void Write(const void *, size_t bytes) override;
|
||||
|
||||
virtual uint64_t GetPosition();
|
||||
virtual void SetPosition(uint64_t);
|
||||
uint64_t GetPosition() override;
|
||||
void SetPosition(uint64_t) override;
|
||||
|
||||
virtual uint64_t GetLength();
|
||||
uint64_t GetLength() override;
|
||||
/** prohibited */
|
||||
virtual void SetLength(uint64_t);
|
||||
void SetLength(uint64_t) override;
|
||||
};
|
||||
}
|
@ -33,8 +33,8 @@ namespace spades {
|
||||
public:
|
||||
Exception(const char *format, ...);
|
||||
Exception(const char *file, int line, const char *format, ...);
|
||||
virtual ~Exception() throw();
|
||||
virtual const char *what() const throw();
|
||||
~Exception() throw();
|
||||
const char *what() const throw() override;
|
||||
const std::string &GetShortMessage() const throw() { return shortMessage; }
|
||||
};
|
||||
}
|
||||
|
@ -32,20 +32,20 @@ namespace spades {
|
||||
public:
|
||||
MemoryStream(char *buffer, size_t length, bool allowWrite);
|
||||
MemoryStream(const char *buffer, size_t length);
|
||||
virtual ~MemoryStream();
|
||||
~MemoryStream();
|
||||
|
||||
virtual int ReadByte();
|
||||
virtual size_t Read(void *, size_t bytes);
|
||||
virtual std::string Read(size_t maxBytes);
|
||||
int ReadByte() override;
|
||||
size_t Read(void *, size_t bytes) override;
|
||||
std::string Read(size_t maxBytes) override;
|
||||
|
||||
virtual void WriteByte(int);
|
||||
virtual void Write(const void *, size_t bytes);
|
||||
void WriteByte(int) override;
|
||||
void Write(const void *, size_t bytes) override;
|
||||
|
||||
virtual uint64_t GetPosition();
|
||||
virtual void SetPosition(uint64_t);
|
||||
uint64_t GetPosition() override;
|
||||
void SetPosition(uint64_t) override;
|
||||
|
||||
virtual uint64_t GetLength();
|
||||
uint64_t GetLength() override;
|
||||
/** prohibited */
|
||||
virtual void SetLength(uint64_t);
|
||||
void SetLength(uint64_t) override;
|
||||
};
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace spades {
|
||||
Mutex();
|
||||
~Mutex();
|
||||
|
||||
virtual void Lock();
|
||||
virtual void Unlock();
|
||||
void Lock() override;
|
||||
void Unlock() override;
|
||||
};
|
||||
}
|
||||
|
@ -42,17 +42,17 @@ namespace spades {
|
||||
|
||||
public:
|
||||
OpusAudioStream(IStream *, bool autoClose);
|
||||
virtual ~OpusAudioStream();
|
||||
~OpusAudioStream();
|
||||
|
||||
virtual uint64_t GetLength();
|
||||
virtual int GetSamplingFrequency();
|
||||
virtual SampleFormat GetSampleFormat();
|
||||
virtual int GetNumChannels();
|
||||
uint64_t GetLength() override;
|
||||
int GetSamplingFrequency() override;
|
||||
SampleFormat GetSampleFormat() override;
|
||||
int GetNumChannels() override;
|
||||
|
||||
virtual int ReadByte();
|
||||
virtual size_t Read(void *, size_t bytes);
|
||||
int ReadByte() override;
|
||||
size_t Read(void *, size_t bytes) override;
|
||||
|
||||
virtual uint64_t GetPosition();
|
||||
virtual void SetPosition(uint64_t);
|
||||
uint64_t GetPosition() override;
|
||||
void SetPosition(uint64_t) override;
|
||||
};
|
||||
}
|
||||
|
@ -33,20 +33,20 @@ namespace spades {
|
||||
SdlFileStream(SDL_RWops *f, bool autoClose = false);
|
||||
SdlFileStream(const SdlFileStream &) = delete;
|
||||
void operator=(const SdlFileStream &) = delete;
|
||||
virtual ~SdlFileStream();
|
||||
~SdlFileStream();
|
||||
|
||||
virtual int ReadByte();
|
||||
virtual size_t Read(void *, size_t bytes);
|
||||
int ReadByte() override;
|
||||
size_t Read(void *, size_t bytes) override;
|
||||
|
||||
virtual void WriteByte(int);
|
||||
virtual void Write(const void *, size_t bytes);
|
||||
void WriteByte(int) override;
|
||||
void Write(const void *, size_t bytes) override;
|
||||
|
||||
virtual uint64_t GetPosition();
|
||||
virtual void SetPosition(uint64_t);
|
||||
uint64_t GetPosition() override;
|
||||
void SetPosition(uint64_t) override;
|
||||
|
||||
virtual uint64_t GetLength();
|
||||
virtual void SetLength(uint64_t);
|
||||
uint64_t GetLength() override;
|
||||
void SetLength(uint64_t) override;
|
||||
|
||||
virtual void Flush();
|
||||
void Flush() override;
|
||||
};
|
||||
}
|
@ -32,7 +32,7 @@ namespace spades {
|
||||
void Post();
|
||||
void Wait();
|
||||
|
||||
virtual void Lock() { Wait(); }
|
||||
virtual void Unlock() { Post(); }
|
||||
void Lock() override { Wait(); }
|
||||
void Unlock() override { Post(); }
|
||||
};
|
||||
}
|
||||
|
@ -33,20 +33,20 @@ namespace spades {
|
||||
|
||||
public:
|
||||
StdStream(FILE *f, bool autoClose = false);
|
||||
virtual ~StdStream();
|
||||
~StdStream();
|
||||
|
||||
virtual int ReadByte();
|
||||
virtual size_t Read(void *, size_t bytes);
|
||||
int ReadByte() override;
|
||||
size_t Read(void *, size_t bytes) override;
|
||||
|
||||
virtual void WriteByte(int);
|
||||
virtual void Write(const void *, size_t bytes);
|
||||
void WriteByte(int) override;
|
||||
void Write(const void *, size_t bytes) override;
|
||||
|
||||
virtual uint64_t GetPosition();
|
||||
virtual void SetPosition(uint64_t);
|
||||
uint64_t GetPosition() override;
|
||||
void SetPosition(uint64_t) override;
|
||||
|
||||
virtual uint64_t GetLength();
|
||||
virtual void SetLength(uint64_t);
|
||||
uint64_t GetLength() override;
|
||||
void SetLength(uint64_t) override;
|
||||
|
||||
virtual void Flush();
|
||||
void Flush() override;
|
||||
};
|
||||
}
|
@ -35,7 +35,7 @@ namespace spades {
|
||||
uint32_t *colors;
|
||||
|
||||
protected:
|
||||
virtual ~VoxelModel();
|
||||
~VoxelModel();
|
||||
|
||||
public:
|
||||
VoxelModel(int width, int height, int depth);
|
||||
|
@ -48,17 +48,17 @@ namespace spades {
|
||||
|
||||
public:
|
||||
WavAudioStream(IStream *, bool autoClose);
|
||||
virtual ~WavAudioStream();
|
||||
~WavAudioStream();
|
||||
|
||||
virtual uint64_t GetLength();
|
||||
virtual int GetSamplingFrequency();
|
||||
virtual SampleFormat GetSampleFormat();
|
||||
virtual int GetNumChannels();
|
||||
uint64_t GetLength() override;
|
||||
int GetSamplingFrequency() override;
|
||||
SampleFormat GetSampleFormat() override;
|
||||
int GetNumChannels() override;
|
||||
|
||||
virtual int ReadByte();
|
||||
virtual size_t Read(void *, size_t bytes);
|
||||
int ReadByte() override;
|
||||
size_t Read(void *, size_t bytes) override;
|
||||
|
||||
virtual uint64_t GetPosition();
|
||||
virtual void SetPosition(uint64_t);
|
||||
uint64_t GetPosition() override;
|
||||
void SetPosition(uint64_t) override;
|
||||
};
|
||||
}
|
||||
|
@ -63,12 +63,12 @@ namespace spades {
|
||||
|
||||
public:
|
||||
ZipFileSystem(IStream *, bool autoClose = true);
|
||||
virtual ~ZipFileSystem();
|
||||
~ZipFileSystem();
|
||||
|
||||
virtual std::vector<std::string> EnumFiles(const char *);
|
||||
std::vector<std::string> EnumFiles(const char *) override;
|
||||
|
||||
virtual IStream *OpenForReading(const char *);
|
||||
virtual IStream *OpenForWriting(const char *);
|
||||
virtual bool FileExists(const char *);
|
||||
IStream *OpenForReading(const char *) override;
|
||||
IStream *OpenForWriting(const char *) override;
|
||||
bool FileExists(const char *) override;
|
||||
};
|
||||
}
|
||||
|
@ -50,11 +50,11 @@ namespace spades {
|
||||
|
||||
public:
|
||||
GLBasicShadowMapRenderer(GLRenderer *);
|
||||
virtual ~GLBasicShadowMapRenderer();
|
||||
virtual void Render();
|
||||
~GLBasicShadowMapRenderer();
|
||||
void Render() override;
|
||||
|
||||
virtual bool Cull(const AABB3 &);
|
||||
virtual bool SphereCull(const Vector3 ¢er, float rad);
|
||||
bool Cull(const AABB3 &) override;
|
||||
bool SphereCull(const Vector3 ¢er, float rad) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ namespace spades {
|
||||
void MakeSureValid();
|
||||
|
||||
protected:
|
||||
virtual ~GLImage();
|
||||
~GLImage();
|
||||
|
||||
public:
|
||||
GLImage(IGLDevice::UInteger textureObject, IGLDevice *device, float w, float h,
|
||||
@ -45,8 +45,8 @@ namespace spades {
|
||||
static GLImage *FromBitmap(Bitmap *, IGLDevice *);
|
||||
void Bind(IGLDevice::Enum target);
|
||||
|
||||
virtual float GetWidth() { return width; }
|
||||
virtual float GetHeight() { return height; }
|
||||
float GetWidth() override { return width; }
|
||||
float GetHeight() override { return height; }
|
||||
|
||||
float GetInvWidth() { return invWidth; }
|
||||
float GetInvHeight() { return invHeight; }
|
||||
|
@ -142,14 +142,8 @@ namespace spades {
|
||||
SPADES_MARK_FUNCTION();
|
||||
|
||||
noise.resize(128 * 128);
|
||||
uint32_t rnd = mt_engine();
|
||||
rnd ^= 0x7abd4513;
|
||||
for (size_t i = 0; i < 128 * 128; i++) {
|
||||
noise[i] = rnd;
|
||||
|
||||
rnd = (rnd * 0x71931) + 0x981f311;
|
||||
if (rnd == 0xffffffff) // mod 2^32-1
|
||||
rnd = 0;
|
||||
noise[i] = static_cast<std::uint32_t>(mt_engine());
|
||||
}
|
||||
|
||||
IGLDevice *dev = renderer->GetGLDevice();
|
||||
|
@ -22,9 +22,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <Core/VoxelModel.h>
|
||||
#include "GLModel.h"
|
||||
#include "IGLDevice.h"
|
||||
#include <Core/VoxelModel.h>
|
||||
|
||||
namespace spades {
|
||||
namespace draw {
|
||||
@ -79,23 +79,23 @@ namespace spades {
|
||||
void GenerateTexture();
|
||||
|
||||
protected:
|
||||
virtual ~GLOptimizedVoxelModel();
|
||||
~GLOptimizedVoxelModel();
|
||||
|
||||
public:
|
||||
GLOptimizedVoxelModel(VoxelModel *, GLRenderer *r);
|
||||
|
||||
static void PreloadShaders(GLRenderer *);
|
||||
|
||||
virtual void Prerender(std::vector<client::ModelRenderParam> params);
|
||||
void Prerender(std::vector<client::ModelRenderParam> params) override;
|
||||
|
||||
virtual void RenderShadowMapPass(std::vector<client::ModelRenderParam> params);
|
||||
void RenderShadowMapPass(std::vector<client::ModelRenderParam> params) override;
|
||||
|
||||
virtual void RenderSunlightPass(std::vector<client::ModelRenderParam> params);
|
||||
void RenderSunlightPass(std::vector<client::ModelRenderParam> params) override;
|
||||
|
||||
virtual void RenderDynamicLightPass(std::vector<client::ModelRenderParam> params,
|
||||
std::vector<GLDynamicLight> lights);
|
||||
void RenderDynamicLightPass(std::vector<client::ModelRenderParam> params,
|
||||
std::vector<GLDynamicLight> lights) override;
|
||||
|
||||
virtual AABB3 GetBoundingBox() { return boundingBox; }
|
||||
AABB3 GetBoundingBox() override { return boundingBox; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -22,13 +22,13 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "GLCameraBlurFilter.h"
|
||||
#include "GLDynamicLight.h"
|
||||
#include "GLSettings.h"
|
||||
#include <Client/IGameMapListener.h>
|
||||
#include <Client/IRenderer.h>
|
||||
#include <Client/SceneDefinition.h>
|
||||
#include <Core/Math.h>
|
||||
#include "GLCameraBlurFilter.h"
|
||||
#include "GLDynamicLight.h"
|
||||
#include "GLSettings.h"
|
||||
|
||||
namespace spades {
|
||||
namespace draw {
|
||||
@ -137,67 +137,66 @@ namespace spades {
|
||||
void EnsureSceneNotStarted();
|
||||
|
||||
protected:
|
||||
virtual ~GLRenderer();
|
||||
~GLRenderer();
|
||||
|
||||
public:
|
||||
GLRenderer(IGLDevice *glDevice);
|
||||
|
||||
virtual void Init();
|
||||
virtual void Shutdown();
|
||||
void Init() override;
|
||||
void Shutdown() override;
|
||||
|
||||
virtual client::IImage *RegisterImage(const char *filename);
|
||||
virtual client::IModel *RegisterModel(const char *filename);
|
||||
client::IImage *RegisterImage(const char *filename) override;
|
||||
client::IModel *RegisterModel(const char *filename) override;
|
||||
|
||||
virtual client::IImage *CreateImage(Bitmap *);
|
||||
virtual client::IModel *CreateModel(VoxelModel *);
|
||||
virtual client::IModel *CreateModelOptimized(VoxelModel *);
|
||||
client::IImage *CreateImage(Bitmap *) override;
|
||||
client::IModel *CreateModel(VoxelModel *) override;
|
||||
client::IModel *CreateModelOptimized(VoxelModel *);
|
||||
|
||||
GLProgram *RegisterProgram(const std::string &name);
|
||||
GLShader *RegisterShader(const std::string &name);
|
||||
|
||||
virtual void SetGameMap(client::GameMap *);
|
||||
virtual void SetFogColor(Vector3 v);
|
||||
virtual void SetFogDistance(float f) { fogDistance = f; }
|
||||
void SetGameMap(client::GameMap *) override;
|
||||
void SetFogColor(Vector3 v) override;
|
||||
void SetFogDistance(float f) override { fogDistance = f; }
|
||||
|
||||
Vector3 GetFogColor() { return fogColor; }
|
||||
float GetFogDistance() { return fogDistance; }
|
||||
Vector3 GetFogColorForSolidPass();
|
||||
|
||||
virtual void StartScene(const client::SceneDefinition &);
|
||||
void StartScene(const client::SceneDefinition &) override;
|
||||
|
||||
virtual void RenderModel(client::IModel *, const client::ModelRenderParam &);
|
||||
void RenderModel(client::IModel *, const client::ModelRenderParam &) override;
|
||||
|
||||
virtual void AddLight(const client::DynamicLightParam &light);
|
||||
void AddLight(const client::DynamicLightParam &light) override;
|
||||
|
||||
virtual void AddDebugLine(Vector3 a, Vector3 b, Vector4 color);
|
||||
void AddDebugLine(Vector3 a, Vector3 b, Vector4 color) override;
|
||||
|
||||
virtual void AddSprite(client::IImage *, Vector3 center, float radius, float rotation);
|
||||
virtual void AddLongSprite(client::IImage *, Vector3 p1, Vector3 p2, float radius);
|
||||
void AddSprite(client::IImage *, Vector3 center, float radius, float rotation) override;
|
||||
void AddLongSprite(client::IImage *, Vector3 p1, Vector3 p2, float radius) override;
|
||||
|
||||
virtual void EndScene();
|
||||
void EndScene() override;
|
||||
|
||||
virtual void MultiplyScreenColor(Vector3);
|
||||
void MultiplyScreenColor(Vector3) override;
|
||||
|
||||
virtual void SetColor(Vector4);
|
||||
virtual void SetColorAlphaPremultiplied(Vector4);
|
||||
void SetColor(Vector4) override;
|
||||
void SetColorAlphaPremultiplied(Vector4) override;
|
||||
|
||||
virtual void DrawImage(client::IImage *, const Vector2 &outTopLeft);
|
||||
virtual void DrawImage(client::IImage *, const AABB2 &outRect);
|
||||
virtual void DrawImage(client::IImage *, const Vector2 &outTopLeft,
|
||||
const AABB2 &inRect);
|
||||
virtual void DrawImage(client::IImage *, const AABB2 &outRect, const AABB2 &inRect);
|
||||
virtual void DrawImage(client::IImage *, const Vector2 &outTopLeft,
|
||||
const Vector2 &outTopRight, const Vector2 &outBottomLeft,
|
||||
const AABB2 &inRect);
|
||||
void DrawImage(client::IImage *, const Vector2 &outTopLeft) override;
|
||||
void DrawImage(client::IImage *, const AABB2 &outRect) override;
|
||||
void DrawImage(client::IImage *, const Vector2 &outTopLeft,
|
||||
const AABB2 &inRect) override;
|
||||
void DrawImage(client::IImage *, const AABB2 &outRect, const AABB2 &inRect) override;
|
||||
void DrawImage(client::IImage *, const Vector2 &outTopLeft, const Vector2 &outTopRight,
|
||||
const Vector2 &outBottomLeft, const AABB2 &inRect) override;
|
||||
|
||||
virtual void DrawFlatGameMap(const AABB2 &outRect, const AABB2 &inRect);
|
||||
void DrawFlatGameMap(const AABB2 &outRect, const AABB2 &inRect) override;
|
||||
|
||||
virtual void FrameDone();
|
||||
virtual void Flip();
|
||||
virtual Bitmap *ReadBitmap();
|
||||
void FrameDone() override;
|
||||
void Flip() override;
|
||||
Bitmap *ReadBitmap() override;
|
||||
|
||||
virtual float ScreenWidth();
|
||||
virtual float ScreenHeight();
|
||||
float ScreenWidth() override;
|
||||
float ScreenHeight() override;
|
||||
|
||||
GLSettings &GetSettings() { return settings; }
|
||||
IGLDevice *GetGLDevice() { return device; }
|
||||
@ -214,7 +213,7 @@ namespace spades {
|
||||
|
||||
bool IsRenderingMirror() const { return renderingMirror; }
|
||||
|
||||
virtual void GameMapChanged(int x, int y, int z, client::GameMap *);
|
||||
void GameMapChanged(int x, int y, int z, client::GameMap *) override;
|
||||
|
||||
const client::SceneDefinition &GetSceneDef() const { return sceneDef; }
|
||||
|
||||
|
@ -102,11 +102,11 @@ namespace spades {
|
||||
|
||||
public:
|
||||
GLSoftLitSpriteRenderer(GLRenderer *);
|
||||
virtual ~GLSoftLitSpriteRenderer();
|
||||
~GLSoftLitSpriteRenderer();
|
||||
|
||||
virtual void Add(GLImage *img, Vector3 center, float rad, float ang, Vector4 color);
|
||||
virtual void Clear();
|
||||
virtual void Render();
|
||||
void Add(GLImage *img, Vector3 center, float rad, float ang, Vector4 color) override;
|
||||
void Clear() override;
|
||||
void Render() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -91,11 +91,11 @@ namespace spades {
|
||||
|
||||
public:
|
||||
GLSoftSpriteRenderer(GLRenderer *);
|
||||
virtual ~GLSoftSpriteRenderer();
|
||||
~GLSoftSpriteRenderer();
|
||||
|
||||
virtual void Add(GLImage *img, Vector3 center, float rad, float ang, Vector4 color);
|
||||
virtual void Clear();
|
||||
virtual void Render();
|
||||
void Add(GLImage *img, Vector3 center, float rad, float ang, Vector4 color) override;
|
||||
void Clear() override;
|
||||
void Render() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -60,15 +60,15 @@ namespace spades {
|
||||
void BuildMatrix(float near, float far);
|
||||
|
||||
protected:
|
||||
virtual void RenderShadowMapPass();
|
||||
void RenderShadowMapPass() override;
|
||||
|
||||
public:
|
||||
GLSparseShadowMapRenderer(GLRenderer *);
|
||||
virtual ~GLSparseShadowMapRenderer();
|
||||
virtual void Render();
|
||||
~GLSparseShadowMapRenderer();
|
||||
void Render() override;
|
||||
|
||||
virtual bool Cull(const AABB3 &);
|
||||
virtual bool SphereCull(const Vector3 ¢er, float rad);
|
||||
bool Cull(const AABB3 &) override;
|
||||
bool SphereCull(const Vector3 ¢er, float rad) override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -84,11 +84,11 @@ namespace spades {
|
||||
|
||||
public:
|
||||
GLSpriteRenderer(GLRenderer *);
|
||||
virtual ~GLSpriteRenderer();
|
||||
~GLSpriteRenderer();
|
||||
|
||||
virtual void Add(GLImage *img, Vector3 center, float rad, float ang, Vector4 color);
|
||||
virtual void Clear();
|
||||
virtual void Render();
|
||||
void Add(GLImage *img, Vector3 center, float rad, float ang, Vector4 color) override;
|
||||
void Clear() override;
|
||||
void Render() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <Core/VoxelModel.h>
|
||||
#include "GLModel.h"
|
||||
#include "IGLDevice.h"
|
||||
#include <Core/VoxelModel.h>
|
||||
|
||||
namespace spades {
|
||||
namespace draw {
|
||||
@ -72,23 +72,23 @@ namespace spades {
|
||||
void BuildVertices(VoxelModel *);
|
||||
|
||||
protected:
|
||||
virtual ~GLVoxelModel();
|
||||
~GLVoxelModel();
|
||||
|
||||
public:
|
||||
GLVoxelModel(VoxelModel *, GLRenderer *r);
|
||||
|
||||
static void PreloadShaders(GLRenderer *);
|
||||
|
||||
virtual void Prerender(std::vector<client::ModelRenderParam> params);
|
||||
void Prerender(std::vector<client::ModelRenderParam> params) override;
|
||||
|
||||
virtual void RenderShadowMapPass(std::vector<client::ModelRenderParam> params);
|
||||
void RenderShadowMapPass(std::vector<client::ModelRenderParam> params) override;
|
||||
|
||||
virtual void RenderSunlightPass(std::vector<client::ModelRenderParam> params);
|
||||
void RenderSunlightPass(std::vector<client::ModelRenderParam> params) override;
|
||||
|
||||
virtual void RenderDynamicLightPass(std::vector<client::ModelRenderParam> params,
|
||||
std::vector<GLDynamicLight> lights);
|
||||
void RenderDynamicLightPass(std::vector<client::ModelRenderParam> params,
|
||||
std::vector<GLDynamicLight> lights) override;
|
||||
|
||||
virtual AABB3 GetBoundingBox() { return boundingBox; }
|
||||
AABB3 GetBoundingBox() override { return boundingBox; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ namespace spades {
|
||||
mag *= expf(-scal * 3.f);
|
||||
|
||||
cell.magnitude = mag;
|
||||
cell.phase = mt_engine();
|
||||
cell.phase = static_cast<uint32_t>(mt_engine());
|
||||
cell.phasePerSecond = dist * 1.e+9f * 128 / Size;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace spades {
|
||||
float iw, ih;
|
||||
|
||||
protected:
|
||||
virtual ~SWImage();
|
||||
~SWImage();
|
||||
|
||||
public:
|
||||
SWImage(Bitmap *bmp);
|
||||
@ -53,10 +53,10 @@ namespace spades {
|
||||
|
||||
void Update(Bitmap &, int x, int y) override;
|
||||
|
||||
virtual float GetWidth() { return w; }
|
||||
virtual float GetHeight() { return h; }
|
||||
virtual float GetInvWidth() { return iw; }
|
||||
virtual float GetInvHeight() { return ih; }
|
||||
float GetWidth() override { return w; }
|
||||
float GetHeight() override { return h; }
|
||||
float GetInvWidth() { return iw; }
|
||||
float GetInvHeight() { return ih; }
|
||||
};
|
||||
|
||||
class SWImageManager {
|
||||
|
@ -41,7 +41,7 @@ namespace spades {
|
||||
std::vector<uint32_t> renderDataAddr;
|
||||
|
||||
protected:
|
||||
virtual ~SWModel();
|
||||
~SWModel();
|
||||
|
||||
public:
|
||||
SWModel(VoxelModel *model);
|
||||
|
@ -27,7 +27,7 @@ namespace spades {
|
||||
namespace draw {
|
||||
class SWPort : public RefCountedObject {
|
||||
protected:
|
||||
virtual ~SWPort() {}
|
||||
~SWPort() {}
|
||||
|
||||
public:
|
||||
virtual Bitmap *GetFramebuffer() = 0;
|
||||
|
@ -25,11 +25,11 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "SWFeatureLevel.h"
|
||||
#include <Client/IGameMapListener.h>
|
||||
#include <Client/IRenderer.h>
|
||||
#include <Client/SceneDefinition.h>
|
||||
#include <Core/Math.h>
|
||||
#include "SWFeatureLevel.h"
|
||||
#include <Core/Stopwatch.h>
|
||||
|
||||
namespace spades {
|
||||
@ -146,71 +146,70 @@ namespace spades {
|
||||
template <SWFeatureLevel> void ApplyDynamicLight(const DynamicLight &);
|
||||
|
||||
protected:
|
||||
virtual ~SWRenderer();
|
||||
~SWRenderer();
|
||||
|
||||
public:
|
||||
SWRenderer(SWPort *port, SWFeatureLevel featureLevel = DetectFeatureLevel());
|
||||
|
||||
virtual void Init();
|
||||
virtual void Shutdown();
|
||||
void Init() override;
|
||||
void Shutdown() override;
|
||||
|
||||
virtual client::IImage *RegisterImage(const char *filename);
|
||||
virtual client::IModel *RegisterModel(const char *filename);
|
||||
client::IImage *RegisterImage(const char *filename) override;
|
||||
client::IModel *RegisterModel(const char *filename) override;
|
||||
|
||||
virtual client::IImage *CreateImage(Bitmap *);
|
||||
virtual client::IModel *CreateModel(VoxelModel *);
|
||||
client::IImage *CreateImage(Bitmap *) override;
|
||||
client::IModel *CreateModel(VoxelModel *) override;
|
||||
/*
|
||||
GLProgram *RegisterProgram(const std::string& name);
|
||||
GLShader *RegisterShader(const std::string& name);
|
||||
GLProgram *RegisterProgram(const std::string& name) override;
|
||||
GLShader *RegisterShader(const std::string& name) override;
|
||||
*/
|
||||
virtual void SetGameMap(client::GameMap *);
|
||||
virtual void SetFogColor(Vector3 v);
|
||||
virtual void SetFogDistance(float f) { fogDistance = f; }
|
||||
void SetGameMap(client::GameMap *) override;
|
||||
void SetFogColor(Vector3 v) override;
|
||||
void SetFogDistance(float f) override { fogDistance = f; }
|
||||
|
||||
Vector3 GetFogColor() { return fogColor; }
|
||||
float GetFogDistance() { return fogDistance; }
|
||||
|
||||
virtual void StartScene(const client::SceneDefinition &);
|
||||
void StartScene(const client::SceneDefinition &) override;
|
||||
|
||||
virtual void RenderModel(client::IModel *, const client::ModelRenderParam &);
|
||||
void RenderModel(client::IModel *, const client::ModelRenderParam &) override;
|
||||
|
||||
virtual void AddLight(const client::DynamicLightParam &light);
|
||||
void AddLight(const client::DynamicLightParam &light) override;
|
||||
|
||||
virtual void AddDebugLine(Vector3 a, Vector3 b, Vector4 color);
|
||||
void AddDebugLine(Vector3 a, Vector3 b, Vector4 color) override;
|
||||
|
||||
virtual void AddSprite(client::IImage *, Vector3 center, float radius, float rotation);
|
||||
virtual void AddLongSprite(client::IImage *, Vector3 p1, Vector3 p2, float radius);
|
||||
void AddSprite(client::IImage *, Vector3 center, float radius, float rotation) override;
|
||||
void AddLongSprite(client::IImage *, Vector3 p1, Vector3 p2, float radius) override;
|
||||
|
||||
virtual void EndScene();
|
||||
void EndScene() override;
|
||||
|
||||
virtual void MultiplyScreenColor(Vector3);
|
||||
void MultiplyScreenColor(Vector3) override;
|
||||
|
||||
virtual void SetColor(Vector4);
|
||||
virtual void SetColorAlphaPremultiplied(Vector4);
|
||||
void SetColor(Vector4) override;
|
||||
void SetColorAlphaPremultiplied(Vector4) override;
|
||||
|
||||
virtual void DrawImage(client::IImage *, const Vector2 &outTopLeft);
|
||||
virtual void DrawImage(client::IImage *, const AABB2 &outRect);
|
||||
virtual void DrawImage(client::IImage *, const Vector2 &outTopLeft,
|
||||
const AABB2 &inRect);
|
||||
virtual void DrawImage(client::IImage *, const AABB2 &outRect, const AABB2 &inRect);
|
||||
virtual void DrawImage(client::IImage *, const Vector2 &outTopLeft,
|
||||
const Vector2 &outTopRight, const Vector2 &outBottomLeft,
|
||||
const AABB2 &inRect);
|
||||
void DrawImage(client::IImage *, const Vector2 &outTopLeft) override;
|
||||
void DrawImage(client::IImage *, const AABB2 &outRect) override;
|
||||
void DrawImage(client::IImage *, const Vector2 &outTopLeft,
|
||||
const AABB2 &inRect) override;
|
||||
void DrawImage(client::IImage *, const AABB2 &outRect, const AABB2 &inRect) override;
|
||||
void DrawImage(client::IImage *, const Vector2 &outTopLeft, const Vector2 &outTopRight,
|
||||
const Vector2 &outBottomLeft, const AABB2 &inRect) override;
|
||||
|
||||
virtual void DrawFlatGameMap(const AABB2 &outRect, const AABB2 &inRect);
|
||||
void DrawFlatGameMap(const AABB2 &outRect, const AABB2 &inRect) override;
|
||||
|
||||
virtual void FrameDone();
|
||||
virtual void Flip();
|
||||
virtual Bitmap *ReadBitmap();
|
||||
void FrameDone() override;
|
||||
void Flip() override;
|
||||
Bitmap *ReadBitmap() override;
|
||||
|
||||
virtual float ScreenWidth();
|
||||
virtual float ScreenHeight();
|
||||
float ScreenWidth() override;
|
||||
float ScreenHeight() override;
|
||||
|
||||
const Matrix4 &GetProjectionMatrix() const { return projectionMatrix; }
|
||||
const Matrix4 &GetProjectionViewMatrix() const { return projectionViewMatrix; }
|
||||
const Matrix4 &GetViewMatrix() const { return viewMatrix; }
|
||||
|
||||
virtual void GameMapChanged(int x, int y, int z, client::GameMap *);
|
||||
void GameMapChanged(int x, int y, int z, client::GameMap *) override;
|
||||
|
||||
const client::SceneDefinition &GetSceneDef() const { return sceneDef; }
|
||||
|
||||
|
@ -24,8 +24,8 @@
|
||||
#include <Client/IAudioDevice.h>
|
||||
#include <Client/IRenderer.h>
|
||||
#include <Core/RefCountedObject.h>
|
||||
#include <ScriptBindings/ScriptManager.h>
|
||||
#include <Core/ServerAddress.h>
|
||||
#include <ScriptBindings/ScriptManager.h>
|
||||
|
||||
namespace spades {
|
||||
namespace client {
|
||||
@ -52,7 +52,7 @@ namespace spades {
|
||||
std::string Connect(const ServerAddress &host);
|
||||
|
||||
protected:
|
||||
virtual ~MainScreen();
|
||||
~MainScreen();
|
||||
|
||||
public:
|
||||
MainScreen(client::IRenderer *, client::IAudioDevice *, client::FontManager *);
|
||||
@ -60,20 +60,20 @@ namespace spades {
|
||||
client::IRenderer *GetRenderer() { return &*renderer; }
|
||||
client::IAudioDevice *GetAudioDevice() { return &*audioDevice; }
|
||||
|
||||
virtual void MouseEvent(float x, float y);
|
||||
virtual void KeyEvent(const std::string &, bool down);
|
||||
virtual void TextInputEvent(const std::string &);
|
||||
virtual void TextEditingEvent(const std::string &, int start, int len);
|
||||
virtual bool AcceptsTextInput();
|
||||
virtual AABB2 GetTextInputRect();
|
||||
virtual void WheelEvent(float x, float y);
|
||||
virtual bool NeedsAbsoluteMouseCoordinate();
|
||||
void MouseEvent(float x, float y) override;
|
||||
void KeyEvent(const std::string &, bool down) override;
|
||||
void TextInputEvent(const std::string &) override;
|
||||
void TextEditingEvent(const std::string &, int start, int len) override;
|
||||
bool AcceptsTextInput() override;
|
||||
AABB2 GetTextInputRect() override;
|
||||
void WheelEvent(float x, float y) override;
|
||||
bool NeedsAbsoluteMouseCoordinate() override;
|
||||
|
||||
virtual void RunFrame(float dt);
|
||||
void RunFrame(float dt) override;
|
||||
|
||||
virtual void Closing();
|
||||
void Closing() override;
|
||||
|
||||
virtual bool WantsToBeClosed();
|
||||
bool WantsToBeClosed() override;
|
||||
};
|
||||
;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ namespace spades {
|
||||
std::unordered_set<std::string> favorites;
|
||||
|
||||
protected:
|
||||
virtual ~MainScreenHelper();
|
||||
~MainScreenHelper();
|
||||
|
||||
public:
|
||||
MainScreenHelper(MainScreen *scr);
|
||||
|
@ -50,13 +50,13 @@ namespace spades {
|
||||
Mutex stateMutex;
|
||||
|
||||
protected:
|
||||
virtual int GetModState() { return modState; }
|
||||
virtual void RunClientLoop(client::IRenderer *renderer, client::IAudioDevice *dev);
|
||||
virtual void ClientThreadProc(client::IRenderer *renderer, client::IAudioDevice *dev);
|
||||
int GetModState() override { return modState; }
|
||||
void RunClientLoop(client::IRenderer *renderer, client::IAudioDevice *dev) override;
|
||||
void ClientThreadProc(client::IRenderer *renderer, client::IAudioDevice *dev);
|
||||
|
||||
public:
|
||||
SDLAsyncRunner();
|
||||
virtual ~SDLAsyncRunner();
|
||||
~SDLAsyncRunner();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -33,160 +33,159 @@ namespace spades {
|
||||
int w, h;
|
||||
|
||||
protected:
|
||||
virtual ~SDLGLDevice();
|
||||
~SDLGLDevice();
|
||||
|
||||
public:
|
||||
SDLGLDevice(SDL_Window *);
|
||||
|
||||
virtual void DepthRange(Float near, Float far);
|
||||
virtual void Viewport(Integer x, Integer y, Sizei width, Sizei height);
|
||||
void DepthRange(Float near, Float far) override;
|
||||
void Viewport(Integer x, Integer y, Sizei width, Sizei height) override;
|
||||
|
||||
virtual void ClearDepth(Float);
|
||||
virtual void ClearColor(Float, Float, Float, Float);
|
||||
virtual void Clear(Enum);
|
||||
void ClearDepth(Float) override;
|
||||
void ClearColor(Float, Float, Float, Float) override;
|
||||
void Clear(Enum) override;
|
||||
|
||||
virtual void Finish();
|
||||
virtual void Flush();
|
||||
void Finish() override;
|
||||
void Flush() override;
|
||||
|
||||
virtual void DepthMask(bool);
|
||||
virtual void ColorMask(bool r, bool g, bool b, bool a);
|
||||
void DepthMask(bool) override;
|
||||
void ColorMask(bool r, bool g, bool b, bool a) override;
|
||||
|
||||
virtual void FrontFace(Enum);
|
||||
virtual void Enable(Enum state, bool);
|
||||
void FrontFace(Enum) override;
|
||||
void Enable(Enum state, bool) override;
|
||||
|
||||
virtual Integer GetInteger(Enum type);
|
||||
Integer GetInteger(Enum type) override;
|
||||
|
||||
virtual const char *GetString(Enum type);
|
||||
virtual const char *GetIndexedString(Enum type, UInteger);
|
||||
const char *GetString(Enum type) override;
|
||||
const char *GetIndexedString(Enum type, UInteger) override;
|
||||
|
||||
virtual void BlendEquation(Enum mode);
|
||||
virtual void BlendEquation(Enum rgb, Enum alpha);
|
||||
virtual void BlendFunc(Enum src, Enum dest);
|
||||
virtual void BlendFunc(Enum srcRgb, Enum destRgb, Enum srcAlpha, Enum destAlpha);
|
||||
virtual void BlendColor(Float r, Float g, Float b, Float a);
|
||||
virtual void DepthFunc(Enum);
|
||||
virtual void LineWidth(Float);
|
||||
void BlendEquation(Enum mode) override;
|
||||
void BlendEquation(Enum rgb, Enum alpha) override;
|
||||
void BlendFunc(Enum src, Enum dest) override;
|
||||
void BlendFunc(Enum srcRgb, Enum destRgb, Enum srcAlpha, Enum destAlpha) override;
|
||||
void BlendColor(Float r, Float g, Float b, Float a) override;
|
||||
void DepthFunc(Enum) override;
|
||||
void LineWidth(Float) override;
|
||||
|
||||
virtual UInteger GenBuffer();
|
||||
virtual void DeleteBuffer(UInteger);
|
||||
virtual void BindBuffer(Enum, UInteger);
|
||||
UInteger GenBuffer() override;
|
||||
void DeleteBuffer(UInteger) override;
|
||||
void BindBuffer(Enum, UInteger) override;
|
||||
|
||||
virtual void *MapBuffer(Enum target, Enum access);
|
||||
virtual void UnmapBuffer(Enum target);
|
||||
void *MapBuffer(Enum target, Enum access) override;
|
||||
void UnmapBuffer(Enum target) override;
|
||||
|
||||
virtual void BufferData(Enum target, Sizei size, const void *data, Enum usage);
|
||||
virtual void BufferSubData(Enum target, Sizei offset, Sizei size, const void *data);
|
||||
void BufferData(Enum target, Sizei size, const void *data, Enum usage) override;
|
||||
void BufferSubData(Enum target, Sizei offset, Sizei size, const void *data) override;
|
||||
|
||||
virtual UInteger GenQuery();
|
||||
virtual void DeleteQuery(UInteger);
|
||||
virtual void BeginQuery(Enum target, UInteger query);
|
||||
virtual void EndQuery(Enum target);
|
||||
virtual UInteger GetQueryObjectUInteger(UInteger query, Enum pname);
|
||||
virtual void BeginConditionalRender(UInteger query, Enum);
|
||||
virtual void EndConditionalRender();
|
||||
UInteger GenQuery() override;
|
||||
void DeleteQuery(UInteger) override;
|
||||
void BeginQuery(Enum target, UInteger query) override;
|
||||
void EndQuery(Enum target) override;
|
||||
UInteger GetQueryObjectUInteger(UInteger query, Enum pname) override;
|
||||
void BeginConditionalRender(UInteger query, Enum) override;
|
||||
void EndConditionalRender() override;
|
||||
|
||||
virtual UInteger GenTexture();
|
||||
virtual void DeleteTexture(UInteger);
|
||||
UInteger GenTexture() override;
|
||||
void DeleteTexture(UInteger) override;
|
||||
|
||||
virtual void ActiveTexture(UInteger stage);
|
||||
virtual void BindTexture(Enum, UInteger);
|
||||
virtual void TexParamater(Enum target, Enum paramater, Enum value);
|
||||
virtual void TexParamater(Enum target, Enum paramater, float value);
|
||||
virtual void TexImage2D(Enum target, Integer level, Enum internalFormat, Sizei width,
|
||||
Sizei height, Integer border, Enum format, Enum type,
|
||||
const void *data);
|
||||
virtual void TexImage3D(Enum target, Integer level, Enum internalFormat, Sizei width,
|
||||
Sizei height, Sizei depth, Integer border, Enum format,
|
||||
Enum type, const void *data);
|
||||
virtual void TexSubImage2D(Enum target, Integer level, Integer x, Integer y,
|
||||
Sizei width, Sizei height, Enum format, Enum type,
|
||||
const void *data);
|
||||
virtual void TexSubImage3D(Enum target, Integer level, Integer x, Integer y, Integer z,
|
||||
Sizei width, Sizei height, Sizei depth, Enum format,
|
||||
Enum type, const void *data);
|
||||
virtual void CopyTexSubImage2D(Enum target, Integer level, Integer destinationX,
|
||||
Integer destinationY, Integer srcX, Integer srcY,
|
||||
Sizei width, Sizei height);
|
||||
virtual void GenerateMipmap(Enum target);
|
||||
void ActiveTexture(UInteger stage) override;
|
||||
void BindTexture(Enum, UInteger) override;
|
||||
void TexParamater(Enum target, Enum paramater, Enum value) override;
|
||||
void TexParamater(Enum target, Enum paramater, float value) override;
|
||||
void TexImage2D(Enum target, Integer level, Enum internalFormat, Sizei width,
|
||||
Sizei height, Integer border, Enum format, Enum type,
|
||||
const void *data) override;
|
||||
void TexImage3D(Enum target, Integer level, Enum internalFormat, Sizei width,
|
||||
Sizei height, Sizei depth, Integer border, Enum format, Enum type,
|
||||
const void *data) override;
|
||||
void TexSubImage2D(Enum target, Integer level, Integer x, Integer y, Sizei width,
|
||||
Sizei height, Enum format, Enum type, const void *data) override;
|
||||
void TexSubImage3D(Enum target, Integer level, Integer x, Integer y, Integer z,
|
||||
Sizei width, Sizei height, Sizei depth, Enum format, Enum type,
|
||||
const void *data) override;
|
||||
void CopyTexSubImage2D(Enum target, Integer level, Integer destinationX,
|
||||
Integer destinationY, Integer srcX, Integer srcY, Sizei width,
|
||||
Sizei height) override;
|
||||
void GenerateMipmap(Enum target) override;
|
||||
|
||||
virtual void VertexAttrib(UInteger index, Float);
|
||||
virtual void VertexAttrib(UInteger index, Float, Float);
|
||||
virtual void VertexAttrib(UInteger index, Float, Float, Float);
|
||||
virtual void VertexAttrib(UInteger index, Float, Float, Float, Float);
|
||||
void VertexAttrib(UInteger index, Float) override;
|
||||
void VertexAttrib(UInteger index, Float, Float) override;
|
||||
void VertexAttrib(UInteger index, Float, Float, Float) override;
|
||||
void VertexAttrib(UInteger index, Float, Float, Float, Float) override;
|
||||
|
||||
virtual void VertexAttribPointer(UInteger index, Integer size, Enum type,
|
||||
bool normalized, Sizei stride, const void *);
|
||||
virtual void VertexAttribIPointer(UInteger index, Integer size, Enum type, Sizei stride,
|
||||
const void *);
|
||||
virtual void EnableVertexAttribArray(UInteger index, bool);
|
||||
virtual void VertexAttribDivisor(UInteger index, UInteger divisor);
|
||||
void VertexAttribPointer(UInteger index, Integer size, Enum type, bool normalized,
|
||||
Sizei stride, const void *) override;
|
||||
void VertexAttribIPointer(UInteger index, Integer size, Enum type, Sizei stride,
|
||||
const void *) override;
|
||||
void EnableVertexAttribArray(UInteger index, bool) override;
|
||||
void VertexAttribDivisor(UInteger index, UInteger divisor) override;
|
||||
|
||||
virtual void DrawArrays(Enum mode, Integer first, Sizei count);
|
||||
virtual void DrawElements(Enum mode, Sizei count, Enum type, const void *indices);
|
||||
virtual void DrawArraysInstanced(Enum mode, Integer first, Sizei count,
|
||||
Sizei instances);
|
||||
virtual void DrawElementsInstanced(Enum mode, Sizei count, Enum type,
|
||||
const void *indices, Sizei instances);
|
||||
void DrawArrays(Enum mode, Integer first, Sizei count) override;
|
||||
void DrawElements(Enum mode, Sizei count, Enum type, const void *indices) override;
|
||||
void DrawArraysInstanced(Enum mode, Integer first, Sizei count,
|
||||
Sizei instances) override;
|
||||
void DrawElementsInstanced(Enum mode, Sizei count, Enum type, const void *indices,
|
||||
Sizei instances) override;
|
||||
|
||||
virtual UInteger CreateShader(Enum type);
|
||||
virtual void ShaderSource(UInteger shader, Sizei count, const char **string,
|
||||
const int *len);
|
||||
virtual void CompileShader(UInteger);
|
||||
virtual void DeleteShader(UInteger);
|
||||
virtual Integer GetShaderInteger(UInteger shader, Enum param);
|
||||
virtual void GetShaderInfoLog(UInteger shader, Sizei bufferSize, Sizei *length,
|
||||
char *outString);
|
||||
virtual Integer GetProgramInteger(UInteger program, Enum param);
|
||||
virtual void GetProgramInfoLog(UInteger program, Sizei bufferSize, Sizei *length,
|
||||
char *outString);
|
||||
UInteger CreateShader(Enum type) override;
|
||||
void ShaderSource(UInteger shader, Sizei count, const char **string,
|
||||
const int *len) override;
|
||||
void CompileShader(UInteger) override;
|
||||
void DeleteShader(UInteger) override;
|
||||
Integer GetShaderInteger(UInteger shader, Enum param) override;
|
||||
void GetShaderInfoLog(UInteger shader, Sizei bufferSize, Sizei *length,
|
||||
char *outString) override;
|
||||
Integer GetProgramInteger(UInteger program, Enum param) override;
|
||||
void GetProgramInfoLog(UInteger program, Sizei bufferSize, Sizei *length,
|
||||
char *outString) override;
|
||||
|
||||
virtual UInteger CreateProgram();
|
||||
virtual void AttachShader(UInteger program, UInteger shader);
|
||||
virtual void DetachShader(UInteger program, UInteger shader);
|
||||
virtual void LinkProgram(UInteger program);
|
||||
virtual void UseProgram(UInteger program);
|
||||
virtual void DeleteProgram(UInteger program);
|
||||
virtual void ValidateProgram(UInteger program);
|
||||
virtual Integer GetAttribLocation(UInteger program, const char *name);
|
||||
virtual void BindAttribLocation(UInteger program, UInteger index, const char *name);
|
||||
virtual Integer GetUniformLocation(UInteger program, const char *name);
|
||||
virtual void Uniform(Integer loc, Float);
|
||||
virtual void Uniform(Integer loc, Float, Float);
|
||||
virtual void Uniform(Integer loc, Float, Float, Float);
|
||||
virtual void Uniform(Integer loc, Float, Float, Float, Float);
|
||||
virtual void Uniform(Integer loc, Integer);
|
||||
virtual void Uniform(Integer loc, Integer, Integer);
|
||||
virtual void Uniform(Integer loc, Integer, Integer, Integer);
|
||||
virtual void Uniform(Integer loc, Integer, Integer, Integer, Integer);
|
||||
virtual void Uniform(Integer loc, bool transpose, const Matrix4 &);
|
||||
UInteger CreateProgram() override;
|
||||
void AttachShader(UInteger program, UInteger shader) override;
|
||||
void DetachShader(UInteger program, UInteger shader) override;
|
||||
void LinkProgram(UInteger program) override;
|
||||
void UseProgram(UInteger program) override;
|
||||
void DeleteProgram(UInteger program) override;
|
||||
void ValidateProgram(UInteger program) override;
|
||||
Integer GetAttribLocation(UInteger program, const char *name) override;
|
||||
void BindAttribLocation(UInteger program, UInteger index, const char *name) override;
|
||||
Integer GetUniformLocation(UInteger program, const char *name) override;
|
||||
void Uniform(Integer loc, Float) override;
|
||||
void Uniform(Integer loc, Float, Float) override;
|
||||
void Uniform(Integer loc, Float, Float, Float) override;
|
||||
void Uniform(Integer loc, Float, Float, Float, Float) override;
|
||||
void Uniform(Integer loc, Integer) override;
|
||||
void Uniform(Integer loc, Integer, Integer) override;
|
||||
void Uniform(Integer loc, Integer, Integer, Integer) override;
|
||||
void Uniform(Integer loc, Integer, Integer, Integer, Integer) override;
|
||||
void Uniform(Integer loc, bool transpose, const Matrix4 &) override;
|
||||
|
||||
virtual UInteger GenRenderbuffer();
|
||||
virtual void DeleteRenderbuffer(UInteger);
|
||||
virtual void BindRenderbuffer(Enum target, UInteger);
|
||||
virtual void RenderbufferStorage(Enum target, Enum internalFormat, Sizei width,
|
||||
Sizei height);
|
||||
virtual void RenderbufferStorage(Enum target, Sizei samples, Enum internalFormat,
|
||||
Sizei width, Sizei height);
|
||||
UInteger GenRenderbuffer() override;
|
||||
void DeleteRenderbuffer(UInteger) override;
|
||||
void BindRenderbuffer(Enum target, UInteger) override;
|
||||
void RenderbufferStorage(Enum target, Enum internalFormat, Sizei width,
|
||||
Sizei height) override;
|
||||
void RenderbufferStorage(Enum target, Sizei samples, Enum internalFormat, Sizei width,
|
||||
Sizei height) override;
|
||||
|
||||
virtual UInteger GenFramebuffer();
|
||||
virtual void BindFramebuffer(Enum target, UInteger framebuffer);
|
||||
virtual void DeleteFramebuffer(UInteger);
|
||||
virtual void FramebufferTexture2D(Enum target, Enum attachment, Enum texTarget,
|
||||
UInteger texture, Integer level);
|
||||
virtual void FramebufferRenderbuffer(Enum target, Enum attachment,
|
||||
Enum renderbufferTarget, UInteger renderbuffer);
|
||||
virtual void BlitFramebuffer(Integer srcX0, Integer srcY0, Integer srcX1, Integer srcY1,
|
||||
Integer dstX0, Integer dstY0, Integer dstX1, Integer dstY1,
|
||||
UInteger mask, Enum filter);
|
||||
virtual Enum CheckFramebufferStatus(Enum target);
|
||||
UInteger GenFramebuffer() override;
|
||||
void BindFramebuffer(Enum target, UInteger framebuffer) override;
|
||||
void DeleteFramebuffer(UInteger) override;
|
||||
void FramebufferTexture2D(Enum target, Enum attachment, Enum texTarget,
|
||||
UInteger texture, Integer level) override;
|
||||
void FramebufferRenderbuffer(Enum target, Enum attachment, Enum renderbufferTarget,
|
||||
UInteger renderbuffer) override;
|
||||
void BlitFramebuffer(Integer srcX0, Integer srcY0, Integer srcX1, Integer srcY1,
|
||||
Integer dstX0, Integer dstY0, Integer dstX1, Integer dstY1,
|
||||
UInteger mask, Enum filter) override;
|
||||
Enum CheckFramebufferStatus(Enum target) override;
|
||||
|
||||
virtual void ReadPixels(Integer x, Integer y, Sizei width, Sizei height, Enum format,
|
||||
Enum type, void *data);
|
||||
void ReadPixels(Integer x, Integer y, Sizei width, Sizei height, Enum format, Enum type,
|
||||
void *data) override;
|
||||
|
||||
virtual Integer ScreenWidth();
|
||||
virtual Integer ScreenHeight();
|
||||
Integer ScreenWidth() override;
|
||||
Integer ScreenHeight() override;
|
||||
|
||||
virtual void Swap();
|
||||
void Swap() override;
|
||||
|
||||
private:
|
||||
static GLenum parseBlendEquation(Enum);
|
||||
|
@ -52,7 +52,7 @@ namespace spades {
|
||||
void Start();
|
||||
|
||||
protected:
|
||||
virtual ~StartupScreen();
|
||||
~StartupScreen();
|
||||
|
||||
public:
|
||||
StartupScreen(client::IRenderer *, client::IAudioDevice *, StartupScreenHelper *helper,
|
||||
@ -61,23 +61,22 @@ namespace spades {
|
||||
client::IRenderer *GetRenderer() { return &*renderer; }
|
||||
client::IAudioDevice *GetAudioDevice() { return &*audioDevice; }
|
||||
|
||||
virtual void MouseEvent(float x, float y);
|
||||
virtual void KeyEvent(const std::string &, bool down);
|
||||
virtual void TextInputEvent(const std::string &);
|
||||
virtual void TextEditingEvent(const std::string &, int start, int len);
|
||||
virtual bool AcceptsTextInput();
|
||||
virtual AABB2 GetTextInputRect();
|
||||
virtual void WheelEvent(float x, float y);
|
||||
virtual bool NeedsAbsoluteMouseCoordinate();
|
||||
void MouseEvent(float x, float y) override;
|
||||
void KeyEvent(const std::string &, bool down) override;
|
||||
void TextInputEvent(const std::string &) override;
|
||||
void TextEditingEvent(const std::string &, int start, int len) override;
|
||||
bool AcceptsTextInput() override;
|
||||
AABB2 GetTextInputRect() override;
|
||||
void WheelEvent(float x, float y) override;
|
||||
bool NeedsAbsoluteMouseCoordinate() override;
|
||||
|
||||
virtual void RunFrame(float dt);
|
||||
void RunFrame(float dt) override;
|
||||
|
||||
virtual void Closing();
|
||||
void Closing() override;
|
||||
|
||||
virtual bool WantsToBeClosed();
|
||||
bool WantsToBeClosed() override;
|
||||
|
||||
static void Run();
|
||||
};
|
||||
;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user