-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimplePiece.CC
47 lines (37 loc) · 875 Bytes
/
SimplePiece.CC
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
// Greg Kaiser
//
// CS290 with Prof. Francis
// 4D Tetris
//
// SimplePiece.C
// Last modified: April 22, 1996
//
// (C) 1996 Board of Trustees University of Illinois
#include "Pieces.h"
extern int *DIM;
extern float *LEN;
extern float *botcorner;
SimplePiece::SimplePiece() : GenPiece(1)
{
centerstat = 0;
int *dudeman = new int[4];
for (int i = 0; i < 3; i++)
dudeman[i] = (DIM[i] /2);
dudeman[VW] = DIM[VW];
float *high = new float[4];
float *low = new float[4];
for (int i = 0; i < 4; i++) {
low[i] = botcorner[i] + dudeman[i] * LEN[i];
high[i] = low[i] + LEN[i];
}
float *temp = new float[4];
for (int i = 0; i < 4; i++)
temp[i] = (low[i] + high[i]) / 2;
center = new FourD(temp);
delete temp;
cubes[0] = new Hyper(low, high, dudeman);
cubes[0]->SetColor(0x0066ff);
delete dudeman;
delete low;
delete high;
}