Skip to content

Commit

Permalink
Client: Removing Qt dependencies; updating for revised libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 6fc0708 commit 8176478
Show file tree
Hide file tree
Showing 106 changed files with 721 additions and 849 deletions.
18 changes: 8 additions & 10 deletions doomsday/apps/client/include/client/clientsubsector.h
Expand Up @@ -22,9 +22,6 @@
#ifndef DE_WORLD_CLIENTSUBSECTOR_H
#define DE_WORLD_CLIENTSUBSECTOR_H

#include <functional>
#include <QBitArray>
#include <QList>
#include "world/audioenvironment.h"
#include "world/line.h"
#include "world/plane.h"
Expand All @@ -33,7 +30,8 @@

#include "render/ilightsource.h"

//class Shard;
#include <de/BitArray>
#include <de/List>

namespace world {

Expand All @@ -49,7 +47,7 @@ class ClientSubsector : public Subsector, public ILightSource
*
* @param subspaces Set of subspaces comprising the resulting subsector.
*/
ClientSubsector(QVector<ConvexSubspace *> const &subspaces);
ClientSubsector(de::List<ConvexSubspace *> const &subspaces);

/**
* Returns a human-friendly, textual description of the subsector.
Expand Down Expand Up @@ -190,20 +188,20 @@ class ClientSubsector : public Subsector, public ILightSource
/**
* Returns the unique identifier of the light source.
*/
LightId lightSourceId() const;
LightId lightSourceId() const override;

/**
* Returns the final ambient light color for the source (which, may be affected by the
* sky light color if one or more Plane Surfaces in the subsector are using a sky-masked
* Material).
*/
de::Vec3f lightSourceColorf() const;
de::Vec3f lightSourceColorf() const override;

/**
* Returns the final ambient light intensity for the source.
* @see lightSourceColorf()
*/
de::dfloat lightSourceIntensity(de::Vec3d const &viewPoint = de::Vec3d(0, 0, 0)) const;
de::dfloat lightSourceIntensity(de::Vec3d const &viewPoint = de::Vec3d(0, 0, 0)) const override;

/**
* Returns the final ambient light color and intensity for the source.
Expand Down Expand Up @@ -258,8 +256,8 @@ class ClientSubsector : public Subsector, public ILightSource
*
* @param callback Function to call for each plane.
*/
de::LoopResult forAllVisPlanes(std::function<de::LoopResult (Plane &)> func);
de::LoopResult forAllVisPlanes(std::function<de::LoopResult (Plane const &)> func) const;
de::LoopResult forAllVisPlanes(const std::function<de::LoopResult (Plane &)>& func);
de::LoopResult forAllVisPlanes(const std::function<de::LoopResult (Plane const &)>& func) const;

/**
* Returns the @em visual Plane of the subsector associated with @a planeIndex.
Expand Down
24 changes: 9 additions & 15 deletions doomsday/apps/client/include/clientapp.h
Expand Up @@ -22,7 +22,6 @@

#include <de/BaseGuiApp>
#include <doomsday/doomsdayapp.h>
#include <QUrl>

class AudioSystem;
class ClientPlayer;
Expand All @@ -46,8 +45,6 @@ class BusyRunner;
*/
class ClientApp : public de::BaseGuiApp, public DoomsdayApp
{
Q_OBJECT

public:
ClientApp(int &argc, char **argv);

Expand All @@ -61,13 +58,12 @@ class ClientApp : public de::BaseGuiApp, public DoomsdayApp
void preFrame();
void postFrame();

void checkPackageCompatibility(
de::StringList const &packageIds,
de::String const &userMessageIfIncompatible,
std::function<void ()> finalizeFunc) override;
void checkPackageCompatibility(const de::StringList & packageIds,
const de::String & userMessageIfIncompatible,
const std::function<void()> &finalizeFunc) override;

void gameSessionWasSaved(AbstractSession const &session, GameStateFolder &toFolder) override;
void gameSessionWasLoaded(AbstractSession const &session, GameStateFolder const &fromFolder) override;
void openInBrowser(const de::String &url);
void openHomepageInBrowser();

public:
/**
Expand Down Expand Up @@ -107,14 +103,12 @@ class ClientApp : public de::BaseGuiApp, public DoomsdayApp
static Updater &updater();
#endif

public slots:
void openHomepageInBrowser();
void openInBrowser(QUrl url);

protected:
void unloadGame(GameProfile const &upcomingGame) override;
void makeGameCurrent(GameProfile const &newGame) override;
void reset() override;
void makeGameCurrent(GameProfile const &newGame) override;
void unloadGame(GameProfile const &upcomingGame) override;
void gameSessionWasSaved(AbstractSession const &session, GameStateFolder &toFolder) override;
void gameSessionWasLoaded(AbstractSession const &session, GameStateFolder const &fromFolder) override;

private:
DE_PRIVATE(d)
Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/include/configprofiles.h
Expand Up @@ -22,8 +22,8 @@
#include <de/String>
#include <de/Observers>
#include <de/Profiles>
#include <QVariant>
#include <QList>
#include <de/List>
#include <de/NoneValue>

/**
* Collection of settings (cvars, Config variables) of which there can be
Expand Down Expand Up @@ -74,7 +74,7 @@ class ConfigProfiles : public de::Profiles
*/
ConfigProfiles &define(SettingType type,
de::String const &settingName,
QVariant const &defaultValue = QVariant());
const de::Value &value = de::NoneValue());

de::String currentProfile() const;

Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/include/gl/sys_opengl.h
Expand Up @@ -45,10 +45,10 @@
#endif

#if defined(UNIX) && defined(MACOSX)
# define GL_GLEXT_PROTOTYPES
//# define GL_GLEXT_PROTOTYPES
# include <de/graphics/opengl.h>
# include <OpenGL/glext.h>
# include <OpenGL/OpenGL.h>
//# include <OpenGL/glext.h>
//# include <OpenGL/OpenGL.h>
# define GL_CALL
#endif

Expand Down
16 changes: 3 additions & 13 deletions doomsday/apps/client/include/network/masterserver.h
Expand Up @@ -28,25 +28,16 @@

#include <de/libcore.h>
#include <de/shell/ServerInfo>
#include <QObject>
#include <QNetworkReply>
#include <QByteArray>

/**
* Network request worker for communicating with the master server.
* @ingroup network
*/
class MasterWorker : public QObject
class MasterWorker
{
Q_OBJECT

public:
// Actions for the master worker.
enum Action {
NONE,
REQUEST_SERVERS,
ANNOUNCE
};
enum Action { NONE, REQUEST_SERVERS, ANNOUNCE };

public:
MasterWorker();
Expand All @@ -60,9 +51,8 @@ class MasterWorker : public QObject

protected:
void nextJob();
bool parseResponse(QByteArray const &response);
bool parseResponse(const de::Block &response);

public slots:
void requestFinished(QNetworkReply *reply);

private:
Expand Down
42 changes: 19 additions & 23 deletions doomsday/apps/client/include/render/drawlist.h
Expand Up @@ -22,7 +22,6 @@
#define CLIENT_RENDER_DRAWLIST_H

#include <array>
#include <QFlags>
#include <de/GLBuffer>
#include <de/Vector>
#include "api_gl.h" // blendmode_e
Expand Down Expand Up @@ -122,7 +121,7 @@ class DrawList
}
};

typedef QVector<de::duint> Indices;
typedef de::List<de::duint> Indices;

struct PrimitiveParams
{
Expand All @@ -134,7 +133,6 @@ class DrawList
OneLight = 0x1000,
ManyLights = 0x2000
};
Q_DECLARE_FLAGS(Flags, Flag)

de::duint32 flags_blendMode;
de::Vec2f texScale;
Expand All @@ -145,14 +143,14 @@ class DrawList
de::Vec3f modColor; ///< Modulation color.

PrimitiveParams(de::gl::Primitive type,
de::Vec2f texScale = de::Vec2f(1, 1),
de::Vec2f texOffset = de::Vec2f(0, 0),
de::Vec2f detailTexScale = de::Vec2f(1, 1),
de::Vec2f detailTexOffset = de::Vec2f(0, 0),
Flags flags = Unlit,
blendmode_t blendMode = BM_NORMAL,
DGLuint modTexture = 0,
de::Vec3f modColor = de::Vec3f());
de::Vec2f texScale = de::Vec2f(1, 1),
de::Vec2f texOffset = de::Vec2f(0, 0),
de::Vec2f detailTexScale = de::Vec2f(1, 1),
de::Vec2f detailTexOffset = de::Vec2f(0, 0),
de::Flags flags = Unlit,
blendmode_t blendMode = BM_NORMAL,
DGLuint modTexture = 0,
de::Vec3f modColor = de::Vec3f());
};

public:
Expand All @@ -174,22 +172,22 @@ class DrawList
* @param primParams GL primitive parameters.
* @param indices Indices for the vertex elements in @a buffer. A copy is made.
*/
DrawList &write(Store const &buffer,
de::duint const *indices, int indexCount,
DrawList &write(Store const & buffer,
de::duint const * indices,
int indexCount,
PrimitiveParams const &primParms);

DrawList &write(Store const &buffer,
de::duint const *indices, int indexCount,
DrawList &write(Store const & buffer,
de::duint const * indices,
int indexCount,
de::gl::Primitive primitiveType); // using default parameters

DrawList &write(Store const &buffer,
Indices const &indices,
PrimitiveParams const &primParms);
DrawList &write(Store const &buffer, Indices const &indices, PrimitiveParams const &primParms);

DrawList &write(Store const &buffer,
Indices const &indices,
DrawList &write(Store const & buffer,
Indices const & indices,
de::gl::Primitive primitiveType); // using default parameters

void draw(DrawMode mode, TexUnitMap const &texUnitMap) const;

/**
Expand Down Expand Up @@ -231,6 +229,4 @@ class DrawList

typedef DrawList::Spec DrawListSpec;

Q_DECLARE_OPERATORS_FOR_FLAGS(DrawList::PrimitiveParams::Flags)

#endif // CLIENT_RENDER_DRAWLIST_H
3 changes: 1 addition & 2 deletions doomsday/apps/client/include/render/drawlists.h
Expand Up @@ -23,12 +23,11 @@

#include "DrawList"
#include <de/Vector>
#include <QVarLengthArray>

class DrawLists
{
public:
typedef QVarLengthArray<DrawList *, 1024> FoundLists;
typedef de::List<DrawList *> FoundLists;

public:
DrawLists();
Expand Down
15 changes: 5 additions & 10 deletions doomsday/apps/client/include/render/model.h
Expand Up @@ -23,9 +23,7 @@
#include <de/ModelDrawable>
#include <de/Timeline>
#include <de/MultiAtlas>

#include <QHash>
#include <QFlags>
#include <de/Map>

namespace render {

Expand Down Expand Up @@ -56,15 +54,14 @@ struct Model : public de::ModelDrawable
AnimSequence(de::String const &n, de::Record const &d);
};

struct StateAnims : public QMap<de::String, QList<AnimSequence>>
struct StateAnims : public de::Map<de::String, de::List<AnimSequence>>
{};

enum Flag
{
AutoscaleToThingHeight = 0x1,
DefaultFlags = AutoscaleToThingHeight
};
Q_DECLARE_FLAGS(Flags, Flag)

enum Alignment
{
Expand All @@ -82,7 +79,7 @@ struct Model : public de::ModelDrawable

std::unique_ptr<de::MultiAtlas::AllocGroup> textures;

Flags flags = DefaultFlags;
de::Flags flags = DefaultFlags;
Alignment alignYaw = NotAligned;
Alignment alignPitch = NotAligned;

Expand All @@ -93,7 +90,7 @@ struct Model : public de::ModelDrawable

de::gl::Face cull = de::gl::Back;

QHash<de::String, de::duint> materialIndexForName;
de::Hash<de::String, de::duint> materialIndexForName;

/// Rendering passes. Will not change after init.
Passes passes;
Expand All @@ -102,11 +99,9 @@ struct Model : public de::ModelDrawable
StateAnims animations;

/// Shared timelines (not sequence-specific). Owned.
QHash<de::String, de::Timeline *> timelines;
de::Hash<de::String, de::Timeline *> timelines;
};

Q_DECLARE_OPERATORS_FOR_FLAGS(Model::Flags)

} // namespace render

#endif // DE_CLIENT_RENDER_MODEL_H
Expand Down
13 changes: 4 additions & 9 deletions doomsday/apps/client/include/render/modelrenderer.h
Expand Up @@ -19,20 +19,17 @@
#ifndef DE_CLIENT_MODELRENDERER_H
#define DE_CLIENT_MODELRENDERER_H

#include "model.h"

#include <de/Function>
#include <de/ModelDrawable>
#include <de/ModelBank>
#include <de/GLState>
#include <de/Timeline>
#include <de/MultiAtlas>

#include <QList>
#include <QMap>
#include <QBitArray>
#include <functional>

#include "model.h"

struct vissprite_t;
struct vispsprite_t;

Expand Down Expand Up @@ -63,12 +60,10 @@ class ModelRenderer
ModelRenderer();

void glInit();

void glDeinit();

render::ModelLoader &loader();

render::ModelLoader const &loader() const;
render::ModelLoader & loader();
const render::ModelLoader &loader() const;

/**
* Provides access to the bank containing available drawable models.
Expand Down

0 comments on commit 8176478

Please sign in to comment.