projects
/
dosdemo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
77e0277
)
switching polytest between zsorting and BSP for performance testing
author
John Tsiombikas
<nuclear@member.fsf.org>
Wed, 21 Feb 2018 04:01:17 +0000
(06:01 +0200)
committer
John Tsiombikas
<nuclear@member.fsf.org>
Wed, 21 Feb 2018 04:01:17 +0000
(06:01 +0200)
with 'b'
src/polytest.c
patch
|
blob
|
history
diff --git
a/src/polytest.c
b/src/polytest.c
index
afe2006
..
bbc1c0b
100644
(file)
--- a/
src/polytest.c
+++ b/
src/polytest.c
@@
-16,6
+16,7
@@
static void destroy(void);
static void start(long trans_time);
static void draw(void);
static void draw_lowres_raster(void);
static void start(long trans_time);
static void draw(void);
static void draw_lowres_raster(void);
+static void keypress(int key);
static int gen_texture(struct pimage *img, int xsz, int ysz);
static struct screen scr = {
static int gen_texture(struct pimage *img, int xsz, int ysz);
static struct screen scr = {
@@
-24,7
+25,7
@@
static struct screen scr = {
destroy,
start, 0,
draw,
destroy,
start, 0,
draw,
- 0
+ keypress
};
static float cam_theta, cam_phi = 25;
};
static float cam_theta, cam_phi = 25;
@@
-202,6
+203,16
@@
static void draw_lowres_raster(void)
}
}
}
}
+static void keypress(int key)
+{
+ switch(key) {
+ case 'b':
+ use_bsp = !use_bsp;
+ printf("drawing with %s\n", use_bsp ? "BSP tree" : "z-sorting");
+ break;
+ }
+}
+
static int gen_texture(struct pimage *img, int xsz, int ysz)
{
int i, j;
static int gen_texture(struct pimage *img, int xsz, int ysz)
{
int i, j;