2010-09-01 10:37:10 +00:00
|
|
|
#ifndef XYView_h
|
|
|
|
#define XYView_h
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2003-05-06 21:52:58 +00:00
|
|
|
#include <AppKit/AppKit.h>
|
2010-09-09 11:46:38 +00:00
|
|
|
|
|
|
|
#include "QF/mathlib.h"
|
|
|
|
|
2003-05-06 21:52:58 +00:00
|
|
|
#include "SetBrush.h"
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-09 11:46:38 +00:00
|
|
|
#include "render.h"
|
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
extern id xyview_i;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
#define MINSCALE 0.125
|
|
|
|
#define MAXSCALE 2.0
|
|
|
|
|
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
extern vec3_t xy_viewnormal; // v_forward for xy view
|
|
|
|
extern float xy_viewdist; // clip behind this plane
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
extern NSRect xy_draw_rect;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
void linestart (float r, float g, float b);
|
|
|
|
void lineflush (void);
|
|
|
|
void linecolor (float r, float g, float b);
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
void XYmoveto (vec3_t pt);
|
|
|
|
void XYlineto (vec3_t pt);
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-11 16:41:18 +00:00
|
|
|
@interface XYView:NSView
|
|
|
|
{
|
2010-09-11 10:06:04 +00:00
|
|
|
NSRect realbounds, newrect, combinedrect;
|
|
|
|
NSPoint midpoint;
|
|
|
|
int gridsize;
|
|
|
|
float scale;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
// for textured view
|
2010-09-11 10:06:04 +00:00
|
|
|
int xywidth, xyheight;
|
|
|
|
float *xyzbuffer;
|
|
|
|
unsigned *xypicbuffer;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
drawmode_t drawmode;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
|
|
|
// UI links
|
2010-09-11 10:06:04 +00:00
|
|
|
id mode_radio_i;
|
2003-03-18 19:48:24 +00:00
|
|
|
}
|
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-(float) currentScale;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-setModeRadio:m;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-drawMode:sender;
|
|
|
|
-setDrawMode:(drawmode_t) mode;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-newSuperBounds;
|
|
|
|
-newRealBounds:(NSRect *) nb;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-addToScrollRange: (float) x:(float) y;
|
2010-09-11 16:41:18 +00:00
|
|
|
-setOrigin:(NSPoint *) pt scale:(float) sc;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-centerOn:(vec3_t) org;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-drawMode:sender;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-superviewChanged;
|
2003-03-18 19:48:24 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
-(int) gridsize;
|
|
|
|
-(float) snapToGrid:(float) f;
|
2010-09-01 10:37:10 +00:00
|
|
|
|
2010-09-11 10:06:04 +00:00
|
|
|
@end
|
|
|
|
#endif // XYView_h
|