Skip to content

Commit

Permalink
Merge branch 'master' of ssh://deng.git.sourceforge.net/gitroot/deng/…
Browse files Browse the repository at this point in the history
…deng
  • Loading branch information
skyjake committed Feb 12, 2012
2 parents 0855a1e + ef9fc12 commit 9424be8
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 86 deletions.
60 changes: 24 additions & 36 deletions doomsday/engine/portable/include/svg.h
@@ -1,50 +1,38 @@
/**\file svg.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2012 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2006-2012 Daniel Swanson <danij@dengine.net>
/**
* @file svg.h
* Scaleable Vector Graphic. @ingroup refresh
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* @authors Copyright © 2012 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2012 Daniel Swanson <danij@dengine.net>
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/

#ifndef LIBDENG_SVG_H
#define LIBDENG_SVG_H
#ifndef LIBDENG_REFRESH_SVG_H
#define LIBDENG_REFRESH_SVG_H

#include "dd_vectorgraphic.h"

/**
* @defgroup svgLineFlags SVG Line Flags
*/
///@{
#define SLF_IS_LOOP 0x1 ///< Cap the line joining the rightmost edge to the leftmost with additional segment(s).
///@}

typedef struct SvgLine_s {
uint numPoints;
Point2Rawf* points;
int flags;
} SvgLine;
struct svgline_s;
typedef struct svgline_s SvgLine;

/**
* Svg. Scaleable Vector Graphic.
*/
struct Svg_s; // The svg instance (opaque).
typedef struct Svg_s Svg;
struct svg_s; // The svg instance (opaque).
typedef struct svg_s Svg;

void Svg_Delete(Svg* svg);

Expand All @@ -68,4 +56,4 @@ svgid_t Svg_UniqueId(Svg* svg);
*/
Svg* Svg_FromDef(svgid_t uniqueId, const def_svgline_t* lines, uint numLines);

#endif /* LIBDENG_SVG_H */
#endif /// LIBDENG_REFRESH_SVG_H
23 changes: 11 additions & 12 deletions doomsday/engine/portable/src/dd_main.c
Expand Up @@ -559,7 +559,7 @@ static int validateResource(AbstractResource* rec, void* paramaters)
return validated;
}

static void locateGameResources(Game* game)
static void locateGameStartupResources(Game* game)
{
Game* oldGame = theGame;
uint i;
Expand Down Expand Up @@ -600,7 +600,7 @@ static void locateGameResources(Game* game)
}
}

static boolean allGameResourcesFound(Game* game)
static boolean allGameStartupResourcesFound(Game* game)
{
if(!DD_IsNullGame(game))
{
Expand Down Expand Up @@ -654,7 +654,7 @@ static void printGameResources(Game* game, boolean printStatus, int rflags)
{
AbstractResource* rec = *recordIt;

if(AbstractResource_ResourceFlags(rec) == rflags)
if((rflags & RF_STARTUP) == (AbstractResource_ResourceFlags(rec) & RF_STARTUP))
{
AbstractResource_Print(rec, printStatus);
count += 1;
Expand Down Expand Up @@ -696,14 +696,13 @@ void DD_PrintGame(Game* game, int flags)
if(flags & PGF_LIST_OTHER_RESOURCES)
{
Con_Printf("Other resources:\n");
/*@todo dj: we need a resource flag for "located"*/
Con_Printf(" ");
printGameResources(game, /*(flags & PGF_STATUS) != 0*/false, 0);
}

if(flags & PGF_STATUS)
Con_Printf("Status: %s\n", theGame == game? "Loaded" :
allGameResourcesFound(game)? "Complete/Playable" :
allGameStartupResourcesFound(game)? "Complete/Playable" :
"Incomplete/Not playable");
}

Expand Down Expand Up @@ -1322,7 +1321,7 @@ static int countPlayableGames(void)
for(i = 0; i < gamesCount; ++i)
{
Game* game = games[i];
if(!allGameResourcesFound(game)) continue;
if(!allGameStartupResourcesFound(game)) continue;
++count;
}
return count;
Expand All @@ -1334,7 +1333,7 @@ static Game* findFirstPlayableGame(void)
for(i = 0; i < gamesCount; ++i)
{
Game* game = games[i];
if(allGameResourcesFound(game)) return game;
if(allGameStartupResourcesFound(game)) return game;
}
return NULL;
}
Expand All @@ -1351,7 +1350,7 @@ Game* DD_AutoselectGame(void)
const char* identityKey = ArgNext();
Game* game = findGameForIdentityKey(identityKey);

if(game && allGameResourcesFound(game))
if(game && allGameStartupResourcesFound(game))
{
return game;
}
Expand Down Expand Up @@ -1430,7 +1429,7 @@ static int DD_LocateAllGameResourcesWorker(void* paramaters)

VERBOSE( Con_Printf("Locating resources for \"%s\"...\n", Str_Text(Game_Title(game))) )

locateGameResources(game);
locateGameStartupResources(game);
Con_SetProgress((i+1) * 200/gamesCount -1);

VERBOSE( DD_PrintGame(game, PGF_LIST_STARTUP_RESOURCES|PGF_STATUS) )
Expand Down Expand Up @@ -2416,7 +2415,7 @@ D_CMD(Load)
game = findGameForIdentityKey(Str_Text(&searchPath));
if(game)
{
if(!allGameResourcesFound(game))
if(!allGameStartupResourcesFound(game))
{
Con_Message("Failed to locate all required startup resources:\n");
printGameResources(game, true, RF_STARTUP);
Expand Down Expand Up @@ -2565,11 +2564,11 @@ D_CMD(ListGames)
Game* game = gamePtrs[i];

Con_Printf(" %s %-16s %s (%s)\n", theGame == game? "*" :
!allGameResourcesFound(game)? "!" : " ",
!allGameStartupResourcesFound(game)? "!" : " ",
Str_Text(Game_IdentityKey(game)), Str_Text(Game_Title(game)),
Str_Text(Game_Author(game)));

if(allGameResourcesFound(game))
if(allGameStartupResourcesFound(game))
numCompleteGames++;
}

Expand Down
5 changes: 2 additions & 3 deletions doomsday/engine/portable/src/def_main.c
Expand Up @@ -596,7 +596,7 @@ int Def_GetFlagValue(const char* flag)
if(!stricmp(defs.flags[i].id, flag))
return defs.flags[i].value;

Con_Message("Def_GetFlagValue: Undefined flag '%s'.\n", flag);
Con_Message("Warning: Def_GetFlagValue: Undefined flag '%s'.\n", flag);
return 0;
}

Expand Down Expand Up @@ -1196,8 +1196,7 @@ void Def_Read(void)
// It's probably a bias light definition, then?
if(!defs.lights[i].uniqueMapID[0])
{
Con_Message("Def_Read: Lights: Undefined state '%s'.\n",
defs.lights[i].state);
Con_Message("Warning: Def_Read: Undefined state '%s' in Light definition.\n", defs.lights[i].state);
}
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/materials.c
Expand Up @@ -874,7 +874,7 @@ materialid_t Materials_ResolveUri2(const Uri* uri, boolean quiet)
{
#if _DEBUG
ddstring_t* uriStr = Uri_ToString(uri);
Con_Message("Warning:Materials::ResolveUri: Uri \"%s\" failed to validate, returing NULL.\n", Str_Text(uriStr));
Con_Message("Warning: Materials::ResolveUri: \"%s\" failed to validate, returing NOMATERIALID.\n", Str_Text(uriStr));
Str_Delete(uriStr);
#endif
return NOMATERIALID;
Expand All @@ -888,7 +888,7 @@ materialid_t Materials_ResolveUri2(const Uri* uri, boolean quiet)
if(!quiet && !ddMapSetup) // Do not announce during map setup.
{
ddstring_t* path = Uri_ToString(uri);
Con_Message("Materials::ResolveUri: \"%s\" not found!\n", Str_Text(path));
Con_Message("Warning: Materials::ResolveUri: \"%s\" not found, returning NOMATERIALID.\n", Str_Text(path));
Str_Delete(path);
}
return NOMATERIALID;
Expand Down

0 comments on commit 9424be8

Please sign in to comment.