Browse Source

add default value tests for json validator and fixed some invalid behavior

Kolja Strohm 2 years ago
parent
commit
5a6d1eebd5
8 changed files with 442 additions and 276 deletions
  1. 22 22
      DX12PixelShader.h
  2. 18 18
      DX12VertexShader.h
  3. BIN
      Framework Tests/Framwork.dll
  4. 83 1
      Framework Tests/Json.cpp
  5. 82 49
      JSON.cpp
  6. 200 149
      JSON.h
  7. 22 22
      UIPixelShader.h
  8. 15 15
      UIVertexShader.h

+ 22 - 22
DX12PixelShader.h

@@ -92,10 +92,10 @@ ret
 
 const BYTE DX12PixelShaderBytes[] =
 {
-     68,  88,  66,  67,  45, 240, 
-     40, 192,  58,  36, 164, 115, 
-    240,  63,  98, 190, 172,  93, 
-     98, 164,   1,   0,   0,   0, 
+     68,  88,  66,  67, 121, 229, 
+     38, 112, 184,  41,  29, 168, 
+     34, 114, 117,  10,  50, 137, 
+    129, 135,   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, 229, 111,  72,  98, 
-      1,   0,   0,   0,  95, 185, 
-    137, 251,  87,   1,  66,  66, 
-    156,  18, 237, 181, 102, 228, 
-    237, 103,   0,   0,   0,   0, 
+     49,   1, 138, 150,  90,  98, 
+      1,   0,   0,   0, 106,  98, 
+     45, 233,  28,  44,  86,  76, 
+    172, 193,  60, 173, 116,  51, 
+    122,   3,   0,   0,   0,   0, 
       0,   0,   0,   0,   1,   0, 
       0,   0,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -938,10 +938,10 @@ const BYTE DX12PixelShaderBytes[] =
       3,   0, 242,  56,   1,   0, 
      43, 236,   3,   0,  28,  19, 
       2,   0,  65,  36,   1,   0, 
-    236, 179,   1,   0,  51, 246, 
-      1,   0, 125,  10,   2,   0, 
-    125, 181,   2,   0,  45,  24, 
-      0,   0, 193,  33,   3,   0, 
+    236, 179,   1,   0,  53, 134, 
+      0,   0, 125,  10,   2,   0, 
+    125, 181,   2,   0, 111, 167, 
+      1,   0, 193,  33,   3,   0, 
      65, 185,   2,   0, 140, 239, 
       1,   0, 246,  49,   0,   0, 
     213, 255,   0,   0,  46, 248, 
@@ -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, 
-    191, 183,  31, 219, 168,  70, 
+    141, 187, 178, 120, 122,  81, 
     216,   1,   1,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2348,14 +2348,14 @@ const BYTE DX12PixelShaderBytes[] =
       0,   0,  23,   0,   1,   0, 
       5,  16,   0,   0,  14,   0, 
      23,  21,   0,  16,   0,   0, 
-      3,   2,  64, 119,   0,   0, 
+      3,   2, 176,  37,   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, 
-     64, 119,   0,   0, 242, 241, 
+    176,  37,   0,   0, 242, 241, 
      10,   0,  24,  21,  11,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,  12,  16, 
@@ -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, 229, 111, 
-     72,  98,   1,   0,   0,   0, 
-     95, 185, 137, 251,  87,   1, 
-     66,  66, 156,  18, 237, 181, 
-    102, 228, 237, 103, 128,   0, 
+    148,  46,  49,   1, 138, 150, 
+     90,  98,   1,   0,   0,   0, 
+    106,  98,  45, 233,  28,  44, 
+     86,  76, 172, 193,  60, 173, 
+    116,  51, 122,   3, 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,  20,   0,   0,   0, 
+      1,   0, 174, 240,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 109,  97, 
     105, 110,   0, 110, 111, 110, 

+ 18 - 18
DX12VertexShader.h

@@ -129,10 +129,10 @@ ret
 
 const BYTE DX12VertexShaderBytes[] =
 {
-     68,  88,  66,  67, 234,  46, 
-     38, 164, 122,  45,  63, 125, 
-     89,  69, 239,  14, 233, 147, 
-     80,  31,   1,   0,   0,   0, 
+     68,  88,  66,  67, 165, 132, 
+     40, 107, 218, 138, 233, 158, 
+    206, 178, 184, 199, 159,  18, 
+    180, 103,   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, 229, 111, 
-     72,  98,   1,   0,   0,   0, 
-    235, 249,  93, 241,  19, 173, 
-    199,  64, 180,  38,   1, 253, 
-     72, 162,   5, 172,   0,   0, 
+    148,  46,  49,   1, 138, 150, 
+     90,  98,   1,   0,   0,   0, 
+    170, 236, 197, 191, 217, 113, 
+    156,  71, 173, 214, 104, 176, 
+    188,  26, 198, 203,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       1,   0,   0,   0,   1,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -1095,7 +1095,7 @@ const BYTE DX12VertexShaderBytes[] =
       0,   0, 103, 159,   1,   0, 
     179, 120,   1,   0, 238,  97, 
       2,   0,  90,  28,   0,   0, 
-     48, 242,   2,   0,  53, 174, 
+    236,  89,   1,   0,  53, 174, 
       3,   0, 206,  21,   0,   0, 
     193, 205,   3,   0, 207, 193, 
       1,   0,  62,   3,   3,   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, 213, 223,  85, 219, 
-    168,  70, 216,   1,   1,   0, 
+      0,   0, 127, 165, 233, 120, 
+    122,  81, 216,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -2200,7 +2200,7 @@ const BYTE DX12VertexShaderBytes[] =
      12,  16,   0,   0,   1,   0, 
       1,   0,  14,   0,  23,  21, 
      13,  16,   0,   0,  36,   2, 
-    128, 208,   0,   0, 242, 241, 
+    160, 103,   0,   0, 242, 241, 
      10,   0,  24,  21,  14,  16, 
       0,   0,   1,   0,   0,   2, 
      18,   0,  22,  21,  10,  16, 
@@ -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, 229, 111,  72,  98, 
-      1,   0,   0,   0, 235, 249, 
-     93, 241,  19, 173, 199,  64, 
-    180,  38,   1, 253,  72, 162, 
-      5, 172, 129,   0,   0,   0, 
+     49,   1, 138, 150,  90,  98, 
+      1,   0,   0,   0, 170, 236, 
+    197, 191, 217, 113, 156,  71, 
+    173, 214, 104, 176, 188,  26, 
+    198, 203, 129,   0,   0,   0, 
      47,  76, 105, 110, 107,  73, 
     110, 102, 111,   0,  47, 110, 
      97, 109, 101, 115,   0,  47, 

BIN
Framework Tests/Framwork.dll


+ 83 - 1
Framework Tests/Json.cpp

@@ -325,7 +325,89 @@ namespace FrameworkTests
 			Assert::IsTrue(!result->isValid(), L"Invalid Json was marked as valid");
 			Framework::JSON::JSONValue* validValue = result->getValidPart();
 			result->release();
-			Framework::JSON::JSONValue* expected = Framework::JSON::Parser::getValue("[{\"type\": \"shaped\",\"group\": \"inventory\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"},\"outputCount\": 1},{\"type\": \"shaped\",\"group\": \"inventory\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}},{\"x\": 0,\"y\": 1,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"},\"outputCount\": 1}]");
+			Assert::IsTrue(validValue == 0, L"getValidPart of invalid validation result without removeInvalidEntries or default values used in validation should return 0");
+			value->release();
+			validator->release();
+		}
+
+		TEST_METHOD(ComplexRemoveInvalidTest)
+		{
+			Framework::JSON::Validator::JSONValidator* validator = Framework::JSON::Validator::JSONValidator::buildForArray()->removeInvalidEntries()->typeSpecifiedByAttribute("type")->addAcceptedObjectInArray()->withRequiredString("type")->withExactMatch("shaped")->finishString()->withRequiredString("group")->finishString()->withRequiredNumber("width")->whichIsGreaterThen(0)->finishNumber()->withRequiredNumber("height")->whichIsGreaterThen(0)->finishNumber()->withRequiredArray("inputs")->addAcceptedObjectInArray()->withRequiredNumber("x")->whichIsGreaterOrEqual(0)->finishNumber()->withRequiredNumber("y")->whichIsGreaterOrEqual(0)->finishNumber()->withRequiredObject("filter")->withRequiredString("itemType")->finishString()->finishObject()->finishObject()->finishArray()->withRequiredObject("output")->withRequiredString("itemType")->finishString()->finishObject()->withRequiredNumber("outputCount")->whichIsGreaterThen(0)->finishNumber()->finishObject()->addAcceptedObjectInArray()->withRequiredString("type")->withExactMatch("unordered")->finishString()->withRequiredString("group")->finishString()->withRequiredArray("inputs")->addAcceptedObjectInArray()->withRequiredNumber("count")->whichIsGreaterThen(0)->finishNumber()->withRequiredObject("filter")->withRequiredString("itemType")->finishString()->finishObject()->finishObject()->finishArray()->withRequiredArray("output")->addAcceptedObjectInArray()->withRequiredObject("filter")->withRequiredString("itemType")->finishString()->finishObject()->withRequiredNumber("count")->whichIsGreaterThen(0)->finishNumber()->finishObject()->finishArray()->finishObject()->finishArray();
+			std::cout << validator->zConstraints()->toString().getText() << "\n";
+			Framework::JSON::JSONValue* value = Framework::JSON::Parser::getValue("[{\"type\": \"shaped\",\"group\": \"inventory\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}},{\"x\": 0,\"y\": -1,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"},\"outputCount\": 1},{\"type\": \"shaped\",\"group\": \"inventory\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}},{\"x\": 0,\"y\": 1,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"},\"outputCount\": 1}]");
+			std::cout << value->toString().getText() << "\n";
+			Framework::JSON::Validator::JSONValidationResult* result = validator->validate(value);
+			result->printInvalidInfo();
+			Assert::IsTrue(!result->isValid(), L"Invalid Json was marked as valid");
+			Framework::JSON::JSONValue* validValue = result->getValidPart();
+			result->release();
+			Framework::JSON::JSONValue* expected = Framework::JSON::Parser::getValue("[{\"type\": \"shaped\",\"group\": \"inventory\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}},{\"x\": 0,\"y\": 1,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"},\"outputCount\": 1}]");
+			Assert::IsTrue(JSONParserTests::isEqual(validValue, expected), L"getValidPart of invalid validation result does not match the expected valid part");
+			result = validator->validate(validValue);
+			Assert::IsTrue(result->isValid(), L"Re validation of a value returned by getValidPart on a validation result should never return an invalid validation result");
+			value->release();
+			value = result->getValidPart();
+			Assert::IsTrue(JSONParserTests::isEqual(validValue, value), L"getValidPart of a valid validation result should return the validated value");
+			value->release();
+			validValue->release();
+			expected->release();
+			validator->release();
+		}
+
+		TEST_METHOD(DefaultValuesTest)
+		{
+			Framework::JSON::Validator::JSONValidator* validator = Framework::JSON::Validator::JSONValidator::buildForArray()
+				->typeSpecifiedByAttribute("type")
+				->removeInvalidEntries()
+				->addAcceptedTypeInArray(
+					Framework::JSON::Validator::JSONValidator::buildForObject()
+					->withRequiredString("type")->withExactMatch("shaped")->finishString()
+					->withRequiredString("group")->withDefault("test")->finishString()
+					->withRequiredNumber("width")->whichIsGreaterThen(0)->finishNumber()
+					->withRequiredNumber("height")->whichIsGreaterThen(0)->finishNumber()
+					->withRequiredAttribute("inputs",
+						Framework::JSON::Validator::JSONValidator::buildForArray()
+						->withDefault(new Framework::JSON::JSONArray())
+						->addAcceptedTypeInArray(Framework::JSON::Validator::JSONValidator::buildForObject()
+							->withRequiredNumber("x")->whichIsGreaterOrEqual(0)->finishNumber()
+							->withRequiredNumber("y")->whichIsGreaterOrEqual(0)->finishNumber()
+							->withRequiredObject("filter")->withRequiredString("itemType")->finishString()->finishObject()
+							->finishObject())
+						->finishArray())
+					->withRequiredObject("output")->withRequiredString("itemType")->finishString()->finishObject()
+					->withRequiredNumber("outputCount")->withDefault(1)->whichIsGreaterThen(0)->finishNumber()
+					->finishObject())
+				->addAcceptedTypeInArray(
+					Framework::JSON::Validator::JSONValidator::buildForObject()
+					->withRequiredString("type")->withExactMatch("unordered")->finishString()
+					->withRequiredString("group")->finishString()
+					->withRequiredAttribute("inputs",
+						Framework::JSON::Validator::JSONValidator::buildForArray()
+						->withDefault(new Framework::JSON::JSONArray())
+						->addAcceptedTypeInArray(
+							Framework::JSON::Validator::JSONValidator::buildForObject()
+							->withRequiredNumber("count")->withDefault(1)->whichIsGreaterThen(0)->finishNumber()
+							->withRequiredObject("filter")->withRequiredString("itemType")->finishString()->finishObject()
+							->finishObject())
+						->finishArray())
+					->withRequiredAttribute("output",
+						Framework::JSON::Validator::JSONValidator::buildForArray()
+						->addAcceptedTypeInArray(Framework::JSON::Validator::JSONValidator::buildForObject()
+							->withRequiredObject("filter")->withRequiredString("itemType")->finishString()->finishObject()
+							->withRequiredNumber("count")->withDefault(1)->whichIsGreaterThen(0)->finishNumber()
+							->finishObject())
+						->finishArray())
+					->finishObject())
+				->finishArray();
+			std::cout << validator->zConstraints()->toString().getText() << "\n";
+			Framework::JSON::JSONValue* value = Framework::JSON::Parser::getValue("[{\"type\": \"shaped\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}},{\"x\": 0,\"y\": 1,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"}},{\"type\": \"shaped\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}},{\"x\": 0,\"y\": -1,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"}},{\"type\": \"unordered\",\"group\": \"bla\", \"inputs\": [{\"filter\": {\"itemType\": \"Cobble\"}},{\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": [{\"filter\": {\"itemType\": \"StoneTool\"}}]}]");
+			std::cout << value->toString().getText() << "\n";
+			Framework::JSON::Validator::JSONValidationResult* result = validator->validate(value);
+			result->printInvalidInfo();
+			Assert::IsTrue(!result->isValid(), L"Invalid Json was marked as valid");
+			Framework::JSON::JSONValue* validValue = result->getValidPart();
+			result->release();
+			Framework::JSON::JSONValue* expected = Framework::JSON::Parser::getValue("[{\"type\": \"shaped\", \"group\": \"test\",\"width\": 1,\"height\": 2,\"inputs\": [{\"x\": 0,\"y\": 0,\"filter\": {\"itemType\": \"Cobble\"}},{\"x\": 0,\"y\": 1,\"filter\": {\"itemType\": \"Cobble\"}}],\"output\": {\"itemType\": \"StoneTool\"}, \"outputCount\": 1},{\"type\": \"unordered\",\"group\": \"bla\", \"inputs\": [{\"count\": 1, \"filter\": {\"itemType\": \"Cobble\"}},{\"count\": 1, \"filter\": {\"itemType\": \"Cobble\"}}],\"output\": [{\"count\": 1, \"filter\": {\"itemType\": \"StoneTool\"}}]}]");
 			Assert::IsTrue(JSONParserTests::isEqual(validValue, expected), L"getValidPart of invalid validation result does not match the expected valid part");
 			result = validator->validate(validValue);
 			Assert::IsTrue(result->isValid(), L"Re validation of a value returned by getValidPart on a validation result should never return an invalid validation result");

+ 82 - 49
JSON.cpp

@@ -4,6 +4,8 @@
 using namespace Framework;
 using namespace JSON;
 
+#pragma region JSONValue
+
 JSONValue::JSONValue()
 	: ReferenceCounter()
 {
@@ -59,6 +61,9 @@ JSONObject* JSONValue::asObject() const
 	return (JSONObject*)this;
 }
 
+#pragma endregion Content
+
+#pragma region JSONBool
 
 JSONBool::JSONBool(bool b)
 	: JSONValue(JSONType::BOOLEAN)
@@ -84,6 +89,9 @@ JSONValue* JSONBool::clone() const
 	return new JSONBool(b);
 }
 
+#pragma endregion Content
+
+#pragma region JSONNumber
 
 JSONNumber::JSONNumber(double num)
 	: JSONValue(JSONType::NUMBER)
@@ -106,6 +114,9 @@ JSONValue* JSONNumber::clone() const
 	return new JSONNumber(number);
 }
 
+#pragma endregion Content
+
+#pragma region JSONString
 
 JSONString::JSONString(Text string)
 	: JSONValue(JSONType::STRING)
@@ -131,6 +142,9 @@ JSONValue* JSONString::clone() const
 	return new JSONString(string);
 }
 
+#pragma endregion Content
+
+#pragma region JSONArray
 
 JSONArray::JSONArray()
 	: JSONValue(JSONType::ARRAY)
@@ -239,6 +253,9 @@ JSONValue* JSONArray::clone() const
 	return new JSONArray(toString());
 }
 
+#pragma endregion Content
+
+#pragma region JSONObject
 
 JSONObject::JSONObject()
 	: JSONValue(JSONType::OBJECT)
@@ -399,6 +416,8 @@ JSONValue* JSONObject::clone() const
 	return new JSONObject(toString());
 }
 
+#pragma endregion Content
+
 JSONValue* JSON::loadJSONFromFile(Text path)
 {
 	Datei d;
@@ -414,6 +433,8 @@ JSONValue* JSON::loadJSONFromFile(Text path)
 	return result;
 }
 
+#pragma region Parser
+
 int Parser::findObjectEndInArray(const char* str)
 {
 	return findValueEndInObject(str);
@@ -633,9 +654,11 @@ int Parser::findValueEndInObject(const char* str)
 	return i;
 }
 
+#pragma endregion Content
 
 using namespace Validator;
 
+#pragma region JSONValidationResult
 
 JSONValidationResult::JSONValidationResult()
 	: ReferenceCounter()
@@ -643,6 +666,7 @@ JSONValidationResult::JSONValidationResult()
 
 JSONValidationResult::~JSONValidationResult() {}
 
+#pragma region JSONTypeMissmatch
 
 JSONTypeMissmatch::JSONTypeMissmatch(Text path, JSONValue* foundValue, XML::Element* expected, JSONValidationResult* reason)
 	: JSONValidationResult()
@@ -686,6 +710,11 @@ JSONValue* JSONTypeMissmatch::getValidPart() const
 		Text* p = reason->getPath().getTeilText(path.getLength());
 		if (foundValue->getType() == JSONType::ARRAY)
 		{
+			if (!valid && (!expected->hasAttribute("removeInvalidEntries") || !expected->getAttributeValue("removeInvalidEntries").istGleich("true")))
+			{
+				p->release();
+				return 0;
+			}
 			if (p->hatAt(0, "[") && p->hatAt(p->getLength() - 1, "]"))
 			{
 				Text* it = p->getTeilText(1, p->getLength() - 1);
@@ -720,59 +749,43 @@ JSONValue* JSONTypeMissmatch::getValidPart() const
 		}
 		else if (foundValue->getType() == JSONType::OBJECT)
 		{
+			if (!valid && (!expected->hasAttribute("removeInvalidEntries") || !expected->getAttributeValue("removeInvalidEntries").istGleich("true")))
+			{
+				p->release();
+				return 0;
+			}
 			if (p->hatAt(0, "."))
 			{
 				Text* at = p->getTeilText(1);
 				Text attr = *at;
 				at->release();
-				if (foundValue->asObject()->hasValue(attr))
+				JSONValue* tmp = foundValue->clone();
+				tmp->asObject()->removeValue(attr);
+				if (valid)
+					tmp->asObject()->addValue(attr, valid);
+				JSONValidationResult* res = JSONValidator(dynamic_cast<XML::Element*>(expected->getThis())).validate(tmp);
+				if (res->isValid())
 				{
-					JSONValue* tmp = foundValue->clone();
-					tmp->asObject()->removeValue(attr);
-					if (valid)
-						tmp->asObject()->addValue(attr, valid);
-					JSONValidationResult* res = JSONValidator(dynamic_cast<XML::Element*>(expected->getThis())).validate(tmp);
-					if (res->isValid())
-					{
-						res->release();
-						p->release();
-						return tmp;
-					}
-					else if (res->isDifferent(this, path) || !valid)
-					{
-						p->release();
-						tmp->release();
-						JSONValue* result = res->getValidPart();
-						res->release();
-						return result;
-					}
+					res->release();
+					p->release();
+					return tmp;
+				}
+				else if (res->isDifferent(this, path) || !valid)
+				{
+					p->release();
 					tmp->release();
+					JSONValue* result = res->getValidPart();
 					res->release();
+					return result;
 				}
+				tmp->release();
+				res->release();
 			}
 		}
 		p->release();
 		if (valid)
 			valid->release();
 	}
-	if (expected->hasAttribute("default"))
-	{
-		JSONValue* def = Parser::getValue(expected->getAttributeValue("default"));
-		JSONValidationResult* res = JSONValidator(dynamic_cast<XML::Element*>(expected->getThis())).validate(def);
-		if (res->isValid())
-		{
-			res->release();
-			return def;
-		}
-		else if (res->isDifferent(this, path))
-		{
-			def->release();
-			JSONValue* result = res->getValidPart();
-			res->release();
-			return result;
-		}
-		def->release();
-	}
 	return 0;
 }
 
@@ -791,6 +804,9 @@ bool JSONTypeMissmatch::isDifferent(const JSONValidationResult* zResult, Text ad
 	return reason->isDifferent(casted->reason, path);
 }
 
+#pragma endregion Content
+
+#pragma region JSONUnknownValue
 
 JSONUnknownValue::JSONUnknownValue(Text path, JSONValue* foundValue)
 	: JSONValidationResult()
@@ -813,7 +829,7 @@ void JSONUnknownValue::printInvalidInfo(int indent) const
 {
 	Text ind = "";
 	ind.fillText(' ', indent);
-	std::cout << ind.getText() << "Unknown Value at '" << path.getText() << "'. Value found:\n" << foundValue->toString().getText() << "\n";
+	std::cout << ind.getText() << "Unknown Value at '" << path.getText() << "'. Value found:\n" << ind.getText() << foundValue->toString().getText() << "\n";
 }
 
 JSONValue* JSONUnknownValue::getValidPart() const
@@ -836,6 +852,9 @@ bool JSONUnknownValue::isDifferent(const JSONValidationResult* zResult, Text add
 	return 0;
 }
 
+#pragma endregion Content
+
+#pragma region JSONMissingValue
 
 JSONMissingValue::JSONMissingValue(Text path, XML::Element* expected)
 	: JSONValidationResult()
@@ -858,7 +877,7 @@ void JSONMissingValue::printInvalidInfo(int indent) const
 {
 	Text ind = "";
 	ind.fillText(' ', indent);
-	std::cout << ind.getText() << "Missing Value at '" << path.getText() << "'. Expected type:\n" << expected->toString().getText() << "\n";
+	std::cout << ind.getText() << "Missing Value at '" << path.getText() << "'. Expected type:\n" << ind.getText() << expected->toString().getText() << "\n";
 }
 
 JSONValue* JSONMissingValue::getValidPart() const
@@ -899,6 +918,9 @@ bool JSONMissingValue::isDifferent(const JSONValidationResult* zResult, Text add
 	return 0;
 }
 
+#pragma endregion Content
+
+#pragma region JSONMissingOneOf
 
 JSONMissingOneOf::JSONMissingOneOf(Text path, XML::Editor expected)
 	: JSONValidationResult()
@@ -949,6 +971,9 @@ bool JSONMissingOneOf::isDifferent(const JSONValidationResult* zResult, Text add
 	return 0;
 }
 
+#pragma endregion Content
+
+#pragma region JSONNoTypeMatching
 
 JSONNoTypeMatching::JSONNoTypeMatching(Text path, JSONValue* foundValue, RCArray<XML::Element>& expected, RCArray<JSONValidationResult>& reasons)
 	: JSONValidationResult()
@@ -1013,6 +1038,9 @@ bool JSONNoTypeMatching::isDifferent(const JSONValidationResult* zResult, Text a
 	return 0;
 }
 
+#pragma endregion Content
+
+#pragma region JSONValidValue
 
 JSONValidValue::JSONValidValue(Text path, JSONValue* value)
 	: JSONValidationResult()
@@ -1054,6 +1082,11 @@ bool JSONValidValue::isDifferent(const JSONValidationResult* zResult, Text addit
 	return 0;
 }
 
+#pragma endregion Content
+
+#pragma endregion Content
+
+#pragma region JSONValidator
 
 JSONValidator::JSONValidator(XML::Element* constraints)
 	: ReferenceCounter(),
@@ -1163,15 +1196,15 @@ JSONValidationResult* JSONValidator::validate(JSONValue* zValue, XML::Element* z
 			{
 				return new JSONTypeMissmatch(path, dynamic_cast<JSONValue*>(zValue->getThis()), dynamic_cast<XML::Element*>(zConstraints->getThis()), 0);
 			}
-			else if (zConstraints->hasAttribute("contains") && zValue->asString()->getString().hat(zConstraints->getAttributeValue("contains")))
+			else if (zConstraints->hasAttribute("contains") && zValue->asString()->getString().hat(zConstraints->getAttributeValue("contains").getText()))
 			{
 				return new JSONTypeMissmatch(path, dynamic_cast<JSONValue*>(zValue->getThis()), dynamic_cast<XML::Element*>(zConstraints->getThis()), 0);
 			}
-			else if (zConstraints->hasAttribute("startsWith") && zValue->asString()->getString().positionVon(zConstraints->getAttributeValue("startsWith")) == 0)
+			else if (zConstraints->hasAttribute("startsWith") && zValue->asString()->getString().positionVon(zConstraints->getAttributeValue("startsWith").getText()) == 0)
 			{
 				return new JSONTypeMissmatch(path, dynamic_cast<JSONValue*>(zValue->getThis()), dynamic_cast<XML::Element*>(zConstraints->getThis()), 0);
 			}
-			else if (zConstraints->hasAttribute("endsWith") && zValue->asString()->getString().positionVon(zConstraints->getAttributeValue("endsWith")) == zValue->asString()->getString().getLength() - zConstraints->getAttributeValue("endsWith").getLength())
+			else if (zConstraints->hasAttribute("endsWith") && zValue->asString()->getString().positionVon(zConstraints->getAttributeValue("endsWith").getText()) == zValue->asString()->getString().getLength() - zConstraints->getAttributeValue("endsWith").getLength())
 			{
 				return new JSONTypeMissmatch(path, dynamic_cast<JSONValue*>(zValue->getThis()), dynamic_cast<XML::Element*>(zConstraints->getThis()), 0);
 			}
@@ -1184,7 +1217,6 @@ JSONValidationResult* JSONValidator::validate(JSONValue* zValue, XML::Element* z
 		}
 		else
 		{
-			bool valid = 1;
 			int index = 0;
 			for (JSON::JSONValue* value : *zValue->asArray())
 			{
@@ -1209,7 +1241,6 @@ JSONValidationResult* JSONValidator::validate(JSONValue* zValue, XML::Element* z
 		}
 		else
 		{
-			bool valid = 1;
 			JSON::JSONObject* obj = zValue->asObject();
 			for (auto i = obj->getFields(); i; i++)
 			{
@@ -1218,7 +1249,7 @@ JSONValidationResult* JSONValidator::validate(JSONValue* zValue, XML::Element* z
 				p += i.val();
 				if (!zConstraints->selectChildsByAttribute("name", i.val()).exists())
 				{
-					return new JSONUnknownValue(p, zValue->asObject()->getValue(i.val()));
+					return new JSONTypeMissmatch(path, dynamic_cast<JSONValue*>(zValue->getThis()), dynamic_cast<XML::Element*>(zConstraints->getThis()), new JSONUnknownValue(p, zValue->asObject()->getValue(i.val())));
 				}
 				else
 				{
@@ -1239,8 +1270,8 @@ JSONValidationResult* JSONValidator::validate(JSONValue* zValue, XML::Element* z
 					p += ".";
 					p += constraint->getAttributeValue("name");
 					if (constraint->getChildCount() != 1)
-						return new JSONMissingOneOf(p, constraint->selectChildren());
-					return new JSONMissingValue(path, dynamic_cast<XML::Element*>(constraint->selectChildren().begin().val()->getThis()));
+						return new JSONTypeMissmatch(path, dynamic_cast<JSONValue*>(zValue->getThis()), dynamic_cast<XML::Element*>(zConstraints->getThis()), new JSONMissingOneOf(p, constraint->selectChildren()));
+					return new JSONTypeMissmatch(path, dynamic_cast<JSONValue*>(zValue->getThis()), dynamic_cast<XML::Element*>(zConstraints->getThis()), new JSONMissingValue(p, dynamic_cast<XML::Element*>(constraint->selectChildren().begin().val()->getThis())));
 				}
 			}
 		}
@@ -1342,4 +1373,6 @@ ArrayValidationBuilder<JSONValidator>* JSONValidator::buildForArray()
 		{
 			return new JSONValidator(e.dublicate());
 		});
-}
+}
+
+#pragma endregion Content

+ 200 - 149
JSON.h

@@ -235,6 +235,166 @@ namespace Framework
 
 		namespace Validator
 		{
+			class JSONValidationResult : public Framework::ReferenceCounter
+			{
+			public:
+				__declspec(dllexport) JSONValidationResult();
+				__declspec(dllexport) virtual ~JSONValidationResult();
+				virtual bool isValid() const = 0;
+				virtual void printInvalidInfo(int indent = 0) const = 0;
+				virtual JSONValue* getValidPart() const = 0;
+				virtual Text getPath() const = 0;
+				virtual bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const = 0;
+			};
+
+			class JSONTypeMissmatch : public JSONValidationResult
+			{
+			private:
+				Text path;
+				JSONValue* foundValue;
+				XML::Element* expected;
+				JSONValidationResult* reason;
+			public:
+				__declspec(dllexport) JSONTypeMissmatch(Text path, JSONValue* foundValue, XML::Element* expected, JSONValidationResult* reason);
+				__declspec(dllexport) ~JSONTypeMissmatch();
+				__declspec(dllexport) bool isValid() const override;
+				__declspec(dllexport) void printInvalidInfo(int indent) const override;
+				__declspec(dllexport) JSONValue* getValidPart() const override;
+				__declspec(dllexport) Text getPath() const override;
+				bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
+			};
+
+			class JSONUnknownValue : public JSONValidationResult
+			{
+			private:
+				Text path;
+				JSONValue* foundValue;
+
+			public:
+				__declspec(dllexport) JSONUnknownValue(Text path, JSONValue* foundValue);
+				__declspec(dllexport) ~JSONUnknownValue();
+				__declspec(dllexport) bool isValid() const override;
+				__declspec(dllexport) void printInvalidInfo(int indent) const override;
+				__declspec(dllexport) JSONValue* getValidPart() const override;
+				__declspec(dllexport) Text getPath() const override;
+				__declspec(dllexport) bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
+			};
+
+			class JSONMissingValue : public JSONValidationResult
+			{
+			private:
+				Text path;
+				XML::Element* expected;
+
+			public:
+				__declspec(dllexport) JSONMissingValue(Text path, XML::Element* expected);
+				__declspec(dllexport) ~JSONMissingValue();
+				__declspec(dllexport) bool isValid() const override;
+				__declspec(dllexport) void printInvalidInfo(int indent) const override;
+				__declspec(dllexport) JSONValue* getValidPart() const override;
+				__declspec(dllexport) Text getPath() const override;
+				__declspec(dllexport) bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
+			};
+
+			class JSONMissingOneOf : public JSONValidationResult
+			{
+			private:
+				Text path;
+				RCArray<XML::Element> expected;
+
+			public:
+				__declspec(dllexport) JSONMissingOneOf(Text path, XML::Editor expected);
+				__declspec(dllexport) ~JSONMissingOneOf();
+				__declspec(dllexport) bool isValid() const override;
+				__declspec(dllexport) void printInvalidInfo(int indent) const override;
+				__declspec(dllexport) JSONValue* getValidPart() const override;
+				__declspec(dllexport) Text getPath() const override;
+				__declspec(dllexport) bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
+			};
+
+			class JSONNoTypeMatching : public JSONValidationResult
+			{
+			private:
+				Text path;
+				JSONValue* foundValue;
+				RCArray<XML::Element> expected;
+				RCArray<JSONValidationResult> reasons;
+
+			public:
+				__declspec(dllexport) JSONNoTypeMatching(Text path, JSONValue* foundValue, RCArray<XML::Element>& expected, RCArray<JSONValidationResult>& reasons);
+				__declspec(dllexport) ~JSONNoTypeMatching();
+				__declspec(dllexport) bool isValid() const override;
+				__declspec(dllexport) void printInvalidInfo(int indent) const override;
+				__declspec(dllexport) JSONValue* getValidPart() const override;
+				__declspec(dllexport) Text getPath() const override;
+				__declspec(dllexport) bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
+			};
+
+			class JSONValidValue : public JSONValidationResult
+			{
+			private:
+				Text path;
+				JSONValue* value;
+
+			public:
+				__declspec(dllexport) JSONValidValue(Text path, JSONValue* value);
+				__declspec(dllexport) ~JSONValidValue();
+				__declspec(dllexport) bool isValid() const override;
+				__declspec(dllexport) void printInvalidInfo(int indent) const override;
+				__declspec(dllexport) JSONValue* getValidPart() const override;
+				__declspec(dllexport) Text getPath() const override;
+				__declspec(dllexport) bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
+			};
+
+			template<typename T>
+			class StringValidationBuilder;
+
+			template<typename T>
+			class NumberValidationBuilder;
+
+			template<typename T>
+			class BoolValidationBuilder;
+
+			template<typename T>
+			class ObjectValidationBuilder;
+
+			template<typename T>
+			class ArrayValidationBuilder;
+
+			class JSONValidator : public Framework::ReferenceCounter
+			{
+			private:
+				XML::Element* constraints;
+
+			public:
+				__declspec(dllexport) JSONValidator(XML::Element* constraints);
+				__declspec(dllexport) ~JSONValidator();
+				__declspec(dllexport) JSONValidationResult* validate(JSONValue* zValue) const;
+				__declspec(dllexport) bool isValid(JSONValue* zValue) const;
+				/**
+				* returns the valid part of the json by performing the following operations in the specified order untill no further changes are made:
+				* - invalid or unknown object properties are removed
+				* - missing object properties with default values are added if missing
+				* - invalid array elements are removed
+				*
+				* @param zValue the json value to to extract the valid part without increased reference counter
+				* @return the valid part or 0 if no valid part exists
+				*/
+				__declspec(dllexport) JSONValue* getValidParts(JSONValue* zValue) const;
+				__declspec(dllexport) XML::Element* zConstraints();
+
+			private:
+				__declspec(dllexport) JSONValidationResult* validate(JSONValue* zValue, XML::Element* zConstraints, Text path) const;
+				__declspec(dllexport) JSONValidationResult* validateMultipleTypes(JSONValue* zChildValue, XML::Element* zPossibleChildConstraints, Text childPath) const;
+
+			public:
+				__declspec(dllexport) static StringValidationBuilder<JSONValidator>* buildForString();
+				__declspec(dllexport) static NumberValidationBuilder<JSONValidator>* buildForNumber();
+				__declspec(dllexport) static BoolValidationBuilder<JSONValidator>* buildForBool();
+				__declspec(dllexport) static ObjectValidationBuilder<JSONValidator>* buildForObject();
+				__declspec(dllexport) static ArrayValidationBuilder<JSONValidator>* buildForArray();
+			};
+
 			template<typename T>
 			class StringValidationBuilder
 			{
@@ -521,9 +681,23 @@ namespace Framework
 						});
 				}
 
-				ObjectValidationBuilder<T>* withDefault(JSONObject* zObj)
+				ObjectValidationBuilder<T>* withRequiredAttribute(Text name, JSONValidator* validator)
+				{
+					if (!element.selectChildsByAttribute("name", name).exists())
+					{
+						XML::Element* attr = new XML::Element("<value></value>");
+						attr->setAttribute("name", name);
+						element.addChild(attr);
+					}
+					element.selectChildsByAttribute("name", name).addChild(validator->zConstraints()->dublicate());
+					validator->release();
+					return this;
+				}
+
+				ObjectValidationBuilder<T>* withDefault(JSONObject* obj)
 				{
-					element.setAttribute("default", zObj->toString());
+					element.setAttribute("default", obj->toString()); obj
+						obj->release();
 					return this;
 				}
 
@@ -557,6 +731,12 @@ namespace Framework
 					return this;
 				}
 
+				ObjectValidationBuilder<T>* removeInvalidEntries()
+				{
+					element.setAttribute("removeInvalidEntries", "true");
+					return this;
+				}
+
 				T* finishObject()
 				{
 					T* result = builder(element);
@@ -623,20 +803,30 @@ namespace Framework
 						});
 				}
 
+				ArrayValidationBuilder<T>* addAcceptedTypeInArray(JSONValidator* validator)
+				{
+					element.addChild(validator->zConstraints()->dublicate());
+					validator->release();
+					return this;
+				}
+
 				ArrayValidationBuilder<T>* acceptNullsInArray()
 				{
 					element.setAttribute("nullsEnabled", "true");
 					return this;
 				}
 
-				ArrayValidationBuilder<T>* withDefault(JSONArray* zArray)
+				ArrayValidationBuilder<T>* withDefault(JSONArray* array)
 				{
-					element.setAttribute("default", zArray->toString());
+					element.setAttribute("default", array->toString());
+					array->release();
+					return this;
 				}
 
 				ArrayValidationBuilder<T>* withDefaultNull()
 				{
 					element.setAttribute("default", "null");
+					return this;
 				}
 
 				ArrayValidationBuilder<T>* whichCanBeNull()
@@ -657,6 +847,12 @@ namespace Framework
 					return this;
 				}
 
+				ArrayValidationBuilder<T>* removeInvalidEntries()
+				{
+					element.setAttribute("removeInvalidEntries", "true");
+					return this;
+				}
+
 				T* finishArray()
 				{
 					T* result = builder(element);
@@ -664,151 +860,6 @@ namespace Framework
 					return result;
 				}
 			};
-
-			class JSONValidationResult : public Framework::ReferenceCounter
-			{
-			public:
-				JSONValidationResult();
-				virtual ~JSONValidationResult();
-				virtual bool isValid() const = 0;
-				virtual void printInvalidInfo(int indent = 0) const = 0;
-				virtual JSONValue* getValidPart() const = 0;
-				virtual Text getPath() const = 0;
-				virtual bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const = 0;
-			};
-
-			class JSONTypeMissmatch : public JSONValidationResult
-			{
-			private:
-				Text path;
-				JSONValue* foundValue;
-				XML::Element* expected;
-				JSONValidationResult* reason;
-			public:
-				JSONTypeMissmatch(Text path, JSONValue* foundValue, XML::Element* expected, JSONValidationResult* reason);
-				~JSONTypeMissmatch();
-				bool isValid() const override;
-				void printInvalidInfo(int indent) const override;
-				JSONValue* getValidPart() const override;
-				Text getPath() const override;
-				bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
-			};
-
-			class JSONUnknownValue : public JSONValidationResult
-			{
-			private:
-				Text path;
-				JSONValue* foundValue;
-
-			public:
-				JSONUnknownValue(Text path, JSONValue* foundValue);
-				~JSONUnknownValue();
-				bool isValid() const override;
-				void printInvalidInfo(int indent) const override;
-				JSONValue* getValidPart() const override;
-				Text getPath() const override;
-				bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
-			};
-
-			class JSONMissingValue : public JSONValidationResult
-			{
-			private:
-				Text path;
-				XML::Element* expected;
-
-			public:
-				JSONMissingValue(Text path, XML::Element* expected);
-				~JSONMissingValue();
-				bool isValid() const override;
-				void printInvalidInfo(int indent) const override;
-				JSONValue* getValidPart() const override;
-				Text getPath() const override;
-				bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
-			};
-
-			class JSONMissingOneOf : public JSONValidationResult
-			{
-			private:
-				Text path;
-				RCArray<XML::Element> expected;
-
-			public:
-				JSONMissingOneOf(Text path, XML::Editor expected);
-				~JSONMissingOneOf();
-				bool isValid() const override;
-				void printInvalidInfo(int indent) const override;
-				JSONValue* getValidPart() const override;
-				Text getPath() const override;
-				bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
-			};
-
-			class JSONNoTypeMatching : public JSONValidationResult
-			{
-			private:
-				Text path;
-				JSONValue* foundValue;
-				RCArray<XML::Element> expected;
-				RCArray<JSONValidationResult> reasons;
-
-			public:
-				JSONNoTypeMatching(Text path, JSONValue* foundValue, RCArray<XML::Element>& expected, RCArray<JSONValidationResult>& reasons);
-				~JSONNoTypeMatching();
-				bool isValid() const override;
-				void printInvalidInfo(int indent) const override;
-				JSONValue* getValidPart() const override;
-				Text getPath() const override;
-				bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
-			};
-
-			class JSONValidValue : public JSONValidationResult
-			{
-			private:
-				Text path;
-				JSONValue* value;
-
-			public:
-				JSONValidValue(Text path, JSONValue* value);
-				~JSONValidValue();
-				bool isValid() const override;
-				void printInvalidInfo(int indent) const override;
-				JSONValue* getValidPart() const override;
-				Text getPath() const override;
-				bool isDifferent(const JSONValidationResult* zResult, Text additionalPath) const override;
-			};
-
-			class JSONValidator : public Framework::ReferenceCounter
-			{
-			private:
-				XML::Element* constraints;
-
-			public:
-				__declspec(dllexport) JSONValidator(XML::Element* constraints);
-				__declspec(dllexport) ~JSONValidator();
-				__declspec(dllexport) JSONValidationResult* validate(JSONValue* zValue) const;
-				__declspec(dllexport) bool isValid(JSONValue* zValue) const;
-				/**
-				* returns the valid part of the json by performing the following operations in the specified order untill no further changes are made:
-				* - invalid or unknown object properties are removed
-				* - missing object properties with default values are added if missing
-				* - invalid array elements are removed
-				*
-				* @param zValue the json value to to extract the valid part without increased reference counter
-				* @return the valid part or 0 if no valid part exists
-				*/
-				__declspec(dllexport) JSONValue* getValidParts(JSONValue* zValue) const;
-				__declspec(dllexport) XML::Element* zConstraints();
-
-			private:
-				__declspec(dllexport) JSONValidationResult* validate(JSONValue* zValue, XML::Element* zConstraints, Text path) const;
-				__declspec(dllexport) JSONValidationResult* validateMultipleTypes(JSONValue* zChildValue, XML::Element* zPossibleChildConstraints, Text childPath) const;
-
-			public:
-				__declspec(dllexport) static StringValidationBuilder<JSONValidator>* buildForString();
-				__declspec(dllexport) static NumberValidationBuilder<JSONValidator>* buildForNumber();
-				__declspec(dllexport) static BoolValidationBuilder<JSONValidator>* buildForBool();
-				__declspec(dllexport) static ObjectValidationBuilder<JSONValidator>* buildForObject();
-				__declspec(dllexport) static ArrayValidationBuilder<JSONValidator>* buildForArray();
-			};
 		}
 	}
 }

+ 22 - 22
UIPixelShader.h

@@ -353,10 +353,10 @@ ret
 
 const BYTE UIPixelShader[] =
 {
-     68,  88,  66,  67, 225, 236, 
-     18, 150,  68, 156, 132,  61, 
-     69, 155, 244,  69, 113, 208, 
-     58, 245,   1,   0,   0,   0, 
+     68,  88,  66,  67, 133,  70, 
+    192, 222, 198,  87, 193,  79, 
+    229, 183, 127, 120, 131, 225, 
+    164, 109,   1,   0,   0,   0, 
      64, 134,   0,   0,   6,   0, 
       0,   0,  56,   0,   0,   0, 
     192,   6,   0,   0,  80,   7, 
@@ -1815,10 +1815,10 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0, 148,  46,  49,   1, 
-    229, 111,  72,  98,   1,   0, 
-      0,   0, 213, 124, 118, 103, 
-     38,  53, 238,  73, 150, 118, 
-    133,  18, 143, 135, 162,  55, 
+    138, 150,  90,  98,   1,   0, 
+      0,   0,  40, 118,  24,  52, 
+    233, 101, 212,  74, 181, 107, 
+    188, 194,  70,  14, 199,  80, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   1,   0,   0,   0, 
       1,   0,   0,   0,   0,   0, 
@@ -1990,9 +1990,9 @@ const BYTE UIPixelShader[] =
     242,  56,   1,   0,  43, 236, 
       3,   0,  28,  19,   2,   0, 
      65,  36,   1,   0, 236, 179, 
-      1,   0,  51, 246,   1,   0, 
+      1,   0,  53, 134,   0,   0, 
     125,  10,   2,   0, 125, 181, 
-      2,   0,  45,  24,   0,   0, 
+      2,   0, 111, 167,   1,   0, 
     193,  33,   3,   0,  65, 185, 
       2,   0,   9, 241,   2,   0, 
     146, 230,   3,   0, 125, 218, 
@@ -3010,8 +3010,8 @@ const BYTE UIPixelShader[] =
     120, 116, 117, 114, 101,  50, 
      68,  32, 115, 104,  97, 100, 
      27, 226,  48,   1, 128,   0, 
-      0,   0,  66, 246, 122, 219, 
-    168,  70, 216,   1,   1,   0, 
+      0,   0, 184, 201,  15, 121, 
+    122,  81, 216,   1,   1,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -4253,14 +4253,14 @@ const BYTE UIPixelShader[] =
       0,   0,  23,   0,   1,   0, 
       5,  16,   0,   0,  14,   0, 
      23,  21,   0,  16,   0,   0, 
-      3,   2,  64, 119,   0,   0, 
+      3,   2, 176,  37,   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, 
-     64, 119,   0,   0, 242, 241, 
+    176,  37,   0,   0, 242, 241, 
      10,   0,  24,  21,  11,  16, 
       0,   0,   1,   0,   1,   0, 
      10,   0,  24,  21,  12,  16, 
@@ -5401,8 +5401,8 @@ const BYTE UIPixelShader[] =
       0,   0,  16,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
+      0,   0, 210,  69,   0,   0, 
+      0,   0,  16, 220, 210,  69, 
     255, 255, 255, 255,  26,   9, 
      47, 241,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
@@ -5484,11 +5484,11 @@ const BYTE UIPixelShader[] =
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0, 148,  46, 
-     49,   1, 229, 111,  72,  98, 
-      1,   0,   0,   0, 213, 124, 
-    118, 103,  38,  53, 238,  73, 
-    150, 118, 133,  18, 143, 135, 
-    162,  55, 128,   0,   0,   0, 
+     49,   1, 138, 150,  90,  98, 
+      1,   0,   0,   0,  40, 118, 
+     24,  52, 233, 101, 212,  74, 
+    181, 107, 188, 194,  70,  14, 
+    199,  80, 128,   0,   0,   0, 
      47,  76, 105, 110, 107,  73, 
     110, 102, 111,   0,  47, 110, 
      97, 109, 101, 115,   0,  47, 
@@ -5588,7 +5588,7 @@ const BYTE UIPixelShader[] =
       2,   0,   9,   0, 204,   8, 
       0,   0,   0,   0,   0,   0, 
     164,  14,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
+    205,  69,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
       0,   0,  84, 101, 120, 116, 
     117, 114, 101,  80, 105, 120, 

+ 15 - 15
UIVertexShader.h

@@ -119,10 +119,10 @@ ret
 
 const BYTE UIVertexShader[] =
 {
-     68,  88,  66,  67, 222,  77, 
-     76, 107,  92, 142, 145, 170, 
-    144,  72, 184, 211, 248, 219, 
-     19,  34,   1,   0,   0,   0, 
+     68,  88,  66,  67,  75,  95, 
+    177,  31, 131, 193, 205, 226, 
+    212, 133,  34, 131,  88, 232, 
+    169,  61,   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, 
-    230, 111,  72,  98,   1,   0, 
-      0,   0, 126, 242, 225, 129, 
-    144, 227,  82,  79, 164,  52, 
-    208,  83, 125, 169,  42,  55, 
+    139, 150,  90,  98,   1,   0, 
+      0,   0,  28,  86, 186,  28, 
+     92,  80, 101,  67, 188,  89, 
+    254, 130, 187,  97, 174,  73, 
       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,  15, 246, 181, 219, 
-    168,  70, 216,   1,   1,   0, 
+      0,   0, 137, 161,  80, 121, 
+    122,  81, 216,   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, 
-    230, 111,  72,  98,   1,   0, 
-      0,   0, 126, 242, 225, 129, 
-    144, 227,  82,  79, 164,  52, 
-    208,  83, 125, 169,  42,  55, 
+    139, 150,  90,  98,   1,   0, 
+      0,   0,  28,  86, 186,  28, 
+     92,  80, 101,  67, 188,  89, 
+    254, 130, 187,  97, 174,  73, 
     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,   0,   0, 
+      0,   0,   1,   0, 232, 102, 
       0,   0,   0,   0,   0,   0, 
       0,   0,   0,   0,   0,   0, 
      84, 101, 120, 116, 117, 114,