File: hull_weapon_twirl.cpp

package info (click to toggle)
rafkill 1.2.2-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,268 kB
  • ctags: 5,074
  • sloc: cpp: 13,508; makefile: 64; sh: 14
file content (28 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "hull_weapon.h"
#include "bitmap.h"
#include "hull_weapon_twirl.h"
#include "ebox.h"

Twirl_WHull::Twirl_WHull( const Bitmap & who, ECollide * ec ):
HullWeapon( 0, 1, 3 ) {
	collide = ec;
	ang = 0;
	// *Bitmap = who;
	bitmap = who;
	myBitmap = &bitmap;
}

Twirl_WHull::~Twirl_WHull() {
	delete collide;
	myBitmap = NULL;
}

void Twirl_WHull::Draw( const Bitmap & who, int x, int y ) {

	int mx = myBitmap->getWidth()/2;
	int my = myBitmap->getHeight()/2;

	bitmap.drawRotate( x-mx, y-my, ang, who );
	ang = ( ang + 8 ) % 360;

}