Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 29, 2011
1 parent 7a8ad98 commit 9af9240
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 201 deletions.
32 changes: 13 additions & 19 deletions doomsday/engine/api/dd_vectorgraphic.h
@@ -1,4 +1,4 @@
/**\file
/**\file dd_vectorgraphic.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
Expand All @@ -23,28 +23,22 @@
*/

/**
* dd_vectorgraphic.h: Vector graphics.
* SVG (Scalable Vector Graphic).
*/

#ifndef LIBDENG_VECTORGRAPHIC_H
#define LIBDENG_VECTORGRAPHIC_H
#ifndef LIBDENG_API_VECTORGRAPHIC_H
#define LIBDENG_API_VECTORGRAPHIC_H

typedef uint32_t vectorgraphicid_t;
typedef uint32_t svgid_t;

// Used during vector graphic creation/registration.
// \todo Refactor me away.
typedef struct {
float pos[3];
} mpoint_t;
typedef struct svgline_s {
Point2Rawf from, to;
} svgline_t;

typedef struct vgline_s {
mpoint_t a, b;
} vgline_t;
void R_NewSVG(svgid_t svgId, const svgline_t* lines, size_t numLines);

void R_NewVectorGraphic(vectorgraphicid_t vgId, const vgline_t* lines, size_t numLines);
void GL_DrawSVG(svgid_t svgId, float x, float y);
void GL_DrawSVG2(svgid_t svgId, float x, float y, float scale);
void GL_DrawSVG3(svgid_t svgId, float x, float y, float scale, float angle);

void GL_DrawVectorGraphic(vectorgraphicid_t vgId, float x, float y);
void GL_DrawVectorGraphic2(vectorgraphicid_t vgId, float x, float y, float scale);
void GL_DrawVectorGraphic3(vectorgraphicid_t vgId, float x, float y, float scale, float angle);

#endif /* LIBDENG_VECTORGRAPHIC_H */
#endif /* LIBDENG_API_VECTORGRAPHIC_H */
8 changes: 4 additions & 4 deletions doomsday/engine/api/doomsday.def
Expand Up @@ -628,11 +628,11 @@ EXPORTS
FI_ScriptFlags @235 NONAME

; SVG
R_NewVectorGraphic @317 NONAME
R_NewSVG @317 NONAME

GL_DrawVectorGraphic @318 NONAME
GL_DrawVectorGraphic2 @319 NONAME
GL_DrawVectorGraphic3 @320 NONAME
GL_DrawSVG @318 NONAME
GL_DrawSVG2 @319 NONAME
GL_DrawSVG3 @320 NONAME

; Graphics.
GL_GrabScreen @109 NONAME
Expand Down
12 changes: 9 additions & 3 deletions doomsday/engine/portable/include/r_data.h
Expand Up @@ -471,9 +471,15 @@ boolean R_IsAllowedDetailTex(ded_detailtexture_t* def, boolean hasExternal, bool

boolean R_IsValidLightDecoration(const ded_decorlight_t* lightDef);

void R_InitVectorGraphics(void);
void R_UnloadVectorGraphics(void);
void R_ShutdownVectorGraphics(void);
void R_InitSVGs(void);

/**
* Unload any resources needed for vector graphics.
* Called during shutdown and before a renderer restart.
*/
void R_UnloadSVGs(void);

void R_ShutdownSVGs(void);

int R_TextureUniqueId2(const Uri* uri, boolean quiet);
int R_TextureUniqueId(const Uri* uri); /* quiet=false */
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/dd_main.c
Expand Up @@ -1082,7 +1082,7 @@ boolean DD_ChangeGame2(Game* game, boolean allowReload)
P_ShutdownGameMapObjDefs();
Cl_Reset();

R_ShutdownVectorGraphics();
R_ShutdownSVGs();
R_DestroyColorPalettes();

Fonts_ClearRuntime();
Expand All @@ -1100,7 +1100,7 @@ boolean DD_ChangeGame2(Game* game, boolean allowReload)
DD_Register();
I_InitVirtualInputDevices();

R_InitVectorGraphics();
R_InitSVGs();
R_InitViewWindow();

/// \fixme Assumes we only cache lumps from non-startup wads.
Expand Down

0 comments on commit 9af9240

Please sign in to comment.