~marten-r/widelands/feature-3d-rendering-open-gl-es-compat

« back to all changes in this revision

Viewing changes to src/graphic/render/gamerenderer.cc

  • Committer: Marten Richter \
  • Date: 2013-12-07 16:34:54 UTC
  • Revision ID: marten.richter@freenet.de-20131207163454-ssy014khpxtrgvq9
Add z-Ordering for rendering, fix some drawing glitches, change api for 3d rendering

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
        static const uint32_t BL = 2;
293
293
        static const uint32_t BR = 3;
294
294
        const Map & map = m_egbase->map();
 
295
        m_dst->start_rendering3d(Vector(0.f,0.f,-1.f));
295
296
 
296
297
        for (int32_t fy = m_minfy; fy <= m_maxfy; ++fy) {
297
298
                for (int32_t fx = m_minfx; fx <= m_maxfx; ++fx) {
437
438
                                for
438
439
                                        (const Overlay_Manager::Overlay_Info * it = overlay_info;
439
440
                                         it < end;
440
 
                                         ++it)
441
 
                                        m_dst->blit3d(pos[F] - it->hotspot, it->pic);
 
441
                                         ++it) {
 
442
                                        int32_t corr_z= it->pic->height() - it->hotspot.y ;
 
443
                                        if (corr_z<0) corr_z=0;
 
444
                                        Point3D corr(0,-corr_z,-corr_z*2);
 
445
                                        m_dst->blit3d(pos[F] - it->hotspot + corr, it->pic);
 
446
                                }
 
447
 
442
448
                        }
443
449
 
444
450
                        {
484
490
                        }
485
491
                }
486
492
        }
 
493
        m_dst->end_rendering3d();
487
494
}