about summary refs log tree commit diff
path: root/src/Sprites.h
blob: 28a795806a98acce04cddd9c7e5db412f1693491 (plain) (blame)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Sprites
// Copyright (C) 2002  David Rosen
// Copyright (C) 2003  Steven Fuller
// Copyright (C) 2003  Zachary Jack Slater
// Copyright (C) 2021  Nguyễn Gia Phong
//
// This file is part of Black Shades.
//
// Black Shades is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Black Shades is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Black Shades.  If not, see <https://www.gnu.org/licenses/>.

#ifndef BLACKSHADES_SPRITES_H
#define BLACKSHADES_SPRITES_H

#include <GL/gl.h>

#include "Quaternions.h"

#define maxsprites 2000

#define muzzleflashsprite 1
#define smokesprite 2
#define smokespritenoup 3
#define bullet 4
#define bulletinstant 5
#define flashsprite 6
#define grenadesprite 7
#define pinsprite 8
#define spoonsprite 9
#define bloodspritedown 10
#define bloodspritenoup 11
#define particlesspritedown 12
#define snowsprite 13
#define rainsprite 14

class Sprites{
public:
	GLuint flaretextureptr;
	GLuint muzzleflaretextureptr;
	GLuint smoketextureptr;
	GLuint bullettextureptr;
	GLuint bloodtextureptr;
	GLuint raintextureptr;
	GLuint snowtextureptr;

	int howmanysprites;

	XYZ location[maxsprites];
	XYZ oldlocation[maxsprites];
	XYZ velocity[maxsprites];
	XYZ initialvelocity[maxsprites];
	float size[maxsprites];
	float initialsize[maxsprites];
	float brightness[maxsprites];
	float initialbrightness[maxsprites];
	float color1[maxsprites];
	float color2[maxsprites];
	float color3[maxsprites];
	float alivetime[maxsprites];
	float rotation[maxsprites];
	int type[maxsprites];
	int owner[maxsprites];

	void draw();

	int DeleteSprite(int which);
	int MakeSprite(int atype, float abrightness,
		float acolor1, float acolor2, float acolor3,
		XYZ alocation, XYZ avelocity, float asize);
	int MakeSprite(int atype, float abrightness,
		float acolor1, float acolor2, float acolor3,
		XYZ alocation, XYZ avelocity, float asize, int aowner);

	void DoStuff();
	~Sprites();
};
#endif // BLACKSHADES_SPRITES_H