/[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 10 by matty, Tue Aug 15 10:23:24 2000 UTC revision 20 by matty, Mon Oct 16 07:37:52 2000 UTC
# Line 85  FONTGLYPH *cache_get_font(uint8 font, ui Line 85  FONTGLYPH *cache_get_font(uint8 font, ui
85  }  }
86    
87  /* Store a glyph in the font cache */  /* Store a glyph in the font cache */
88  void cache_put_font(uint8 font, uint32 character, uint16 baseline,  void cache_put_font(uint8 font, uint16 character, uint16 offset,
89                      uint16 width, uint16 height, HGLYPH pixmap)                  uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap)
90  {  {
91          FONTGLYPH *glyph;          FONTGLYPH *glyph;
92    
# Line 97  void cache_put_font(uint8 font, uint32 c Line 97  void cache_put_font(uint8 font, uint32 c
97                  if (glyph->pixmap != NULL)                  if (glyph->pixmap != NULL)
98                          ui_destroy_glyph(glyph->pixmap);                          ui_destroy_glyph(glyph->pixmap);
99    
100                    glyph->offset = offset;
101                  glyph->baseline = baseline;                  glyph->baseline = baseline;
102                  glyph->width = width;                  glyph->width = width;
103                  glyph->height = height;                  glyph->height = height;
# Line 154  void cache_put_text(uint8 cache_id, void Line 155  void cache_put_text(uint8 cache_id, void
155  static uint8 deskcache[0x38400];  static uint8 deskcache[0x38400];
156    
157  /* Retrieve desktop data from the cache */  /* Retrieve desktop data from the cache */
158  uint8 *cache_get_desktop(uint32 offset, uint32 length)  uint8 *cache_get_desktop(uint32 offset, int cx, int cy)
159  {  {
160            int length = cx * cy;
161    
162          if ((offset + length) <= sizeof(deskcache))          if ((offset + length) <= sizeof(deskcache))
163          {          {
164                  return &deskcache[offset];                  return &deskcache[offset];
# Line 166  uint8 *cache_get_desktop(uint32 offset, Line 169  uint8 *cache_get_desktop(uint32 offset,
169  }  }
170    
171  /* Store desktop data in the cache */  /* Store desktop data in the cache */
172  void cache_put_desktop(uint32 offset, uint32 length, uint8 *data)  void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, uint8 *data)
173  {  {
174            int length = cx * cy;
175    
176          if ((offset + length) <= sizeof(deskcache))          if ((offset + length) <= sizeof(deskcache))
177          {          {
178                  memcpy(&deskcache[offset], data, length);                  while (cy--)
179                    {
180                            memcpy(&deskcache[offset], data, cx);
181                            data += scanline;
182                            offset += cx;
183                    }
184          }          }
185          else          else
186          {          {

Legend:
Removed from v.10  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26