home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / Triton / Source / src / color_prim.c next >
C/C++ Source or Header  |  1998-05-23  |  3KB  |  83 lines

  1. /*
  2.  *  OpenTriton -- A free release of the triton.library source code
  3.  *  Copyright (C) 1993-1998  Stefan Zeiger
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  *  color_prim.c - Color Primitives
  20.  *
  21.  */
  22.  
  23.  
  24. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  25. //////////////////////////////////////////////////////////////////////////////////////// Include our stuff //
  26. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  27.  
  28. #define INTUI_V36_NAMES_ONLY
  29. #define TR_NOSUPPORT
  30. #define TR_THIS_IS_TRITON
  31. #define TR_EXTERNAL_ONLY
  32.  
  33. #include "include/libraries/triton.h"
  34. #include "include/clib/triton_protos.h"
  35. #include "prefs/Triton.h"
  36. #include "/internal.h"
  37.  
  38. #include "parts/define_classes.h"
  39.  
  40.  
  41. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  42. ///////////////////////////////////////////////////////////////////////////////////////// Color Primitives //
  43. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  44.  
  45. /****** triton.library/TR_GetPen ******
  46. *
  47. *   NAME    
  48. *    TR_GetPen -- Returns a pen number. (V6)
  49. *
  50. *   SYNOPSIS
  51. *    Pen = TR_GetPen(Project, PenType, PenData)
  52. *                    A0       D0       D1
  53. *
  54. *    ULONG TR_GetPen(struct TR_Project *, ULONG, ULONG);
  55. *
  56. *   FUNCTION
  57. *    Returns the pen specified by PenType and PenData.
  58. *
  59. *   RESULT
  60. *    Pen - The number of the requested pen
  61. *
  62. ******/
  63.  
  64. ULONG __saveds __asm TR_GetPen(register __a0 struct TR_Project *project,
  65.                    register __d0 ULONG pentype, register __d1 ULONG pendata)
  66. {
  67.   switch(pentype)
  68.   {
  69.     case TRPT_TRITONPEN:
  70.       return TR_GetPen(
  71.         project,
  72.         ((struct TR_AppPrefs *)(project->trp_App->tra_Prefs))->pentype[pendata],
  73.         ((struct TR_AppPrefs *)(project->trp_App->tra_Prefs))->pendata[pendata]
  74.       );
  75.  
  76.     case TRPT_SYSTEMPEN:
  77.       return project->trp_DrawInfo->dri_Pens[pendata];
  78.  
  79.     default: /* TRPT_GRAPHICSPEN */
  80.       return pendata;
  81.   }
  82. }
  83.