Mercurial > projects > openmelee
diff render/render.d @ 26:88cca12cc8b9
added ship explode
author | zzzzrrr <mason.green@gmail.com> |
---|---|
date | Fri, 27 Mar 2009 19:26:01 -0400 |
parents | 441eb7672404 |
children | d63faa81a5e4 |
line wrap: on
line diff
--- a/render/render.d Fri Mar 27 16:25:17 2009 -0400 +++ b/render/render.d Fri Mar 27 19:26:01 2009 -0400 @@ -353,13 +353,17 @@ void draw(vec2i screenSize, GL gl) { - - vec2 point1 = vec2.from(ship1.rBody.position); - vec2 point2 = vec2.from(ship2.rBody.position); - vec2 range = point1 - point2; - zoom = bzClamp(1000/range.length, 2, 60); - viewCenter = point1 - (range * 0.5f); - + if(ship2) { + vec2 point1 = vec2.from(ship1.rBody.position); + vec2 point2 = vec2.from(ship2.rBody.position); + vec2 range = point1 - point2; + zoom = bzClamp(1000/range.length, 2, 60); + viewCenter = point1 - (range * 0.5f); + } else { + viewCenter = vec2.from(ship1.rBody.position); + zoom = 10; + } + this.screenSize = screenSize; gl.LoadIdentity(); @@ -378,21 +382,12 @@ gl.LoadIdentity(); gl.Clear(GL_COLOR_BUFFER_BIT); - vec2 pp1 = vec2.from(ship2.rBody.position); - vec2 pp2 = vec2.from(ship2.state.target); - - //gl.drawSegment(pp1, pp2, Color(0, 1, 0)); - // Draw dynamic bodies if (settings.drawShapes) { for (bzBody b = world.bodyList; b; b = b.next) { - - for (bzShape shape = b.shapeList; shape; shape = shape.next) { - bzShape s = shape; bzXForm xf = b.xf; - if (b.isStatic) { gl.drawShape(s, xf, Color(0.5f, 0.9f, 0.5f), settings.drawCoreShapes); }else if (b.isSleeping) {