[xmoto-dev] Request of testing my branch |
[ Thread Index | Date Index | More lists.tuxfamily.org/xmoto-dev Archives ]
Hi! I've commited some chenges into my branch - svn.tuxfamily.org/svnroot/xmoto/xmoto/branches/benetnash This version isn't fully functional - there is no layers support and clipping code is wrong. Implementing that require some coding and I'll wait first for some feedback. In my branch draving algorithm is completly changed. I've created one superclass for each drawn object - LevelObject. This class stores depth and bounding box of some object and have several virtual methond including main, void render(GameRenderer* r) which draws object on screen. Second thing is RendererObjects file where are stored methods called by mentioned render() method, for example RenderLevelEntity or RenderLevelBlock. Next thing is m_LevelObjects vector in GameRenderer class where all level objects are stored and sorted by their z value. During each frame whole vector is scanned and only visible objects are drawn (it's determined by calling virtual isVisible() method from LevelObject class). With this clipping and rendering logic is hidden and in render() method is on smart loop for (std::vector<LevelObject*>::iterator iter = m_LevelObjects.begin(); iter != m_LevelObjects.end(); iter++) { if ((*iter)->isVisible(m_screenBBox)) (*iter)->render(this); } which render all visible objects. Imo this method is better then old split to methods that were rendering background, foreground, dynamic blocks and so on. My other ideas (I could implement them if you like): - add to .lvl files z-value of block and add to svg2lvl option to store order of block from inkscape in .lvl file using this value. - add colors (or even transparency) to textures using glColor call - it will effect in better looking levels - fpt throttling - now game is optimized for 100fps which is very much on slower computer. With drawing only half or 1/3 of frames performance of game on such computer schould increase. - dynamic camera - when player is falling down more area below him schould be visible and so on On my computer effect of my changes isn't visible as higher farmerate but as lower CPU usage - version from trunk uses 50% to 70% of CPU and version from my branch uses 35% to 55%. I'd like to hear some feedback from you about performance of this on your machines. Best Regards benetnash -- Janek Polak WWW: http://www.icpnet.pl/~benetnash GnuPG: 6A1E7B75 GG: 2852217 Jabber: benetnash@xxxxxxxxxxxxx ICQ: 473154175 Skype: benetnash86
Attachment:
pgpljXSGLPgQ7.pgp
Description: PGP signature
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |