Skip to content

Commit

Permalink
Refactor: Post mapdata-c++ merge changes and fixes
Browse files Browse the repository at this point in the history
Renamed material_t to Material and relocated Material_* functions
into the C++ class itself.
  • Loading branch information
danij-deng committed Jan 17, 2013
1 parent 15860b7 commit c0c6806
Show file tree
Hide file tree
Showing 70 changed files with 720 additions and 794 deletions.
6 changes: 3 additions & 3 deletions doomsday/engine/api/api_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ DENG_API_TYPEDEF(GL)
void (*DeleteLists)(DGLuint list, int range);

void (*SetNoMaterial)(void);
void (*SetMaterialUI)(material_t *mat, DGLint wrapS, DGLint wrapT);
void (*SetMaterialUI)(Material *mat, DGLint wrapS, DGLint wrapT);
void (*SetPatch)(patchid_t id, DGLint wrapS, DGLint wrapT);
void (*SetPSprite)(material_t *mat);
void (*SetPSprite2)(material_t *mat, int tclass, int tmap);
void (*SetPSprite)(Material *mat);
void (*SetPSprite2)(Material *mat, int tclass, int tmap);
void (*SetRawImage)(lumpnum_t lumpNum, DGLint wrapS, DGLint wrapT);

void (*BlendOp)(int op);
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/api/api_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ typedef struct plane_s Plane;
typedef struct sector_s Sector;
typedef struct sidedef_s SideDef;
typedef struct vertex_s Vertex;
typedef struct material_s material_t;
typedef struct material_s Material;

#elif defined __cplusplus

// Foward declarations.
class BspLeaf;
class LineDef;
class Sector;
class material_t;
class Material;

#endif

Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/api/api_material.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DENG_API_TYPEDEF(Material)
{
de_api_t api;

material_t *(*ForTextureUri)(Uri const *textureUri);
Material *(*ForTextureUri)(Uri const *textureUri);
Uri *(*ComposeUri)(materialid_t materialId);
materialid_t (*ResolveUri)(const Uri* uri);
materialid_t (*ResolveUriCString)(const char* path);
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/api/api_materialarchive.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ DENG_API_TYPEDEF(MaterialArchive)
/**
* @return A new (unused) SerialId for the specified material.
*/
materialarchive_serialid_t (*FindUniqueSerialId)(MaterialArchive const *arc, material_t *mat);
materialarchive_serialid_t (*FindUniqueSerialId)(MaterialArchive const *arc, Material *mat);

/**
* Finds and returns a material with the identifier @a serialId.
Expand All @@ -70,7 +70,7 @@ DENG_API_TYPEDEF(MaterialArchive)
*
* @return Pointer to a material instance. Ownership not given.
*/
material_t *(*Find)(MaterialArchive const *arc, materialarchive_serialid_t serialId, int group);
Material *(*Find)(MaterialArchive const *arc, materialarchive_serialid_t serialId, int group);

/**
* Returns the number of materials in the archive.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/api/dd_share.h
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ typedef struct {

/// Sprite Info
typedef struct {
material_t *material;
Material *material;
int flip;
RectRaw geometry;
float texCoord[2]; // Prepared texture coordinates.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/include/dd_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fontschemeid_t DD_ParseFontSchemeName(char const *str);
AutoStr *DD_MaterialSchemeNameForTextureScheme(Str const *textureSchemeName);

/// @return Material associated with specified @a textureUri; otherwise @c NULL.
material_t *DD_MaterialForTextureUri(Uri const *textureUri);
Material *DD_MaterialForTextureUri(Uri const *textureUri);

const char* value_Str(int val);

Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/include/gl/gl_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct ColorRawf_s;
struct material_s;
struct texturevariant_s;

class material_t;
class Material;

#define MAX_TEX_UNITS 2 // More aren't currently used.

Expand Down Expand Up @@ -174,10 +174,10 @@ void GL_CallList(DGLuint list);

void GL_DeleteLists(DGLuint list, int range);

void GL_SetMaterialUI2(material_t *mat, int wrapS, int wrapT);
void GL_SetMaterialUI(material_t *mat);
void GL_SetMaterialUI2(Material *mat, int wrapS, int wrapT);
void GL_SetMaterialUI(Material *mat);

void GL_SetPSprite(material_t *mat, int tclass, int tmap);
void GL_SetPSprite(Material *mat, int tclass, int tmap);

void GL_SetRawImage(lumpnum_t lumpNum, int wrapS, int wrapT);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/include/map/r_world.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void R_MarkDependantSurfacesForDecorationUpdate(Plane* pln);
* To be called in response to a Material property changing which may
* require updating any map surfaces which are presently using it.
*/
void R_UpdateMapSurfacesOnMaterialChange(material_t* material);
void R_UpdateMapSurfacesOnMaterialChange(Material* material);

/// @return @c true= @a plane is non-glowing (i.e. not glowing or a sky).
boolean R_IsGlowingPlane(const Plane* plane);
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/include/map/surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Surface : public de::MapElement
de::MapElement *owner; ///< Either @c DMU_SIDEDEF, or @c DMU_PLANE
int flags; ///< SUF_ flags
int oldFlags;
material_t* material;
Material* material;
blendmode_t blendMode;
float tangent[3];
float bitangent[3];
Expand Down Expand Up @@ -123,7 +123,7 @@ boolean Surface_AttachedToMap(Surface* surface);
* @param surface Surface instance.
* @param mat New Material.
*/
boolean Surface_SetMaterial(Surface* surface, material_t* material);
boolean Surface_SetMaterial(Surface* surface, Material *material);

/**
* Change Material origin.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/include/render/r_things.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

typedef struct {
byte rotate; // 0= no rotations, 1= only front, 2= more...
material_t *mats[8]; // Material to use for view angles 0-7
Material *mats[8]; // Material to use for view angles 0-7
byte flip[8]; // Flip (1 = flip) to use for view angles 0-7
} spriteframe_t;

Expand Down Expand Up @@ -206,7 +206,7 @@ DENG_EXTERN_C int psp3d;
extern "C" {
#endif

material_t *R_GetMaterialForSprite(int sprite, int frame);
Material *R_GetMaterialForSprite(int sprite, int frame);

/// @return Radius of the mobj as it would visually appear to be.
coord_t R_VisualRadius(struct mobj_s *mo);
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/include/render/sky.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ float Sky_LayerFadeoutLimit(int layerId);
boolean Sky_LayerMasked(int layerId);

/// @return Material assigned to the identified @a layerId of the current Sky.
material_t *Sky_LayerMaterial(int layerId);
Material *Sky_LayerMaterial(int layerId);

/// @return Horizontal offset for the identified @a layerId of the current Sky.
float Sky_LayerOffset(int layerId);
Expand All @@ -115,7 +115,7 @@ void Sky_LayerSetFadeoutLimit(int layerId, float limit);
* Change the Material assigned to the identified @a layerId of the current Sky.
* @post Sky light color and layer Material are marked for update (deferred).
*/
void Sky_LayerSetMaterial(int layerId, material_t *material);
void Sky_LayerSetMaterial(int layerId, Material *material);

/**
* Change the horizontal offset for the identified @a layerId of the current Sky.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/include/render/sprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct rendpspriteparams_s
float pos[2]; // {X, Y} Screen-space position.
float width, height;

material_t *mat;
Material *mat;
float texOffset[2];
boolean texFlip[2]; // {X, Y} Flip along the specified axis.

Expand Down
Loading

0 comments on commit c0c6806

Please sign in to comment.