Skip to content

Commit

Permalink
Refactor: Continuing removal of Qt dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 6f574fa commit b0aa511
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 192 deletions.
22 changes: 18 additions & 4 deletions doomsday/apps/client/include/gl/gl_main.h
Expand Up @@ -53,7 +53,7 @@ DE_EXTERN_C float vid_gamma, vid_bright, vid_contrast;
DE_EXTERN_C int r_detail;

#ifdef _DEBUG
# define DE_ASSERT_GL_CONTEXT_ACTIVE() {DE_ASSERT(QOpenGLContext::currentContext() != nullptr);}
# define DE_ASSERT_GL_CONTEXT_ACTIVE() LIBGUI_ASSERT_GL_CONTEXT_ACTIVE()
#else
# define DE_ASSERT_GL_CONTEXT_ACTIVE()
#endif
Expand Down Expand Up @@ -263,9 +263,23 @@ dd_bool GL_OptimalTextureSize(int width, int height, dd_bool noStretch, dd_bool
*/
int GL_ChooseSmartFilter(int width, int height, int flags);

GLuint GL_NewTextureWithParams(dgltexformat_t format, int width, int height, uint8_t const *pixels, int flags);
GLuint GL_NewTextureWithParams(dgltexformat_t format, int width, int height, uint8_t const *pixels, int flags,
int grayMipmap, int minFilter, int magFilter, int anisoFilter, int wrapS, int wrapT);
GLuint GL_NewTextureWithParams(dgltexformat_t format,
int width,
int height,
uint8_t const *pixels,
int flags);

GLuint GL_NewTextureWithParams(dgltexformat_t format,
int width,
int height,
uint8_t const *pixels,
int flags,
int grayMipmap,
GLenum minFilter,
GLenum magFilter,
int anisoFilter,
GLenum wrapS,
GLenum wrapT);

/**
* in/out format:
Expand Down
27 changes: 9 additions & 18 deletions doomsday/apps/client/include/network/serverlink.h
Expand Up @@ -26,7 +26,6 @@
#include <de/shell/Protocol>
#include <de/shell/ServerInfo>
#include <de/shell/PackageDownloader>
#include <QObject>
#include "network/net_main.h"

/**
Expand All @@ -35,8 +34,6 @@
*/
class ServerLink : public de::shell::AbstractLink
{
Q_OBJECT

public:
DE_DEFINE_AUDIENCE2(DiscoveryUpdate, void linkDiscoveryUpdate(ServerLink const &link))
DE_DEFINE_AUDIENCE2(PingResponse, void pingResponse(de::Address const &, de::TimeSpan))
Expand All @@ -45,17 +42,17 @@ class ServerLink : public de::shell::AbstractLink
DE_DEFINE_AUDIENCE2(Join, void networkGameJoined())
DE_DEFINE_AUDIENCE2(Leave, void networkGameLeft())

enum Flag
{
DE_DEFINE_AUDIENCE2(Discovery, void serversDiscovered())

enum Flag {
DiscoverLocalServers = 0x1,
ManualConnectionOnly = 0,
};
Q_DECLARE_FLAGS(Flags, Flag)

static ServerLink &get();

public:
ServerLink(Flags flags = DiscoverLocalServers);
ServerLink(de::Flags flags = DiscoverLocalServers);

de::shell::PackageDownloader &packageDownloader();

Expand Down Expand Up @@ -95,7 +92,7 @@ class ServerLink : public de::shell::AbstractLink

void ping(de::Address const &address);

void connectDomain(de::String const &domain, de::TimeSpan const &timeout = 0) override;
void connectDomain(de::String const &domain, de::TimeSpan const &timeout = 0.0) override;
void connectHost(de::Address const &address) override;

/**
Expand Down Expand Up @@ -126,7 +123,7 @@ class ServerLink : public de::shell::AbstractLink

Any = Direct | LocalNetwork | MasterServer
};
Q_DECLARE_FLAGS(FoundMask, FoundMaskFlag)
using FoundMask = de::Flags;

/**
* @param mask Defines the sources that are enabled when querying for found servers.
Expand All @@ -136,7 +133,7 @@ class ServerLink : public de::shell::AbstractLink
/**
* @param mask Defines the sources that are enabled when querying for found servers.
*/
QList<de::Address> foundServers(FoundMask mask = Any) const;
de::List<de::Address> foundServers(FoundMask mask = Any) const;

bool isFound(de::Address const &host, FoundMask mask = Any) const;

Expand All @@ -154,24 +151,18 @@ class ServerLink : public de::shell::AbstractLink

bool isServerOnLocalNetwork(de::Address const &host) const;

signals:
void serversDiscovered();

public slots:
public:
void handleIncomingPackets();

protected slots:
protected:
void localServersFound();
void linkDisconnected();

protected:
de::Packet *interpret(de::Message const &msg) override;
void initiateCommunications() override;

private:
DE_PRIVATE(d)
};

Q_DECLARE_OPERATORS_FOR_FLAGS(ServerLink::FoundMask)

#endif // CLIENT_LINK_H
16 changes: 8 additions & 8 deletions doomsday/apps/client/include/ui/clientwindow.h
Expand Up @@ -61,14 +61,14 @@ class ClientWindow : public de::BaseWindow
public:
ClientWindow(de::String const &id = "main");

ClientRootWidget & root();
TaskBarWidget & taskBar();
de::GuiWidget & taskBarBlur();
ConsoleWidget & console();
HomeWidget & home();
GameWidget & game();
BusyWidget & busy();
AlertDialog & alerts();
ClientRootWidget &root();
TaskBarWidget & taskBar();
de::GuiWidget & taskBarBlur();
ConsoleWidget & console();
HomeWidget & home();
GameWidget & game();
BusyWidget & busy();
AlertDialog & alerts();
de::NotificationAreaWidget &notifications();

/**
Expand Down
9 changes: 3 additions & 6 deletions doomsday/apps/client/include/ui/home/homewidget.h
Expand Up @@ -30,8 +30,6 @@
*/
class HomeWidget : public de::GuiWidget, public de::IPersistent
{
Q_OBJECT

public:
HomeWidget();

Expand All @@ -43,6 +41,9 @@ class HomeWidget : public de::GuiWidget, public de::IPersistent
void moveOnscreen(de::TimeSpan span = 1.5);
void moveOffscreen(de::TimeSpan span = 1.5);

void tabChanged();
void mouseActivityInColumn(const de::GuiWidget *);

// Events.
void update() override;

Expand All @@ -52,10 +53,6 @@ class HomeWidget : public de::GuiWidget, public de::IPersistent

static de::PopupWidget *makeSettingsPopup();

public slots:
void tabChanged();
void mouseActivityInColumn(QObject const *);

protected:
void updateStyle() override;

Expand Down
17 changes: 7 additions & 10 deletions doomsday/apps/client/include/ui/widgets/taskbarwidget.h
Expand Up @@ -19,7 +19,6 @@
#ifndef DE_CLIENT_TASKBARWIDGET_H
#define DE_CLIENT_TASKBARWIDGET_H

#include <QObject>
#include <de/Action>
#include <de/GuiWidget>
#include <de/ButtonWidget>
Expand All @@ -33,14 +32,16 @@
*/
class TaskBarWidget : public de::GuiWidget
{
Q_OBJECT
public:
DE_DEFINE_AUDIENCE2(Open, void taskBarOpened())
DE_DEFINE_AUDIENCE2(Close, void taskBarClosed())

public:
TaskBarWidget();

ConsoleWidget &console();
ConsoleWidget & console();
de::CommandWidget &commandLine();
de::ButtonWidget &logoButton();
de::ButtonWidget & logoButton();

bool isOpen() const;
de::Rule const &shift();
Expand All @@ -51,7 +52,7 @@ class TaskBarWidget : public de::GuiWidget
void drawContent();
bool handleEvent(de::Event const &event);

public slots:
public:
void open();
void openAndPauseGame();
void close();
Expand All @@ -70,13 +71,9 @@ public slots:
void showUpdaterSettings();
#endif

protected slots:
protected:
void updateCommandLineLayout();

signals:
void opened();
void closed();

protected:
void glInit();
void glDeinit();
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/world/bsp/hplane.h
Expand Up @@ -26,7 +26,7 @@
#ifndef DE_WORLD_BSP_HPLANE_H
#define DE_WORLD_BSP_HPLANE_H

#include <QList>
#include <de/List>
#include <de/Partition>
#include <de/Vector>
#include "world/bsp/linesegment.h"
Expand Down Expand Up @@ -134,7 +134,7 @@ class HPlane
de::dint _edge = 0;
};

typedef QList<Intercept> Intercepts;
typedef de::List<Intercept> Intercepts;

public:
/**
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/world/bsp/partitioner.h
Expand Up @@ -23,7 +23,7 @@
#ifndef DE_WORLD_BSP_PARTITIONER_H
#define DE_WORLD_BSP_PARTITIONER_H

#include <QSet>
#include <de/Set>
#include <de/Observers>
#include <de/Vector>

Expand Down Expand Up @@ -86,7 +86,7 @@ class Partitioner
* @return Root tree node of the resultant BSP; otherwise @c nullptr if no usable tree
* data was produced.
*/
BspTree *makeBspTree(QSet<Line *> const &lines, de::Mesh &mesh);
BspTree *makeBspTree(de::Set<Line *> const &lines, de::Mesh &mesh);

/**
* Retrieve the number of Segments owned by the partitioner. When the build completes
Expand Down
6 changes: 4 additions & 2 deletions doomsday/apps/client/include/world/thinkers.h
Expand Up @@ -72,7 +72,7 @@ class Thinkers
* @param flags Thinker filter flags.
* @param func Callback to make for each thinker_t.
*/
de::LoopResult forAll(de::dbyte flags, std::function<de::LoopResult (thinker_t *th)> func) const;
de::LoopResult forAll(de::dbyte flags, const std::function<de::LoopResult (thinker_t *th)>& func) const;

/**
* Iterate the list of thinkers making a callback for each.
Expand All @@ -83,7 +83,9 @@ class Thinkers
*
* @overload
*/
de::LoopResult forAll(thinkfunc_t thinkFunc, de::dbyte flags, std::function<de::LoopResult (thinker_t *th)> func) const;
de::LoopResult forAll(thinkfunc_t thinkFunc,
de::dbyte flags,
const std::function<de::LoopResult(thinker_t *th)> &func) const;

/**
* Locates a mobj by its unique identifier in the map.
Expand Down

0 comments on commit b0aa511

Please sign in to comment.