forked from jbperin/BattleZone4Oric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrawLandscape.c
50 lines (42 loc) · 1.57 KB
/
drawLandscape.c
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
void drawLandscape () {
unsigned char glCamRotZdiv4;
unsigned char idxSeg, nbLeftClipSeg, nbRightClipSeg, nbNoClipSeg, idxPt1, idxPt2;
glCamRotZdiv4 = ((unsigned char )glCamRotZ) >> 2;
idxSeg = tabIdxFirstSeg [glCamRotZdiv4];
nbLeftClipSeg = tabNbLeftClipSeg [glCamRotZdiv4];
nbRightClipSeg = tabNbRightClipSeg [glCamRotZdiv4];
nbNoClipSeg = tabNoClipSeg [glCamRotZdiv4];
while (nbLeftClipSeg > 0){
idxPt1 = tabSegPt1[idxSeg];
idxPt2 = tabSegPt2[idxSeg];
LargeX0 = tabPointsX[idxPt1]-tabOffset[glCamRotZdiv4];
LargeY0 = tabPointsY[idxPt1];
LargeX1 = tabPointsX[idxPt2]-tabOffset[glCamRotZdiv4];
LargeY1 = tabPointsY[idxPt2];
DrawClippedLine();
idxSeg = idxSeg + 1;
nbLeftClipSeg --;
}
while (nbNoClipSeg > 0) {
idxPt1 = tabSegPt1[idxSeg];
idxPt2 = tabSegPt2[idxSeg];
CurrentPixelX = tabPointsX[idxPt1]-tabOffset[glCamRotZdiv4];
CurrentPixelY = tabPointsY[idxPt1];
OtherPixelX = tabPointsX[idxPt2]-tabOffset[glCamRotZdiv4];
OtherPixelY = tabPointsY[idxPt2];
DrawLine8();
idxSeg = idxSeg + 1;
nbNoClipSeg --;
}
while (nbRightClipSeg > 0){
idxPt1 = tabSegPt1[idxSeg];
idxPt2 = tabSegPt2[idxSeg];
LargeX0 = tabPointsX[idxPt1]-tabOffset[glCamRotZdiv4];
LargeY0 = tabPointsY[idxPt1];
LargeX1 = tabPointsX[idxPt2]-tabOffset[glCamRotZdiv4];
LargeY1 = tabPointsY[idxPt2];
DrawClippedLine();
idxSeg = idxSeg + 1;
nbRightClipSeg --;
}
}