From cfa8a1820d0789ba2f87ff0fdfdc38fa46ba6859 Mon Sep 17 00:00:00 2001
From: Michael <goldtextwitch@outlook.com>
Date: Wed, 18 Oct 2017 21:05:06 -0700
Subject: [PATCH] Add Warriors Orochi 3 to build script

---
 Quality/WarriorsOrochi3_1080p/rules.txt | 18 -----
 Source/WarriorsOrochi3/rules.txt        | 87 +++++++++++++++++++++++++
 build.sh                                |  1 +
 3 files changed, 88 insertions(+), 18 deletions(-)
 delete mode 100644 Quality/WarriorsOrochi3_1080p/rules.txt
 create mode 100644 Source/WarriorsOrochi3/rules.txt

diff --git a/Quality/WarriorsOrochi3_1080p/rules.txt b/Quality/WarriorsOrochi3_1080p/rules.txt
deleted file mode 100644
index 71abb0f8..00000000
--- a/Quality/WarriorsOrochi3_1080p/rules.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-[Definition]
-titleIds = 0005000010110200,0005000010112B00,000500001010EA00
-name = "Warriors Orochi 3 - 1920x1080"
-version = 2
-
-[TextureRedefine]
-width = 1280
-height = 720
-tileModesExcluded = 0x001
-overwriteWidth = 1920
-overwriteHeight = 1080
-
-[TextureRedefine]
-width = 640
-height = 360
-tileModesExcluded = 0x001
-overwriteWidth = 960
-overwriteHeight = 540
\ No newline at end of file
diff --git a/Source/WarriorsOrochi3/rules.txt b/Source/WarriorsOrochi3/rules.txt
new file mode 100644
index 00000000..8f023d1d
--- /dev/null
+++ b/Source/WarriorsOrochi3/rules.txt
@@ -0,0 +1,87 @@
+<?php
+include 'Source/functions.php';
+$fullWidth = $argv[1];
+$fullHeight = $argv[2];
+$scaleFactorX = $fullWidth / 1280.0;
+$scaleFactorY = $fullHeight / 720.0;
+
+$title = get_title($fullWidth, $fullHeight);
+?>
+[Definition]
+titleIds = 0005000010110200,0005000010112B00,000500001010EA00
+name = "Warriors Orochi 3 - <?=$title?>"
+version = 2
+
+[TextureRedefine] #Game Resolution
+width = 1280
+height = 720
+formatsExcluded = 0x431,0x433
+tileModesExcluded = 0x001
+overwriteWidth = <?=round($scaleFactorX*1280)?> 
+overwriteHeight = <?=round($scaleFactorY*720)?> 
+
+[TextureRedefine] #Only saw depth in Nsight
+width = 640
+height = 360
+tileModesExcluded = 0x001
+overwriteWidth = <?=round($scaleFactorX*640)?> 
+overwriteHeight = <?=round($scaleFactorY*360)?> 
+
+[TextureRedefine] #Lighting?
+width = 322
+height = 182
+overwriteWidth = <?=round($scaleFactorX*322)?> 
+overwriteHeight = <?=round($scaleFactorY*182)?> 
+
+[TextureRedefine] #Dupe of Main Game
+width = 320
+height = 180
+overwriteWidth = <?=round($scaleFactorX*320)?> 
+overwriteHeight = <?=round($scaleFactorY*180)?> 
+
+[TextureRedefine] #Lighting Blur?
+width = 162
+height = 92
+overwriteWidth = <?=round($scaleFactorX*162)?> 
+overwriteHeight = <?=round($scaleFactorY*92)?> 
+
+[TextureRedefine] #Lighting Blur?
+width = 160
+height = 90
+overwriteWidth = <?=round($scaleFactorX*160)?> 
+overwriteHeight = <?=round($scaleFactorY*90)?> 
+
+#[TextureRedefine] #Shadows?
+#width = 1024
+#height = 2048
+#formats = 0x005
+#overwriteWidth = <?=round($scaleFactorY*1024)?> 
+#overwriteHeight = <?=round($scaleFactorY*2048)?> 
+
+#[TextureRedefine] #Dupe of Main Game?
+#width = 64
+#height = 64
+#formats = 0x005
+#overwriteWidth = <?=round($scaleFactorY*64)?> 
+#overwriteHeight = <?=round($scaleFactorY*64)?> 
+
+#[TextureRedefine] #Dupe of Main Game?
+#width = 16
+#height = 16
+#formats = 0x005
+#overwriteWidth = <?=round($scaleFactorY*16)?> 
+#overwriteHeight = <?=round($scaleFactorY*16)?> 
+
+#[TextureRedefine] #Dupe of Main Game?
+#width = 4
+#height = 4
+#formats = 0x005
+#overwriteWidth = <?=round($scaleFactorY*6)?> 
+#overwriteHeight = <?=round($scaleFactorY*6)?> 
+
+#[TextureRedefine] #Dupe of Main Game?
+#width = 1
+#height = 1
+#formats = 0x005
+#overwriteWidth = <?=round($scaleFactorY*1)?> 
+#overwriteHeight = <?=round($scaleFactorY*1)?> 
diff --git a/build.sh b/build.sh
index 66b7e3b6..e710aa5b 100644
--- a/build.sh
+++ b/build.sh
@@ -101,6 +101,7 @@ std_respack "SuperMario3DWorld" "${res16by9[@]}" "${res21by9[@]}"
 std_respack "SuperSmashBros" "${res16by9[@]}"
 std_respack "TropicalFreeze" "${res16by9[@]}" "${res21by9[@]}"
 std_respack "TwilightPrincessHD" "${res16by9[@]}"
+std_respack "WarriorsOrochi3" "${res16by9[@]}"
 std_respack "WindWakerHD" "${res16by9[@]}" "${res21by9[@]}"
 std_respack "WoollyWorld" "${res16by9[@]}" "${res21by9[@]}"
 std_respack "XenobladeX" "${res16by9[@]}" "${res21by9[@]}"