Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent f30a253 commit f2685ef
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 31 deletions.
11 changes: 1 addition & 10 deletions doomsday/apps/client/src/render/rend_font.cpp
Expand Up @@ -513,15 +513,6 @@ struct TextFragment
{
width += FR_CharWidth(c);
}

if (length > 0)
{
DE_ASSERT(fragment != 0);

if (fr.fontNum == 0)
{
width += currentAttribs()->tracking * (length - 1);
}
}

// Height.
Expand Down Expand Up @@ -974,7 +965,7 @@ static void parseParamaterBlock(const char **strPtr, drawtextstate_t* state, int
(*strPtr)++;
while (*(*strPtr) && *(*strPtr) != '}')
{
(*strPtr) = M_SkipWhite((*strPtr));
(*strPtr) = M_SkipWhite(*strPtr);

// What do we have here?
if (!strnicmp((*strPtr), "flash", 5))
Expand Down
2 changes: 2 additions & 0 deletions doomsday/apps/gloomed/src/editor.cpp
Expand Up @@ -342,6 +342,8 @@ DE_PIMPL(Editor)
break;

case EditEntities:
case EditPlanes:
case EditVolumes:
break;
}
break;
Expand Down
3 changes: 1 addition & 2 deletions doomsday/apps/gloomed/src/editor.h
Expand Up @@ -34,9 +34,8 @@ class Editor : public QWidget
EditPlanes,
EditVolumes,
EditEntities,

ModeCount,
};
enum { ModeCount = 6 };

Editor();

Expand Down
15 changes: 7 additions & 8 deletions doomsday/apps/plugins/common/src/acs/system.cpp
Expand Up @@ -360,27 +360,26 @@ D_CMD(ListACScripts)
{
DE_UNUSED(src, argc, argv);
System &scriptSys = gfw_Session()->acsSystem();

if(scriptSys.scriptCount())
if (scriptSys.scriptCount())
{
LOG_SCR_MSG("Available ACScripts:");
scriptSys.forAllScripts([&scriptSys] (Script const &script)
{
scriptSys.forAllScripts([](Script const &script) {
LOG_SCR_MSG(" %s") << script.describe();
return LoopContinue;
});

#ifdef DE_DEBUG
LOG_SCR_MSG("World variables:");
dint idx = 0;
for(dint const &var : scriptSys.worldVars)
for (dint const &var : scriptSys.worldVars)
{
LOG_SCR_MSG(" #%i: %i") << (idx++) << var;
}

LOG_SCR_MSG("Map variables:");
idx = 0;
for(dint const &var : scriptSys.mapVars)
for (dint const &var : scriptSys.mapVars)
{
LOG_SCR_MSG(" #%i: %i") << (idx++) << var;
}
Expand Down
Expand Up @@ -1351,8 +1351,6 @@ AutomapStyle *AutomapWidget::style() const

void AutomapWidget::draw(Vec2i const &offset) const
{
static int updateWait = 0; /// @todo should be an instance var of AutomapWidget

float const alpha = uiRendState->pageAlpha;
player_t *plr = &players[player()];

Expand All @@ -1365,6 +1363,7 @@ void AutomapWidget::draw(Vec2i const &offset) const
RectRaw geom; Rect_Raw(&geometry(), &geom);

// Freeze the lists if the map is fading out from being open, or for debug.
// static int updateWait = 0; /// @todo should be an instance var of AutomapWidget
// if ((++updateWait % 10) && d->needBuildLists && !freezeMapRLs && isOpen())
// {
// // Its time to rebuild the automap object display lists.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libs/doomsday/src/defs/ded.cpp
Expand Up @@ -418,9 +418,9 @@ dint ded_s::evalFlags(char const *ptr) const

while (*ptr)
{
ptr = M_SkipWhite(const_cast<char *>(ptr));
ptr = M_SkipWhite(ptr);

dsize flagNameLength = M_FindWhite(const_cast<char *>(ptr)) - ptr;
dsize flagNameLength = M_FindWhite(ptr) - ptr;
String flagName(ptr, flagNameLength);
ptr += flagNameLength;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/doomsday/src/filesys/virtualmappings.cpp
Expand Up @@ -80,7 +80,7 @@ static bool parsePathLumpMapping(char lumpName[9/*LUMPNAME_T_MAXLEN*/], ddstring
if (!*ptr || *ptr == '\n') return false;

// Find the end of the lump name.
char const *end = (char const *)M_FindWhite((char *)ptr);
char const *end = M_FindWhite(ptr);
if (!*end || *end == '\n') return false;

size_t len = end - ptr;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libs/legacy/include/de/strutil.h
Expand Up @@ -74,9 +74,9 @@ DE_PUBLIC char *strlwr(char *string);

// String Utilities

DE_PUBLIC char *M_SkipWhite(const char *str);
DE_PUBLIC const char *M_SkipWhite(const char *str);

DE_PUBLIC char *M_FindWhite(const char *str);
DE_PUBLIC const char *M_FindWhite(const char *str);

DE_PUBLIC void M_StripLeft(char* str);

Expand Down
8 changes: 4 additions & 4 deletions doomsday/libs/legacy/src/strutil.c
Expand Up @@ -87,18 +87,18 @@ char* strlwr(char* string)
}
#endif // UNIX

char *M_SkipWhite(const char *str)
const char *M_SkipWhite(const char *str)
{
while (*str && DE_ISSPACE(*str))
str++;
return (char *) str;
return str;
}

char *M_FindWhite(const char *str)
const char *M_FindWhite(const char *str)
{
while (*str && !DE_ISSPACE(*str))
str++;
return (char *) str;
return str;
}

void M_StripLeft(char* str)
Expand Down

0 comments on commit f2685ef

Please sign in to comment.