~ubuntu-branches/ubuntu/natty/spring/natty

« back to all changes in this revision

Viewing changes to rts/Sim/Projectiles/Unsynced/GfxProjectile.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Ritchie
  • Date: 2010-09-23 18:56:03 UTC
  • mfrom: (3.1.9 experimental)
  • Revision ID: james.westby@ubuntu.com-20100923185603-st97s5chplo42y7w
Tags: 0.82.5.1+dfsg1-1ubuntu1
* Latest upstream version for online play
* debian/control: Replace (rather than conflict) spring-engine
  - spring-engine will be a dummy package (LP: #612905)
  - also set maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
 
2
 
1
3
#include "StdAfx.h"
2
 
// GfxProjectile.cpp: implementation of the CGfxProjectile class.
3
 
//
4
 
//////////////////////////////////////////////////////////////////////
5
4
#include "mmgr.h"
6
5
 
7
 
#include "Sim/Misc/GlobalSynced.h"
8
6
#include "Game/Camera.h"
9
7
#include "GfxProjectile.h"
 
8
#include "Rendering/ProjectileDrawer.hpp"
10
9
#include "Rendering/GL/VertexArray.h"
 
10
#include "Rendering/Textures/TextureAtlas.h"
11
11
#include "Rendering/Colors.h"
 
12
#include "Sim/Misc/GlobalSynced.h"
12
13
#include "Sim/Projectiles/ProjectileHandler.h"
13
 
#include "GlobalUnsynced.h"
14
14
 
15
15
CR_BIND_DERIVED(CGfxProjectile, CProjectile, );
16
16
 
28
28
// Construction/Destruction
29
29
//////////////////////////////////////////////////////////////////////
30
30
 
31
 
CGfxProjectile::CGfxProjectile()
32
 
:       CProjectile()
 
31
CGfxProjectile::CGfxProjectile(): CProjectile()
33
32
{
34
33
        creationTime = lifeTime = 0;
35
34
        color[0] = color[1] = color[2] = color[3] = 255;
36
35
        checkCol = false;
37
36
}
38
37
 
39
 
CGfxProjectile::CGfxProjectile(const float3& pos, const float3& speed, int lifeTime, const float3& color GML_PARG_C):
40
 
        CProjectile(pos, speed, 0, false, false, false GML_PARG_P),
 
38
CGfxProjectile::CGfxProjectile(const float3& pos, const float3& speed, int lifeTime, const float3& color):
 
39
        CProjectile(pos, speed, 0, false, false, false),
41
40
        creationTime(gs->frameNum),
42
41
        lifeTime(lifeTime)
43
42
{
73
72
{
74
73
        inArray = true;
75
74
 
76
 
        va->AddVertexTC(drawPos - camera->right * drawRadius - camera->up * drawRadius, ph->gfxtex.xstart, ph->gfxtex.ystart, color);
77
 
        va->AddVertexTC(drawPos + camera->right * drawRadius - camera->up * drawRadius, ph->gfxtex.xend,   ph->gfxtex.ystart, color);
78
 
        va->AddVertexTC(drawPos + camera->right * drawRadius + camera->up * drawRadius, ph->gfxtex.xend,   ph->gfxtex.yend,   color);
79
 
        va->AddVertexTC(drawPos - camera->right * drawRadius + camera->up * drawRadius, ph->gfxtex.xstart, ph->gfxtex.yend,   color);
 
75
        #define gfxt projectileDrawer->gfxtex
 
76
        va->AddVertexTC(drawPos - camera->right * drawRadius - camera->up * drawRadius, gfxt->xstart, gfxt->ystart, color);
 
77
        va->AddVertexTC(drawPos + camera->right * drawRadius - camera->up * drawRadius, gfxt->xend,   gfxt->ystart, color);
 
78
        va->AddVertexTC(drawPos + camera->right * drawRadius + camera->up * drawRadius, gfxt->xend,   gfxt->yend,   color);
 
79
        va->AddVertexTC(drawPos - camera->right * drawRadius + camera->up * drawRadius, gfxt->xstart, gfxt->yend,   color);
 
80
        #undef gfxt
80
81
}
81
82
 
82
83
void CGfxProjectile::DrawOnMinimap(CVertexArray& lines, CVertexArray& points)