-
Notifications
You must be signed in to change notification settings - Fork 0
/
echo_model_stairs.cpp
117 lines (107 loc) · 3.47 KB
/
echo_model_stairs.cpp
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// echo_model_stairs.cpp
/*
This file is part of L-Echo.
L-Echo 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.
L-Echo 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 L-Echo. If not, see <http://www.gnu.org/licenses/>.
*/
#include "echo_platform.h"
#include "echo_gfx.h"
#ifdef ECHO_NDS
#include <nds.h>
#elif ECHO_OSX //OS X
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#endif
//stats: LATS: 6, ANGLE_INCR: 0.523599, NDS_LATS: 2, NDS_ANGLE_INCR: 1.570796
#ifdef ECHO_NDS
#define SET_ID(id) gfx_set_polyID(id)
#else
#define SET_ID(id)
#endif
void draw_stairs()
{
#ifndef ECHO_NDS
glBegin(GL_QUAD_STRIP);
glVertex3f(0.5f, -0.500f, -0.500f);
glVertex3f(-0.5f, -0.500f, -0.500f);
glVertex3f(0.5f, -0.500f, -0.334f);
glVertex3f(-0.5f, -0.500f, -0.334f);
glVertex3f(0.5f, -0.334f, -0.334f);
glVertex3f(-0.5f, -0.334f, -0.334f);
glVertex3f(0.5f, -0.334f, -0.168f);
glVertex3f(-0.5f, -0.334f, -0.168f);
glVertex3f(0.5f, -0.168f, -0.168f);
glVertex3f(-0.5f, -0.168f, -0.168f);
glVertex3f(0.5f, -0.168f, -0.002f);
glVertex3f(-0.5f, -0.168f, -0.002f);
glVertex3f(0.5f, -0.002f, -0.002f);
glVertex3f(-0.5f, -0.002f, -0.002f);
glVertex3f(0.5f, -0.002f, 0.164f);
glVertex3f(-0.5f, -0.002f, 0.164f);
glVertex3f(0.5f, 0.164f, 0.164f);
glVertex3f(-0.5f, 0.164f, 0.164f);
glVertex3f(0.5f, 0.164f, 0.330f);
glVertex3f(-0.5f, 0.164f, 0.330f);
glVertex3f(0.5f, 0.330f, 0.330f);
glVertex3f(-0.5f, 0.330f, 0.330f);
glVertex3f(0.5f, 0.330f, 0.496f);
glVertex3f(-0.5f, 0.330f, 0.496f);
glVertex3f(0.5f, 0.496f, 0.496f);
glVertex3f(-0.5f, 0.496f, 0.496f);
glVertex3f(0.5f, 0.496f, 0.662f);
glVertex3f(-0.5f, 0.496f, 0.662f);
glVertex3f(0.5f, 0.5f, 0.5f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glEnd();
#else
SET_ID(16);
draw_rectv16(2048, -1359, -1359, 2048, -2039, -1359
, -2048, -2039, -1359, -2048, -1359, -1359);
SET_ID(17);
draw_rectv16(2048, -2039, -2039, 2048, -2039, -1359
, -2048, -2039, -1359, -2048, -2039, -2039);
SET_ID(18);
draw_rectv16(2048, -679, -679, 2048, -1359, -679
, -2048, -1359, -679, -2048, -679, -679);
SET_ID(16);
draw_rectv16(2048, -1359, -1359, 2048, -1359, -679
, -2048, -1359, -679, -2048, -1359, -1359);
SET_ID(17);
draw_rectv16(2048, 0, 0, 2048, -679, 0
, -2048, -679, 0, -2048, 0, 0);
SET_ID(18);
draw_rectv16(2048, -679, -679, 2048, -679, 0
, -2048, -679, 0, -2048, -679, -679);
SET_ID(16);
draw_rectv16(2048, 679, 679, 2048, 0, 679
, -2048, 0, 679, -2048, 679, 679);
SET_ID(17);
draw_rectv16(2048, 0, 0, 2048, 0, 679
, -2048, 0, 679, -2048, 0, 0);
SET_ID(18);
draw_rectv16(2048, 1359, 1359, 2048, 679, 1359
, -2048, 679, 1359, -2048, 1359, 1359);
SET_ID(16);
draw_rectv16(2048, 679, 679, 2048, 679, 1359
, -2048, 679, 1359, -2048, 679, 679);
SET_ID(17);
draw_rectv16(2048, 2039, 2039, 2048, 1359, 2039
, -2048, 1359, 2039, -2048, 2039, 2039);
SET_ID(18);
draw_rectv16(2048, 1359, 1359, 2048, 1359, 2039
, -2048, 1359, 2039, -2048, 1359, 1359);
#endif
}