Browse Source

add cache implementation with tests

Kolja Strohm 2 years ago
parent
commit
54045ff034

+ 222 - 0
Cache.h

@@ -0,0 +1,222 @@
+#pragma once
+
+#include "Zeit.h"
+#include "HashMap.h"
+
+namespace Framework
+{
+    enum class CacheCleanupStrategy
+    {
+        LONGEST_NOT_USED,
+        OLDEST,
+        RANDOM
+    };
+
+    template <typename T>
+    struct CacheEntry
+    {
+        __int64 created;
+        __int64 lastUsed;
+        T value;
+    };
+
+    template<typename K, typename T>
+    class CacheIterator
+    {
+    private:
+        MapIterator<K, CacheEntry<T>> delegate;
+
+    public:
+        CacheIterator( MapIterator<K, CacheEntry<T>> delegate )
+            : delegate( delegate )
+        {}
+
+        CacheIterator( const CacheIterator< K, T >& it )
+        {
+            delegate = it.delegate;
+        }
+
+        CacheIterator< K, T >& operator=( CacheIterator< K, T > r )
+        {
+            delegate = r.delegate;
+            return *this;
+        }
+
+        bool hasNext()
+        {
+            return delegate.hasNext();
+        }
+
+        MapEntry<K, T> operator*()
+        {
+            return MapEntry<K, T>( delegate.operator->().getKey(), delegate.operator->().getValue().value );
+        }
+
+        CacheIterator< K, T > next()
+        {
+            return CacheIterator( delegate.next() );
+        }
+
+        operator bool()
+        {
+            return delegate;
+        }
+
+        operator MapEntry<K, T>()
+        {
+            return MapEntry<K, T>( delegate->getKey(), delegate->getValue().value );
+        }
+
+        CacheIterator< K, T >& operator++() //! prefix
+        {
+            ++delegate;
+            return *this;
+        }
+
+        CacheIterator< K, T > operator++( int ) //! postfix
+        {
+            CacheIterator< K, T > temp( *this );
+            ++delegate;
+            return temp;
+        }
+
+        MapEntry< K, T > operator->()
+        {
+            return MapEntry<K, T>( delegate->getKey(), delegate->getValue().value );
+        }
+
+        void set( MapEntry<K, T> val )
+        {
+            time_t zeit = time( 0 );
+            delegate.set( MapEntry<K, CacheEntry<T>>( val.getKey(), CacheEntry<T>{ zeit, zeit, val.getValue() } ) );
+        }
+
+        bool operator!=( CacheIterator< K, T >& r )
+        {
+            return delegate != r.delegate;
+        }
+    };
+
+    template <typename K, typename T>
+    class Cache : public virtual ReferenceCounter
+    {
+    private:
+        HashMap<K, CacheEntry<T>>* cache;
+        CacheCleanupStrategy cleanup;
+        int maxSize;
+
+        void removeOneElement()
+        {
+            switch( cleanup )
+            {
+            case CacheCleanupStrategy::LONGEST_NOT_USED:
+            {
+                K key;
+                __int64 t = -1;
+                for( MapEntry<K, CacheEntry<T>> e : *cache )
+                {
+                    if( t < 0 || t > e.getValue().lastUsed )
+                    {
+                        t = e.getValue().lastUsed;
+                        key = e.getKey();
+                    }
+                }
+                if( t >= 0 )
+                    cache->remove( key );
+                break;
+            }
+            case CacheCleanupStrategy::OLDEST:
+            {
+                K key;
+                __int64 t = -1;
+                for( MapEntry<K, CacheEntry<T>> e : *cache )
+                {
+                    if( t < 0 || t > e.getValue().created )
+                    {
+                        t = e.getValue().created;
+                        key = e.getKey();
+                    }
+                }
+                if( t >= 0 )
+                    cache->remove( key );
+                break;
+            }
+            case CacheCleanupStrategy::RANDOM:
+            {
+                int size = cache->getSize();
+                int index = (int)(((double)rand() / RAND_MAX) * size);
+                auto it = cache->begin();
+                for( int i = 0; i < index; i++ )
+                    ++it;
+                cache->remove( it.operator->().getKey() );
+                break;
+            }
+            }
+        }
+
+    public:
+        Cache( int size, std::function<int( K )> hash, CacheCleanupStrategy cleanup )
+            : ReferenceCounter(),
+            cleanup( cleanup ),
+            maxSize( size )
+        {
+            cache = new HashMap<K, CacheEntry<T>>( size, hash );
+        }
+
+        ~Cache()
+        {
+            cache->release();
+        }
+
+        void put( K key, T value )
+        {
+            time_t zeit = time( 0 );
+            if( cache->getSize() >= maxSize && !cache->has( key ) )
+                removeOneElement();
+            cache->put( key, { zeit, zeit, value } );
+        }
+
+        void remove( K key )
+        {
+            cache->remove( key );
+        }
+
+        T get( K key ) const
+        {
+            CacheEntry<T> entry = cache->get( key );
+            entry.lastUsed = time( 0 );
+            cache->put( key, entry );
+            return entry.value;
+        }
+
+        bool has( K key ) const
+        {
+            return cache->has( key );
+        }
+
+        int getCurrentSize() const
+        {
+            return cache->getSize();
+        }
+
+        int getMaxSize() const
+        {
+            return maxSize;
+        }
+
+        void reset() const
+        {
+            cache->leeren();
+        }
+
+        CacheIterator<K, T> begin()
+        {
+            return CacheIterator<K, T>( cache->begin() );
+        }
+
+        CacheIterator<K, T> end()
+        {
+            return CacheIterator<K, T>( cache->end() );
+        }
+    };
+}

+ 16 - 16
DX12PixelShader.h

@@ -92,10 +92,10 @@ ret
 
 const BYTE DX12PixelShaderBytes[] =
 {
-     68,  88,  66,  67, 115, 119, 
-    121,  84,  95,  26,  41, 203, 
-     13,  92, 229, 111, 210, 180, 
-     95, 234,   1,   0,   0,   0, 
+     68,  88,  66,  67, 199,  72, 
+      1, 117, 228, 191, 237,  87, 
+    143, 180,  79,  17,  44,  16, 
+     11, 118,   1,   0,   0,   0, 
     184,  91,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      36,   2,   0,   0, 188,   2, 
@@ -763,11 +763,11 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1, 249,  73, 144,  97, 
-      1,   0,   0,   0, 181, 198, 
-     10, 130, 200,  19, 206,  79, 
-    178, 121,   0,  51,  99,  32, 
-    152, 250,   0,   0,   0,   0, 
+     49,   1, 138, 198, 168,  97, 
+      1,   0,   0,   0, 112, 251, 
+      1, 234, 122, 157, 213,  78, 
+    150, 147, 150, 190, 206, 139, 
+    238, 188,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1788,7 +1788,7 @@ const BYTE DX12PixelShaderBytes[] =
     117, 114, 101,  50,  68,  32, 
     115, 104,  97, 100,  27, 226, 
      48,   1, 128,   0,   0,   0, 
-    182,  84, 177,  20, 230, 216, 
+    163,  47,  26, 112, 126, 231, 
     215,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3408,11 +3408,11 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 249,  73, 
-    144,  97,   1,   0,   0,   0, 
-    181, 198,  10, 130, 200,  19, 
-    206,  79, 178, 121,   0,  51, 
-     99,  32, 152, 250, 128,   0, 
+    148,  46,  49,   1, 138, 198, 
+    168,  97,   1,   0,   0,   0, 
+    112, 251,   1, 234, 122, 157, 
+    213,  78, 150, 147, 150, 190, 
+    206, 139, 238, 188, 128,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 
@@ -3512,7 +3512,7 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,   2,   0,   9,   0, 
     220,   4,   0,   0,   0,   0, 
       0,   0, 156,   1,   0,   0, 
-      1,   0, 150, 105,   0,   0, 
+      1,   0,  73, 200,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 109,  97, 
     105, 110,   0, 110, 111, 110, 

+ 16 - 16
DX12VertexShader.h

@@ -129,10 +129,10 @@ ret
 
 const BYTE DX12VertexShaderBytes[] =
 {
-     68,  88,  66,  67, 133,  58, 
-    112, 155, 199, 221, 189, 249, 
-    228, 173, 107,  99,   7, 181, 
-    205, 105,   1,   0,   0,   0, 
+     68,  88,  66,  67, 104,  83, 
+    220, 213, 203, 189, 140, 156, 
+    207, 123, 133,  45, 133,  90, 
+    201, 131,   1,   0,   0,   0, 
     108,  78,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     124,   2,   0,   0,  16,   3, 
@@ -915,11 +915,11 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 249,  73, 
-    144,  97,   1,   0,   0,   0, 
-     85,  50, 155, 239,  34,  97, 
-    159,  79, 171, 137, 202,  46, 
-      4, 118, 255, 255,   0,   0, 
+    148,  46,  49,   1, 138, 198, 
+    168,  97,   1,   0,   0,   0, 
+    241, 108, 183, 211, 105, 209, 
+    219,  79, 142, 158,  30,  16, 
+     89,   7, 151,  59,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       1,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1684,8 +1684,8 @@ const BYTE DX12VertexShaderBytes[] =
     112, 111, 115, 105, 116, 105, 
     111, 110,  32, 111, 102,  32, 
      27, 226,  48,   1, 128,   0, 
-      0,   0, 145,  69, 222,  20, 
-    230, 216, 215,   1,   1,   0, 
+      0,   0, 158, 124,  82, 112, 
+    126, 231, 215,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3134,11 +3134,11 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1, 249,  73, 144,  97, 
-      1,   0,   0,   0,  85,  50, 
-    155, 239,  34,  97, 159,  79, 
-    171, 137, 202,  46,   4, 118, 
-    255, 255, 129,   0,   0,   0, 
+     49,   1, 138, 198, 168,  97, 
+      1,   0,   0,   0, 241, 108, 
+    183, 211, 105, 209, 219,  79, 
+    142, 158,  30,  16,  89,   7, 
+    151,  59, 129,   0,   0,   0, 
      47,  76, 105, 110, 107,  73, 
     110, 102, 111,   0,  47, 110, 
      97, 109, 101, 115,   0,  47, 

+ 1 - 0
Framework Linux.vcxproj

@@ -176,6 +176,7 @@
     <ClInclude Include="Betriebssystem.h" />
     <ClInclude Include="Bild.h" />
     <ClInclude Include="Bildschirm.h" />
+    <ClInclude Include="Cache.h" />
     <ClInclude Include="CharMap.h" />
     <ClInclude Include="Critical.h" />
     <ClInclude Include="Cube.h" />

+ 3 - 0
Framework Linux.vcxproj.filters

@@ -315,6 +315,9 @@
     <ClInclude Include="Maybe.h">
       <Filter>Headerdateien\Framework\Data</Filter>
     </ClInclude>
+    <ClInclude Include="Cache.h">
+      <Filter>Headerdateien\Framework\Data</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="Prozess.cpp">

+ 107 - 0
Framework Tests/Cache.cpp

@@ -0,0 +1,107 @@
+#include "pch.h"
+#include "CppUnitTest.h"
+#include <Cache.h>
+
+using namespace Microsoft::VisualStudio::CppUnitTestFramework;
+
+namespace FrameworkTests
+{
+    TEST_CLASS( CacheTests )
+    {
+    public:
+
+        TEST_METHOD( EmtptyTest )
+        {
+            Framework::Cache<int, int> cache( 100, []( int i ) {
+                return i;
+            }, Framework::CacheCleanupStrategy::RANDOM );
+            Assert::IsTrue( cache.getCurrentSize() == 0, L"getCurrentSize() on empty cache should be 0" );
+            Assert::IsTrue( cache.getMaxSize() == 100, L"getMaxSize() on empty cache" );
+        }
+
+        TEST_METHOD( PutTest )
+        {
+            Framework::Cache<int, int> cache( 2, []( int i ) {
+                return i;
+            }, Framework::CacheCleanupStrategy::RANDOM );
+            cache.put( 0, 100 );
+            cache.put( 1, 10 );
+            cache.put( 2, 1000 );
+            Assert::IsTrue( cache.getCurrentSize() == 2, L"unexpected count of elements in cache" );
+            Assert::IsTrue( cache.has( 0 ) ? cache.get( 0 ) == 100 : 1, L"invalid value at key 0 in cache after adding elements" );
+            Assert::IsTrue( cache.has( 1 ) ? cache.get( 1 ) == 10 : 1, L"invalid value at key 1 in cache after adding elements" );
+            Assert::IsTrue( cache.get( 2 ) == 1000, L"invalid value at key 2 in cache after adding elements" );
+            int count = 0;
+            for( Framework::MapEntry< int, int > i : cache )
+            {
+                if( i.getKey() == 0 )
+                    Assert::IsTrue( i.getValue() == 100, L"invalid value at key 0 in cache after adding elements" );
+                else if( i.getKey() == 1 )
+                    Assert::IsTrue( i.getValue() == 10, L"invalid value at key 1 in cache after adding elements" );
+                else if( i.getKey() == 2 )
+                    Assert::IsTrue( i.getValue() == 1000, L"invalid value at key 2 in cache after adding elements" );
+                else
+                    Assert::Fail( L"invalid key in cache after adding elements" );
+                count++;
+            }
+            Assert::IsTrue( count == 2, L"unexpected count of elements in cache" );
+        }
+
+        TEST_METHOD( OldestTest )
+        {
+            Framework::Cache<int, int> cache( 2, []( int i ) {
+                return i;
+            }, Framework::CacheCleanupStrategy::OLDEST );
+            cache.put( 0, 100 );
+            Sleep( 1000 );
+            cache.put( 1, 10 );
+            Sleep( 1000 );
+            cache.put( 2, 1000 );
+            Assert::IsTrue( cache.getCurrentSize() == 2, L"unexpected count of elements in cache" );
+            Assert::IsFalse( cache.has( 0 ), L"invalid value at key 0 in cache after adding elements" );
+            Assert::IsTrue( cache.has( 1 ) && cache.get( 1 ) == 10, L"invalid value at key 1 in cache after adding elements" );
+            Assert::IsTrue( cache.get( 2 ) == 1000, L"invalid value at key 2 in cache after adding elements" );
+            int count = 0;
+            for( Framework::MapEntry< int, int > i : cache )
+            {
+                if( i.getKey() == 1 )
+                    Assert::IsTrue( i.getValue() == 10, L"invalid value at key 1 in cache after adding elements" );
+                else if( i.getKey() == 2 )
+                    Assert::IsTrue( i.getValue() == 1000, L"invalid value at key 2 in cache after adding elements" );
+                else
+                    Assert::Fail( L"invalid key in cache after adding elements" );
+                count++;
+            }
+            Assert::IsTrue( count == 2, L"unexpected count of elements in cache" );
+        }
+
+        TEST_METHOD( LongestNotUsedTest )
+        {
+            Framework::Cache<int, int> cache( 2, []( int i ) {
+                return i;
+            }, Framework::CacheCleanupStrategy::LONGEST_NOT_USED );
+            cache.put( 0, 100 );
+            Sleep( 1000 );
+            cache.put( 1, 10 );
+            Sleep( 1000 );
+            cache.get( 0 );
+            cache.put( 2, 1000 );
+            Assert::IsTrue( cache.getCurrentSize() == 2, L"unexpected count of elements in cache" );
+            Assert::IsTrue( cache.has( 0 ) && cache.get( 0 ) == 100, L"invalid value at key 0 in cache after adding elements" );
+            Assert::IsFalse( cache.has( 1 ), L"invalid value at key 1 in cache after adding elements" );
+            Assert::IsTrue( cache.get( 2 ) == 1000, L"invalid value at key 2 in cache after adding elements" );
+            int count = 0;
+            for( Framework::MapEntry< int, int > i : cache )
+            {
+                if( i.getKey() == 0 )
+                    Assert::IsTrue( i.getValue() == 100, L"invalid value at key 0 in cache after adding elements" );
+                else if( i.getKey() == 2 )
+                    Assert::IsTrue( i.getValue() == 1000, L"invalid value at key 2 in cache after adding elements" );
+                else
+                    Assert::Fail( L"invalid key in cache after adding elements" );
+                count++;
+            }
+            Assert::IsTrue( count == 2, L"unexpected count of elements in cache" );
+        }
+    };
+}

+ 1 - 0
Framework Tests/Framework Tests.vcxproj

@@ -166,6 +166,7 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="Array.cpp" />
+    <ClCompile Include="Cache.cpp" />
     <ClCompile Include="pch.cpp">
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>

+ 3 - 0
Framework Tests/Framework Tests.vcxproj.filters

@@ -21,6 +21,9 @@
     <ClCompile Include="pch.cpp">
       <Filter>Quelldateien</Filter>
     </ClCompile>
+    <ClCompile Include="Cache.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="pch.h">

BIN
Framework Tests/Framwork.dll


+ 30 - 13
HashMap.h

@@ -47,6 +47,7 @@ namespace Framework
 
     public:
         MapIterator( Array< MapEntry<K, V> >** buckets, int bucketCount, int bucketIndex, Iterator< MapEntry<K, V> > iterator )
+            : iterator( iterator )
         {
             while( bucketIndex < bucketCount && (!buckets[ bucketIndex ] || buckets[ bucketIndex ]->getEintragAnzahl() == 0) )
             {
@@ -55,9 +56,7 @@ namespace Framework
             }
             if( bucketIndex < bucketCount )
             {
-                if( iterator )
-                    this->iterator = iterator;
-                else
+                if( !iterator )
                     this->iterator = buckets[ bucketIndex ]->begin();
             }
             else
@@ -73,8 +72,8 @@ namespace Framework
         }
 
         MapIterator( const MapIterator< K, V >& it )
+            : iterator( it.iterator )
         {
-            iterator = it.iterator;
             buckets = it.buckets;
             bucketCount = it.bucketCount;
             bucketIndex = it.bucketIndex;
@@ -99,11 +98,6 @@ namespace Framework
             return ind < bucketCount;
         }
 
-        MapEntry<K, V> operator*()
-        {
-            return iterator;
-        }
-
         MapIterator< K, V > next()
         {
             if( bucketIndex >= bucketCount )
@@ -143,6 +137,7 @@ namespace Framework
             ++iterator;
             if( !iterator )
             {
+                bucketIndex++;
                 while( bucketIndex < bucketCount && (!buckets[ bucketIndex ] || buckets[ bucketIndex ]->getEintragAnzahl() == 0) )
                     bucketIndex++;
                 if( bucketIndex < bucketCount )
@@ -160,12 +155,25 @@ namespace Framework
 
         MapIterator< K, V > operator++( int ) //! postfix
         {
-            Iterator< TYP > temp( *this );
+            MapIterator< K, V > temp( *this );
             ++(*this);
             return temp;
         }
 
-        MapIterator< K, V > operator->()
+        MapEntry< K, V > operator*()
+        {
+            if( bucketIndex >= bucketCount )
+            {
+                Text err = "Index out of Range Exception File: ";
+                err += __FILE__;
+                err += " Line: ";
+                err += __LINE__;
+                throw std::out_of_range( (char*)err );
+            }
+            return iterator.val();
+        }
+
+        MapEntry< K, V > operator->()
         {
             if( bucketIndex >= bucketCount )
             {
@@ -255,7 +263,7 @@ namespace Framework
             {
                 if( bucket.getKey() == key )
                 {
-                    bucket.remove( listIndex );
+                    buckets[ index ]->remove( listIndex );
                     size--;
                     return;
                 }
@@ -294,7 +302,7 @@ namespace Framework
             int index = abs( hash( key ) ) % bucketCount;
             if( !buckets[ index ] )
                 return 0;
-            for( auto bucket : buckets[ index ] )
+            for( auto bucket : *buckets[ index ] )
             {
                 if( bucket.getKey() == key )
                     return 1;
@@ -307,6 +315,15 @@ namespace Framework
             return size;
         }
 
+        void leeren()
+        {
+            for( int i = 0; i < bucketCount; i++ )
+            {
+                if( buckets[ i ] )
+                    buckets[ i ]->leeren();
+            }
+        }
+
         MapIterator<K, V> begin()
         {
             return MapIterator<K, V>( buckets, bucketCount, 0, Iterator< MapEntry<K, V> >( 0 ) );

+ 20 - 20
UIPixelShader.h

@@ -284,10 +284,10 @@ ret
 
 const BYTE UIPixelShader[] =
 {
-     68,  88,  66,  67, 165, 107, 
-    238,  85,  74, 187,  69,  48, 
-     69, 100, 218, 156, 123,  95, 
-     77, 134,   1,   0,   0,   0, 
+     68,  88,  66,  67,  40, 227, 
+    199,  33,   0,  60,  71,  26, 
+    143, 223,  23,  54,  70,  94, 
+     57, 207,   1,   0,   0,   0, 
     132, 113,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     124,   5,   0,   0,  12,   6, 
@@ -1544,10 +1544,10 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    249,  73, 144,  97,   1,   0, 
-      0,   0, 248, 161,  99,  78, 
-    212, 210, 254,  75, 149, 141, 
-    187, 139,  64, 185,  61,  25, 
+    138, 198, 168,  97,   1,   0, 
+      0,   0, 143,  75, 245, 205, 
+    161, 172,  86,  71, 132, 125, 
+    173, 209,  68,  86,  36,  96, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -1719,9 +1719,9 @@ const BYTE UIPixelShader[] =
     242,  56,   1,   0,  43, 236, 
       3,   0,  28,  19,   2,   0, 
      65,  36,   1,   0, 236, 179, 
-      1,   0, 186,  16,   1,   0, 
+      1,   0, 120, 255,   1,   0, 
     125,  10,   2,   0, 125, 181, 
-      2,   0, 176,  97,   1,   0, 
+      2,   0,  50,  45,   0,   0, 
     193,  33,   3,   0,  65, 185, 
       2,   0,   9, 241,   2,   0, 
     146, 230,   3,   0, 125, 218, 
@@ -2568,8 +2568,8 @@ const BYTE UIPixelShader[] =
      84, 101, 120, 116, 117, 114, 
     101,  50,  68,  32, 115, 104, 
      97, 100,  27, 226,  48,   1, 
-    128,   0,   0,   0, 232,  82, 
-    254,  20, 230, 216, 215,   1, 
+    128,   0,   0,   0,  23,  16, 
+    125, 112, 126, 231, 215,   1, 
       1,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -3641,13 +3641,13 @@ const BYTE UIPixelShader[] =
      23,   0,   1,   0,   5,  16, 
       0,   0,  14,   0,  23,  21, 
       0,  16,   0,   0,   3,   2, 
-    112,  43,   0,   0, 242, 241, 
+     80,   1,   0,   0, 242, 241, 
      10,   0,  24,  21,   8,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,   9,  16, 
       0,   0,   1,   0,   0,   2, 
      14,   0,  23,  21,   0,   0, 
-      0,   0,  10,   2, 112,  43, 
+      0,   0,  10,   2,  80,   1, 
       0,   0, 242, 241,  10,   0, 
      24,  21,  11,  16,   0,   0, 
       1,   0,   1,   0,  10,   0, 
@@ -4786,11 +4786,11 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-    148,  46,  49,   1, 249,  73, 
-    144,  97,   1,   0,   0,   0, 
-    248, 161,  99,  78, 212, 210, 
-    254,  75, 149, 141, 187, 139, 
-     64, 185,  61,  25, 128,   0, 
+    148,  46,  49,   1, 138, 198, 
+    168,  97,   1,   0,   0,   0, 
+    143,  75, 245, 205, 161, 172, 
+     86,  71, 132, 125, 173, 209, 
+     68,  86,  36,  96, 128,   0, 
       0,   0,  47,  76, 105, 110, 
     107,  73, 110, 102, 111,   0, 
      47, 110,  97, 109, 101, 115, 
@@ -4890,7 +4890,7 @@ const BYTE UIPixelShader[] =
       0,   0,   2,   0,   9,   0, 
     164,   7,   0,   0,   0,   0, 
       0,   0,  68,  11,   0,   0, 
-      1,   0, 121,  43,   0,   0, 
+      1,   0,  20,   1,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,  84, 101, 
     120, 116, 117, 114, 101,  80, 

+ 15 - 15
UIVertexShader.h

@@ -119,10 +119,10 @@ ret
 
 const BYTE UIVertexShader[] =
 {
-     68,  88,  66,  67, 126, 148, 
-     54,  73, 180,   9,   4,  58, 
-     22, 234,  85, 156,  82, 204, 
-    207, 157,   1,   0,   0,   0, 
+     68,  88,  66,  67, 219, 222, 
+    160, 130,  22, 126,  13, 243, 
+     72,  30,   0,  11, 113, 201, 
+     75, 146,   1,   0,   0,   0, 
     168,  77,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
      20,   2,   0,   0, 168,   2, 
@@ -873,10 +873,10 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    250,  73, 144,  97,   1,   0, 
-      0,   0, 168,  47, 197,  62, 
-    178, 188, 246,  75, 147, 255, 
-    247, 242, 250,  86, 159, 157, 
+    139, 198, 168,  97,   1,   0, 
+      0,   0,  55, 109, 171,  77, 
+    214, 133, 101,  66, 175, 124, 
+     66, 213,  22, 223, 191,  17, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -1556,8 +1556,8 @@ const BYTE UIVertexShader[] =
      32,  32,  32,  32,  32,  32, 
      32,  32,  32,  32,  32,  32, 
      27, 226,  48,   1, 128,   0, 
-      0,   0, 220,  39,  47,  21, 
-    230, 216, 215,   1,   1,   0, 
+      0,   0, 138, 214, 179, 112, 
+    126, 231, 215,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2921,10 +2921,10 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    250,  73, 144,  97,   1,   0, 
-      0,   0, 168,  47, 197,  62, 
-    178, 188, 246,  75, 147, 255, 
-    247, 242, 250,  86, 159, 157, 
+    139, 198, 168,  97,   1,   0, 
+      0,   0,  55, 109, 171,  77, 
+    214, 133, 101,  66, 175, 124, 
+     66, 213,  22, 223, 191,  17, 
     129,   0,   0,   0,  47,  76, 
     105, 110, 107,  73, 110, 102, 
     111,   0,  47, 110,  97, 109, 
@@ -3024,7 +3024,7 @@ const BYTE UIVertexShader[] =
       0,   0,   0,   0,   2,   0, 
       9,   0,  80,   5,   0,   0, 
       0,   0,   0,   0, 236,   2, 
-      0,   0,   1,   0, 233, 201, 
+      0,   0,   1,   0, 184,  76, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
      84, 101, 120, 116, 117, 114,