Skip to content

Commit

Permalink
Removed obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Kondratyev committed Jun 3, 2018
1 parent 8822b28 commit 211ab3d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ WinExtract/.vs/WinExtract/v14/.suo
/.vs/VSWorkspaceState.json
/.vs/UndertaleTools/v15/.suo
/WinExtract/.vs/WinExtract/v15/Server/sqlite3
/GameMakerStringsEditor/.vs/GameMakerStringsEditor/v15/Server/sqlite3
Binary file not shown.
Binary file modified WinExtract/.vs/WinExtract/v15/.suo
Binary file not shown.
58 changes: 13 additions & 45 deletions WinExtract/WinExtract/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class Program
static bool showstringsextract;
static bool strgWithBr;
static string[] fontNames;
static uint undertaleVer = 0;
static bool oldUndertale = false;
static bool correctTXTR = false;
static bool isPSVITA = false;
static bool ForceAUDO;
//static bool isPSVITA = false;
static bool unpackAUDO;

struct endFiles
{
Expand Down Expand Up @@ -56,8 +56,9 @@ static void Main(string[] args)
if (args[i] == "-tt") translatale = true;
if (args[i] == "-showstringsextract") showstringsextract = true;
if (args[i] == "-correctTXTR") correctTXTR = true;
if (args[i] == "-isPSVITA") isPSVITA = true;
if (args[i] == "-ForceAUDO") ForceAUDO = true;
//if (args[i] == "-isPSVITA") isPSVITA = true;
if (args[i] == "-unpackAUDO") unpackAUDO = true;
if (args[i] == "-oldUndertale") oldUndertale = true;
}
translatale = true;
strgWithBr = false;
Expand Down Expand Up @@ -153,7 +154,7 @@ static void Main(string[] args)
filesToCreate.Add(f1);
}
}
else if (chunk_name == "AUDO" && ForceAUDO == true)
else if (chunk_name == "AUDO" && unpackAUDO == true)
{
List<uint> entries = collect_entries(false);
filesToCreate = new List<endFiles>();
Expand Down Expand Up @@ -199,43 +200,10 @@ static void Main(string[] args)
sBuilder.Append(hashByte[i].ToString("x2"));
}
string hashString = sBuilder.ToString();
if (hashString == "ff44e9b4b88209202af1b73d7b187d5f")
if (hashString == "ff44e9b4b88209202af1b73d7b187d5f")//Undertale 1.01
{
undertaleVer = 101;
ForceAUDO = true;
}
else if (hashString == "00fc3b1363cd51f7bfc81e6c082d2d14")
{
undertaleVer = 106;
ForceAUDO = true;

}
else if (hashString == "76de1a6b4b75786b54f7d69177eb1e3e")
{
undertaleVer = 108;
ForceAUDO = true;
}
else if (hashString == "63cdc7c0c88297172f0b63a1f0fc18b8" && ForceAUDO == true)
{
undertaleVer = 109;
isPSVITA = true;
}
else if (hashString == "63cdc7c0c88297172f0b63a1f0fc18b8")
{
undertaleVer = 109;
isPSVITA = true;
ForceAUDO = false;
}
if (undertaleVer != 0 && isPSVITA == false)
{
System.Console.WriteLine("Undertale v. " + undertaleVer + " PC edition");
}
else if (undertaleVer != 0 && isPSVITA == true)
{
System.Console.WriteLine("Undertale v. " + undertaleVer + " PS Vita edition");
}
else {
System.Console.WriteLine("Unknown Undertale ver. Hash " + hashString);
oldUndertale = true;
unpackAUDO = true;
}
}
}
Expand Down Expand Up @@ -263,8 +231,8 @@ static void Main(string[] args)
Directory.CreateDirectory(input_folder + "FONT_new");
File.Open(input_folder + "FONT_new\\patch.txt", FileMode.OpenOrCreate);

//Console.Write("Done! Press any key to exit.");
//Console.ReadKey();
Console.Write("Done! Press any key to exit.");
Console.ReadKey();
}

static List<uint> collect_entries(bool fnt, bool correctTXTR_=false)
Expand Down Expand Up @@ -415,7 +383,7 @@ static spriteInfo getSpriteInfo(uint sprite_offset)
result.h = bread.ReadUInt16();
bread.BaseStream.Position += 12;
result.i = bread.ReadUInt16();
if(undertaleVer>=105)
if(!oldUndertale)
result.i++;//Undertale 1.05. WTF?
if (result.i > 16) result.i--; //What?
bread.BaseStream.Position = bacup;
Expand Down
4 changes: 2 additions & 2 deletions WinExtract/WinExtract/WinExtract.csproj.user
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<StartArguments>"E:\Undertale\data.win" "E:\Undertale\Data"</StartArguments>
<StartArguments>"D:\Temp\game [Undertale].win" "D:\Temp\Undertale\" -isPSVITA</StartArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>"E:\Undertale\data.win" "E:\Undertale\Data" -correctTXTR</StartArguments>
<StartArguments>"D:\Temp\game [Va-11 Hall-a PS Vita].win" D:\Temp\Valhalla -unpackAUDO</StartArguments>
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
</Project>

0 comments on commit 211ab3d

Please sign in to comment.