Changeset - r20833:1e58b6394fb5
[Not reviewed]
master
0 1 0
planetmaker - 11 years ago 2013-10-17 21:41:59
planetmaker@openttd.org
(svn r25877) -Doc: A bit too much c&p in comment
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_object.h
Show inline comments
 
@@ -94,63 +94,63 @@ struct ObjectSpec {
 
	bool IsAvailable() const;
 
	uint Index() const;
 

	
 
	static const ObjectSpec *Get(ObjectType index);
 
	static const ObjectSpec *GetByTile(TileIndex tile);
 
};
 

	
 
/** Object scope resolver. */
 
struct ObjectScopeResolver : public ScopeResolver {
 
	struct Object *obj; ///< The object the callback is ran for.
 
	TileIndex tile;     ///< The tile related to the object.
 
	uint8 view;         ///< The view of the object.
 

	
 
	ObjectScopeResolver(ResolverObject *ro, Object *obj, TileIndex tile, uint8 view = 0);
 

	
 
	/* virtual */ uint32 GetRandomBits() const;
 
	/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
 
};
 

	
 
/** A resolver object to be used with feature 0F spritegroups. */
 
struct ObjectResolverObject : public ResolverObject {
 
	ObjectScopeResolver object_scope; ///< The object scope resolver.
 
	TownScopeResolver *town_scope;    ///< The town scope resolver (created on the first call).
 

	
 
	ObjectResolverObject(const ObjectSpec *spec, Object *o, TileIndex tile, uint8 view = 0,
 
			CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0);
 
	~ObjectResolverObject();
 

	
 
	/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
 
	{
 
		switch (scope) {
 
			case VSG_SCOPE_SELF:
 
				return &this->object_scope;
 

	
 
			case VSG_SCOPE_PARENT: {
 
				TownScopeResolver *tsr = this->GetTown();
 
				if (tsr != NULL) return tsr;
 
				/* FALL-THROUGH */
 
			}
 

	
 
			default: return ResolverObject::GetScope(scope, relative);
 
		}
 
	}
 

	
 
private:
 
	TownScopeResolver *GetTown();
 
};
 

	
 
/** Struct containing information relating to station classes. */
 
/** Struct containing information relating to object classes. */
 
typedef NewGRFClass<ObjectSpec, ObjectClassID, OBJECT_CLASS_MAX> ObjectClass;
 

	
 
/** Mapping of purchase for objects. */
 
static const CargoID CT_PURCHASE_OBJECT = 1;
 

	
 
uint16 GetObjectCallback(CallbackID callback, uint32 param1, uint32 param2, const ObjectSpec *spec, Object *o, TileIndex tile, uint8 view = 0);
 

	
 
void DrawNewObjectTile(TileInfo *ti, const ObjectSpec *spec);
 
void DrawNewObjectTileInGUI(int x, int y, const ObjectSpec *spec, uint8 view);
 
void AnimateNewObjectTile(TileIndex tile);
 
void TriggerObjectTileAnimation(Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec);
 
void TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec);
 

	
 
#endif /* NEWGRF_OBJECT_H */
0 comments (0 inline, 0 general)