Skip to content

Commit

Permalink
Refactor: Started cleaning up Qt dependencies in the rest of the code
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent e8d77b3 commit 79fc040
Show file tree
Hide file tree
Showing 337 changed files with 2,466 additions and 2,564 deletions.
6 changes: 1 addition & 5 deletions doomsday/apps/api/api_uri.h
@@ -1,11 +1,7 @@
/** @file api_uri.h Public API for Universal Resource Identifiers.
* @ingroup base
*
* @todo de::Uri will eventually be moved to libcore, at which point this API
* is deprecated and the libcore c_wrapper will provide C API functions
* equivalent to these.
*
* @author Copyright &copy; 2010-2013 Daniel Swanson <danij@dengine.net>
* @authores::Uriight &copy; 2010-2013 Daniel Swanson <danij@dengine.net>
* @author Copyright &copy; 2010-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* @par License
Expand Down
14 changes: 6 additions & 8 deletions doomsday/apps/client/CMakeLists.txt
Expand Up @@ -9,8 +9,6 @@ include (../../cmake/Config.cmake)

# Dependencies --------------------------------------------------------------------------

find_package (DengAppfw)
find_package (DengDoomsday)
find_package (Amethyst QUIET)
find_package (SDL2)
if (WIN32)
Expand Down Expand Up @@ -128,11 +126,11 @@ if (APPLE AND NOT IOS)
)
endif ()

# Windows: Use Qt resources.
if (WIN32)
qt5_add_resources (RCC_SOURCES res/windows/client.qrc)
list (APPEND src ${RCC_SOURCES})
endif ()
# Windows: Compile resources.
#if (WIN32)
# qt5_add_resources (RCC_SOURCES res/windows/client.qrc)
# list (APPEND src ${RCC_SOURCES})
#endif ()

deng_add_application (client ${src} EXTRA_RESOURCES ${MACX_RESOURCES})

Expand Down Expand Up @@ -208,7 +206,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "BSD")
target_link_libraries (client PUBLIC execinfo)
endif()

target_link_libraries (client PUBLIC Deng::libappfw Deng::libdoomsday)
deng_link_libraries (client PUBLIC DengAppfw DengDoomsday)

# Deployment ----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/include/audio/s_environ.h
Expand Up @@ -60,6 +60,6 @@ AudioEnvironment const &S_AudioEnvironment(AudioEnvironmentId id);
* Lookup the audio environment associated with material @a uri. If no environment
* is defined then @c AE_NONE is returned.
*/
AudioEnvironmentId S_AudioEnvironmentId(de::Uri const *uri);
AudioEnvironmentId S_AudioEnvironmentId(res::Uri const *uri);

#endif // DE_SOUND_ENVIRON
9 changes: 3 additions & 6 deletions doomsday/apps/client/include/dd_main.h
Expand Up @@ -20,8 +20,6 @@
#ifndef DE_MAIN_H
#define DE_MAIN_H

#include <QList>
#include <QMap>
#include <de/LibraryFile>
#include <de/String>
#include <doomsday/resource/resources.h>
Expand All @@ -36,7 +34,7 @@
#include "world/clientserverworld.h"
#include "ui/infine/infinesystem.h"

namespace de { class File1; }
namespace res { class File1; }

extern de::dint verbose;
extern de::dint isDedicated; // true if __SERVER__
Expand All @@ -45,9 +43,8 @@ extern de::dint symbolicEchoMode;
#endif

de::dint DD_EarlyInit();
void DD_FinishInitializationAfterWindowReady();

void DD_ConsoleRegister();
void DD_FinishInitializationAfterWindowReady();
void DD_ConsoleRegister();

/**
* Print an error message and quit.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/include/def_main.h
Expand Up @@ -158,7 +158,7 @@ bool Def_SameStateSequence(state_t *snew, state_t *sold);

ded_compositefont_t *Def_GetCompositeFont(char const *uri);
ded_ptcgen_t *Def_GetGenerator(struct uri_s const *uri);
ded_ptcgen_t *Def_GetGenerator(de::Uri const &uri);
ded_ptcgen_t *Def_GetGenerator(res::Uri const &uri);
ded_ptcgen_t *Def_GetDamageGenerator(int mobjType);
ded_light_t *Def_GetLightDef(int spr, int frame);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/include/gl/gl_texmanager.h
Expand Up @@ -69,7 +69,7 @@ GLuint GL_PrepareLSTexture(lightingtexid_t which);
void GL_LoadFlareTextures();
void GL_ReleaseAllFlareTextures();

GLuint GL_PrepareFlaremap(de::Uri const &resourceUri);
GLuint GL_PrepareFlaremap(res::Uri const &resourceUri);
GLuint GL_PrepareSysFlaremap(flaretexid_t which);


Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/render/consoleeffect.h
Expand Up @@ -85,15 +85,15 @@ class ConsoleEffect
/// Dynamic stack of effects. (Used currently as a fixed array, though.)
struct ConsoleEffectStack
{
typedef QList<ConsoleEffect *> EffectList;
typedef de::List<ConsoleEffect *> EffectList;
EffectList effects;

~ConsoleEffectStack() {
clear();
}

void clear() {
qDeleteAll(effects);
deleteAll(effects);
effects.clear();
}
};
Expand Down
7 changes: 4 additions & 3 deletions doomsday/apps/client/include/render/shadervar.h
Expand Up @@ -22,7 +22,8 @@
#include <de/AnimationValue>
#include <de/GLUniform>
#include <de/Range>
#include <QList>
#include <de/List>
#include <de/Hash>

/**
* Animatable variable bound to a GL uniform. The value can have 1...4 float
Expand All @@ -36,7 +37,7 @@ struct ShaderVar

Value(de::AnimationValue *a = nullptr) : anim(a) {} // not owned
};
QList<Value> values;
de::List<Value> values;
de::GLUniform *uniform = nullptr; // owned

public:
Expand Down Expand Up @@ -69,7 +70,7 @@ struct ShaderVar

struct ShaderVars
{
QHash<de::String, ShaderVar *> members;
de::Hash<de::String, ShaderVar *> members;

DE_ERROR(DefinitionError);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/include/resource/clientmaterial.h
Expand Up @@ -251,7 +251,7 @@ class ClientMaterial : public world::Material
*/
void clearAllAnimators();

static ClientMaterial &find(de::Uri const &uri);
static ClientMaterial &find(res::Uri const &uri);

private:
DE_PRIVATE(d)
Expand Down
8 changes: 4 additions & 4 deletions doomsday/apps/client/include/resource/clientresources.h
Expand Up @@ -134,7 +134,7 @@ class ClientResources : public Resources
*
* @return @c true, if a manifest exists; otherwise @a false.
*/
bool hasFont(de::Uri const &path) const;
bool hasFont(res::Uri const &path) const;

/**
* Convenient method of looking up a concrete font resource in the collection
Expand All @@ -159,7 +159,7 @@ class ClientResources : public Resources
* @param search The search term.
* @return Found unique identifier.
*/
de::FontManifest &fontManifest(de::Uri const &search) const;
de::FontManifest &fontManifest(res::Uri const &search) const;

/**
* Lookup a manifest by unique identifier.
Expand Down Expand Up @@ -222,7 +222,7 @@ class ClientResources : public Resources
*
* @return The associated manifest for this URI.
*/
inline de::FontManifest &declareFont(de::Uri const &uri) {
inline de::FontManifest &declareFont(res::Uri const &uri) {
return fontScheme(uri.scheme()).declare(uri.path());
}

Expand Down Expand Up @@ -365,7 +365,7 @@ class ClientResources : public Resources
TextureVariantSpec &detailTextureSpec(de::dfloat contrast);

AbstractFont *newFontFromDef(ded_compositefont_t const &def);
AbstractFont *newFontFromFile(de::Uri const &uri, de::String filePath);
AbstractFont *newFontFromFile(res::Uri const &uri, de::String filePath);

/**
* Release all GL-textures for fonts in the identified scheme.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/resource/framemodel.h
Expand Up @@ -151,7 +151,7 @@ class FrameModel
* Determines whether the specified @a file appears to be in a recognised
* model format.
*/
static bool recognise(de::FileHandle &file);
static bool recognise(res::FileHandle &file);

/**
* Attempt to load a new model resource from the specified @a file.
Expand All @@ -161,7 +161,7 @@ class FrameModel
*
* @return The new FrameModel (if any). Ownership is given to the caller.
*/
static FrameModel *loadFromFile(de::FileHandle &file, float aspectScale = 1);
static FrameModel *loadFromFile(res::FileHandle &file, float aspectScale = 1);

/**
* Returns the unique identifier associated with the model.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/resource/image.h
Expand Up @@ -117,9 +117,9 @@ de::String Image_Description(image_t const &image);
* The allocated memory buffer always has enough space for 4-component
* colors.
*/
uint8_t *Image_LoadFromFile(image_t &image, de::FileHandle &file);
uint8_t *Image_LoadFromFile(image_t &image, res::FileHandle &file);

bool Image_LoadFromFileWithFormat(image_t &image, char const *format, de::FileHandle &file);
bool Image_LoadFromFileWithFormat(image_t &image, char const *format, res::FileHandle &file);

bool Image_Save(image_t const &image, char const *filePath);

Expand Down
40 changes: 15 additions & 25 deletions doomsday/apps/client/include/ui/clientwindow.h
Expand Up @@ -53,29 +53,22 @@ class HomeWidget;
*/
class ClientWindow : public de::BaseWindow
{
Q_OBJECT

public:
enum Mode {
Normal,
Busy
};

enum SidebarLocation {
RightEdge
};
enum Mode { Normal, Busy };
enum SidebarLocation { RightEdge };
enum FadeDirection { FadeFromBlack, FadeToBlack };

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 Expand Up @@ -142,13 +135,15 @@ class ClientWindow : public de::BaseWindow
*/
void grab(image_t &image, bool halfSized = false) const;

enum FadeDirection { FadeFromBlack, FadeToBlack };

void fadeContent(FadeDirection fadeDirection, de::TimeSpan const &duration);

de::FadeToBlackWidget *contentFade();

void fadeInTaskBarBlur(de::TimeSpan span);
void fadeOutTaskBarBlur(de::TimeSpan span);
void toggleFPSCounter();
void showColorAdjustments();
void hideTaskBarBlur();

void updateRootSize();

Expand All @@ -165,11 +160,6 @@ class ClientWindow : public de::BaseWindow
static ClientWindow &main();
static bool mainExists();

public slots:
void toggleFPSCounter();
void showColorAdjustments();
void hideTaskBarBlur();

protected:
void windowAboutToClose() override;

Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/ui/infine/infinesystem.h
Expand Up @@ -20,7 +20,7 @@
#ifndef DE_UI_INFINESYSTEM_H
#define DE_UI_INFINESYSTEM_H

#include <QList>
#include <de/List>
#include <de/Error>
#include <de/String>
#include "finale.h"
Expand All @@ -36,7 +36,7 @@ class InFineSystem
/// The referenced Finale could not be found. @ingroup errors
DE_ERROR(MissingFinaleError);

typedef QList<Finale *> Finales;
typedef de::List<Finale *> Finales;

public:
InFineSystem();
Expand Down
6 changes: 3 additions & 3 deletions doomsday/apps/client/include/world/clientserverworld.h
Expand Up @@ -99,22 +99,22 @@ class ClientServerWorld : public World
*
* @return @c true= the map change completed successfully.
*/
bool changeMap(de::Uri const &uri);
bool changeMap(res::Uri const &uri);

/**
* Unload the currently loaded map (if any).
*
* @see changeMap()
*/
inline void unloadMap() { changeMap(de::Uri()); }
inline void unloadMap() { changeMap(res::Uri()); }

/**
* Returns the effective map-info definition Record associated with the given
* @a mapUri (which may be the default definition, if invalid/unknown).
*
* @param mapUri Unique identifier for the map to lookup map-info data for.
*/
de::Record const &mapInfoForMapUri(de::Uri const &mapUri) const;
de::Record const &mapInfoForMapUri(res::Uri const &mapUri) const;

/**
* Advance time in the world.
Expand Down
9 changes: 4 additions & 5 deletions doomsday/apps/client/include/world/polyobjdata.h
Expand Up @@ -20,8 +20,7 @@
#ifndef DE_WORLD_POLYOBJDATA_H
#define DE_WORLD_POLYOBJDATA_H

#include <QList>
#include <QVector>
#include <de/List>
#include <de/Vector>
#include <doomsday/world/thinker.h>

Expand All @@ -40,7 +39,7 @@ class PolyobjData : public Thinker::IData
{
public:
/// Used to store the original/previous vertex coordinates.
typedef QVector<de::Vec2d> VertexCoords;
typedef de::List<de::Vec2d> VertexCoords;

public:
PolyobjData();
Expand All @@ -61,8 +60,8 @@ class PolyobjData : public Thinker::IData
de::duint origIndex = world::MapElement::NoIndex;

de::Mesh *mesh = nullptr;
QList<Line *> lines;
QList<Vertex *> uniqueVertexes;
de::List<Line *> lines;
de::List<Vertex *> uniqueVertexes;
VertexCoords originalPts; ///< Used as the base for the rotations.
VertexCoords prevPts; ///< Use to restore the old point values.

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/include/world/surface.h
Expand Up @@ -210,7 +210,7 @@ class Surface : public world::MapElement
*
* @see hasMaterial(), MaterialManifest::composeUri()
*/
de::Uri composeMaterialUri() const;
res::Uri composeMaterialUri() const;

void setDecorationState(IDecorationState *state);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/api_console.cpp
Expand Up @@ -28,7 +28,7 @@ void Con_SetUri2(char const *path, uri_s const *uri, int svFlags)
{
cvar_t* var = Con_FindVariable(path);
if(!var) return;
CVar_SetUri2(var, *reinterpret_cast<de::Uri const *>(uri), svFlags);
CVar_SetUri2(var, *reinterpret_cast<res::Uri const *>(uri), svFlags);
}

#undef Con_SetUri
Expand Down

0 comments on commit 79fc040

Please sign in to comment.