/[rdesktop]/sourceforge.net/trunk/rdesktop/pstcache.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/pstcache.c

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

revision 830 by jdmeijer, Tue Mar 8 00:23:02 2005 UTC revision 1222 by jsorg71, Sat Apr 8 04:19:11 2006 UTC
# Line 1  Line 1 
1  /*  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Persistent Bitmap Cache routines     Persistent Bitmap Cache routines
4     Copyright (C) Jeroen Meijer 2004-2005     Copyright (C) Jeroen Meijer 2004-2005
# Line 24  Line 24 
24    
25  #define IS_PERSISTENT(id) (id < 8 && g_pstcache_fd[id] > 0)  #define IS_PERSISTENT(id) (id < 8 && g_pstcache_fd[id] > 0)
26    
27  extern int g_server_bpp;  extern int g_server_depth;
28  extern BOOL g_bitmap_cache;  extern BOOL g_bitmap_cache;
29  extern BOOL g_bitmap_cache_persist_enable;  extern BOOL g_bitmap_cache_persist_enable;
30  extern BOOL g_bitmap_cache_precache;  extern BOOL g_bitmap_cache_precache;
# Line 81  pstcache_load_bitmap(uint8 cache_id, uin Line 81  pstcache_load_bitmap(uint8 cache_id, uin
81  /* Store a bitmap in the persistent cache */  /* Store a bitmap in the persistent cache */
82  BOOL  BOOL
83  pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * key,  pstcache_save_bitmap(uint8 cache_id, uint16 cache_idx, uint8 * key,
84                       uint16 width, uint16 height, uint16 length, uint8 * data)                       uint8 width, uint8 height, uint16 length, uint8 * data)
85  {  {
86          int fd;          int fd;
87          CELLHEADER cellhdr;          CELLHEADER cellhdr;
# Line 107  pstcache_save_bitmap(uint8 cache_id, uin Line 107  pstcache_save_bitmap(uint8 cache_id, uin
107  int  int
108  pstcache_enumerate(uint8 id, HASH_KEY * keylist)  pstcache_enumerate(uint8 id, HASH_KEY * keylist)
109  {  {
110          int fd, idx, n;          int fd, n;
111            uint16 idx;
112          sint16 mru_idx[0xa00];          sint16 mru_idx[0xa00];
113          uint32 mru_stamp[0xa00];          uint32 mru_stamp[0xa00];
114          CELLHEADER cellhdr;          CELLHEADER cellhdr;
# Line 131  pstcache_enumerate(uint8 id, HASH_KEY * Line 132  pstcache_enumerate(uint8 id, HASH_KEY *
132                  {                  {
133                          memcpy(keylist[idx], cellhdr.key, sizeof(HASH_KEY));                          memcpy(keylist[idx], cellhdr.key, sizeof(HASH_KEY));
134    
135                          /* Pre-cache (not possible for 8bpp because 8bpp needs a colourmap) */                          /* Pre-cache (not possible for 8 bit colour depth cause it needs a colourmap) */
136                          if (g_bitmap_cache_precache && cellhdr.stamp && g_server_bpp > 8)                          if (g_bitmap_cache_precache && cellhdr.stamp && g_server_depth > 8)
137                                  pstcache_load_bitmap(id, idx);                                  pstcache_load_bitmap(id, idx);
138    
139                          /* Sort by stamp */                          /* Sort by stamp */
# Line 179  pstcache_init(uint8 cache_id) Line 180  pstcache_init(uint8 cache_id)
180                  return False;                  return False;
181          }          }
182    
183          g_pstcache_Bpp = (g_server_bpp + 7) / 8;          g_pstcache_Bpp = (g_server_depth + 7) / 8;
184          sprintf(filename, "cache/pstcache_%d_%d", cache_id, g_pstcache_Bpp);          sprintf(filename, "cache/pstcache_%d_%d", cache_id, g_pstcache_Bpp);
185          DEBUG(("persistent bitmap cache file: %s\n", filename));          DEBUG(("persistent bitmap cache file: %s\n", filename));
186    

Legend:
Removed from v.830  
changed lines
  Added in v.1222

  ViewVC Help
Powered by ViewVC 1.1.26