home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / agl103p.lha / src / agl / RCS / text.c,v < prev    next >
Encoding:
Text File  |  1994-12-09  |  5.1 KB  |  352 lines

  1. head    1.2;
  2. branch    1.2.1.99;
  3. access;
  4. symbols;
  5. locks; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 1.2
  10. date    93.02.07.23.24.26;    author jason;    state Exp;
  11. branches
  12.     1.2.1.1;
  13. next    ;
  14.  
  15. 1.2.1.1
  16. date    94.03.29.05.41.32;    author jason;    state Exp;
  17. branches;
  18. next    1.2.1.2;
  19.  
  20. 1.2.1.2
  21. date    94.09.13.03.53.06;    author jason;    state Exp;
  22. branches;
  23. next    1.2.1.3;
  24.  
  25. 1.2.1.3
  26. date    94.11.16.06.30.09;    author jason;    state Exp;
  27. branches;
  28. next    1.2.1.4;
  29.  
  30. 1.2.1.4
  31. date    94.12.09.05.29.56;    author jason;    state Exp;
  32. branches;
  33. next    ;
  34.  
  35.  
  36. desc
  37. @text drawing
  38. @
  39.  
  40.  
  41. 1.2
  42. log
  43. @Initial RCS Version
  44. @
  45. text
  46. @#include"agl.h"
  47.  
  48. long TextX[MAX_WINDOWS],TextY[MAX_WINDOWS];
  49.  
  50.  
  51. /******************************************************************************
  52. void    cmov2s(long sx,long sy)
  53.  
  54. ******************************************************************************/
  55. /*PROTOTYPE*/
  56. void cmov2i(long sx,long sy)
  57.     {
  58.     if(OneToOne[CurrentWid])    /* bypass transforms if no effect */
  59.         {
  60.         TextX[CurrentWid]=sx;
  61.         TextY[CurrentWid]=sy;
  62.         }
  63.     else
  64.         cmov((float)sx,(float)sy,(float)0.0);
  65.     }
  66.  
  67.  
  68. /******************************************************************************
  69. void    cmovs(long sx,long sy,long sz)
  70.  
  71. ******************************************************************************/
  72. /*PROTOTYPE*/
  73. void cmovi(long sx,long sy,long sz)
  74.     {
  75.     cmov((float)sx,(float)sy,(float)sz);
  76.     }
  77.  
  78.  
  79. /******************************************************************************
  80. void    cmov2s(short sx,short sy)
  81.  
  82. ******************************************************************************/
  83. /*PROTOTYPE*/
  84. void cmov2s(short sx,short sy)
  85.     {
  86.     if(OneToOne[CurrentWid])    /* bypass transforms if no effect */
  87.         {
  88.         TextX[CurrentWid]=sx;
  89.         TextY[CurrentWid]=sy;
  90.         }
  91.     else
  92.         cmov((float)sx,(float)sy,(float)0.0);
  93.     }
  94.  
  95.  
  96. /******************************************************************************
  97. void    cmovs(short sx,short sy,short sz)
  98.  
  99. ******************************************************************************/
  100. /*PROTOTYPE*/
  101. void cmovs(short sx,short sy,short sz)
  102.     {
  103.     cmov((float)sx,(float)sy,(float)sz);
  104.     }
  105.  
  106.  
  107. /******************************************************************************
  108. void    cmov2(float fx,float fy)
  109.  
  110. ******************************************************************************/
  111. /*PROTOTYPE*/
  112. void cmov2(float fx,float fy)
  113.     {
  114.     if(OneToOne[CurrentWid])    /* bypass transforms if no effect */
  115.         {
  116.         TextX[CurrentWid]=fx;
  117.         TextY[CurrentWid]=fy;
  118.         }
  119.     else
  120.         cmov(fx,fy,(float)0.0);
  121.     }
  122.  
  123.  
  124. /******************************************************************************
  125. void    cmov(float fx,float fy,float fz)
  126.  
  127. ******************************************************************************/
  128. /*PROTOTYPE*/
  129. void cmov(float fx,float fy,float fz)
  130.     {
  131.     float vert[3],rvert[3],pvert[3];
  132.  
  133.     vert[0]=fx;
  134.     vert[1]=fy;
  135.     vert[2]=fz;
  136.  
  137.     rotate_translate_position(vert,rvert);
  138.     project_vertex(rvert,pvert);
  139.  
  140.     TextX[CurrentWid]=CurrentWidth*(pvert[0]+1.0)/2.0;
  141.     TextY[CurrentWid]=CurrentHeight*(pvert[1]+1.0)/2.0;
  142.     }
  143.  
  144.  
  145. /******************************************************************************
  146. void    charstr(char *string)
  147.  
  148. ******************************************************************************/
  149. /*PROTOTYPE*/
  150. void charstr(char *string)
  151.     {
  152.     Move(DrawRPort,TextX[CurrentWid],CurrentHeight-1-TextY[CurrentWid]);
  153.     Text(DrawRPort,string,(ULONG)strlen(string));
  154.     }
  155.  
  156.  
  157. /******************************************************************************
  158. void    getcpos(short *cx,short *cy)
  159.  
  160. ******************************************************************************/
  161. /*PROTOTYPE*/
  162. void getcpos(short *cx,short *cy)
  163.     {
  164.     *cx=TextX[CurrentWid];
  165.     *cy=TextY[CurrentWid];
  166.     }
  167. @
  168.  
  169.  
  170. 1.2.1.1
  171. log
  172. @Added RCS Header
  173. @
  174. text
  175. @a0 16
  176.  
  177. /******************************************************************************
  178.  
  179. $Id: text.c,v 1.2.1.1 2002/03/26 22:04:24 jason Exp jason $
  180.  
  181. $Log: text.c,v $
  182.  * Revision 1.2.1.1  2002/03/26  22:04:24  jason
  183.  * Added RCS Header
  184.  *
  185.  * Revision 1.2.1.1  2002/03/26  22:00:51  jason
  186.  * RCS/agl.h,v
  187.  *
  188.  
  189. ******************************************************************************/
  190.  
  191.  
  192. @
  193.  
  194.  
  195. 1.2.1.2
  196. log
  197. @fixed alignment of text
  198. @
  199. text
  200. @d4 1
  201. a4 1
  202. $Id: text.c,v 1.2.1.1 1994/03/29 05:41:32 jason Exp jason $
  203. a6 3
  204.  * Revision 1.2.1.1  1994/03/29  05:41:32  jason
  205.  * Added RCS Header
  206.  *
  207. a16 1
  208. #ifndef NOT_EXTERN
  209. a17 1
  210. #endif
  211. d111 2
  212. a112 7
  213. /*
  214.     TextX[CurrentWid]=CurrentWidth* (pvert[0]+1.0)/2.0+0.5;
  215.     TextY[CurrentWid]=CurrentHeight*(pvert[1]+1.0)/2.0+0.5;
  216. */
  217.  
  218.     TextX[CurrentWid]=ViewPort[CurrentWid][0] + ViewPort[CurrentWid][1] * (pvert[0]+1.0)/2.0;
  219.     TextY[CurrentWid]=ViewPort[CurrentWid][2] + ViewPort[CurrentWid][3] * (pvert[1]+1.0)/2.0;
  220. @
  221.  
  222.  
  223. 1.2.1.3
  224. log
  225. @adjust for borders
  226. @
  227. text
  228. @d4 1
  229. a4 1
  230. $Id: text.c,v 1.2.1.2 1994/09/13 03:53:06 jason Exp jason $
  231. a6 3
  232.  * Revision 1.2.1.2  1994/09/13  03:53:06  jason
  233.  * fixed alignment of text
  234.  *
  235. d133 1
  236. a133 13
  237.     short cx,cy;
  238.  
  239.     getcpos(&cx,&cy);
  240.  
  241.     cy=CurrentHeight-1-cy;
  242.  
  243.     if(Bordered[CurrentWid])
  244.         {
  245.         cx+=BorderWidth;
  246.         cy+=BorderWidth+BorderHeight;
  247.         }
  248.  
  249.     Move(DrawRPort,cx,cy);
  250. @
  251.  
  252.  
  253. 1.2.1.4
  254. log
  255. @added copyright
  256. @
  257. text
  258. @d1 1
  259. d4 1
  260. a4 4
  261. Copyright © 1994 Jason Weber
  262. All Rights Reserved
  263.  
  264. $Id: text.c,v 1.2.1.3 1994/11/16 06:30:09 jason Exp jason $
  265. a6 3
  266.  * Revision 1.2.1.3  1994/11/16  06:30:09  jason
  267.  * adjust for borders
  268.  *
  269. @
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.