1 /* Copyright (C) 2009 Wildfire Games.
2 * This file is part of 0 A.D.
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef INCLUDED_BLENDSHAPES
19 #define INCLUDED_BLENDSHAPES
25 BlendShape4(int a
,int b
,int c
,int d
) {
26 m_Data
[0]=a
; m_Data
[1]=b
; m_Data
[2]=c
; m_Data
[3]=d
;
29 int& operator[](int index
) { return m_Data
[index
]; }
30 const int& operator[](int index
) const { return m_Data
[index
]; }
32 bool operator==(const BlendShape4
& lhs
) const {
33 return memcmp(m_Data
,lhs
.m_Data
,sizeof(BlendShape4
))==0;
36 void Rotate90(BlendShape4
& dst
) const {
43 void Rotate180(BlendShape4
& dst
) const {
50 void Rotate270(BlendShape4
& dst
) const {
57 void FlipU(BlendShape4
& dst
) const {
64 void FlipV(BlendShape4
& dst
) const {
80 BlendShape8(int a
,int b
,int c
,int d
,int e
,int f
,int g
,int h
) {
81 m_Data
[0]=a
; m_Data
[1]=b
; m_Data
[2]=c
; m_Data
[3]=d
;
82 m_Data
[4]=e
; m_Data
[5]=f
; m_Data
[6]=g
; m_Data
[7]=h
;
85 int& operator[](size_t index
) { return m_Data
[index
]; }
86 const int& operator[](size_t index
) const { return m_Data
[index
]; }
88 bool operator==(const BlendShape8
& lhs
) const {
89 return memcmp(m_Data
,lhs
.m_Data
,sizeof(BlendShape8
))==0;
92 void Rotate90(BlendShape8
& dst
) const {
103 void Rotate180(BlendShape8
& dst
) const {
114 void Rotate270(BlendShape8
& dst
) const {
125 void FlipU(BlendShape8
& dst
) const {
136 void FlipV(BlendShape8
& dst
) const {