From 80df004c4d56e6db063babf8d916662481014387 Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 9 Dec 2005 19:08:08 +0000 Subject: [PATCH] A new builtin, for drawing lines. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1690 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/plugin.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/engine/common/plugin.c b/engine/common/plugin.c index f1c34065d..227d46dd8 100644 --- a/engine/common/plugin.c +++ b/engine/common/plugin.c @@ -534,6 +534,24 @@ int VARGS Plug_Draw_Image(void *offset, unsigned int mask, const long *arg) Draw_Image(VM_FLOAT(arg[0]), VM_FLOAT(arg[1]), VM_FLOAT(arg[2]), VM_FLOAT(arg[3]), VM_FLOAT(arg[4]), VM_FLOAT(arg[5]), VM_FLOAT(arg[6]), VM_FLOAT(arg[7]), pic); return 1; } +//x1,y1,x2,y2 +int VARGS Plug_Draw_Line(void *offset, unsigned int mask, const long *arg) +{ + switch(qrenderer) //FIXME: I don't want qrenderer seen outside the refresh + { +#ifdef RGLQUAKE + case QR_OPENGL: + qglDisable(GL_TEXTURE_2D); + qglBegin(GL_LINES); + qglVertex2f(VM_FLOAT(arg[0]), VM_FLOAT(arg[1])); + qglVertex2f(VM_FLOAT(arg[2]), VM_FLOAT(arg[3])); + qglEnd(); + qglEnable(GL_TEXTURE_2D); + break; +#endif + } + return 1; +} int VARGS Plug_Draw_Character(void *offset, unsigned int mask, const long *arg) { @@ -1359,9 +1377,9 @@ void Plug_Init(void) Plug_RegisterBuiltin("Draw_LoadImage", Plug_Draw_LoadImage, 0); Plug_RegisterBuiltin("Draw_Image", Plug_Draw_Image, 0); - Plug_RegisterBuiltin("Draw_Character", Plug_Draw_Character, 0); Plug_RegisterBuiltin("Draw_Fill", Plug_Draw_Fill, 0); + Plug_RegisterBuiltin("Draw_Line", Plug_Draw_Line, 0); Plug_RegisterBuiltin("Draw_Colourp", Plug_Draw_ColourP, 0); Plug_RegisterBuiltin("Draw_Colour3f", Plug_Draw_Colour3f, 0); Plug_RegisterBuiltin("Draw_Colour4f", Plug_Draw_Colour4f, 0);