/[rdesktop]/sourceforge.net/trunk/rdesktop/cache.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/cache.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 16 by matty, Thu Sep 28 07:04:14 2000 UTC revision 25 by matty, Sat Jan 6 03:47:04 2001 UTC
# Line 27  Line 27 
27  static HBITMAP bmpcache[3][600];  static HBITMAP bmpcache[3][600];
28    
29  /* Retrieve a bitmap from the cache */  /* Retrieve a bitmap from the cache */
30  HBITMAP cache_get_bitmap(uint8 cache_id, uint16 cache_idx)  HBITMAP
31    cache_get_bitmap(uint8 cache_id, uint16 cache_idx)
32  {  {
33          HBITMAP bitmap;          HBITMAP bitmap;
34    
35          if ((cache_id < NUM_ELEMENTS(bmpcache))          if ((cache_id < NUM_ELEMENTS(bmpcache))
36                          && (cache_idx < NUM_ELEMENTS(bmpcache[0])))              && (cache_idx < NUM_ELEMENTS(bmpcache[0])))
37          {          {
38                  bitmap = bmpcache[cache_id][cache_idx];                  bitmap = bmpcache[cache_id][cache_idx];
39                  if (bitmap != NULL)                  if (bitmap != NULL)
# Line 44  HBITMAP cache_get_bitmap(uint8 cache_id, Line 45  HBITMAP cache_get_bitmap(uint8 cache_id,
45  }  }
46    
47  /* Store a bitmap in the cache */  /* Store a bitmap in the cache */
48  void cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap)  void
49    cache_put_bitmap(uint8 cache_id, uint16 cache_idx, HBITMAP bitmap)
50  {  {
51          HBITMAP old;          HBITMAP old;
52    
53          if ((cache_id < NUM_ELEMENTS(bmpcache))          if ((cache_id < NUM_ELEMENTS(bmpcache))
54                          && (cache_idx < NUM_ELEMENTS(bmpcache[0])))              && (cache_idx < NUM_ELEMENTS(bmpcache[0])))
55          {          {
56                  old = bmpcache[cache_id][cache_idx];                  old = bmpcache[cache_id][cache_idx];
57                  if (old != NULL)                  if (old != NULL)
# Line 68  void cache_put_bitmap(uint8 cache_id, ui Line 70  void cache_put_bitmap(uint8 cache_id, ui
70  static FONTGLYPH fontcache[12][256];  static FONTGLYPH fontcache[12][256];
71    
72  /* Retrieve a glyph from the font cache */  /* Retrieve a glyph from the font cache */
73  FONTGLYPH *cache_get_font(uint8 font, uint16 character)  FONTGLYPH *
74    cache_get_font(uint8 font, uint16 character)
75  {  {
76          FONTGLYPH *glyph;          FONTGLYPH *glyph;
77    
78          if ((font < NUM_ELEMENTS(fontcache))          if ((font < NUM_ELEMENTS(fontcache))
79                          && (character < NUM_ELEMENTS(fontcache[0])))              && (character < NUM_ELEMENTS(fontcache[0])))
80          {          {
81                  glyph = &fontcache[font][character];                  glyph = &fontcache[font][character];
82                  if (glyph->pixmap != NULL)                  if (glyph->pixmap != NULL)
# Line 85  FONTGLYPH *cache_get_font(uint8 font, ui Line 88  FONTGLYPH *cache_get_font(uint8 font, ui
88  }  }
89    
90  /* Store a glyph in the font cache */  /* Store a glyph in the font cache */
91  void cache_put_font(uint8 font, uint32 character, uint16 baseline,  void
92                      uint16 width, uint16 height, HGLYPH pixmap)  cache_put_font(uint8 font, uint16 character, uint16 offset,
93                   uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap)
94  {  {
95          FONTGLYPH *glyph;          FONTGLYPH *glyph;
96    
97          if ((font < NUM_ELEMENTS(fontcache))          if ((font < NUM_ELEMENTS(fontcache))
98                          && (character < NUM_ELEMENTS(fontcache[0])))              && (character < NUM_ELEMENTS(fontcache[0])))
99          {          {
100                  glyph = &fontcache[font][character];                  glyph = &fontcache[font][character];
101                  if (glyph->pixmap != NULL)                  if (glyph->pixmap != NULL)
102                          ui_destroy_glyph(glyph->pixmap);                          ui_destroy_glyph(glyph->pixmap);
103    
104                    glyph->offset = offset;
105                  glyph->baseline = baseline;                  glyph->baseline = baseline;
106                  glyph->width = width;                  glyph->width = width;
107                  glyph->height = height;                  glyph->height = height;
# Line 113  void cache_put_font(uint8 font, uint32 c Line 118  void cache_put_font(uint8 font, uint32 c
118  static DATABLOB textcache[256];  static DATABLOB textcache[256];
119    
120  /* Retrieve a text item from the cache */  /* Retrieve a text item from the cache */
121  DATABLOB *cache_get_text(uint8 cache_id)  DATABLOB *
122    cache_get_text(uint8 cache_id)
123  {  {
124          DATABLOB *text;          DATABLOB *text;
125    
# Line 129  DATABLOB *cache_get_text(uint8 cache_id) Line 135  DATABLOB *cache_get_text(uint8 cache_id)
135  }  }
136    
137  /* Store a text item in the cache */  /* Store a text item in the cache */
138  void cache_put_text(uint8 cache_id, void *data, int length)  void
139    cache_put_text(uint8 cache_id, void *data, int length)
140  {  {
141          DATABLOB *text;          DATABLOB *text;
142    
# Line 154  void cache_put_text(uint8 cache_id, void Line 161  void cache_put_text(uint8 cache_id, void
161  static uint8 deskcache[0x38400];  static uint8 deskcache[0x38400];
162    
163  /* Retrieve desktop data from the cache */  /* Retrieve desktop data from the cache */
164  uint8 *cache_get_desktop(uint32 offset, int cx, int cy)  uint8 *
165    cache_get_desktop(uint32 offset, int cx, int cy)
166  {  {
167          int length = cx * cy;          int length = cx * cy;
168    
# Line 168  uint8 *cache_get_desktop(uint32 offset, Line 176  uint8 *cache_get_desktop(uint32 offset,
176  }  }
177    
178  /* Store desktop data in the cache */  /* Store desktop data in the cache */
179  void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, uint8 *data)  void
180    cache_put_desktop(uint32 offset, int cx, int cy, int scanline, uint8 *data)
181  {  {
182          int length = cx * cy;          int length = cx * cy;
183    
# Line 186  void cache_put_desktop(uint32 offset, in Line 195  void cache_put_desktop(uint32 offset, in
195                  ERROR("put desktop %d:%d\n", offset, length);                  ERROR("put desktop %d:%d\n", offset, length);
196          }          }
197  }  }
   

Legend:
Removed from v.16  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26