tank-dev / tank

A 2D C++ game engine taking inspiration from FlashPunk
Boost Software License 1.0
12 stars 3 forks source link

visible_ flag in Entity #39

Closed qualiaa closed 11 years ago

qualiaa commented 11 years ago

I'm currently fixing issue #9, and I noticed that there was an unusued visible_ flag that I must have wanted to use at some point.

My question is, do we actually want to check if something is visible before rendering it? I'm thinking definitely not, but I wondered if anyone has any reason to think otherwise.

Anstow commented 11 years ago

Flashpunk has a visible flag which may be where is comes from. Actually sometimes it is useful, if you want to hide an entity.

qualiaa commented 11 years ago

Heh, no, I made this engine about a year before I'd heard of FP. I remember wanting to use it, I just don't think it's a very good idea any more. If an entity doesn't want to be visible it can do something with its graphic. For example, I'd like all graphic objects to have a colour multiplier (including an alpha channel). Then OpenGL will work out when something doesn't need to be rendered, and it's a more general approach.

qualiaa commented 11 years ago

Okay, the visible flag is now gone, but I'll probably add one to Graphic.