Skip to content

Commit

Permalink
libdoom: Import available public APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 2, 2013
1 parent 29c1bd5 commit 8c87b3f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/api/api_base.h
Expand Up @@ -49,7 +49,7 @@ typedef struct de_api_s {
#define DENG_DECLARE_API(Name) DENG_API_T(Name) _api_##Name
#define DENG_USING_API(Name) DENG_EXTERN_C DENG_DECLARE_API(Name)
#define DENG_API_EXCHANGE(APIs) \
extern "C" void deng_API(int id, void *api) { \
DENG_EXTERN_C void deng_API(int id, void *api) { \
switch(id) { APIs \
default: break; } }
#define DENG_GET_API(Ident, Name) \
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/api/api_def.h
Expand Up @@ -30,8 +30,8 @@ DENG_API_TYPEDEF(Def) // v1
{
de_api_t api;

int (*Get)(int type, const char* id, void* out);
int (*Set)(int type, int index, int value, const void* ptr);
int (*_Get)(int type, const char* id, void* out);
int (*_Set)(int type, int index, int value, const void* ptr);
int (*EvalFlags)(char* flags);

// Functions related to DED database manipulation (deprecated):
Expand All @@ -41,8 +41,8 @@ DENG_API_TYPEDEF(Def) // v1
DENG_API_T(Def);

#ifndef DENG_NO_API_MACROS_DEFINITIONS
#define Def_Get _api_Def.Get
#define Def_Set _api_Def.Set
#define Def_Get _api_Def._Get
#define Def_Set _api_Def._Set
#define Def_EvalFlags _api_Def.EvalFlags
#endif

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/common/src/gl_drawpatch.c
Expand Up @@ -24,6 +24,7 @@

#include <math.h>
#include "doomsday.h"
#include "common.h"
#include "gl_drawpatch.h"

void GL_DrawPatch3(patchid_t id, const Point2Raw* origin, int alignFlags, int patchFlags)
Expand Down
10 changes: 10 additions & 0 deletions doomsday/plugins/jdoom/include/d_api.h
Expand Up @@ -34,6 +34,7 @@
#endif

#include "dd_api.h"
#include "doomsday.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -42,6 +43,15 @@ extern "C" {
extern game_import_t gi;
extern game_export_t gx;

DENG_USING_API(Base);
DENG_USING_API(Con);
DENG_USING_API(Def);
DENG_USING_API(F);
DENG_USING_API(Material);
DENG_USING_API(Plug);
DENG_USING_API(Uri);
DENG_USING_API(W);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
20 changes: 20 additions & 0 deletions doomsday/plugins/jdoom/src/d_api.c
Expand Up @@ -278,3 +278,23 @@ const char* deng_LibraryType(void)
{
return "deng-plugin/game";
}

DENG_DECLARE_API(Base);
DENG_DECLARE_API(Con);
DENG_DECLARE_API(Def);
DENG_DECLARE_API(F);
DENG_DECLARE_API(Material);
DENG_DECLARE_API(Plug);
DENG_DECLARE_API(Uri);
DENG_DECLARE_API(W);

DENG_API_EXCHANGE(
DENG_GET_API(DE_API_BASE_v1, Base);
DENG_GET_API(DE_API_CONSOLE_v1, Con);
DENG_GET_API(DE_API_DEFINITIONS_v1, Def);
DENG_GET_API(DE_API_FILE_SYSTEM_v1, F);
DENG_GET_API(DE_API_MATERIALS_v1, Material);
DENG_GET_API(DE_API_PLUGIN_v1, Plug);
DENG_GET_API(DE_API_URI_v1, Uri);
DENG_GET_API(DE_API_WAD_v1, W);
)

0 comments on commit 8c87b3f

Please sign in to comment.