v_video.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* Emacs style mode select -*- C++ -*-
  2. *-----------------------------------------------------------------------------
  3. *
  4. *
  5. * PrBoom: a Doom port merged with LxDoom and LSDLDoom
  6. * based on BOOM, a modified and improved DOOM engine
  7. * Copyright (C) 1999 by
  8. * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
  9. * Copyright (C) 1999-2000 by
  10. * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
  11. * Copyright 2005, 2006 by
  12. * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version 2
  17. * of the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  27. * 02111-1307, USA.
  28. *
  29. * DESCRIPTION:
  30. * Gamma correction LUT.
  31. * Color range translation support
  32. * Functions to draw patches (by post) directly to screen.
  33. * Functions to blit a block to the screen.
  34. *
  35. *-----------------------------------------------------------------------------*/
  36. #ifndef __V_VIDEO__
  37. #define __V_VIDEO__
  38. #include "doomtype.h"
  39. #include "doomdef.h"
  40. // Needed because we are refering to patches.
  41. #include "r_data.h"
  42. //
  43. // VIDEO
  44. //
  45. #define CENTERY (SCREENHEIGHT/2)
  46. // symbolic indices into color translation table pointer array
  47. typedef enum
  48. {
  49. CR_BRICK, //0
  50. CR_TAN, //1
  51. CR_GRAY, //2
  52. CR_GREEN, //3
  53. CR_BROWN, //4
  54. CR_GOLD, //5
  55. CR_RED, //6
  56. CR_BLUE, //7
  57. CR_ORANGE, //8
  58. CR_YELLOW, //9
  59. CR_BLUE2, //10 // proff
  60. CR_LIMIT //11 //jff 2/27/98 added for range check
  61. } crange_idx_e;
  62. //jff 1/16/98 end palette color range additions
  63. #define CR_DEFAULT CR_RED /* default value for out of range colors */
  64. typedef struct
  65. {
  66. unsigned short *data;// pointer to the screen content
  67. short width; // the width of the surface
  68. short height; // the height of the surface, used when mallocing
  69. } screeninfo_t;
  70. #define NUM_SCREENS 1
  71. // V_FillRect
  72. void V_FillRect(int x, int y, int width, int height, byte colour);
  73. // CPhipps - patch drawing
  74. // Consolidated into the 3 really useful functions:
  75. // V_DrawNumPatch - Draws the patch from lump num
  76. void V_DrawNumPatch(int x, int y, int scrn,
  77. int lump, int cm,
  78. enum patch_translation_e flags);
  79. void V_DrawPatch(int x, int y, int scrn, const patch_t* patch);
  80. void V_DrawPatchNoScale(int x, int y, const patch_t* patch);
  81. // V_DrawNamePatch - Draws the patch from lump "name"
  82. #define V_DrawNamePatch(x,y,s,n,t,f) V_DrawNumPatch(x,y,s,W_GetNumForName(n),t,f)
  83. /* cph -
  84. * Functions to return width & height of a patch.
  85. * Doesn't really belong here, but is often used in conjunction with
  86. * this code.
  87. */
  88. #define V_NamePatchWidth(name) R_NumPatchWidth(W_GetNumForName(name))
  89. #define V_NamePatchHeight(name) R_NumPatchHeight(W_GetNumForName(name))
  90. /* cphipps 10/99: function to tile a flat over the screen */
  91. void V_DrawBackground(const char* flatname);
  92. // CPhipps - function to set the palette to palette number pal.
  93. void V_SetPalette(int pal);
  94. // Kippykip - Multiple colour corrected palettes
  95. void V_SetPalLump(int pal);
  96. // CPhipps - function to plot a pixel
  97. typedef struct
  98. {
  99. int x, y;
  100. } fpoint_t;
  101. typedef struct
  102. {
  103. fpoint_t a, b;
  104. } fline_t;
  105. // V_DrawLine
  106. void V_DrawLine(fline_t* fl, int color);
  107. #endif