summaryrefslogtreecommitdiff
path: root/src/graphics_c3.h
blob: 36b7c6bad6daadf3a68c6972ea3e74ee80a7636f (plain) (blame)
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
#ifndef _HACKVR_GRAPHICS_H_
#define _HACKVR_GRAPHICS_H_

#include <idc.h>
#include "common.h"

struct gra_global {
  unsigned int width;
  unsigned int height;
  c2_t mouse;
  int greyscale;
  int xoff;
  int split_screen;
  real split;
  int split_flip;
  char force_redraw;//this should be to make it draw as often as possible
  char redrawplzkthx;//this is just a flag that redraw() sets, so if multiple draws are asked for, it can clear all of them at once instead of queueing them
  char red_and_blue;
  unsigned int depth;//???
  unsigned int border_width;
  char zsort;
  char drawminimap;
  char input_mode;
  char drawsky;
  char draw3d;
  int redraw[2];//pipe fd
  int mapxoff;
  int mapyoff;
  int mousemap[10];//you're only going to have 10 buttons on your mouse... right?
  c2_t dragstart[10];//mouse coordinates where a drag was started
  c3_rot_t oldcamera;
  int maxshapes;
  int fieldofview;
};

typedef struct {
 struct c3_shape *s;
 real d;
} zsort_t;

int graphics_init();
int graphics_sub_init();
void graphics_event_handler(struct shit *me,char *line);
void draw_screen();
void set_aspect_ratio();
void recalculate_eyes();
int selfcommand(char *s);
cs_t c3_to_cs(c3_group_rel_t eye,c3_t p);
radians d2r(degrees d);
real shitdist(struct c3_shape *s,c3_t p);
c3_t rotate_c3_xr(c3_t p1,c3_t p2,radians xr);
c3_t rotate_c3_yr(c3_t p1,c3_t p2,radians yr);
c3_t rotate_c3_zr(c3_t p1,c3_t p2,radians zr);

int compar(zsort_t *a,zsort_t *b);
void redraw();

#endif