diff options
Diffstat (limited to 'src/FbTk/ImageControl.cc')
-rw-r--r-- | src/FbTk/ImageControl.cc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc index 1281b56..1fa2f65 100644 --- a/src/FbTk/ImageControl.cc +++ b/src/FbTk/ImageControl.cc | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "ImageControl.hh" | 25 | #include "ImageControl.hh" |
26 | 26 | ||
27 | #include "TextureRender.hh" | 27 | #include "TextureRender.hh" |
28 | #include "Texture.hh" | ||
28 | #include "App.hh" | 29 | #include "App.hh" |
29 | #include "SimpleCommand.hh" | 30 | #include "SimpleCommand.hh" |
30 | #include "I18n.hh" | 31 | #include "I18n.hh" |
@@ -67,15 +68,17 @@ using std::list; | |||
67 | 68 | ||
68 | namespace FbTk { | 69 | namespace FbTk { |
69 | 70 | ||
70 | // lookup table for texture | 71 | namespace { // anonymous |
71 | unsigned long *ImageControl::sqrt_table = 0; | 72 | |
73 | static unsigned long *sqrt_table = 0; /// lookup table | ||
74 | |||
72 | #ifdef TIMEDCACHE | 75 | #ifdef TIMEDCACHE |
73 | bool ImageControl::s_timed_cache = true; | 76 | bool s_timed_cache = true; |
74 | #else | 77 | #else |
75 | bool ImageControl::s_timed_cache = false; | 78 | bool s_timed_cache = false; |
76 | #endif // TIMEDCACHE | 79 | #endif // TIMEDCACHE |
77 | 80 | ||
78 | namespace { // anonymous | 81 | |
79 | 82 | ||
80 | inline unsigned long bsqrt(unsigned long x) { | 83 | inline unsigned long bsqrt(unsigned long x) { |
81 | if (x <= 0) return 0; | 84 | if (x <= 0) return 0; |
@@ -93,6 +96,14 @@ inline unsigned long bsqrt(unsigned long x) { | |||
93 | 96 | ||
94 | }; // end anonymous namespace | 97 | }; // end anonymous namespace |
95 | 98 | ||
99 | struct ImageControl::Cache { | ||
100 | Pixmap pixmap; | ||
101 | Pixmap texture_pixmap; | ||
102 | Orientation orient; | ||
103 | unsigned int count, width, height; | ||
104 | unsigned long pixel1, pixel2, texture; | ||
105 | }; | ||
106 | |||
96 | ImageControl::ImageControl(int screen_num, bool dither, | 107 | ImageControl::ImageControl(int screen_num, bool dither, |
97 | int cpc, unsigned long cache_timeout, unsigned long cmax): | 108 | int cpc, unsigned long cache_timeout, unsigned long cmax): |
98 | m_dither(dither), | 109 | m_dither(dither), |
@@ -148,7 +159,7 @@ ImageControl::~ImageControl() { | |||
148 | delete [] m_colors; | 159 | delete [] m_colors; |
149 | } | 160 | } |
150 | 161 | ||
151 | if (cache.size() > 0) { | 162 | if (!cache.empty()) { |
152 | CacheList::iterator it = cache.begin(); | 163 | CacheList::iterator it = cache.begin(); |
153 | CacheList::iterator it_end = cache.end(); | 164 | CacheList::iterator it_end = cache.end(); |
154 | for (; it != it_end; ++it) { | 165 | for (; it != it_end; ++it) { |