Skip to content

Commit

Permalink
Replaced the fi_namespace_t in FIPage with an fi_object_collection_t.…
Browse files Browse the repository at this point in the history
… Moved the fi_namespace_t stuff into finaleinterpreter.c and refactored accordingly.
  • Loading branch information
danij-deng committed Jul 24, 2010
1 parent b0bff02 commit b1b7fcd
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 228 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/api/dd_infine.h
Expand Up @@ -62,7 +62,7 @@ struct fi_page_s;
// Base fi_objects_t elements. All objects MUST use this as their basis.
#define FIOBJECT_BASE_ELEMENTS() \
fi_objectid_t id; /* Unique id of the object. */ \
fi_objectname_t name; /* Object names are unique among objects of the same type and spawned by the same script. */ \
fi_objectname_t name; /* Nice name. */ \
fi_obtype_e type; /* Type of the object. */ \
animatorvector3_t pos; \
animator_t angle; \
Expand Down
10 changes: 4 additions & 6 deletions doomsday/engine/portable/include/fi_main.h
Expand Up @@ -46,15 +46,14 @@ typedef struct fi_object_s {
fi_object_t* FI_NewObject(fi_obtype_e type, const char* name);
void FI_DeleteObject(fi_object_t* obj);

/// \todo Should be private.
typedef struct fi_namespace_s {
typedef struct fi_object_collection_s {
uint num;
fi_object_t** vector;
} fi_namespace_t;
} fi_object_collection_t;

typedef struct fi_page_s {
// Known symbols (to this script).
fi_namespace_t _namespace;
// Objects visible on this page.
fi_object_collection_t _objects;

struct material_s* bgMaterial;
animatorvector4_t bgColor;
Expand All @@ -70,7 +69,6 @@ void FIPage_RunTic(fi_page_t* page);
fi_object_t* FIPage_AddObject(fi_page_t* page, fi_object_t* obj);
fi_object_t* FIPage_RemoveObject(fi_page_t* page, fi_object_t* obj);
boolean FIPage_HasObject(fi_page_t* page, fi_object_t* obj);
fi_objectid_t FIPage_ObjectIdForName(fi_page_t* page, const char* name, fi_obtype_e type);

void FIPage_SetBackground(fi_page_t* page, struct material_s* mat);
void FIPage_SetBackgroundColor(fi_page_t* page, float red, float green, float blue, int steps);
Expand Down
9 changes: 9 additions & 0 deletions doomsday/engine/portable/include/finaleinterpreter.h
Expand Up @@ -47,6 +47,12 @@ typedef struct fi_handler_s {
fi_objectname_t marker;
} fi_handler_t;

/// \todo Should be private.
typedef struct fi_namespace_s {
uint num;
struct fi_namespace_record_s* vector;
} fi_namespace_t;

typedef struct finaleinterpreter_t {
finale_mode_t mode;
struct finaleinterpreter_flags_s {
Expand All @@ -72,6 +78,9 @@ typedef struct finaleinterpreter_t {
uint numEventHandlers;
fi_handler_t* eventHandlers;

// Known symbols (to the loaded script).
fi_namespace_t _namespace;

// The page all our objects are on.
struct fi_page_s* _page;

Expand Down

0 comments on commit b1b7fcd

Please sign in to comment.