Skip to content

Commit

Permalink
Cleanup: Post-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent c7ec66e commit 9ded441
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 40 deletions.
8 changes: 4 additions & 4 deletions doomsday/apps/client/src/busyrunner.cpp
Expand Up @@ -221,10 +221,10 @@ DE_PIMPL_NOREF(BusyRunner)

DE_AUDIENCE_METHOD(BusyRunner, DeferredGLTask)

static BusyRunner &busyRunner()
{
return *static_cast<BusyRunner *>(busy().taskRunner());
}
//static BusyRunner &busyRunner()
//{
// return *static_cast<BusyRunner *>(busy().taskRunner());
//}

BusyRunner::BusyRunner() : d(new Impl)
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/network/base/masterserver.cpp
Expand Up @@ -57,7 +57,7 @@ static String masterUrl(const char *suffix = nullptr)
{
String u = App::apiUrl() + "master_server";
if (suffix) u += suffix;
return std::move(u);
return u;
}

DE_PIMPL(MasterWorker)
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/render/modelrenderer.cpp
Expand Up @@ -169,12 +169,12 @@ DE_PIMPL(ModelRenderer)
modelToLocal = modelToLocal * (*preModelToLocal);
}

Mat4f const localToWorld =
const Mat4f localToWorld =
Mat4f::translate(origin) *
Mat4f::scale(aspectCorrect); // Inverse aspect correction.

const Mat4f viewProj = Rend_GetProjectionMatrix(weaponFixedFOV) *
ClientApp::renderSystem().uViewMatrix().toMatrix4f();
ClientApp::renderSystem().uViewMatrix().toMat4f();

const Mat4f localToScreen = viewProj * localToWorld;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/world/base/bindings_world.cpp
Expand Up @@ -62,7 +62,7 @@ void initBindings(Binder &binder, Record &worldModule)
startSoundArgs["volume"] = new NumberValue(1.0);

binder.init(thing)
<< DE_FUNC_NOARG(Thing_Health, "health");
<< DE_FUNC_NOARG(Thing_Health, "health")
<< DE_FUNC_DEFS (Thing_StartSound, "startSound", "id" << "volume", startSoundArgs);

}
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/src/world/base/clientserverworld.cpp
Expand Up @@ -988,11 +988,11 @@ void ClientServerWorld::consoleRegister() // static
mobj_t &ClientServerWorld::contextMobj(const Context &ctx) // static
{
/// @todo Not necessarily always the current map. -jk
const int id = ctx.selfInstance().geti(QStringLiteral("__id__"), 0);
const int id = ctx.selfInstance().geti(DE_STR("__id__"), 0);
mobj_t *mo = App_World().map().thinkers().mobjById(id);
if (!mo)
{
throw Map::MissingObjectError("ClientServerWorld::contextMobj",
throw world::Map::MissingObjectError("ClientServerWorld::contextMobj",
String::format("Mobj %d does not exist", id));
}
return *mo;
Expand Down
4 changes: 4 additions & 0 deletions doomsday/libs/core/include/de/core/asset.h
Expand Up @@ -72,6 +72,8 @@ class DE_PUBLIC Asset
* Determines if the asset is ready for use (immediately).
*/
virtual bool isReady() const;

virtual String asText() const;

void waitForState(State s) const;

Expand Down Expand Up @@ -132,6 +134,8 @@ class DE_PUBLIC AssetGroup
return *this;
}

String asText() const override;

// Observes contained Assets.
void assetBeingDeleted(Asset &);
void assetStateChanged(Asset &);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/scriptsys/function.h
Expand Up @@ -319,7 +319,7 @@ class DE_PUBLIC Binder
bool _isOwned;
FunctionOwnership _funcOwned;
Set<String> _boundEntryPoints;
QSet<Variable *> _boundFunctions;
Set<Variable *> _boundFunctions;
};

} // namespace de
Expand Down
20 changes: 20 additions & 0 deletions doomsday/libs/core/src/core/asset.cpp
Expand Up @@ -18,6 +18,7 @@

#include "de/Asset"
#include "de/Waitable"
#include "de/Widget"

namespace de {

Expand Down Expand Up @@ -96,6 +97,15 @@ void Asset::waitForState(State s) const
w.wait();
}
}

String Asset::asText() const
{
if (const auto *w = dynamic_cast<const Widget *>(this))
{
return w->name();
}
return Stringf("Asset %p", this);
}

//----------------------------------------------------------------------------

Expand Down Expand Up @@ -214,6 +224,16 @@ void AssetGroup::assetStateChanged(Asset &)
d->update(*this);
}

String AssetGroup::asText() const
{
StringList str;
for (auto i = d->deps.begin(); i != d->deps.end(); ++i)
{
str.append(i->first->asText());
}
return Stringf("AssetGroup with %zu members:\n%s", str.size(), String::join(str, "\n").c_str());
}

IAssetGroup::~IAssetGroup()
{}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/libs/doomsday/src/defs/ded.cpp
Expand Up @@ -420,11 +420,11 @@ dint ded_s::evalFlags(char const *ptr) const
{
ptr = M_SkipWhite(ptr);

dsize flagNameLength = M_FindWhite(ptr) - ptr;
dsize flagNameLength = dsize(M_FindWhite(ptr) - ptr);
String flagName(ptr, flagNameLength);
ptr += flagNameLength;

if (Record const *flag = flags.tryFind(defn::Definition::VAR_ID, flagName.toLower()))
if (Record const *flag = flags.tryFind(defn::Definition::VAR_ID, flagName.lower()))
{
value |= flag->geti("value");
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/doomsday/src/defs/mapinfo.cpp
Expand Up @@ -48,7 +48,7 @@ void MapInfo::resetToDefaults()
def().addNumber("gravity", 1);
def().addText ("skyId", "");
def().addText ("execute", "");
def().addText (QStringLiteral("intermissionBg"), "");
def().addText (DE_STR("intermissionBg"), "");

std::unique_ptr<Record> sky(new Record);
Sky(*sky).resetToDefaults();
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/doomsday/src/resource/databundle.cpp
Expand Up @@ -647,7 +647,7 @@ DE_PIMPL(DataBundle), public Lockable
category.replace(" ", "");
category.replace("gamedata", "data"); // "gamedata" is a special tag
category.replace("core", ""); // "core" is special tag
category = category.trimmed();
category = category.strip();
if (!category.isEmpty())
{
meta.appendUniqueWord(VAR_TAGS(), category);
Expand Down
5 changes: 2 additions & 3 deletions doomsday/libs/doomsday/src/world/actions.cpp
Expand Up @@ -63,7 +63,7 @@ static void C_DECL A_DoomsdayScript(void *actor)
{
const ThinkerData &data = THINKER_DATA(mobj->thinker, ThinkerData);
Record ns;
ns.add(new Variable(QStringLiteral("self"), new RecordValue(data.objectNamespace())));
ns.add(new Variable(DE_STR("self"), new RecordValue(data.objectNamespace())));
Process proc(&ns);
const Script script(s_currentAction);
proc.run(script);
Expand Down Expand Up @@ -102,13 +102,12 @@ void P_SetCurrentAction(const String &name)

void P_SetCurrentActionState(int state)
{
P_SetCurrentAction(DED_Definitions()->states[state].gets(QStringLiteral("action")));
P_SetCurrentAction(DED_Definitions()->states[state].gets(DE_STR("action")));
}

acfnptr_t P_GetAction(const String &name)
{
if (!name.isEmpty())
auto found = actions.find(name);
{
if (isScriptAction(name))
{
Expand Down
10 changes: 5 additions & 5 deletions doomsday/libs/gamekit/libs/common/src/common.cpp
Expand Up @@ -135,7 +135,7 @@ static mobj_t &instanceMobj(const de::Context &ctx)
{
using namespace de;

const int id = ctx.selfInstance().geti(QStringLiteral("__id__"), 0);
const int id = ctx.selfInstance().geti(DE_STR("__id__"), 0);
if (mobj_t *mo = Mobj_ById(id))
{
return *mo;
Expand Down Expand Up @@ -211,18 +211,18 @@ void Common_Load()
attackArgs["damage"] = new NumberValue(0.0);
attackArgs["missile"] = new NoneValue;

DENG2_ASSERT(gameBindings == nullptr);
DE_ASSERT(gameBindings == nullptr);
gameBindings = new Binder(nullptr, Binder::FunctionsOwned); // must delete when plugin unloaded
gameBindings->init(ScriptSystem::get().builtInClass("World", "Thing"))
#if defined(__JHERETIC__)
<< DENG2_FUNC_DEFS(Thing_Attack, "attack", "damage" << "missile", attackArgs)
<< DE_FUNC_DEFS(Thing_Attack, "attack", "damage" << "missile", attackArgs)
#endif
<< DENG2_FUNC_DEFS(Thing_SpawnMissile, "spawnMissile", "id" << "angle" << "momz", spawnMissileArgs);
<< DE_FUNC_DEFS(Thing_SpawnMissile, "spawnMissile", "id" << "angle" << "momz", spawnMissileArgs);
}

void Common_Unload()
{
DENG2_ASSERT(gameBindings != nullptr);
DE_ASSERT(gameBindings != nullptr);
delete gameBindings;
gameBindings = nullptr;
}
8 changes: 4 additions & 4 deletions doomsday/libs/gamekit/libs/common/src/hu_menu.cpp
Expand Up @@ -3033,7 +3033,7 @@ void Hu_MenuDrawEpisodePage(Page const &page, Vec2i const &origin)

DGL_Disable(DGL_TEXTURE_2D);
#else
DENG2_UNUSED(page);
DE_UNUSED(page);

#if defined (__JHERETIC__)
String titleText;
Expand All @@ -3050,7 +3050,7 @@ void Hu_MenuDrawEpisodePage(Page const &page, Vec2i const &origin)
FR_SetFont(FID(GF_FONTB));
FR_SetColorAndAlpha(cfg.common.menuTextColors[0][CR], cfg.common.menuTextColors[0][CG], cfg.common.menuTextColors[0][CB], mnRendState->pageAlpha);

FR_DrawTextXY3(titleText.toLatin1(), SCREENWIDTH / 2, origin.y - 42, ALIGN_TOP,
FR_DrawTextXY3(titleText, SCREENWIDTH / 2, origin.y - 42, ALIGN_TOP,
Hu_MenuMergeEffectWithDrawTextFlags(0));

DGL_Disable(DGL_TEXTURE_2D);
Expand Down Expand Up @@ -3085,7 +3085,7 @@ void Hu_MenuDrawSkillPage(Page const & /*page*/, Vec2i const &origin)
titleText = value->text;
}

Hu_MenuDrawPageTitle(titleText, Vector2i(SCREENWIDTH / 2, origin.y - 28));
Hu_MenuDrawPageTitle(titleText, Vec2i(SCREENWIDTH / 2, origin.y - 28));
#endif
}

Expand Down Expand Up @@ -3168,7 +3168,7 @@ void Hu_MenuDrawLoadGamePage(Page const & /*page*/, Vec2i const &origin)
FR_SetColorAndAlpha(cfg.common.menuTextColors[0][CR], cfg.common.menuTextColors[0][CG], cfg.common.menuTextColors[0][CB], mnRendState->pageAlpha);

#if __JHERETIC__ || __JHEXEN__
FR_DrawTextXY3(Widget::labelText("Load Game").toLatin1(), SCREENWIDTH / 2, origin.y - 20, ALIGN_TOP, Hu_MenuMergeEffectWithDrawTextFlags(0));
FR_DrawTextXY3(Widget::labelText("Load Game"), SCREENWIDTH / 2, origin.y - 20, ALIGN_TOP, Hu_MenuMergeEffectWithDrawTextFlags(0));
#else
WI_DrawPatch(pLoadGame, Hu_ChoosePatchReplacement(patchreplacemode_t(cfg.common.menuPatchReplaceMode), pLoadGame),
Vec2i(origin.x - 8, origin.y - 26), ALIGN_TOPLEFT, 0, Hu_MenuMergeEffectWithDrawTextFlags(0));
Expand Down
Expand Up @@ -94,13 +94,13 @@ void InlineListWidget::updateGeometry()
FR_SetFont(page().predefinedFont(mn_page_fontid_t(font())));
Size2Raw maxSize{};
Size2Raw size;
for (int i = 0; i < items().size(); ++i)
for (auto i = 0u; i < items().size(); ++i)
{
FR_TextSize(&size, items().at(i)->text());
maxSize.width = de::max(maxSize.width, size.width);
maxSize.height = de::max(maxSize.height, size.height);
}
geometry().setSize(Vector2ui(maxSize.width, maxSize.height));
geometry().setSize(Vec2ui(maxSize.width, maxSize.height));
FR_PopAttrib();
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/gamekit/libs/heretic/include/h_main.h
Expand Up @@ -30,7 +30,7 @@
DE_EXTERN_C gamemode_t gameMode;
DE_EXTERN_C int gameModeBits;

DENG_EXTERN_C const char *ammoName[NUM_AMMO_TYPES];
DE_EXTERN_C const char *ammoName[NUM_AMMO_TYPES];
DE_EXTERN_C char const *borderGraphics[];

DE_EXTERN_C float const defFontRGB[];
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libs/gamekit/libs/heretic/src/h_items.cpp
Expand Up @@ -476,12 +476,12 @@ void P_InitWeaponInfo()
{
for (auto i = int(WT_FIRST); i < NUM_WEAPON_TYPES; ++i)
{
const String id = String::number(i);
const String id = String::asText(i);

for (int k = 0; k < 2; ++k) // Each firing mode.
{
// Firing modes other than @c 0 use a sublevel.
const String mode = (k == 0 ? "" : "|" + String::number(k + 1));
const String mode = (k == 0 ? "" : "|" + String::asText(k + 1));
const String key = "Weapon Info|" + id + mode + "|";

weaponmodeinfo_t *wminfo = WEAPON_INFO(i, PCLASS_PLAYER, k);
Expand Down
8 changes: 4 additions & 4 deletions doomsday/libs/gamekit/libs/heretic/src/intermission.cpp
Expand Up @@ -410,9 +410,9 @@ static void initDeathmatchStats()
}
}

static de::Block labelString(const char *text)
static de::String labelString(const char *text)
{
return common::menu::Widget::labelText(text, "Intermission Label").toLatin1();
return common::menu::Widget::labelText(text, "Intermission Label");
}

static void drawDeathmatchStats()
Expand Down Expand Up @@ -782,14 +782,14 @@ static void initShowStats()

static void drawStats()
{
de::Block bgMaterial = "Flats:FLOOR16";
de::String bgMaterial = "Flats:FLOOR16";

// Intermission background can be defined via DED.
{
const String defined = gfw_Session()->mapInfo().gets("intermissionBg", "");
if (!defined.empty())
{
bgMaterial = defined.toUtf8();
bgMaterial = defined;
}
}

Expand Down
8 changes: 4 additions & 4 deletions doomsday/libs/gui/src/graphics/glwindow.cpp
Expand Up @@ -635,12 +635,12 @@ void GLWindow::update()
void GLWindow::initializeGL()
{
if (!d->initialized)
{
LOG_AS("GLWindow");
LOGDEV_GL_NOTE("Initializing OpenGL window");
{
LOG_AS("GLWindow");
LOGDEV_GL_NOTE("Initializing OpenGL window");

d->initialized = true;
d->glInit();
d->glInit();

int w, h;
SDL_GL_GetDrawableSize(d->window, &w, &h);
Expand Down

0 comments on commit 9ded441

Please sign in to comment.