├── .gitignore ├── ImageToGameMap ├── .gitignore ├── Assets │ ├── LevelMaker.cs │ ├── LevelMaker.cs.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── Android.meta │ │ ├── Android │ │ │ ├── zipper.jar │ │ │ └── zipper.jar.meta │ │ ├── Ionic.Zip.dll │ │ ├── Ionic.Zip.dll.meta │ │ ├── Zip.cs │ │ ├── Zip.cs.meta │ │ ├── iOS.meta │ │ └── iOS │ │ │ ├── UnityZipFile.mm │ │ │ └── UnityZipFile.mm.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── SampleScene.unity │ │ └── SampleScene.unity.meta │ ├── StandaloneFileBrowser.meta │ └── StandaloneFileBrowser │ │ ├── IStandaloneFileBrowser.cs │ │ ├── IStandaloneFileBrowser.cs.meta │ │ ├── Plugins.meta │ │ ├── Plugins │ │ ├── Linux.meta │ │ ├── Linux │ │ │ ├── x86_64.meta │ │ │ └── x86_64 │ │ │ │ ├── libStandaloneFileBrowser.so │ │ │ │ └── libStandaloneFileBrowser.so.meta │ │ ├── Ookii.Dialogs.dll │ │ ├── Ookii.Dialogs.dll.meta │ │ ├── StandaloneFileBrowser.bundle.meta │ │ ├── StandaloneFileBrowser.bundle │ │ │ ├── Contents.meta │ │ │ └── Contents │ │ │ │ ├── Info.plist │ │ │ │ ├── Info.plist.meta │ │ │ │ ├── MacOS.meta │ │ │ │ └── MacOS │ │ │ │ ├── StandaloneFileBrowser │ │ │ │ └── StandaloneFileBrowser.meta │ │ ├── StandaloneFileBrowser.jslib │ │ ├── StandaloneFileBrowser.jslib.meta │ │ ├── System.Windows.Forms.dll │ │ └── System.Windows.Forms.dll.meta │ │ ├── StandaloneFileBrowser.cs │ │ ├── StandaloneFileBrowser.cs.meta │ │ ├── StandaloneFileBrowserEditor.cs │ │ ├── StandaloneFileBrowserEditor.cs.meta │ │ ├── StandaloneFileBrowserLinux.cs │ │ ├── StandaloneFileBrowserLinux.cs.meta │ │ ├── StandaloneFileBrowserMac.cs │ │ ├── StandaloneFileBrowserMac.cs.meta │ │ ├── StandaloneFileBrowserWindows.cs │ │ └── StandaloneFileBrowserWindows.cs.meta ├── Packages │ ├── manifest.json │ └── packages-lock.json ├── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── MemorySettings.asset │ ├── NavMeshAreas.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ ├── XRSettings.asset │ └── boot.config └── README.md ├── LICENSE ├── Level ├── MapProperties.json ├── SampleLevel.ldtk └── tiles-export.png ├── PlatformerEngine ├── .gitignore ├── PlatformerEngine.sln ├── PlatformerEngine.vcxproj ├── PlatformerEngine.vcxproj.filters ├── inc │ ├── camera.h │ ├── global.h │ ├── levelgenerator.h │ ├── levels.h │ ├── map.h │ ├── physics.h │ ├── player.h │ └── types.h ├── out │ └── rom.bin ├── res │ ├── images │ │ ├── level.png │ │ └── player.png │ ├── resources.h │ ├── resources.res │ └── sound │ │ ├── jump.wav │ │ └── sonic2Emerald.vgm ├── romlauncher │ ├── RomLauncher.exe │ └── emulatorPath.txt └── src │ ├── boot │ ├── rom_head.c │ └── sega.s │ ├── camera.c │ ├── global.c │ ├── levelgenerator.c │ ├── levels.c │ ├── main.c │ ├── map.c │ ├── physics.c │ ├── player.c │ └── types.c └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | [Ii]mageToGameMapBuild/ 2 | Level/SampleLevel -------------------------------------------------------------------------------- /ImageToGameMap/.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Ll]ogs/ 3 | [Tt]emp/ 4 | [Oo]bj/ 5 | [Bb]uild/ 6 | [Bb]uilds/ 7 | [Uu]serSettings/ 8 | Assets/AssetStoreTools* 9 | 10 | # Visual Studio cache directory 11 | .vs/ 12 | 13 | # Autogenerated VS/MD/Consulo solution and project files 14 | ExportedObj/ 15 | .consulo/ 16 | *.csproj 17 | *.unityproj 18 | *.sln 19 | *.suo 20 | *.tmp 21 | *.user 22 | *.userprefs 23 | *.pidb 24 | *.booproj 25 | *.svd 26 | *.pdb 27 | *.opendb 28 | *.VC.db 29 | *.vsconfig 30 | 31 | # Unity3D generated meta files 32 | *.pidb.meta 33 | *.pdb.meta 34 | 35 | # Unity3D Generated File On Crash Reports 36 | sysinfo.txt 37 | 38 | # Builds 39 | *.apk 40 | *.unitypackage -------------------------------------------------------------------------------- /ImageToGameMap/Assets/LevelMaker.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using SFB; 3 | using System.IO; 4 | using System.Collections.Generic; 5 | 6 | public class LevelMaker : MonoBehaviour{ 7 | 8 | string[] hText; 9 | string[] cText; 10 | 11 | [System.Serializable] 12 | class JSONArray{ 13 | public ColorToText[] level; 14 | } 15 | 16 | [System.Serializable] 17 | class ColorToText{ 18 | public ColorToText(string color, short number){ 19 | this.color = color; 20 | this.number = number; 21 | } 22 | 23 | public string color; 24 | public short number; 25 | } 26 | 27 | JSONArray jsonArray; 28 | 29 | public void SelectJSON(){ 30 | var extensions = new[] { 31 | new ExtensionFilter("JSON", "json"), 32 | }; 33 | var paths = StandaloneFileBrowser.OpenFilePanel("Open File", PlayerPrefs.GetString("CSVFolder", Application.dataPath), extensions, false); 34 | 35 | if (paths.Length != 0){ 36 | PlayerPrefs.SetString("CSVFolder", Path.GetDirectoryName(paths[0])); 37 | var reader = new StreamReader(paths[0]); 38 | jsonArray = JsonUtility.FromJson(reader.ReadToEnd()); 39 | } 40 | } 41 | 42 | public void SelectFile(){ 43 | if (jsonArray == null) 44 | return; 45 | 46 | var extensions = new[] { 47 | new ExtensionFilter("PNG", "png"), 48 | new ExtensionFilter("JPG", "jpg", "jpeg", "jpe", "jfif"), 49 | new ExtensionFilter("Bitmap", "bmp"), 50 | new ExtensionFilter("TIFF", "tiff", "tif"), 51 | }; 52 | var paths = StandaloneFileBrowser.OpenFilePanel("Open File", PlayerPrefs.GetString("ImageFolder", Application.dataPath), extensions, true); 53 | 54 | List dynamicPaths = new List(paths); 55 | if(paths.Length != 0){ 56 | PlayerPrefs.SetString("ImageFolder", Path.GetDirectoryName(paths[0])); 57 | for (int i = 0; i < paths.Length; i++){ 58 | var rawData = File.ReadAllBytes(paths[i]); 59 | Texture2D map = new Texture2D(2, 2); 60 | map.LoadImage(rawData); 61 | } 62 | paths = dynamicPaths.ToArray(); 63 | 64 | cText = new string[paths.Length]; 65 | hText = new string[paths.Length]; 66 | for (int i = 0; i < paths.Length; i++){ 67 | var rawData = File.ReadAllBytes(paths[i]); 68 | Texture2D map = new Texture2D(2, 2); 69 | map.LoadImage(rawData); 70 | 71 | string textImage = "const u8 level_" + (i + 1) + "[" + map.height + "][" + map.width + "] = {\r\n"; 72 | 73 | for (int y = map.height - 1, y0 = 0; y >= 0; y--, y0++){ 74 | textImage += "\t{ "; 75 | for (int x = 0; x < map.width; x++){ 76 | Color pixelColor = map.GetPixel(x, y); 77 | 78 | if (pixelColor.a == 0){ 79 | textImage += '0' + ", "; 80 | }else{ 81 | textImage += PaintTile(pixelColor) + ", "; 82 | } 83 | } 84 | if (y != 0) 85 | textImage += "},\r\n"; 86 | } 87 | 88 | textImage += "},\r\n};"; 89 | 90 | cText[i] += textImage; 91 | hText[i] += "extern const u8 level_" + (i + 1) + "[" + map.height + "][" + map.width + "];"; 92 | } 93 | } 94 | } 95 | 96 | int PaintTile(Color color){ 97 | foreach(ColorToText col in jsonArray.level){ 98 | ColorUtility.TryParseHtmlString(col.color, out Color c); 99 | if (c.Equals(color)){ 100 | return col.number; 101 | } 102 | } 103 | return 0; 104 | } 105 | 106 | public void SaveFile(){ 107 | if (string.IsNullOrEmpty(cText[0]) || jsonArray == null) 108 | return; 109 | 110 | var path = StandaloneFileBrowser.OpenFolderPanel("", PlayerPrefs.GetString("SaveFolder"), false); 111 | if (path.Length > 0){ 112 | string dirName = path[0]; 113 | PlayerPrefs.SetString("SaveFolder", dirName); 114 | StreamWriter hStream = new StreamWriter(dirName + @"\map.h", false); 115 | hStream.Write("#pragma once"); 116 | hStream.Write("\r\n\r\n"); 117 | for (int i = 0; i < hText.Length; i++){ 118 | hStream.Write(hText[i]); 119 | hStream.Write("\r\n"); 120 | } 121 | hStream.Close(); 122 | 123 | StreamWriter cStream = new StreamWriter(dirName + @"\map.c", false); 124 | for (int i = 0; i < cText.Length; i++){ 125 | cStream.Write(cText[i]); 126 | cStream.Write("\r\n"); 127 | } 128 | cStream.Close(); 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/LevelMaker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b985ef8cf534607458f477ef246eea53 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da01026eff931df4480c132f2ea24251 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9cc438f7459334001bd8e92eef639069 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/Android/zipper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/ImageToGameMap/Assets/Plugins/Android/zipper.jar -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/Android/zipper.jar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d92153e6d88864707b56d9e4fabc1209 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/Ionic.Zip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/ImageToGameMap/Assets/Plugins/Ionic.Zip.dll -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/Ionic.Zip.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4004f0d460b114c95bff6bbf651624e3 3 | MonoAssemblyImporter: 4 | serializedVersion: 1 5 | iconMap: {} 6 | executionOrder: {} 7 | userData: 8 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/Zip.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | using System.Runtime.InteropServices; 5 | using Ionic.Zip; 6 | using System.Text; 7 | using System.IO; 8 | 9 | public class ZipUtil 10 | { 11 | #if UNITY_IPHONE 12 | [DllImport("__Internal")] 13 | private static extern void unzip (string zipFilePath, string location); 14 | 15 | [DllImport("__Internal")] 16 | private static extern void zip (string zipFilePath); 17 | 18 | [DllImport("__Internal")] 19 | private static extern void addZipFile (string addFile); 20 | 21 | #endif 22 | 23 | public static void Unzip (string zipFilePath, string location) 24 | { 25 | #if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX 26 | Directory.CreateDirectory (location); 27 | 28 | using (ZipFile zip = ZipFile.Read (zipFilePath)) { 29 | 30 | zip.ExtractAll (location, ExtractExistingFileAction.OverwriteSilently); 31 | } 32 | #elif UNITY_ANDROID 33 | using (AndroidJavaClass zipper = new AndroidJavaClass ("com.tsw.zipper")) { 34 | zipper.CallStatic ("unzip", zipFilePath, location); 35 | } 36 | #elif UNITY_IPHONE 37 | unzip (zipFilePath, location); 38 | #endif 39 | } 40 | 41 | public static void Zip (string zipFileName, params string[] files) 42 | { 43 | #if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX 44 | string path = Path.GetDirectoryName(zipFileName); 45 | Directory.CreateDirectory (path); 46 | 47 | using (ZipFile zip = new ZipFile()) { 48 | foreach (string file in files) { 49 | zip.AddFile(file, ""); 50 | } 51 | zip.Save (zipFileName); 52 | } 53 | #elif UNITY_ANDROID 54 | using (AndroidJavaClass zipper = new AndroidJavaClass ("com.tsw.zipper")) { 55 | { 56 | zipper.CallStatic ("zip", zipFileName, files); 57 | } 58 | } 59 | #elif UNITY_IPHONE 60 | foreach (string file in files) { 61 | addZipFile (file); 62 | } 63 | zip (zipFileName); 64 | #endif 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/Zip.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 159cfd1f9497d47d7a49851b7ad95aa2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 104959ab4e49d436790b0884c9e562d5 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/Plugins/iOS/UnityZipFile.mm: -------------------------------------------------------------------------------- 1 | // 2 | // UnityZipFile.m 3 | // Unity-iPhone 4 | // 5 | // Created by 山村 達彦 on 2013/12/29. 6 | // 7 | // 8 | #import "ZipArchive.h" 9 | 10 | static NSMutableArray* list = nil; 11 | 12 | extern "C"{ 13 | 14 | 15 | void zip(const char*file) { 16 | NSString *zipPath =[NSString stringWithUTF8String:file]; 17 | 18 | ZipArchive* zip = [[ZipArchive alloc] init]; 19 | 20 | 21 | [zip CreateZipFile2:zipPath]; 22 | 23 | for(int i=0; i cb); 10 | void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb); 11 | void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/IStandaloneFileBrowser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7609f7b6787a54496aa41a3053fcc76a 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddc4e7b83981f244ba9a26b88c18cb67 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Linux.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82666e520ab4d4cf08bebbb8059cd6f4 3 | folderAsset: yes 4 | timeCreated: 1538224809 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Linux/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd198408642944765b9305bd99404136 3 | folderAsset: yes 4 | timeCreated: 1538230728 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8c465928f1784a3fac8dc3766f7201c 3 | timeCreated: 1538230728 4 | licenseType: Free 5 | PluginImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | isOverridable: 0 12 | platformData: 13 | - first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 1 21 | Exclude Linux64: 0 22 | Exclude LinuxUniversal: 0 23 | Exclude OSXIntel: 1 24 | Exclude OSXIntel64: 1 25 | Exclude OSXUniversal: 1 26 | Exclude SamsungTV: 1 27 | Exclude Tizen: 1 28 | Exclude WebGL: 1 29 | Exclude Win: 0 30 | Exclude Win64: 0 31 | Exclude iOS: 1 32 | - first: 33 | Android: Android 34 | second: 35 | enabled: 0 36 | settings: 37 | CPU: ARMv7 38 | - first: 39 | Any: 40 | second: 41 | enabled: 0 42 | settings: {} 43 | - first: 44 | Editor: Editor 45 | second: 46 | enabled: 1 47 | settings: 48 | CPU: x86_64 49 | DefaultValueInitialized: true 50 | OS: Linux 51 | - first: 52 | Facebook: Win 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: AnyCPU 57 | - first: 58 | Facebook: Win64 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: AnyCPU 63 | - first: 64 | Samsung TV: SamsungTV 65 | second: 66 | enabled: 0 67 | settings: 68 | STV_MODEL: STANDARD_15 69 | - first: 70 | Standalone: Linux 71 | second: 72 | enabled: 0 73 | settings: 74 | CPU: None 75 | - first: 76 | Standalone: Linux64 77 | second: 78 | enabled: 1 79 | settings: 80 | CPU: x86_64 81 | - first: 82 | Standalone: LinuxUniversal 83 | second: 84 | enabled: 1 85 | settings: 86 | CPU: x86_64 87 | - first: 88 | Standalone: OSXIntel 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: None 93 | - first: 94 | Standalone: OSXIntel64 95 | second: 96 | enabled: 0 97 | settings: 98 | CPU: None 99 | - first: 100 | Standalone: OSXUniversal 101 | second: 102 | enabled: 0 103 | settings: 104 | CPU: None 105 | - first: 106 | Standalone: Win 107 | second: 108 | enabled: 1 109 | settings: 110 | CPU: AnyCPU 111 | - first: 112 | Standalone: Win64 113 | second: 114 | enabled: 1 115 | settings: 116 | CPU: AnyCPU 117 | - first: 118 | iPhone: iOS 119 | second: 120 | enabled: 0 121 | settings: 122 | CompileFlags: 123 | FrameworkDependencies: 124 | userData: 125 | assetBundleName: 126 | assetBundleVariant: 127 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e60958662eed5413d86143a0a69b731e 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXIntel: 1 25 | Exclude OSXIntel64: 1 26 | Exclude OSXUniversal: 1 27 | Exclude WebGL: 1 28 | Exclude Win: 0 29 | Exclude Win64: 0 30 | Exclude iOS: 1 31 | - first: 32 | : Editor 33 | second: 34 | enabled: 0 35 | settings: 36 | CPU: AnyCPU 37 | OS: AnyOS 38 | - first: 39 | Android: Android 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: ARMv7 44 | - first: 45 | Any: 46 | second: 47 | enabled: 0 48 | settings: {} 49 | - first: 50 | Editor: Editor 51 | second: 52 | enabled: 1 53 | settings: 54 | DefaultValueInitialized: true 55 | - first: 56 | Facebook: Win 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: AnyCPU 61 | - first: 62 | Facebook: Win64 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: AnyCPU 67 | - first: 68 | Standalone: Linux 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: None 73 | - first: 74 | Standalone: Linux64 75 | second: 76 | enabled: 0 77 | settings: 78 | CPU: None 79 | - first: 80 | Standalone: LinuxUniversal 81 | second: 82 | enabled: 0 83 | settings: 84 | CPU: None 85 | - first: 86 | Standalone: OSXIntel 87 | second: 88 | enabled: 0 89 | settings: 90 | CPU: None 91 | - first: 92 | Standalone: OSXIntel64 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: None 97 | - first: 98 | Standalone: OSXUniversal 99 | second: 100 | enabled: 0 101 | settings: 102 | CPU: None 103 | - first: 104 | Standalone: Win 105 | second: 106 | enabled: 1 107 | settings: 108 | CPU: AnyCPU 109 | - first: 110 | Standalone: Win64 111 | second: 112 | enabled: 1 113 | settings: 114 | CPU: AnyCPU 115 | - first: 116 | Windows Store Apps: WindowsStoreApps 117 | second: 118 | enabled: 0 119 | settings: 120 | CPU: AnyCPU 121 | - first: 122 | iPhone: iOS 123 | second: 124 | enabled: 0 125 | settings: 126 | CompileFlags: 127 | FrameworkDependencies: 128 | userData: 129 | assetBundleName: 130 | assetBundleVariant: 131 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 110fdfb459db4fc448a2ccd37e200fa4 3 | folderAsset: yes 4 | PluginImporter: 5 | externalObjects: {} 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | - first: 13 | Any: 14 | second: 15 | enabled: 0 16 | settings: {} 17 | - first: 18 | Editor: Editor 19 | second: 20 | enabled: 1 21 | settings: 22 | DefaultValueInitialized: true 23 | - first: 24 | Standalone: OSXIntel 25 | second: 26 | enabled: 1 27 | settings: {} 28 | - first: 29 | Standalone: OSXIntel64 30 | second: 31 | enabled: 1 32 | settings: {} 33 | - first: 34 | Standalone: OSXUniversal 35 | second: 36 | enabled: 1 37 | settings: {} 38 | userData: 39 | assetBundleName: 40 | assetBundleVariant: 41 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 996ea0b0fb9804844ba9595686ee3e7a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18A391 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | StandaloneFileBrowser 11 | CFBundleIdentifier 12 | com.gkngkc.sfb 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | StandaloneFileBrowser 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.0 29 | CSResourcesFileMapped 30 | 31 | DTCompiler 32 | com.apple.compilers.llvm.clang.1_0 33 | DTPlatformBuild 34 | 10A255 35 | DTPlatformVersion 36 | GM 37 | DTSDKBuild 38 | 18A384 39 | DTSDKName 40 | macosx10.14 41 | DTXcode 42 | 1000 43 | DTXcodeBuild 44 | 10A255 45 | 46 | 47 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce685769797f44046afa3e567860c94c 3 | timeCreated: 1505756861 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5a66f5db020f344c9327188aec2c060 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddf122e0e89124ce78aacfeecb3ec554 3 | timeCreated: 1508179371 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib: -------------------------------------------------------------------------------- 1 | var StandaloneFileBrowserWebGLPlugin = { 2 | // Open file. 3 | // gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage. 4 | // methodNamePtr: Callback method name on given GameObject. 5 | // filter: Filter files. Example filters: 6 | // Match all image files: "image/*" 7 | // Match all video files: "video/*" 8 | // Match all audio files: "audio/*" 9 | // Custom: ".plist, .xml, .yaml" 10 | // multiselect: Allows multiple file selection 11 | UploadFile: function(gameObjectNamePtr, methodNamePtr, filterPtr, multiselect) { 12 | gameObjectName = Pointer_stringify(gameObjectNamePtr); 13 | methodName = Pointer_stringify(methodNamePtr); 14 | filter = Pointer_stringify(filterPtr); 15 | 16 | // Delete if element exist 17 | var fileInput = document.getElementById(gameObjectName) 18 | if (fileInput) { 19 | document.body.removeChild(fileInput); 20 | } 21 | 22 | fileInput = document.createElement('input'); 23 | fileInput.setAttribute('id', gameObjectName); 24 | fileInput.setAttribute('type', 'file'); 25 | fileInput.setAttribute('style','display:none;'); 26 | fileInput.setAttribute('style','visibility:hidden;'); 27 | if (multiselect) { 28 | fileInput.setAttribute('multiple', ''); 29 | } 30 | if (filter) { 31 | fileInput.setAttribute('accept', filter); 32 | } 33 | fileInput.onclick = function (event) { 34 | // File dialog opened 35 | this.value = null; 36 | }; 37 | fileInput.onchange = function (event) { 38 | // multiselect works 39 | var urls = []; 40 | for (var i = 0; i < event.target.files.length; i++) { 41 | urls.push(URL.createObjectURL(event.target.files[i])); 42 | } 43 | // File selected 44 | SendMessage(gameObjectName, methodName, urls.join()); 45 | 46 | // Remove after file selected 47 | document.body.removeChild(fileInput); 48 | } 49 | document.body.appendChild(fileInput); 50 | 51 | document.onmouseup = function() { 52 | fileInput.click(); 53 | document.onmouseup = null; 54 | } 55 | }, 56 | 57 | // Save file 58 | // DownloadFile method does not open SaveFileDialog like standalone builds, its just allows user to download file 59 | // gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage. 60 | // methodNamePtr: Callback method name on given GameObject. 61 | // filenamePtr: Filename with extension 62 | // byteArray: byte[] 63 | // byteArraySize: byte[].Length 64 | DownloadFile: function(gameObjectNamePtr, methodNamePtr, filenamePtr, byteArray, byteArraySize) { 65 | gameObjectName = Pointer_stringify(gameObjectNamePtr); 66 | methodName = Pointer_stringify(methodNamePtr); 67 | filename = Pointer_stringify(filenamePtr); 68 | 69 | var bytes = new Uint8Array(byteArraySize); 70 | for (var i = 0; i < byteArraySize; i++) { 71 | bytes[i] = HEAPU8[byteArray + i]; 72 | } 73 | 74 | var downloader = window.document.createElement('a'); 75 | downloader.setAttribute('id', gameObjectName); 76 | downloader.href = window.URL.createObjectURL(new Blob([bytes], { type: 'application/octet-stream' })); 77 | downloader.download = filename; 78 | document.body.appendChild(downloader); 79 | 80 | document.onmouseup = function() { 81 | downloader.click(); 82 | document.body.removeChild(downloader); 83 | document.onmouseup = null; 84 | 85 | SendMessage(gameObjectName, methodName); 86 | } 87 | } 88 | }; 89 | 90 | mergeInto(LibraryManager.library, StandaloneFileBrowserWebGLPlugin); -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 265aaf20a6d564e0fb00a9c4a7a9c300 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXUniversal: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 1 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Facebook: WebGL 48 | second: 49 | enabled: 1 50 | settings: {} 51 | - first: 52 | Facebook: Win 53 | second: 54 | enabled: 0 55 | settings: 56 | CPU: AnyCPU 57 | - first: 58 | Facebook: Win64 59 | second: 60 | enabled: 0 61 | settings: 62 | CPU: AnyCPU 63 | - first: 64 | Standalone: Linux 65 | second: 66 | enabled: 0 67 | settings: 68 | CPU: x86 69 | - first: 70 | Standalone: Linux64 71 | second: 72 | enabled: 0 73 | settings: 74 | CPU: AnyCPU 75 | - first: 76 | Standalone: LinuxUniversal 77 | second: 78 | enabled: 0 79 | settings: 80 | CPU: None 81 | - first: 82 | Standalone: OSXUniversal 83 | second: 84 | enabled: 0 85 | settings: 86 | CPU: AnyCPU 87 | - first: 88 | Standalone: Win 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: AnyCPU 93 | - first: 94 | Standalone: Win64 95 | second: 96 | enabled: 0 97 | settings: 98 | CPU: AnyCPU 99 | - first: 100 | WebGL: WebGL 101 | second: 102 | enabled: 1 103 | settings: {} 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d459a96865cc4aaab657012c6dc4833 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 1 22 | Exclude Linux64: 1 23 | Exclude LinuxUniversal: 1 24 | Exclude OSXIntel: 1 25 | Exclude OSXIntel64: 1 26 | Exclude OSXUniversal: 1 27 | Exclude WebGL: 1 28 | Exclude Win: 0 29 | Exclude Win64: 0 30 | Exclude iOS: 1 31 | - first: 32 | : Editor 33 | second: 34 | enabled: 0 35 | settings: 36 | CPU: AnyCPU 37 | OS: AnyOS 38 | - first: 39 | Android: Android 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: ARMv7 44 | - first: 45 | Any: 46 | second: 47 | enabled: 0 48 | settings: {} 49 | - first: 50 | Editor: Editor 51 | second: 52 | enabled: 1 53 | settings: 54 | DefaultValueInitialized: true 55 | - first: 56 | Facebook: Win 57 | second: 58 | enabled: 0 59 | settings: 60 | CPU: AnyCPU 61 | - first: 62 | Facebook: Win64 63 | second: 64 | enabled: 0 65 | settings: 66 | CPU: AnyCPU 67 | - first: 68 | Standalone: Linux 69 | second: 70 | enabled: 0 71 | settings: 72 | CPU: None 73 | - first: 74 | Standalone: Linux64 75 | second: 76 | enabled: 0 77 | settings: 78 | CPU: None 79 | - first: 80 | Standalone: LinuxUniversal 81 | second: 82 | enabled: 0 83 | settings: 84 | CPU: None 85 | - first: 86 | Standalone: OSXIntel 87 | second: 88 | enabled: 0 89 | settings: 90 | CPU: None 91 | - first: 92 | Standalone: OSXIntel64 93 | second: 94 | enabled: 0 95 | settings: 96 | CPU: None 97 | - first: 98 | Standalone: OSXUniversal 99 | second: 100 | enabled: 0 101 | settings: 102 | CPU: None 103 | - first: 104 | Standalone: Win 105 | second: 106 | enabled: 1 107 | settings: 108 | CPU: AnyCPU 109 | - first: 110 | Standalone: Win64 111 | second: 112 | enabled: 1 113 | settings: 114 | CPU: AnyCPU 115 | - first: 116 | Windows Store Apps: WindowsStoreApps 117 | second: 118 | enabled: 0 119 | settings: 120 | CPU: AnyCPU 121 | - first: 122 | iPhone: iOS 123 | second: 124 | enabled: 0 125 | settings: 126 | CompileFlags: 127 | FrameworkDependencies: 128 | userData: 129 | assetBundleName: 130 | assetBundleVariant: 131 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SFB { 4 | public struct ExtensionFilter { 5 | public string Name; 6 | public string[] Extensions; 7 | 8 | public ExtensionFilter(string filterName, params string[] filterExtensions) { 9 | Name = filterName; 10 | Extensions = filterExtensions; 11 | } 12 | } 13 | 14 | public class StandaloneFileBrowser { 15 | private static IStandaloneFileBrowser _platformWrapper = null; 16 | 17 | static StandaloneFileBrowser() { 18 | #if UNITY_STANDALONE_OSX 19 | _platformWrapper = new StandaloneFileBrowserMac(); 20 | #elif UNITY_STANDALONE_WIN 21 | _platformWrapper = new StandaloneFileBrowserWindows(); 22 | #elif UNITY_STANDALONE_LINUX 23 | _platformWrapper = new StandaloneFileBrowserLinux(); 24 | #elif UNITY_EDITOR 25 | _platformWrapper = new StandaloneFileBrowserEditor(); 26 | #endif 27 | } 28 | 29 | /// 30 | /// Native open file dialog 31 | /// 32 | /// Dialog title 33 | /// Root directory 34 | /// Allowed extension 35 | /// Allow multiple file selection 36 | /// Returns array of chosen paths. Zero length array when cancelled 37 | public static string[] OpenFilePanel(string title, string directory, string extension, bool multiselect) { 38 | var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) }; 39 | return OpenFilePanel(title, directory, extensions, multiselect); 40 | } 41 | 42 | /// 43 | /// Native open file dialog 44 | /// 45 | /// Dialog title 46 | /// Root directory 47 | /// List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png") 48 | /// Allow multiple file selection 49 | /// Returns array of chosen paths. Zero length array when cancelled 50 | public static string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 51 | return _platformWrapper.OpenFilePanel(title, directory, extensions, multiselect); 52 | } 53 | 54 | /// 55 | /// Native open file dialog async 56 | /// 57 | /// Dialog title 58 | /// Root directory 59 | /// Allowed extension 60 | /// Allow multiple file selection 61 | /// Callback") 62 | public static void OpenFilePanelAsync(string title, string directory, string extension, bool multiselect, Action cb) { 63 | var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) }; 64 | OpenFilePanelAsync(title, directory, extensions, multiselect, cb); 65 | } 66 | 67 | /// 68 | /// Native open file dialog async 69 | /// 70 | /// Dialog title 71 | /// Root directory 72 | /// List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png") 73 | /// Allow multiple file selection 74 | /// Callback") 75 | public static void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 76 | _platformWrapper.OpenFilePanelAsync(title, directory, extensions, multiselect, cb); 77 | } 78 | 79 | /// 80 | /// Native open folder dialog 81 | /// NOTE: Multiple folder selection doesn't supported on Windows 82 | /// 83 | /// 84 | /// Root directory 85 | /// 86 | /// Returns array of chosen paths. Zero length array when cancelled 87 | public static string[] OpenFolderPanel(string title, string directory, bool multiselect) { 88 | return _platformWrapper.OpenFolderPanel(title, directory, multiselect); 89 | } 90 | 91 | /// 92 | /// Native open folder dialog async 93 | /// NOTE: Multiple folder selection doesn't supported on Windows 94 | /// 95 | /// 96 | /// Root directory 97 | /// 98 | /// Callback") 99 | public static void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 100 | _platformWrapper.OpenFolderPanelAsync(title, directory, multiselect, cb); 101 | } 102 | 103 | /// 104 | /// Native save file dialog 105 | /// 106 | /// Dialog title 107 | /// Root directory 108 | /// Default file name 109 | /// File extension 110 | /// Returns chosen path. Empty string when cancelled 111 | public static string SaveFilePanel(string title, string directory, string defaultName , string extension) { 112 | var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) }; 113 | return SaveFilePanel(title, directory, defaultName, extensions); 114 | } 115 | 116 | /// 117 | /// Native save file dialog 118 | /// 119 | /// Dialog title 120 | /// Root directory 121 | /// Default file name 122 | /// List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png") 123 | /// Returns chosen path. Empty string when cancelled 124 | public static string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 125 | return _platformWrapper.SaveFilePanel(title, directory, defaultName, extensions); 126 | } 127 | 128 | /// 129 | /// Native save file dialog async 130 | /// 131 | /// Dialog title 132 | /// Root directory 133 | /// Default file name 134 | /// File extension 135 | /// Callback") 136 | public static void SaveFilePanelAsync(string title, string directory, string defaultName , string extension, Action cb) { 137 | var extensions = string.IsNullOrEmpty(extension) ? null : new [] { new ExtensionFilter("", extension) }; 138 | SaveFilePanelAsync(title, directory, defaultName, extensions, cb); 139 | } 140 | 141 | /// 142 | /// Native save file dialog async 143 | /// 144 | /// Dialog title 145 | /// Root directory 146 | /// Default file name 147 | /// List of extension filters. Filter Example: new ExtensionFilter("Image Files", "jpg", "png") 148 | /// Callback") 149 | public static void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 150 | _platformWrapper.SaveFilePanelAsync(title, directory, defaultName, extensions, cb); 151 | } 152 | } 153 | } -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c708be74128e4ced9b79eaaf80e8443 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | 3 | using System; 4 | using UnityEditor; 5 | 6 | namespace SFB { 7 | public class StandaloneFileBrowserEditor : IStandaloneFileBrowser { 8 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 9 | string path = ""; 10 | 11 | if (extensions == null) { 12 | path = EditorUtility.OpenFilePanel(title, directory, ""); 13 | } 14 | else { 15 | path = EditorUtility.OpenFilePanelWithFilters(title, directory, GetFilterFromFileExtensionList(extensions)); 16 | } 17 | 18 | return string.IsNullOrEmpty(path) ? new string[0] : new[] { path }; 19 | } 20 | 21 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 22 | cb.Invoke(OpenFilePanel(title, directory, extensions, multiselect)); 23 | } 24 | 25 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 26 | var path = EditorUtility.OpenFolderPanel(title, directory, ""); 27 | return string.IsNullOrEmpty(path) ? new string[0] : new[] {path}; 28 | } 29 | 30 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 31 | cb.Invoke(OpenFolderPanel(title, directory, multiselect)); 32 | } 33 | 34 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 35 | var ext = extensions != null ? extensions[0].Extensions[0] : ""; 36 | var name = string.IsNullOrEmpty(ext) ? defaultName : defaultName + "." + ext; 37 | return EditorUtility.SaveFilePanel(title, directory, name, ext); 38 | } 39 | 40 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 41 | cb.Invoke(SaveFilePanel(title, directory, defaultName, extensions)); 42 | } 43 | 44 | // EditorUtility.OpenFilePanelWithFilters extension filter format 45 | private static string[] GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 46 | var filters = new string[extensions.Length * 2]; 47 | for (int i = 0; i < extensions.Length; i++) { 48 | filters[(i * 2)] = extensions[i].Name; 49 | filters[(i * 2) + 1] = string.Join(",", extensions[i].Extensions); 50 | } 51 | return filters; 52 | } 53 | } 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2650af8de2cda46b99b1bc7cf5d30ca5 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_LINUX 2 | 3 | using System; 4 | using System.IO; 5 | using System.Runtime.InteropServices; 6 | using UnityEngine; 7 | 8 | namespace SFB { 9 | 10 | public class StandaloneFileBrowserLinux : IStandaloneFileBrowser { 11 | 12 | private static Action _openFileCb; 13 | private static Action _openFolderCb; 14 | private static Action _saveFileCb; 15 | 16 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 17 | public delegate void AsyncCallback(string path); 18 | 19 | [DllImport("StandaloneFileBrowser")] 20 | private static extern void DialogInit(); 21 | [DllImport("StandaloneFileBrowser")] 22 | private static extern IntPtr DialogOpenFilePanel(string title, string directory, string extension, bool multiselect); 23 | [DllImport("StandaloneFileBrowser")] 24 | private static extern void DialogOpenFilePanelAsync(string title, string directory, string extension, bool multiselect, AsyncCallback callback); 25 | [DllImport("StandaloneFileBrowser")] 26 | private static extern IntPtr DialogOpenFolderPanel(string title, string directory, bool multiselect); 27 | [DllImport("StandaloneFileBrowser")] 28 | private static extern void DialogOpenFolderPanelAsync(string title, string directory, bool multiselect, AsyncCallback callback); 29 | [DllImport("StandaloneFileBrowser")] 30 | private static extern IntPtr DialogSaveFilePanel(string title, string directory, string defaultName, string extension); 31 | [DllImport("StandaloneFileBrowser")] 32 | private static extern void DialogSaveFilePanelAsync(string title, string directory, string defaultName, string extension, AsyncCallback callback); 33 | 34 | public StandaloneFileBrowserLinux() 35 | { 36 | DialogInit(); 37 | } 38 | 39 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 40 | var paths = Marshal.PtrToStringAnsi(DialogOpenFilePanel( 41 | title, 42 | directory, 43 | GetFilterFromFileExtensionList(extensions), 44 | multiselect)); 45 | return paths.Split((char)28); 46 | } 47 | 48 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 49 | _openFileCb = cb; 50 | DialogOpenFilePanelAsync( 51 | title, 52 | directory, 53 | GetFilterFromFileExtensionList(extensions), 54 | multiselect, 55 | (string result) => { _openFileCb.Invoke(result.Split((char)28)); }); 56 | } 57 | 58 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 59 | var paths = Marshal.PtrToStringAnsi(DialogOpenFolderPanel( 60 | title, 61 | directory, 62 | multiselect)); 63 | return paths.Split((char)28); 64 | } 65 | 66 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 67 | _openFolderCb = cb; 68 | DialogOpenFolderPanelAsync( 69 | title, 70 | directory, 71 | multiselect, 72 | (string result) => { _openFolderCb.Invoke(result.Split((char)28)); }); 73 | } 74 | 75 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 76 | return Marshal.PtrToStringAnsi(DialogSaveFilePanel( 77 | title, 78 | directory, 79 | defaultName, 80 | GetFilterFromFileExtensionList(extensions))); 81 | } 82 | 83 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 84 | _saveFileCb = cb; 85 | DialogSaveFilePanelAsync( 86 | title, 87 | directory, 88 | defaultName, 89 | GetFilterFromFileExtensionList(extensions), 90 | (string result) => { _saveFileCb.Invoke(result); }); 91 | } 92 | 93 | private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 94 | if (extensions == null) { 95 | return ""; 96 | } 97 | 98 | var filterString = ""; 99 | foreach (var filter in extensions) { 100 | filterString += filter.Name + ";"; 101 | 102 | foreach (var ext in filter.Extensions) { 103 | filterString += ext + ","; 104 | } 105 | 106 | filterString = filterString.Remove(filterString.Length - 1); 107 | filterString += "|"; 108 | } 109 | filterString = filterString.Remove(filterString.Length - 1); 110 | return filterString; 111 | } 112 | } 113 | } 114 | 115 | #endif -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d3a668018554b8a89c3fe12de72b60c 3 | timeCreated: 1538067919 -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserMac.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_OSX 2 | 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace SFB { 7 | public class StandaloneFileBrowserMac : IStandaloneFileBrowser { 8 | private static Action _openFileCb; 9 | private static Action _openFolderCb; 10 | private static Action _saveFileCb; 11 | 12 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 13 | public delegate void AsyncCallback(string path); 14 | 15 | [AOT.MonoPInvokeCallback(typeof(AsyncCallback))] 16 | private static void openFileCb(string result) { 17 | _openFileCb.Invoke(result.Split((char)28)); 18 | } 19 | 20 | [AOT.MonoPInvokeCallback(typeof(AsyncCallback))] 21 | private static void openFolderCb(string result) { 22 | _openFolderCb.Invoke(result.Split((char)28)); 23 | } 24 | 25 | [AOT.MonoPInvokeCallback(typeof(AsyncCallback))] 26 | private static void saveFileCb(string result) { 27 | _saveFileCb.Invoke(result); 28 | } 29 | 30 | [DllImport("StandaloneFileBrowser")] 31 | private static extern IntPtr DialogOpenFilePanel(string title, string directory, string extension, bool multiselect); 32 | [DllImport("StandaloneFileBrowser")] 33 | private static extern void DialogOpenFilePanelAsync(string title, string directory, string extension, bool multiselect, AsyncCallback callback); 34 | [DllImport("StandaloneFileBrowser")] 35 | private static extern IntPtr DialogOpenFolderPanel(string title, string directory, bool multiselect); 36 | [DllImport("StandaloneFileBrowser")] 37 | private static extern void DialogOpenFolderPanelAsync(string title, string directory, bool multiselect, AsyncCallback callback); 38 | [DllImport("StandaloneFileBrowser")] 39 | private static extern IntPtr DialogSaveFilePanel(string title, string directory, string defaultName, string extension); 40 | [DllImport("StandaloneFileBrowser")] 41 | private static extern void DialogSaveFilePanelAsync(string title, string directory, string defaultName, string extension, AsyncCallback callback); 42 | 43 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 44 | var paths = Marshal.PtrToStringAnsi(DialogOpenFilePanel( 45 | title, 46 | directory, 47 | GetFilterFromFileExtensionList(extensions), 48 | multiselect)); 49 | return paths.Split((char)28); 50 | } 51 | 52 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 53 | _openFileCb = cb; 54 | DialogOpenFilePanelAsync( 55 | title, 56 | directory, 57 | GetFilterFromFileExtensionList(extensions), 58 | multiselect, 59 | openFileCb); 60 | } 61 | 62 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 63 | var paths = Marshal.PtrToStringAnsi(DialogOpenFolderPanel( 64 | title, 65 | directory, 66 | multiselect)); 67 | return paths.Split((char)28); 68 | } 69 | 70 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 71 | _openFolderCb = cb; 72 | DialogOpenFolderPanelAsync( 73 | title, 74 | directory, 75 | multiselect, 76 | openFolderCb); 77 | } 78 | 79 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 80 | return Marshal.PtrToStringAnsi(DialogSaveFilePanel( 81 | title, 82 | directory, 83 | defaultName, 84 | GetFilterFromFileExtensionList(extensions))); 85 | } 86 | 87 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 88 | _saveFileCb = cb; 89 | DialogSaveFilePanelAsync( 90 | title, 91 | directory, 92 | defaultName, 93 | GetFilterFromFileExtensionList(extensions), 94 | saveFileCb); 95 | } 96 | 97 | private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 98 | if (extensions == null) { 99 | return ""; 100 | } 101 | 102 | var filterString = ""; 103 | foreach (var filter in extensions) { 104 | filterString += filter.Name + ";"; 105 | 106 | foreach (var ext in filter.Extensions) { 107 | filterString += ext + ","; 108 | } 109 | 110 | filterString = filterString.Remove(filterString.Length - 1); 111 | filterString += "|"; 112 | } 113 | filterString = filterString.Remove(filterString.Length - 1); 114 | return filterString; 115 | } 116 | } 117 | } 118 | 119 | #endif -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserMac.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcb49ddb0ed5644fda9c3b055cafa27a 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_WIN 2 | 3 | using System; 4 | using System.IO; 5 | using System.Windows.Forms; 6 | using System.Runtime.InteropServices; 7 | using Ookii.Dialogs; 8 | 9 | namespace SFB { 10 | // For fullscreen support 11 | // - WindowWrapper class and GetActiveWindow() are required for modal file dialog. 12 | // - "PlayerSettings/Visible In Background" should be enabled, otherwise when file dialog opened app window minimizes automatically. 13 | 14 | public class WindowWrapper : IWin32Window { 15 | private IntPtr _hwnd; 16 | public WindowWrapper(IntPtr handle) { _hwnd = handle; } 17 | public IntPtr Handle { get { return _hwnd; } } 18 | } 19 | 20 | public class StandaloneFileBrowserWindows : IStandaloneFileBrowser { 21 | [DllImport("user32.dll")] 22 | private static extern IntPtr GetActiveWindow(); 23 | 24 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 25 | var fd = new VistaOpenFileDialog(); 26 | fd.Title = title; 27 | if (extensions != null) { 28 | fd.Filter = GetFilterFromFileExtensionList(extensions); 29 | fd.FilterIndex = 1; 30 | } 31 | else { 32 | fd.Filter = string.Empty; 33 | } 34 | fd.Multiselect = multiselect; 35 | if (!string.IsNullOrEmpty(directory)) { 36 | fd.FileName = GetDirectoryPath(directory); 37 | } 38 | var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); 39 | var filenames = res == DialogResult.OK ? fd.FileNames : new string[0]; 40 | fd.Dispose(); 41 | return filenames; 42 | } 43 | 44 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 45 | cb.Invoke(OpenFilePanel(title, directory, extensions, multiselect)); 46 | } 47 | 48 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 49 | var fd = new VistaFolderBrowserDialog(); 50 | fd.Description = title; 51 | if (!string.IsNullOrEmpty(directory)) { 52 | fd.SelectedPath = GetDirectoryPath(directory); 53 | } 54 | var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); 55 | var filenames = res == DialogResult.OK ? new []{ fd.SelectedPath } : new string[0]; 56 | fd.Dispose(); 57 | return filenames; 58 | } 59 | 60 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 61 | cb.Invoke(OpenFolderPanel(title, directory, multiselect)); 62 | } 63 | 64 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 65 | var fd = new VistaSaveFileDialog(); 66 | fd.Title = title; 67 | 68 | var finalFilename = ""; 69 | 70 | if (!string.IsNullOrEmpty(directory)) { 71 | finalFilename = GetDirectoryPath(directory); 72 | } 73 | 74 | if (!string.IsNullOrEmpty(defaultName)) { 75 | finalFilename += defaultName; 76 | } 77 | 78 | fd.FileName = finalFilename; 79 | if (extensions != null) { 80 | fd.Filter = GetFilterFromFileExtensionList(extensions); 81 | fd.FilterIndex = 1; 82 | fd.DefaultExt = extensions[0].Extensions[0]; 83 | fd.AddExtension = true; 84 | } 85 | else { 86 | fd.DefaultExt = string.Empty; 87 | fd.Filter = string.Empty; 88 | fd.AddExtension = false; 89 | } 90 | var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); 91 | var filename = res == DialogResult.OK ? fd.FileName : ""; 92 | fd.Dispose(); 93 | return filename; 94 | } 95 | 96 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 97 | cb.Invoke(SaveFilePanel(title, directory, defaultName, extensions)); 98 | } 99 | 100 | // .NET Framework FileDialog Filter format 101 | // https://msdn.microsoft.com/en-us/library/microsoft.win32.filedialog.filter 102 | private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 103 | var filterString = ""; 104 | foreach (var filter in extensions) { 105 | filterString += filter.Name + "("; 106 | 107 | foreach (var ext in filter.Extensions) { 108 | filterString += "*." + ext + ","; 109 | } 110 | 111 | filterString = filterString.Remove(filterString.Length - 1); 112 | filterString += ") |"; 113 | 114 | foreach (var ext in filter.Extensions) { 115 | filterString += "*." + ext + "; "; 116 | } 117 | 118 | filterString += "|"; 119 | } 120 | filterString = filterString.Remove(filterString.Length - 1); 121 | return filterString; 122 | } 123 | 124 | private static string GetDirectoryPath(string directory) { 125 | var directoryPath = Path.GetFullPath(directory); 126 | if (!directoryPath.EndsWith("\\")) { 127 | directoryPath += "\\"; 128 | } 129 | if (Path.GetPathRoot(directoryPath) == directoryPath) { 130 | return directory; 131 | } 132 | return Path.GetDirectoryName(directoryPath) + Path.DirectorySeparatorChar; 133 | } 134 | } 135 | } 136 | 137 | #endif -------------------------------------------------------------------------------- /ImageToGameMap/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 194e247414a78461d83ae606c1b96917 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ImageToGameMap/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.visualstudio": "2.0.12", 4 | "com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.21-preview", 5 | "com.unity.ugui": "1.0.0", 6 | "com.unity.modules.ai": "1.0.0", 7 | "com.unity.modules.androidjni": "1.0.0", 8 | "com.unity.modules.animation": "1.0.0", 9 | "com.unity.modules.assetbundle": "1.0.0", 10 | "com.unity.modules.audio": "1.0.0", 11 | "com.unity.modules.cloth": "1.0.0", 12 | "com.unity.modules.director": "1.0.0", 13 | "com.unity.modules.imageconversion": "1.0.0", 14 | "com.unity.modules.imgui": "1.0.0", 15 | "com.unity.modules.jsonserialize": "1.0.0", 16 | "com.unity.modules.particlesystem": "1.0.0", 17 | "com.unity.modules.physics": "1.0.0", 18 | "com.unity.modules.physics2d": "1.0.0", 19 | "com.unity.modules.screencapture": "1.0.0", 20 | "com.unity.modules.terrain": "1.0.0", 21 | "com.unity.modules.terrainphysics": "1.0.0", 22 | "com.unity.modules.tilemap": "1.0.0", 23 | "com.unity.modules.ui": "1.0.0", 24 | "com.unity.modules.uielements": "1.0.0", 25 | "com.unity.modules.umbra": "1.0.0", 26 | "com.unity.modules.unityanalytics": "1.0.0", 27 | "com.unity.modules.unitywebrequest": "1.0.0", 28 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 29 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 30 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 31 | "com.unity.modules.unitywebrequestwww": "1.0.0", 32 | "com.unity.modules.vehicles": "1.0.0", 33 | "com.unity.modules.video": "1.0.0", 34 | "com.unity.modules.vr": "1.0.0", 35 | "com.unity.modules.wind": "1.0.0", 36 | "com.unity.modules.xr": "1.0.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ImageToGameMap/Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ext.nunit": { 4 | "version": "1.0.6", 5 | "depth": 2, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ide.visualstudio": { 11 | "version": "2.0.12", 12 | "depth": 0, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.test-framework": "1.1.9" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.sysroot": { 20 | "version": "0.1.19-preview", 21 | "depth": 1, 22 | "source": "registry", 23 | "dependencies": {}, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.sysroot.linux-x86_64": { 27 | "version": "0.1.14-preview", 28 | "depth": 1, 29 | "source": "registry", 30 | "dependencies": { 31 | "com.unity.sysroot": "0.1.18-preview" 32 | }, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.test-framework": { 36 | "version": "1.1.29", 37 | "depth": 1, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.ext.nunit": "1.0.6", 41 | "com.unity.modules.imgui": "1.0.0", 42 | "com.unity.modules.jsonserialize": "1.0.0" 43 | }, 44 | "url": "https://packages.unity.com" 45 | }, 46 | "com.unity.toolchain.win-x86_64-linux-x86_64": { 47 | "version": "0.1.21-preview", 48 | "depth": 0, 49 | "source": "registry", 50 | "dependencies": { 51 | "com.unity.sysroot": "0.1.19-preview", 52 | "com.unity.sysroot.linux-x86_64": "0.1.14-preview" 53 | }, 54 | "url": "https://packages.unity.com" 55 | }, 56 | "com.unity.ugui": { 57 | "version": "1.0.0", 58 | "depth": 0, 59 | "source": "builtin", 60 | "dependencies": { 61 | "com.unity.modules.ui": "1.0.0", 62 | "com.unity.modules.imgui": "1.0.0" 63 | } 64 | }, 65 | "com.unity.modules.ai": { 66 | "version": "1.0.0", 67 | "depth": 0, 68 | "source": "builtin", 69 | "dependencies": {} 70 | }, 71 | "com.unity.modules.androidjni": { 72 | "version": "1.0.0", 73 | "depth": 0, 74 | "source": "builtin", 75 | "dependencies": {} 76 | }, 77 | "com.unity.modules.animation": { 78 | "version": "1.0.0", 79 | "depth": 0, 80 | "source": "builtin", 81 | "dependencies": {} 82 | }, 83 | "com.unity.modules.assetbundle": { 84 | "version": "1.0.0", 85 | "depth": 0, 86 | "source": "builtin", 87 | "dependencies": {} 88 | }, 89 | "com.unity.modules.audio": { 90 | "version": "1.0.0", 91 | "depth": 0, 92 | "source": "builtin", 93 | "dependencies": {} 94 | }, 95 | "com.unity.modules.cloth": { 96 | "version": "1.0.0", 97 | "depth": 0, 98 | "source": "builtin", 99 | "dependencies": { 100 | "com.unity.modules.physics": "1.0.0" 101 | } 102 | }, 103 | "com.unity.modules.director": { 104 | "version": "1.0.0", 105 | "depth": 0, 106 | "source": "builtin", 107 | "dependencies": { 108 | "com.unity.modules.audio": "1.0.0", 109 | "com.unity.modules.animation": "1.0.0" 110 | } 111 | }, 112 | "com.unity.modules.imageconversion": { 113 | "version": "1.0.0", 114 | "depth": 0, 115 | "source": "builtin", 116 | "dependencies": {} 117 | }, 118 | "com.unity.modules.imgui": { 119 | "version": "1.0.0", 120 | "depth": 0, 121 | "source": "builtin", 122 | "dependencies": {} 123 | }, 124 | "com.unity.modules.jsonserialize": { 125 | "version": "1.0.0", 126 | "depth": 0, 127 | "source": "builtin", 128 | "dependencies": {} 129 | }, 130 | "com.unity.modules.particlesystem": { 131 | "version": "1.0.0", 132 | "depth": 0, 133 | "source": "builtin", 134 | "dependencies": {} 135 | }, 136 | "com.unity.modules.physics": { 137 | "version": "1.0.0", 138 | "depth": 0, 139 | "source": "builtin", 140 | "dependencies": {} 141 | }, 142 | "com.unity.modules.physics2d": { 143 | "version": "1.0.0", 144 | "depth": 0, 145 | "source": "builtin", 146 | "dependencies": {} 147 | }, 148 | "com.unity.modules.screencapture": { 149 | "version": "1.0.0", 150 | "depth": 0, 151 | "source": "builtin", 152 | "dependencies": { 153 | "com.unity.modules.imageconversion": "1.0.0" 154 | } 155 | }, 156 | "com.unity.modules.subsystems": { 157 | "version": "1.0.0", 158 | "depth": 1, 159 | "source": "builtin", 160 | "dependencies": { 161 | "com.unity.modules.jsonserialize": "1.0.0" 162 | } 163 | }, 164 | "com.unity.modules.terrain": { 165 | "version": "1.0.0", 166 | "depth": 0, 167 | "source": "builtin", 168 | "dependencies": {} 169 | }, 170 | "com.unity.modules.terrainphysics": { 171 | "version": "1.0.0", 172 | "depth": 0, 173 | "source": "builtin", 174 | "dependencies": { 175 | "com.unity.modules.physics": "1.0.0", 176 | "com.unity.modules.terrain": "1.0.0" 177 | } 178 | }, 179 | "com.unity.modules.tilemap": { 180 | "version": "1.0.0", 181 | "depth": 0, 182 | "source": "builtin", 183 | "dependencies": { 184 | "com.unity.modules.physics2d": "1.0.0" 185 | } 186 | }, 187 | "com.unity.modules.ui": { 188 | "version": "1.0.0", 189 | "depth": 0, 190 | "source": "builtin", 191 | "dependencies": {} 192 | }, 193 | "com.unity.modules.uielements": { 194 | "version": "1.0.0", 195 | "depth": 0, 196 | "source": "builtin", 197 | "dependencies": { 198 | "com.unity.modules.ui": "1.0.0", 199 | "com.unity.modules.imgui": "1.0.0", 200 | "com.unity.modules.jsonserialize": "1.0.0", 201 | "com.unity.modules.uielementsnative": "1.0.0" 202 | } 203 | }, 204 | "com.unity.modules.uielementsnative": { 205 | "version": "1.0.0", 206 | "depth": 1, 207 | "source": "builtin", 208 | "dependencies": { 209 | "com.unity.modules.ui": "1.0.0", 210 | "com.unity.modules.imgui": "1.0.0", 211 | "com.unity.modules.jsonserialize": "1.0.0" 212 | } 213 | }, 214 | "com.unity.modules.umbra": { 215 | "version": "1.0.0", 216 | "depth": 0, 217 | "source": "builtin", 218 | "dependencies": {} 219 | }, 220 | "com.unity.modules.unityanalytics": { 221 | "version": "1.0.0", 222 | "depth": 0, 223 | "source": "builtin", 224 | "dependencies": { 225 | "com.unity.modules.unitywebrequest": "1.0.0", 226 | "com.unity.modules.jsonserialize": "1.0.0" 227 | } 228 | }, 229 | "com.unity.modules.unitywebrequest": { 230 | "version": "1.0.0", 231 | "depth": 0, 232 | "source": "builtin", 233 | "dependencies": {} 234 | }, 235 | "com.unity.modules.unitywebrequestassetbundle": { 236 | "version": "1.0.0", 237 | "depth": 0, 238 | "source": "builtin", 239 | "dependencies": { 240 | "com.unity.modules.assetbundle": "1.0.0", 241 | "com.unity.modules.unitywebrequest": "1.0.0" 242 | } 243 | }, 244 | "com.unity.modules.unitywebrequestaudio": { 245 | "version": "1.0.0", 246 | "depth": 0, 247 | "source": "builtin", 248 | "dependencies": { 249 | "com.unity.modules.unitywebrequest": "1.0.0", 250 | "com.unity.modules.audio": "1.0.0" 251 | } 252 | }, 253 | "com.unity.modules.unitywebrequesttexture": { 254 | "version": "1.0.0", 255 | "depth": 0, 256 | "source": "builtin", 257 | "dependencies": { 258 | "com.unity.modules.unitywebrequest": "1.0.0", 259 | "com.unity.modules.imageconversion": "1.0.0" 260 | } 261 | }, 262 | "com.unity.modules.unitywebrequestwww": { 263 | "version": "1.0.0", 264 | "depth": 0, 265 | "source": "builtin", 266 | "dependencies": { 267 | "com.unity.modules.unitywebrequest": "1.0.0", 268 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 269 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 270 | "com.unity.modules.audio": "1.0.0", 271 | "com.unity.modules.assetbundle": "1.0.0", 272 | "com.unity.modules.imageconversion": "1.0.0" 273 | } 274 | }, 275 | "com.unity.modules.vehicles": { 276 | "version": "1.0.0", 277 | "depth": 0, 278 | "source": "builtin", 279 | "dependencies": { 280 | "com.unity.modules.physics": "1.0.0" 281 | } 282 | }, 283 | "com.unity.modules.video": { 284 | "version": "1.0.0", 285 | "depth": 0, 286 | "source": "builtin", 287 | "dependencies": { 288 | "com.unity.modules.audio": "1.0.0", 289 | "com.unity.modules.ui": "1.0.0", 290 | "com.unity.modules.unitywebrequest": "1.0.0" 291 | } 292 | }, 293 | "com.unity.modules.vr": { 294 | "version": "1.0.0", 295 | "depth": 0, 296 | "source": "builtin", 297 | "dependencies": { 298 | "com.unity.modules.jsonserialize": "1.0.0", 299 | "com.unity.modules.physics": "1.0.0", 300 | "com.unity.modules.xr": "1.0.0" 301 | } 302 | }, 303 | "com.unity.modules.wind": { 304 | "version": "1.0.0", 305 | "depth": 0, 306 | "source": "builtin", 307 | "dependencies": {} 308 | }, 309 | "com.unity.modules.xr": { 310 | "version": "1.0.0", 311 | "depth": 0, 312 | "source": "builtin", 313 | "dependencies": { 314 | "com.unity.modules.physics": "1.0.0", 315 | "com.unity.modules.jsonserialize": "1.0.0", 316 | "com.unity.modules.subsystems": "1.0.0" 317 | } 318 | } 319 | } 320 | } 321 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 9fc0d4010bbf28b4594072e72b8655ab 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 23 7 | productGUID: c55bff817bafdcc44a0af4a3b7a1b8a2 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: TextTiler 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 512 46 | defaultScreenHeight: 150 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | mipStripping: 0 53 | numberOfMipsStripped: 0 54 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 55 | iosShowActivityIndicatorOnLoading: -1 56 | androidShowActivityIndicatorOnLoading: -1 57 | iosUseCustomAppBackgroundBehavior: 0 58 | iosAllowHTTPDownload: 1 59 | allowedAutorotateToPortrait: 1 60 | allowedAutorotateToPortraitUpsideDown: 1 61 | allowedAutorotateToLandscapeRight: 1 62 | allowedAutorotateToLandscapeLeft: 1 63 | useOSAutorotation: 1 64 | use32BitDisplayBuffer: 1 65 | preserveFramebufferAlpha: 0 66 | disableDepthAndStencilBuffers: 0 67 | androidStartInFullscreen: 1 68 | androidRenderOutsideSafeArea: 1 69 | androidUseSwappy: 1 70 | androidBlitType: 0 71 | androidResizableWindow: 0 72 | androidDefaultWindowWidth: 1920 73 | androidDefaultWindowHeight: 1080 74 | androidMinimumWindowWidth: 400 75 | androidMinimumWindowHeight: 300 76 | androidFullscreenMode: 1 77 | defaultIsNativeResolution: 1 78 | macRetinaSupport: 1 79 | runInBackground: 1 80 | captureSingleScreen: 0 81 | muteOtherAudioSources: 0 82 | Prepare IOS For Recording: 0 83 | Force IOS Speakers When Recording: 0 84 | deferSystemGesturesMode: 0 85 | hideHomeButton: 0 86 | submitAnalytics: 1 87 | usePlayerLog: 1 88 | bakeCollisionMeshes: 0 89 | forceSingleInstance: 0 90 | useFlipModelSwapchain: 1 91 | resizableWindow: 0 92 | useMacAppStoreValidation: 0 93 | macAppStoreCategory: public.app-category.games 94 | gpuSkinning: 1 95 | xboxPIXTextureCapture: 0 96 | xboxEnableAvatar: 0 97 | xboxEnableKinect: 0 98 | xboxEnableKinectAutoTracking: 0 99 | xboxEnableFitness: 0 100 | visibleInBackground: 1 101 | allowFullscreenSwitch: 0 102 | fullscreenMode: 3 103 | xboxSpeechDB: 0 104 | xboxEnableHeadOrientation: 0 105 | xboxEnableGuest: 0 106 | xboxEnablePIXSampling: 0 107 | metalFramebufferOnly: 0 108 | xboxOneResolution: 0 109 | xboxOneSResolution: 0 110 | xboxOneXResolution: 3 111 | xboxOneMonoLoggingLevel: 0 112 | xboxOneLoggingLevel: 1 113 | xboxOneDisableEsram: 0 114 | xboxOneEnableTypeOptimization: 0 115 | xboxOnePresentImmediateThreshold: 0 116 | switchQueueCommandMemory: 0 117 | switchQueueControlMemory: 16384 118 | switchQueueComputeMemory: 262144 119 | switchNVNShaderPoolsGranularity: 33554432 120 | switchNVNDefaultPoolsGranularity: 16777216 121 | switchNVNOtherPoolsGranularity: 16777216 122 | switchNVNMaxPublicTextureIDCount: 0 123 | switchNVNMaxPublicSamplerIDCount: 0 124 | stadiaPresentMode: 0 125 | stadiaTargetFramerate: 0 126 | vulkanNumSwapchainBuffers: 3 127 | vulkanEnableSetSRGBWrite: 0 128 | vulkanEnablePreTransform: 0 129 | vulkanEnableLateAcquireNextImage: 0 130 | vulkanEnableCommandBufferRecycling: 1 131 | m_SupportedAspectRatios: 132 | 4:3: 1 133 | 5:4: 1 134 | 16:10: 1 135 | 16:9: 1 136 | Others: 1 137 | bundleVersion: 0.1 138 | preloadedAssets: [] 139 | metroInputSource: 0 140 | wsaTransparentSwapchain: 0 141 | m_HolographicPauseOnTrackingLoss: 1 142 | xboxOneDisableKinectGpuReservation: 1 143 | xboxOneEnable7thCore: 1 144 | vrSettings: 145 | enable360StereoCapture: 0 146 | isWsaHolographicRemotingEnabled: 0 147 | enableFrameTimingStats: 0 148 | useHDRDisplay: 0 149 | D3DHDRBitDepth: 0 150 | m_ColorGamuts: 00000000 151 | targetPixelDensity: 30 152 | resolutionScalingMode: 0 153 | androidSupportedAspectRatio: 1 154 | androidMaxAspectRatio: 2.1 155 | applicationIdentifier: 156 | Standalone: com.DefaultCompany.TextTiler 157 | buildNumber: 158 | Standalone: 0 159 | iPhone: 0 160 | tvOS: 0 161 | overrideDefaultApplicationIdentifier: 0 162 | AndroidBundleVersionCode: 1 163 | AndroidMinSdkVersion: 22 164 | AndroidTargetSdkVersion: 0 165 | AndroidPreferredInstallLocation: 1 166 | aotOptions: 167 | stripEngineCode: 1 168 | iPhoneStrippingLevel: 0 169 | iPhoneScriptCallOptimization: 0 170 | ForceInternetPermission: 0 171 | ForceSDCardPermission: 0 172 | CreateWallpaper: 0 173 | APKExpansionFiles: 0 174 | keepLoadedShadersAlive: 0 175 | StripUnusedMeshComponents: 1 176 | VertexChannelCompressionMask: 4054 177 | iPhoneSdkVersion: 988 178 | iOSTargetOSVersionString: 11.0 179 | tvOSSdkVersion: 0 180 | tvOSRequireExtendedGameController: 0 181 | tvOSTargetOSVersionString: 11.0 182 | uIPrerenderedIcon: 0 183 | uIRequiresPersistentWiFi: 0 184 | uIRequiresFullScreen: 1 185 | uIStatusBarHidden: 1 186 | uIExitOnSuspend: 0 187 | uIStatusBarStyle: 0 188 | appleTVSplashScreen: {fileID: 0} 189 | appleTVSplashScreen2x: {fileID: 0} 190 | tvOSSmallIconLayers: [] 191 | tvOSSmallIconLayers2x: [] 192 | tvOSLargeIconLayers: [] 193 | tvOSLargeIconLayers2x: [] 194 | tvOSTopShelfImageLayers: [] 195 | tvOSTopShelfImageLayers2x: [] 196 | tvOSTopShelfImageWideLayers: [] 197 | tvOSTopShelfImageWideLayers2x: [] 198 | iOSLaunchScreenType: 0 199 | iOSLaunchScreenPortrait: {fileID: 0} 200 | iOSLaunchScreenLandscape: {fileID: 0} 201 | iOSLaunchScreenBackgroundColor: 202 | serializedVersion: 2 203 | rgba: 0 204 | iOSLaunchScreenFillPct: 100 205 | iOSLaunchScreenSize: 100 206 | iOSLaunchScreenCustomXibPath: 207 | iOSLaunchScreeniPadType: 0 208 | iOSLaunchScreeniPadImage: {fileID: 0} 209 | iOSLaunchScreeniPadBackgroundColor: 210 | serializedVersion: 2 211 | rgba: 0 212 | iOSLaunchScreeniPadFillPct: 100 213 | iOSLaunchScreeniPadSize: 100 214 | iOSLaunchScreeniPadCustomXibPath: 215 | iOSLaunchScreenCustomStoryboardPath: 216 | iOSLaunchScreeniPadCustomStoryboardPath: 217 | iOSDeviceRequirements: [] 218 | iOSURLSchemes: [] 219 | macOSURLSchemes: [] 220 | iOSBackgroundModes: 0 221 | iOSMetalForceHardShadows: 0 222 | metalEditorSupport: 1 223 | metalAPIValidation: 1 224 | iOSRenderExtraFrameOnPause: 0 225 | iosCopyPluginsCodeInsteadOfSymlink: 0 226 | appleDeveloperTeamID: 227 | iOSManualSigningProvisioningProfileID: 228 | tvOSManualSigningProvisioningProfileID: 229 | iOSManualSigningProvisioningProfileType: 0 230 | tvOSManualSigningProvisioningProfileType: 0 231 | appleEnableAutomaticSigning: 0 232 | iOSRequireARKit: 0 233 | iOSAutomaticallyDetectAndAddCapabilities: 1 234 | appleEnableProMotion: 0 235 | shaderPrecisionModel: 0 236 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 237 | templatePackageId: com.unity.template.3d@5.0.4 238 | templateDefaultScene: Assets/Scenes/SampleScene.unity 239 | useCustomMainManifest: 0 240 | useCustomLauncherManifest: 0 241 | useCustomMainGradleTemplate: 0 242 | useCustomLauncherGradleManifest: 0 243 | useCustomBaseGradleTemplate: 0 244 | useCustomGradlePropertiesTemplate: 0 245 | useCustomProguardFile: 0 246 | AndroidTargetArchitectures: 1 247 | AndroidTargetDevices: 0 248 | AndroidSplashScreenScale: 0 249 | androidSplashScreen: {fileID: 0} 250 | AndroidKeystoreName: 251 | AndroidKeyaliasName: 252 | AndroidBuildApkPerCpuArchitecture: 0 253 | AndroidTVCompatibility: 0 254 | AndroidIsGame: 1 255 | AndroidEnableTango: 0 256 | androidEnableBanner: 1 257 | androidUseLowAccuracyLocation: 0 258 | androidUseCustomKeystore: 0 259 | m_AndroidBanners: 260 | - width: 320 261 | height: 180 262 | banner: {fileID: 0} 263 | androidGamepadSupportLevel: 0 264 | chromeosInputEmulation: 1 265 | AndroidMinifyWithR8: 0 266 | AndroidMinifyRelease: 0 267 | AndroidMinifyDebug: 0 268 | AndroidValidateAppBundleSize: 1 269 | AndroidAppBundleSizeToValidate: 150 270 | m_BuildTargetIcons: [] 271 | m_BuildTargetPlatformIcons: 272 | - m_BuildTarget: Android 273 | m_Icons: 274 | - m_Textures: [] 275 | m_Width: 432 276 | m_Height: 432 277 | m_Kind: 2 278 | m_SubKind: 279 | - m_Textures: [] 280 | m_Width: 324 281 | m_Height: 324 282 | m_Kind: 2 283 | m_SubKind: 284 | - m_Textures: [] 285 | m_Width: 216 286 | m_Height: 216 287 | m_Kind: 2 288 | m_SubKind: 289 | - m_Textures: [] 290 | m_Width: 162 291 | m_Height: 162 292 | m_Kind: 2 293 | m_SubKind: 294 | - m_Textures: [] 295 | m_Width: 108 296 | m_Height: 108 297 | m_Kind: 2 298 | m_SubKind: 299 | - m_Textures: [] 300 | m_Width: 81 301 | m_Height: 81 302 | m_Kind: 2 303 | m_SubKind: 304 | - m_Textures: [] 305 | m_Width: 192 306 | m_Height: 192 307 | m_Kind: 1 308 | m_SubKind: 309 | - m_Textures: [] 310 | m_Width: 144 311 | m_Height: 144 312 | m_Kind: 1 313 | m_SubKind: 314 | - m_Textures: [] 315 | m_Width: 96 316 | m_Height: 96 317 | m_Kind: 1 318 | m_SubKind: 319 | - m_Textures: [] 320 | m_Width: 72 321 | m_Height: 72 322 | m_Kind: 1 323 | m_SubKind: 324 | - m_Textures: [] 325 | m_Width: 48 326 | m_Height: 48 327 | m_Kind: 1 328 | m_SubKind: 329 | - m_Textures: [] 330 | m_Width: 36 331 | m_Height: 36 332 | m_Kind: 1 333 | m_SubKind: 334 | - m_Textures: [] 335 | m_Width: 192 336 | m_Height: 192 337 | m_Kind: 0 338 | m_SubKind: 339 | - m_Textures: [] 340 | m_Width: 144 341 | m_Height: 144 342 | m_Kind: 0 343 | m_SubKind: 344 | - m_Textures: [] 345 | m_Width: 96 346 | m_Height: 96 347 | m_Kind: 0 348 | m_SubKind: 349 | - m_Textures: [] 350 | m_Width: 72 351 | m_Height: 72 352 | m_Kind: 0 353 | m_SubKind: 354 | - m_Textures: [] 355 | m_Width: 48 356 | m_Height: 48 357 | m_Kind: 0 358 | m_SubKind: 359 | - m_Textures: [] 360 | m_Width: 36 361 | m_Height: 36 362 | m_Kind: 0 363 | m_SubKind: 364 | m_BuildTargetBatching: 365 | - m_BuildTarget: Standalone 366 | m_StaticBatching: 1 367 | m_DynamicBatching: 0 368 | - m_BuildTarget: tvOS 369 | m_StaticBatching: 1 370 | m_DynamicBatching: 0 371 | - m_BuildTarget: Android 372 | m_StaticBatching: 1 373 | m_DynamicBatching: 0 374 | - m_BuildTarget: iPhone 375 | m_StaticBatching: 1 376 | m_DynamicBatching: 0 377 | - m_BuildTarget: WebGL 378 | m_StaticBatching: 0 379 | m_DynamicBatching: 0 380 | m_BuildTargetGraphicsJobs: 381 | - m_BuildTarget: MacStandaloneSupport 382 | m_GraphicsJobs: 0 383 | - m_BuildTarget: Switch 384 | m_GraphicsJobs: 1 385 | - m_BuildTarget: MetroSupport 386 | m_GraphicsJobs: 1 387 | - m_BuildTarget: AppleTVSupport 388 | m_GraphicsJobs: 0 389 | - m_BuildTarget: BJMSupport 390 | m_GraphicsJobs: 1 391 | - m_BuildTarget: LinuxStandaloneSupport 392 | m_GraphicsJobs: 1 393 | - m_BuildTarget: PS4Player 394 | m_GraphicsJobs: 1 395 | - m_BuildTarget: iOSSupport 396 | m_GraphicsJobs: 0 397 | - m_BuildTarget: WindowsStandaloneSupport 398 | m_GraphicsJobs: 1 399 | - m_BuildTarget: XboxOnePlayer 400 | m_GraphicsJobs: 1 401 | - m_BuildTarget: LuminSupport 402 | m_GraphicsJobs: 0 403 | - m_BuildTarget: AndroidPlayer 404 | m_GraphicsJobs: 0 405 | - m_BuildTarget: WebGLSupport 406 | m_GraphicsJobs: 0 407 | m_BuildTargetGraphicsJobMode: 408 | - m_BuildTarget: PS4Player 409 | m_GraphicsJobMode: 0 410 | - m_BuildTarget: XboxOnePlayer 411 | m_GraphicsJobMode: 0 412 | m_BuildTargetGraphicsAPIs: 413 | - m_BuildTarget: AndroidPlayer 414 | m_APIs: 150000000b000000 415 | m_Automatic: 1 416 | - m_BuildTarget: iOSSupport 417 | m_APIs: 10000000 418 | m_Automatic: 1 419 | - m_BuildTarget: AppleTVSupport 420 | m_APIs: 10000000 421 | m_Automatic: 1 422 | - m_BuildTarget: WebGLSupport 423 | m_APIs: 0b000000 424 | m_Automatic: 1 425 | m_BuildTargetVRSettings: 426 | - m_BuildTarget: Standalone 427 | m_Enabled: 0 428 | m_Devices: 429 | - Oculus 430 | - OpenVR 431 | openGLRequireES31: 0 432 | openGLRequireES31AEP: 0 433 | openGLRequireES32: 0 434 | m_TemplateCustomTags: {} 435 | mobileMTRendering: 436 | Android: 1 437 | iPhone: 1 438 | tvOS: 1 439 | m_BuildTargetGroupLightmapEncodingQuality: [] 440 | m_BuildTargetGroupLightmapSettings: [] 441 | m_BuildTargetNormalMapEncoding: [] 442 | m_BuildTargetDefaultTextureCompressionFormat: [] 443 | playModeTestRunnerEnabled: 0 444 | runPlayModeTestAsEditModeTest: 0 445 | actionOnDotNetUnhandledException: 1 446 | enableInternalProfiler: 0 447 | logObjCUncaughtExceptions: 1 448 | enableCrashReportAPI: 0 449 | cameraUsageDescription: 450 | locationUsageDescription: 451 | microphoneUsageDescription: 452 | bluetoothUsageDescription: 453 | switchNMETAOverride: 454 | switchNetLibKey: 455 | switchSocketMemoryPoolSize: 6144 456 | switchSocketAllocatorPoolSize: 128 457 | switchSocketConcurrencyLimit: 14 458 | switchScreenResolutionBehavior: 2 459 | switchUseCPUProfiler: 0 460 | switchUseGOLDLinker: 0 461 | switchLTOSetting: 0 462 | switchApplicationID: 0x01004b9000490000 463 | switchNSODependencies: 464 | switchTitleNames_0: 465 | switchTitleNames_1: 466 | switchTitleNames_2: 467 | switchTitleNames_3: 468 | switchTitleNames_4: 469 | switchTitleNames_5: 470 | switchTitleNames_6: 471 | switchTitleNames_7: 472 | switchTitleNames_8: 473 | switchTitleNames_9: 474 | switchTitleNames_10: 475 | switchTitleNames_11: 476 | switchTitleNames_12: 477 | switchTitleNames_13: 478 | switchTitleNames_14: 479 | switchTitleNames_15: 480 | switchPublisherNames_0: 481 | switchPublisherNames_1: 482 | switchPublisherNames_2: 483 | switchPublisherNames_3: 484 | switchPublisherNames_4: 485 | switchPublisherNames_5: 486 | switchPublisherNames_6: 487 | switchPublisherNames_7: 488 | switchPublisherNames_8: 489 | switchPublisherNames_9: 490 | switchPublisherNames_10: 491 | switchPublisherNames_11: 492 | switchPublisherNames_12: 493 | switchPublisherNames_13: 494 | switchPublisherNames_14: 495 | switchPublisherNames_15: 496 | switchIcons_0: {fileID: 0} 497 | switchIcons_1: {fileID: 0} 498 | switchIcons_2: {fileID: 0} 499 | switchIcons_3: {fileID: 0} 500 | switchIcons_4: {fileID: 0} 501 | switchIcons_5: {fileID: 0} 502 | switchIcons_6: {fileID: 0} 503 | switchIcons_7: {fileID: 0} 504 | switchIcons_8: {fileID: 0} 505 | switchIcons_9: {fileID: 0} 506 | switchIcons_10: {fileID: 0} 507 | switchIcons_11: {fileID: 0} 508 | switchIcons_12: {fileID: 0} 509 | switchIcons_13: {fileID: 0} 510 | switchIcons_14: {fileID: 0} 511 | switchIcons_15: {fileID: 0} 512 | switchSmallIcons_0: {fileID: 0} 513 | switchSmallIcons_1: {fileID: 0} 514 | switchSmallIcons_2: {fileID: 0} 515 | switchSmallIcons_3: {fileID: 0} 516 | switchSmallIcons_4: {fileID: 0} 517 | switchSmallIcons_5: {fileID: 0} 518 | switchSmallIcons_6: {fileID: 0} 519 | switchSmallIcons_7: {fileID: 0} 520 | switchSmallIcons_8: {fileID: 0} 521 | switchSmallIcons_9: {fileID: 0} 522 | switchSmallIcons_10: {fileID: 0} 523 | switchSmallIcons_11: {fileID: 0} 524 | switchSmallIcons_12: {fileID: 0} 525 | switchSmallIcons_13: {fileID: 0} 526 | switchSmallIcons_14: {fileID: 0} 527 | switchSmallIcons_15: {fileID: 0} 528 | switchManualHTML: 529 | switchAccessibleURLs: 530 | switchLegalInformation: 531 | switchMainThreadStackSize: 1048576 532 | switchPresenceGroupId: 533 | switchLogoHandling: 0 534 | switchReleaseVersion: 0 535 | switchDisplayVersion: 1.0.0 536 | switchStartupUserAccount: 0 537 | switchTouchScreenUsage: 0 538 | switchSupportedLanguagesMask: 0 539 | switchLogoType: 0 540 | switchApplicationErrorCodeCategory: 541 | switchUserAccountSaveDataSize: 0 542 | switchUserAccountSaveDataJournalSize: 0 543 | switchApplicationAttribute: 0 544 | switchCardSpecSize: -1 545 | switchCardSpecClock: -1 546 | switchRatingsMask: 0 547 | switchRatingsInt_0: 0 548 | switchRatingsInt_1: 0 549 | switchRatingsInt_2: 0 550 | switchRatingsInt_3: 0 551 | switchRatingsInt_4: 0 552 | switchRatingsInt_5: 0 553 | switchRatingsInt_6: 0 554 | switchRatingsInt_7: 0 555 | switchRatingsInt_8: 0 556 | switchRatingsInt_9: 0 557 | switchRatingsInt_10: 0 558 | switchRatingsInt_11: 0 559 | switchRatingsInt_12: 0 560 | switchLocalCommunicationIds_0: 561 | switchLocalCommunicationIds_1: 562 | switchLocalCommunicationIds_2: 563 | switchLocalCommunicationIds_3: 564 | switchLocalCommunicationIds_4: 565 | switchLocalCommunicationIds_5: 566 | switchLocalCommunicationIds_6: 567 | switchLocalCommunicationIds_7: 568 | switchParentalControl: 0 569 | switchAllowsScreenshot: 1 570 | switchAllowsVideoCapturing: 1 571 | switchAllowsRuntimeAddOnContentInstall: 0 572 | switchDataLossConfirmation: 0 573 | switchUserAccountLockEnabled: 0 574 | switchSystemResourceMemory: 16777216 575 | switchSupportedNpadStyles: 22 576 | switchNativeFsCacheSize: 32 577 | switchIsHoldTypeHorizontal: 0 578 | switchSupportedNpadCount: 8 579 | switchSocketConfigEnabled: 0 580 | switchTcpInitialSendBufferSize: 32 581 | switchTcpInitialReceiveBufferSize: 64 582 | switchTcpAutoSendBufferSizeMax: 256 583 | switchTcpAutoReceiveBufferSizeMax: 256 584 | switchUdpSendBufferSize: 9 585 | switchUdpReceiveBufferSize: 42 586 | switchSocketBufferEfficiency: 4 587 | switchSocketInitializeEnabled: 1 588 | switchNetworkInterfaceManagerInitializeEnabled: 1 589 | switchPlayerConnectionEnabled: 1 590 | switchUseNewStyleFilepaths: 0 591 | switchUseMicroSleepForYield: 1 592 | switchEnableRamDiskSupport: 0 593 | switchMicroSleepForYieldTime: 25 594 | switchRamDiskSpaceSize: 12 595 | ps4NPAgeRating: 12 596 | ps4NPTitleSecret: 597 | ps4NPTrophyPackPath: 598 | ps4ParentalLevel: 11 599 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 600 | ps4Category: 0 601 | ps4MasterVersion: 01.00 602 | ps4AppVersion: 01.00 603 | ps4AppType: 0 604 | ps4ParamSfxPath: 605 | ps4VideoOutPixelFormat: 0 606 | ps4VideoOutInitialWidth: 1920 607 | ps4VideoOutBaseModeInitialWidth: 1920 608 | ps4VideoOutReprojectionRate: 60 609 | ps4PronunciationXMLPath: 610 | ps4PronunciationSIGPath: 611 | ps4BackgroundImagePath: 612 | ps4StartupImagePath: 613 | ps4StartupImagesFolder: 614 | ps4IconImagesFolder: 615 | ps4SaveDataImagePath: 616 | ps4SdkOverride: 617 | ps4BGMPath: 618 | ps4ShareFilePath: 619 | ps4ShareOverlayImagePath: 620 | ps4PrivacyGuardImagePath: 621 | ps4ExtraSceSysFile: 622 | ps4NPtitleDatPath: 623 | ps4RemotePlayKeyAssignment: -1 624 | ps4RemotePlayKeyMappingDir: 625 | ps4PlayTogetherPlayerCount: 0 626 | ps4EnterButtonAssignment: 1 627 | ps4ApplicationParam1: 0 628 | ps4ApplicationParam2: 0 629 | ps4ApplicationParam3: 0 630 | ps4ApplicationParam4: 0 631 | ps4DownloadDataSize: 0 632 | ps4GarlicHeapSize: 2048 633 | ps4ProGarlicHeapSize: 2560 634 | playerPrefsMaxSize: 32768 635 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 636 | ps4pnSessions: 1 637 | ps4pnPresence: 1 638 | ps4pnFriends: 1 639 | ps4pnGameCustomData: 1 640 | playerPrefsSupport: 0 641 | enableApplicationExit: 0 642 | resetTempFolder: 1 643 | restrictedAudioUsageRights: 0 644 | ps4UseResolutionFallback: 0 645 | ps4ReprojectionSupport: 0 646 | ps4UseAudio3dBackend: 0 647 | ps4UseLowGarlicFragmentationMode: 1 648 | ps4SocialScreenEnabled: 0 649 | ps4ScriptOptimizationLevel: 0 650 | ps4Audio3dVirtualSpeakerCount: 14 651 | ps4attribCpuUsage: 0 652 | ps4PatchPkgPath: 653 | ps4PatchLatestPkgPath: 654 | ps4PatchChangeinfoPath: 655 | ps4PatchDayOne: 0 656 | ps4attribUserManagement: 0 657 | ps4attribMoveSupport: 0 658 | ps4attrib3DSupport: 0 659 | ps4attribShareSupport: 0 660 | ps4attribExclusiveVR: 0 661 | ps4disableAutoHideSplash: 0 662 | ps4videoRecordingFeaturesUsed: 0 663 | ps4contentSearchFeaturesUsed: 0 664 | ps4CompatibilityPS5: 0 665 | ps4GPU800MHz: 1 666 | ps4attribEyeToEyeDistanceSettingVR: 0 667 | ps4IncludedModules: [] 668 | ps4attribVROutputEnabled: 0 669 | monoEnv: 670 | splashScreenBackgroundSourceLandscape: {fileID: 0} 671 | splashScreenBackgroundSourcePortrait: {fileID: 0} 672 | blurSplashScreenBackground: 1 673 | spritePackerPolicy: 674 | webGLMemorySize: 16 675 | webGLExceptionSupport: 1 676 | webGLNameFilesAsHashes: 0 677 | webGLDataCaching: 1 678 | webGLDebugSymbols: 0 679 | webGLEmscriptenArgs: 680 | webGLModulesDirectory: 681 | webGLTemplate: APPLICATION:Default 682 | webGLAnalyzeBuildSize: 0 683 | webGLUseEmbeddedResources: 0 684 | webGLCompressionFormat: 1 685 | webGLWasmArithmeticExceptions: 0 686 | webGLLinkerTarget: 1 687 | webGLThreadsSupport: 0 688 | webGLDecompressionFallback: 0 689 | scriptingDefineSymbols: {} 690 | additionalCompilerArguments: {} 691 | platformArchitecture: {} 692 | scriptingBackend: {} 693 | il2cppCompilerConfiguration: {} 694 | managedStrippingLevel: {} 695 | incrementalIl2cppBuild: {} 696 | suppressCommonWarnings: 1 697 | allowUnsafeCode: 0 698 | useDeterministicCompilation: 1 699 | enableRoslynAnalyzers: 1 700 | additionalIl2CppArgs: 701 | scriptingRuntimeVersion: 1 702 | gcIncremental: 1 703 | assemblyVersionValidation: 1 704 | gcWBarrierValidation: 0 705 | apiCompatibilityLevelPerPlatform: 706 | Standalone: 3 707 | m_RenderingPath: 1 708 | m_MobileRenderingPath: 1 709 | metroPackageName: Template3D 710 | metroPackageVersion: 1.0.0.0 711 | metroCertificatePath: 712 | metroCertificatePassword: 713 | metroCertificateSubject: 714 | metroCertificateIssuer: 715 | metroCertificateNotAfter: 0000000000000000 716 | metroApplicationDescription: Template_3D 717 | wsaImages: {} 718 | metroTileShortName: TextTiler 719 | metroTileShowName: 0 720 | metroMediumTileShowName: 0 721 | metroLargeTileShowName: 0 722 | metroWideTileShowName: 0 723 | metroSupportStreamingInstall: 0 724 | metroLastRequiredScene: 0 725 | metroDefaultTileSize: 1 726 | metroTileForegroundText: 2 727 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 728 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} 729 | metroSplashScreenUseBackgroundColor: 0 730 | platformCapabilities: {} 731 | metroTargetDeviceFamilies: {} 732 | metroFTAName: 733 | metroFTAFileTypes: [] 734 | metroProtocolName: 735 | XboxOneProductId: 736 | XboxOneUpdateKey: 737 | XboxOneSandboxId: 738 | XboxOneContentId: 739 | XboxOneTitleId: 740 | XboxOneSCId: 741 | XboxOneGameOsOverridePath: 742 | XboxOnePackagingOverridePath: 743 | XboxOneAppManifestOverridePath: 744 | XboxOneVersion: 1.0.0.0 745 | XboxOnePackageEncryption: 0 746 | XboxOnePackageUpdateGranularity: 2 747 | XboxOneDescription: 748 | XboxOneLanguage: 749 | - enus 750 | XboxOneCapability: [] 751 | XboxOneGameRating: {} 752 | XboxOneIsContentPackage: 0 753 | XboxOneEnhancedXboxCompatibilityMode: 0 754 | XboxOneEnableGPUVariability: 1 755 | XboxOneSockets: {} 756 | XboxOneSplashScreen: {fileID: 0} 757 | XboxOneAllowedProductIds: [] 758 | XboxOnePersistentLocalStorageSize: 0 759 | XboxOneXTitleMemory: 8 760 | XboxOneOverrideIdentityName: 761 | XboxOneOverrideIdentityPublisher: 762 | vrEditorSettings: {} 763 | cloudServicesEnabled: 764 | UNet: 1 765 | luminIcon: 766 | m_Name: 767 | m_ModelFolderPath: 768 | m_PortalFolderPath: 769 | luminCert: 770 | m_CertPath: 771 | m_SignPackage: 1 772 | luminIsChannelApp: 0 773 | luminVersion: 774 | m_VersionCode: 1 775 | m_VersionName: 776 | apiCompatibilityLevel: 6 777 | activeInputHandler: 0 778 | cloudProjectId: 779 | framebufferDepthMemorylessMode: 0 780 | qualitySettingsNames: [] 781 | projectName: 782 | organizationId: 783 | cloudEnabled: 0 784 | legacyClampBlendShapeWeights: 0 785 | playerDataPath: 786 | forceSRGBBlit: 1 787 | virtualTexturingSupportEnabled: 0 788 | uploadClearedTextureDataAfterCreationFromScript: 1 789 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.2.7f1 2 | m_EditorVersionWithRevision: 2021.2.7f1 (6bd9e232123f) 3 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /ImageToGameMap/ProjectSettings/boot.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/ImageToGameMap/ProjectSettings/boot.config -------------------------------------------------------------------------------- /ImageToGameMap/README.md: -------------------------------------------------------------------------------- 1 | # Image To Game Map 2 | 3 | Simple tool to generate a map with the syntax used in my project for designing faster. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Gerard Gascón 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Level/MapProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "level": [ 3 | { 4 | "color": "#000000", 5 | "number": 1 6 | }, 7 | { 8 | "color": "#5FC03E", 9 | "number": 2 10 | }, 11 | { 12 | "color": "#FFF400", 13 | "number": 4 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /Level/tiles-export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/Level/tiles-export.png -------------------------------------------------------------------------------- /PlatformerEngine/.gitignore: -------------------------------------------------------------------------------- 1 | /[Mm]egaDriveProject/romexecuter/ 2 | /[Mm]egaDriveProject/out/ 3 | /[Mm]egaDriveProject/Debug/ 4 | /[Dd]ebug/ 5 | 6 | out/res 7 | out/src 8 | rom_head.bin 9 | rom_head.o 10 | rom.out 11 | sega.o 12 | symbol.txt 13 | 14 | .vs/ 15 | 16 | cloc-1.90.exe 17 | 18 | *.vcxproj 19 | *.vcxproj.filters 20 | *.vcxproj.user 21 | *.sln 22 | /x64/ -------------------------------------------------------------------------------- /PlatformerEngine/PlatformerEngine.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32526.322 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PlatformerEngine", "PlatformerEngine.vcxproj", "{3B1C7019-60F3-46F3-98EE-45B7383C4D71}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Debug|x64.ActiveCfg = Debug|x64 17 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Debug|x64.Build.0 = Debug|x64 18 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Debug|x86.ActiveCfg = Debug|Win32 19 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Debug|x86.Build.0 = Debug|Win32 20 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Release|x64.ActiveCfg = Release|x64 21 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Release|x64.Build.0 = Release|x64 22 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Release|x86.ActiveCfg = Release|Win32 23 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {B085DBF6-4DC9-40F7-9603-E734B837A346} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /PlatformerEngine/PlatformerEngine.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 17.0 23 | {3B1C7019-60F3-46F3-98EE-45B7383C4D71} 24 | Win32Proj 25 | 26 | 27 | 28 | Makefile 29 | true 30 | v143 31 | 32 | 33 | Makefile 34 | false 35 | v143 36 | 37 | 38 | Makefile 39 | true 40 | v143 41 | 42 | 43 | Makefile 44 | false 45 | v143 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | %GDK%\bin\make -f %GDK%\makefile.gen 67 | romlauncher\RomLauncher.exe 68 | _DEBUG;$(NMakePreprocessorDefinitions) 69 | C:\sgdk\inc 70 | 71 | 72 | %GDK%\bin\make -f %GDK%\makefile.gen 73 | PlatformerEngine.exe 74 | WIN32;_DEBUG;$(NMakePreprocessorDefinitions) 75 | 76 | 77 | %GDK%\bin\make -f %GDK%\makefile.gen 78 | PlatformerEngine.exe 79 | WIN32;NDEBUG;$(NMakePreprocessorDefinitions) 80 | 81 | 82 | %GDK%\bin\make -f %GDK%\makefile.gen 83 | PlatformerEngine.exe 84 | NDEBUG;$(NMakePreprocessorDefinitions) 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /PlatformerEngine/PlatformerEngine.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | Header Files 67 | 68 | 69 | Header Files 70 | 71 | 72 | -------------------------------------------------------------------------------- /PlatformerEngine/inc/camera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "types.h" 6 | #include "player.h" 7 | #include "physics.h" 8 | #include "levels.h" 9 | 10 | extern Vect2D_s16 cameraPosition; 11 | 12 | void setupCamera(Vect2D_u16 deadZoneCenter, u16 deadZoneWidth, u16 deadZoneHeight); 13 | void updateCamera(); -------------------------------------------------------------------------------- /PlatformerEngine/inc/global.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "physics.h" 6 | 7 | #define TILEMAP_PLANE BG_A 8 | 9 | #define PLAYER_PALETTE PAL1 10 | #define LEVEL_PALETTE PAL0 11 | 12 | #define GROUND_TILE 1 13 | #define LADDER_TILE 2 14 | #define ONE_WAY_PLATFORM_TILE 4 15 | 16 | extern const fix16 gravityScale; 17 | 18 | struct { 19 | u16 joy; 20 | u16 changed; 21 | u16 state; 22 | }input; 23 | 24 | extern Map* bga; 25 | 26 | extern AABB roomSize; 27 | extern AABB playerBounds; 28 | 29 | extern u16 VDPTilesFilled; -------------------------------------------------------------------------------- /PlatformerEngine/inc/levelgenerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "player.h" 6 | #include "global.h" 7 | 8 | u16 getTileValue(s16 x, s16 y); 9 | 10 | void freeCollisionMap(); 11 | void generateCollisionMap(const u8 map[][48]); -------------------------------------------------------------------------------- /PlatformerEngine/inc/levels.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "global.h" 6 | #include "types.h" 7 | 8 | typedef struct { 9 | s8 top; 10 | s8 bottom; 11 | s8 left; 12 | s8 right; 13 | }Level; 14 | 15 | void loadLevel(); 16 | 17 | extern u16 currentCurrencySpawnerEntity; -------------------------------------------------------------------------------- /PlatformerEngine/inc/map.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | extern const Vect2D_s16 levelStartPos; 6 | 7 | extern const u8 collisionMap[48][48]; 8 | -------------------------------------------------------------------------------- /PlatformerEngine/inc/physics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "types.h" 6 | 7 | u16 getTileLeftEdge(u16 x); 8 | u16 getTileRightEdge(u16 x); 9 | u16 getTileTopEdge(u16 y); 10 | u16 getTileBottomEdge(u16 y); 11 | AABB getTileBounds(s16 x, s16 y); 12 | Vect2D_u16 posToTile(Vect2D_s16 position); -------------------------------------------------------------------------------- /PlatformerEngine/inc/player.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "physics.h" 6 | #include "types.h" 7 | #include "camera.h" 8 | #include "levelgenerator.h" 9 | 10 | struct pBody { 11 | Sprite* sprite; 12 | AABB aabb; 13 | AABB climbingStairAABB; 14 | 15 | int facingDirection; 16 | int speed; 17 | fix16 acceleration; 18 | fix16 deceleration; 19 | int climbingSpeed; 20 | u16 maxFallSpeed; 21 | u16 jumpSpeed; 22 | 23 | u16 currentAnimation; 24 | 25 | bool onGround; 26 | bool onStair; 27 | bool jumping; 28 | bool falling; 29 | bool climbingStair; 30 | 31 | Vect2D_s16 position; 32 | Vect2D_s16 globalPosition; 33 | Vect2D_u16 centerOffset; 34 | 35 | struct { 36 | fix16 fixX; 37 | s16 x; 38 | fix16 fixY; 39 | }velocity; 40 | 41 | Vect2D_s16 input; 42 | }; 43 | 44 | extern struct pBody playerBody; 45 | 46 | void playerInputChanged(); 47 | void playerInit(); 48 | void updatePlayer(); -------------------------------------------------------------------------------- /PlatformerEngine/inc/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #define clamp01(X) (min(max((X), (0)), (1))) 5 | 6 | typedef struct { 7 | u8 x; 8 | u8 y; 9 | }Vect2D_u8; 10 | 11 | typedef struct { 12 | s8 x; 13 | s8 y; 14 | }Vect2D_s8; 15 | 16 | typedef struct { 17 | Vect2D_s16 min; 18 | Vect2D_s16 max; 19 | }AABB; 20 | 21 | AABB newAABB(s16 x1, s16 x2, s16 y1, s16 y2); 22 | 23 | Vect2D_f16 newVector2D_f16(f16 x, f16 y); 24 | Vect2D_f32 newVector2D_f32(f32 x, f32 y); 25 | 26 | Vect2D_s8 newVector2D_s8(s8 x, s8 y); 27 | Vect2D_s16 newVector2D_s16(s16 x, s16 y); 28 | Vect2D_s32 newVector2D_s32(s32 x, s32 y); 29 | 30 | Vect2D_u8 newVector2D_u8(u8 x, u8 y); 31 | Vect2D_u16 newVector2D_u16(u16 x, u16 y); 32 | Vect2D_u32 newVector2D_u32(u32 x, u32 y); -------------------------------------------------------------------------------- /PlatformerEngine/out/rom.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/PlatformerEngine/out/rom.bin -------------------------------------------------------------------------------- /PlatformerEngine/res/images/level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/PlatformerEngine/res/images/level.png -------------------------------------------------------------------------------- /PlatformerEngine/res/images/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/PlatformerEngine/res/images/player.png -------------------------------------------------------------------------------- /PlatformerEngine/res/resources.h: -------------------------------------------------------------------------------- 1 | #ifndef _RES_RESOURCES_H_ 2 | #define _RES_RESOURCES_H_ 3 | 4 | extern const u8 jump[3840]; 5 | extern const u8 song[35840]; 6 | extern const Palette level_palette; 7 | extern const TileSet level_tileset; 8 | extern const SpriteDefinition player_sprite; 9 | extern const MapDefinition level_map; 10 | 11 | #endif // _RES_RESOURCES_H_ 12 | -------------------------------------------------------------------------------- /PlatformerEngine/res/resources.res: -------------------------------------------------------------------------------- 1 | # 3 * 8 = 24 -> Size of the sprite 2 | SPRITE player_sprite "images/player.png" 3 3 FAST 5 3 | 4 | TILESET level_tileset "images/level.png" FAST ALL 5 | MAP level_map "images/level.png" level_tileset FAST 0 6 | PALETTE level_palette "images/level.png" 7 | 8 | XGM song "sound/sonic2Emerald.vgm" AUTO 9 | WAV jump "sound/jump.wav" XGM -------------------------------------------------------------------------------- /PlatformerEngine/res/sound/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/PlatformerEngine/res/sound/jump.wav -------------------------------------------------------------------------------- /PlatformerEngine/res/sound/sonic2Emerald.vgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/PlatformerEngine/res/sound/sonic2Emerald.vgm -------------------------------------------------------------------------------- /PlatformerEngine/romlauncher/RomLauncher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GerardGascon/PlatformerEngine/8f40967124ac2a79f7441c73bededc59ce39d024/PlatformerEngine/romlauncher/RomLauncher.exe -------------------------------------------------------------------------------- /PlatformerEngine/romlauncher/emulatorPath.txt: -------------------------------------------------------------------------------- 1 | C:\sgdk\emulators\gensKMod\gens.exe 2 | 3 | C:\sgdk\emulators\Regen0972\Regen.exe 4 | C:\sgdk\emulators\gensKMod\gens.exe 5 | C:\sgdk\emulators\Blastem\blastem.exe 6 | C:\sgdk\emulators\Exodus\exodus.exe 7 | -------------------------------------------------------------------------------- /PlatformerEngine/src/boot/rom_head.c: -------------------------------------------------------------------------------- 1 | #include "genesis.h" 2 | 3 | __attribute__((externally_visible)) 4 | const ROMHeader rom_header = { 5 | #if (ENABLE_BANK_SWITCH != 0) 6 | "SEGA SSF ", 7 | #elif (MODULE_MEGAWIFI != 0) 8 | "SEGA MEGAWIFI ", 9 | #else 10 | "SEGA MEGA DRIVE ", 11 | #endif 12 | "(C)SGDK 2021 ", 13 | "SAMPLE PROGRAM ", 14 | "SAMPLE PROGRAM ", 15 | "GM 00000000-00", 16 | 0x000, 17 | "JD ", 18 | 0x00000000, 19 | #if (ENABLE_BANK_SWITCH != 0) 20 | 0x003FFFFF, 21 | #else 22 | 0x000FFFFF, 23 | #endif 24 | 0xE0FF0000, 25 | 0xE0FFFFFF, 26 | "RA", 27 | 0xF820, 28 | 0x00200000, 29 | 0x0020FFFF, 30 | " ", 31 | "DEMONSTRATION PROGRAM ", 32 | "JUE " 33 | }; 34 | -------------------------------------------------------------------------------- /PlatformerEngine/src/boot/sega.s: -------------------------------------------------------------------------------- 1 | #include "task_cst.h" 2 | 3 | .section .text.keepboot 4 | 5 | *------------------------------------------------------- 6 | * 7 | * Sega startup code for the GNU Assembler 8 | * Translated from: 9 | * Sega startup code for the Sozobon C compiler 10 | * Written by Paul W. Lee 11 | * Modified by Charles Coty 12 | * Modified by Stephane Dallongeville 13 | * 14 | *------------------------------------------------------- 15 | 16 | .globl rom_header 17 | 18 | .org 0x00000000 19 | 20 | _Start_Of_Rom: 21 | _Vecteurs_68K: 22 | dc.l __stack /* Stack address */ 23 | dc.l _Entry_Point /* Program start address */ 24 | dc.l _Bus_Error 25 | dc.l _Address_Error 26 | dc.l _Illegal_Instruction 27 | dc.l _Zero_Divide 28 | dc.l _Chk_Instruction 29 | dc.l _Trapv_Instruction 30 | dc.l _Privilege_Violation 31 | dc.l _Trace 32 | dc.l _Line_1010_Emulation 33 | dc.l _Line_1111_Emulation 34 | dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception 35 | dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception 36 | dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception 37 | dc.l _Error_Exception 38 | dc.l _INT 39 | dc.l _EXTINT 40 | dc.l _INT 41 | dc.l hintCaller 42 | dc.l _INT 43 | dc.l _VINT 44 | dc.l _INT 45 | dc.l _trap_0 /* Resume supervisor task */ 46 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT 47 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT 48 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT 49 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT 50 | 51 | rom_header: 52 | .incbin "out/rom_head.bin", 0, 0x100 53 | 54 | _Entry_Point: 55 | move #0x2700,%sr 56 | tst.l 0xa10008 57 | bne.s SkipJoyDetect 58 | 59 | tst.w 0xa1000c 60 | 61 | SkipJoyDetect: 62 | bne.s SkipSetup 63 | 64 | lea Table,%a5 65 | movem.w (%a5)+,%d5-%d7 66 | movem.l (%a5)+,%a0-%a4 67 | * Check Version Number 68 | move.b -0x10ff(%a1),%d0 69 | andi.b #0x0f,%d0 70 | beq.s WrongVersion 71 | 72 | * Sega Security Code (SEGA) 73 | move.l #0x53454741,0x2f00(%a1) 74 | WrongVersion: 75 | * Read from the control port to cancel any pending read/write command 76 | move.w (%a4),%d0 77 | 78 | * Configure a USER_STACK_LENGTH bytes user stack at bottom, and system stack on top of it 79 | move %sp, %usp 80 | sub #USER_STACK_LENGTH, %sp 81 | 82 | move.w %d7,(%a1) 83 | move.w %d7,(%a2) 84 | 85 | * Jump to initialisation process now... 86 | 87 | jmp _start_entry 88 | 89 | SkipSetup: 90 | jmp _reset_entry 91 | 92 | 93 | Table: 94 | dc.w 0x8000,0x3fff,0x0100 95 | dc.l 0xA00000,0xA11100,0xA11200,0xC00000,0xC00004 96 | 97 | 98 | *------------------------------------------------ 99 | * 100 | * interrupt functions 101 | * 102 | *------------------------------------------------ 103 | 104 | registersDump: 105 | move.l %d0,registerState+0 106 | move.l %d1,registerState+4 107 | move.l %d2,registerState+8 108 | move.l %d3,registerState+12 109 | move.l %d4,registerState+16 110 | move.l %d5,registerState+20 111 | move.l %d6,registerState+24 112 | move.l %d7,registerState+28 113 | move.l %a0,registerState+32 114 | move.l %a1,registerState+36 115 | move.l %a2,registerState+40 116 | move.l %a3,registerState+44 117 | move.l %a4,registerState+48 118 | move.l %a5,registerState+52 119 | move.l %a6,registerState+56 120 | move.l %a7,registerState+60 121 | rts 122 | 123 | busAddressErrorDump: 124 | move.w 4(%sp),ext1State 125 | move.l 6(%sp),addrState 126 | move.w 10(%sp),ext2State 127 | move.w 12(%sp),srState 128 | move.l 14(%sp),pcState 129 | jmp registersDump 130 | 131 | exception4WDump: 132 | move.w 4(%sp),srState 133 | move.l 6(%sp),pcState 134 | move.w 10(%sp),ext1State 135 | jmp registersDump 136 | 137 | exceptionDump: 138 | move.w 4(%sp),srState 139 | move.l 6(%sp),pcState 140 | jmp registersDump 141 | 142 | 143 | _Bus_Error: 144 | jsr busAddressErrorDump 145 | movem.l %d0-%d1/%a0-%a1,-(%sp) 146 | move.l busErrorCB, %a0 147 | jsr (%a0) 148 | movem.l (%sp)+,%d0-%d1/%a0-%a1 149 | rte 150 | 151 | _Address_Error: 152 | jsr busAddressErrorDump 153 | movem.l %d0-%d1/%a0-%a1,-(%sp) 154 | move.l addressErrorCB, %a0 155 | jsr (%a0) 156 | movem.l (%sp)+,%d0-%d1/%a0-%a1 157 | rte 158 | 159 | _Illegal_Instruction: 160 | jsr exception4WDump 161 | movem.l %d0-%d1/%a0-%a1,-(%sp) 162 | move.l illegalInstCB, %a0 163 | jsr (%a0) 164 | movem.l (%sp)+,%d0-%d1/%a0-%a1 165 | rte 166 | 167 | _Zero_Divide: 168 | jsr exceptionDump 169 | movem.l %d0-%d1/%a0-%a1,-(%sp) 170 | move.l zeroDivideCB, %a0 171 | jsr (%a0) 172 | movem.l (%sp)+,%d0-%d1/%a0-%a1 173 | rte 174 | 175 | _Chk_Instruction: 176 | jsr exception4WDump 177 | movem.l %d0-%d1/%a0-%a1,-(%sp) 178 | move.l chkInstCB, %a0 179 | jsr (%a0) 180 | movem.l (%sp)+,%d0-%d1/%a0-%a1 181 | rte 182 | 183 | _Trapv_Instruction: 184 | jsr exception4WDump 185 | movem.l %d0-%d1/%a0-%a1,-(%sp) 186 | move.l trapvInstCB, %a0 187 | jsr (%a0) 188 | movem.l (%sp)+,%d0-%d1/%a0-%a1 189 | rte 190 | 191 | _Privilege_Violation: 192 | jsr exceptionDump 193 | movem.l %d0-%d1/%a0-%a1,-(%sp) 194 | move.l privilegeViolationCB, %a0 195 | jsr (%a0) 196 | movem.l (%sp)+,%d0-%d1/%a0-%a1 197 | rte 198 | 199 | _Trace: 200 | jsr exceptionDump 201 | movem.l %d0-%d1/%a0-%a1,-(%sp) 202 | move.l traceCB, %a0 203 | jsr (%a0) 204 | movem.l (%sp)+,%d0-%d1/%a0-%a1 205 | rte 206 | 207 | _Line_1010_Emulation: 208 | _Line_1111_Emulation: 209 | jsr exceptionDump 210 | movem.l %d0-%d1/%a0-%a1,-(%sp) 211 | move.l line1x1xCB, %a0 212 | jsr (%a0) 213 | movem.l (%sp)+,%d0-%d1/%a0-%a1 214 | rte 215 | 216 | _Error_Exception: 217 | jsr exceptionDump 218 | movem.l %d0-%d1/%a0-%a1,-(%sp) 219 | move.l errorExceptionCB, %a0 220 | jsr (%a0) 221 | movem.l (%sp)+,%d0-%d1/%a0-%a1 222 | rte 223 | 224 | _INT: 225 | movem.l %d0-%d1/%a0-%a1,-(%sp) 226 | move.l intCB, %a0 227 | jsr (%a0) 228 | movem.l (%sp)+,%d0-%d1/%a0-%a1 229 | rte 230 | 231 | _EXTINT: 232 | movem.l %d0-%d1/%a0-%a1,-(%sp) 233 | move.l eintCB, %a0 234 | jsr (%a0) 235 | movem.l (%sp)+,%d0-%d1/%a0-%a1 236 | rte 237 | 238 | _VINT: 239 | btst #5, (%sp) /* Skip context switch if not in user task */ 240 | bne.s no_user_task 241 | 242 | tst.w task_lock 243 | bne.s 1f 244 | move.w #0, -(%sp) /* TSK_superPend() will return 0 */ 245 | bra.s unlock /* If lock == 0, supervisor task is not locked */ 246 | 247 | 1: 248 | bcs.s no_user_task /* If lock < 0, super is locked with infinite wait */ 249 | subq.w #1, task_lock /* Locked with wait, subtract 1 to the frame count */ 250 | bne.s no_user_task /* And do not unlock if we did not reach 0 */ 251 | move.w #1, -(%sp) /* TSK_superPend() will return 1 */ 252 | 253 | unlock: 254 | /* Save bg task registers (excepting a7, that is stored in usp) */ 255 | move.l %a0, task_regs 256 | lea (task_regs + UTSK_REGS_LEN), %a0 257 | movem.l %d0-%d7/%a1-%a6, -(%a0) 258 | 259 | move.w (%sp)+, %d0 /* Load return value previously pushed to stack */ 260 | 261 | move.w (%sp)+, task_sr /* Pop user task sr and pc, and save them, */ 262 | move.l (%sp)+, task_pc /* so they can be restored later. */ 263 | movem.l (%sp)+, %d2-%d7/%a2-%a6 /* Restore non clobberable registers */ 264 | 265 | no_user_task: 266 | /* At this point, we always have in the stack the SR and PC of the task */ 267 | /* we want to jump after processing the interrupt, that might be the */ 268 | /* point where we came from (if there is no context switch) or the */ 269 | /* supervisor task (if we unlocked it). */ 270 | 271 | movem.l %d0-%d1/%a0-%a1,-(%sp) 272 | ori.w #0x0001, intTrace /* in V-Int */ 273 | addq.l #1, vtimer /* increment frame counter (more a vint counter) */ 274 | btst #3, VBlankProcess+1 /* PROCESS_XGM_TASK ? (use VBlankProcess+1 as btst is a byte operation) */ 275 | beq.s no_xgm_task 276 | 277 | jsr XGM_doVBlankProcess /* do XGM vblank task */ 278 | 279 | no_xgm_task: 280 | btst #1, VBlankProcess+1 /* PROCESS_BITMAP_TASK ? (use VBlankProcess+1 as btst is a byte operation) */ 281 | beq.s no_bmp_task 282 | 283 | jsr BMP_doVBlankProcess /* do BMP vblank task */ 284 | 285 | no_bmp_task: 286 | move.l vintCB, %a0 /* load user callback */ 287 | jsr (%a0) /* call user callback */ 288 | andi.w #0xFFFE, intTrace /* out V-Int */ 289 | movem.l (%sp)+,%d0-%d1/%a0-%a1 290 | rte 291 | 292 | *------------------------------------------------ 293 | * 294 | * Copyright (c) 1988 by Sozobon, Limited. Author: Johann Ruegg 295 | * 296 | * Permission is granted to anyone to use this software for any purpose 297 | * on any computer system, and to redistribute it freely, with the 298 | * following restrictions: 299 | * 1) No charge may be made other than reasonable charges for reproduction. 300 | * 2) Modified versions must be clearly marked as such. 301 | * 3) The authors are not responsible for any harmful consequences 302 | * of using this software, even if they result from defects in it. 303 | * 304 | *------------------------------------------------ 305 | 306 | ldiv: 307 | move.l 4(%a7),%d0 308 | bpl ld1 309 | neg.l %d0 310 | ld1: 311 | move.l 8(%a7),%d1 312 | bpl ld2 313 | neg.l %d1 314 | eor.b #0x80,4(%a7) 315 | ld2: 316 | bsr i_ldiv /* d0 = d0/d1 */ 317 | tst.b 4(%a7) 318 | bpl ld3 319 | neg.l %d0 320 | ld3: 321 | rts 322 | 323 | lmul: 324 | move.l 4(%a7),%d0 325 | bpl lm1 326 | neg.l %d0 327 | lm1: 328 | move.l 8(%a7),%d1 329 | bpl lm2 330 | neg.l %d1 331 | eor.b #0x80,4(%a7) 332 | lm2: 333 | bsr i_lmul /* d0 = d0*d1 */ 334 | tst.b 4(%a7) 335 | bpl lm3 336 | neg.l %d0 337 | lm3: 338 | rts 339 | 340 | lrem: 341 | move.l 4(%a7),%d0 342 | bpl lr1 343 | neg.l %d0 344 | lr1: 345 | move.l 8(%a7),%d1 346 | bpl lr2 347 | neg.l %d1 348 | lr2: 349 | bsr i_ldiv /* d1 = d0%d1 */ 350 | move.l %d1,%d0 351 | tst.b 4(%a7) 352 | bpl lr3 353 | neg.l %d0 354 | lr3: 355 | rts 356 | 357 | ldivu: 358 | move.l 4(%a7),%d0 359 | move.l 8(%a7),%d1 360 | bsr i_ldiv 361 | rts 362 | 363 | lmulu: 364 | move.l 4(%a7),%d0 365 | move.l 8(%a7),%d1 366 | bsr i_lmul 367 | rts 368 | 369 | lremu: 370 | move.l 4(%a7),%d0 371 | move.l 8(%a7),%d1 372 | bsr i_ldiv 373 | move.l %d1,%d0 374 | rts 375 | * 376 | * A in d0, B in d1, return A*B in d0 377 | * 378 | i_lmul: 379 | move.l %d3,%a2 /* save d3 */ 380 | move.w %d1,%d2 381 | mulu %d0,%d2 /* d2 = Al * Bl */ 382 | 383 | move.l %d1,%d3 384 | swap %d3 385 | mulu %d0,%d3 /* d3 = Al * Bh */ 386 | 387 | swap %d0 388 | mulu %d1,%d0 /* d0 = Ah * Bl */ 389 | 390 | add.l %d3,%d0 /* d0 = (Ah*Bl + Al*Bh) */ 391 | swap %d0 392 | clr.w %d0 /* d0 = (Ah*Bl + Al*Bh) << 16 */ 393 | 394 | add.l %d2,%d0 /* d0 = A*B */ 395 | move.l %a2,%d3 /* restore d3 */ 396 | rts 397 | * 398 | *A in d0, B in d1, return A/B in d0, A%B in d1 399 | * 400 | i_ldiv: 401 | tst.l %d1 402 | bne nz1 403 | 404 | * divide by zero 405 | * divu #0,%d0 /* cause trap */ 406 | move.l #0x80000000,%d0 407 | move.l %d0,%d1 408 | rts 409 | nz1: 410 | move.l %d3,%a2 /* save d3 */ 411 | cmp.l %d1,%d0 412 | bhi norm 413 | beq is1 414 | * AB and B is not 0 426 | norm: 427 | cmp.l #1,%d1 428 | bne not1 429 | * B==1, so ret A, rem 0 430 | clr.l %d1 431 | move.l %a2,%d3 /* restore d3 */ 432 | rts 433 | * check for A short (implies B short also) 434 | not1: 435 | cmp.l #0xffff,%d0 436 | bhi slow 437 | * A short and B short -- use 'divu' 438 | divu %d1,%d0 /* d0 = REM:ANS */ 439 | swap %d0 /* d0 = ANS:REM */ 440 | clr.l %d1 441 | move.w %d0,%d1 /* d1 = REM */ 442 | clr.w %d0 443 | swap %d0 444 | move.l %a2,%d3 /* restore d3 */ 445 | rts 446 | * check for B short 447 | slow: 448 | cmp.l #0xffff,%d1 449 | bhi slower 450 | * A long and B short -- use special stuff from gnu 451 | move.l %d0,%d2 452 | clr.w %d2 453 | swap %d2 454 | divu %d1,%d2 /* d2 = REM:ANS of Ahi/B */ 455 | clr.l %d3 456 | move.w %d2,%d3 /* d3 = Ahi/B */ 457 | swap %d3 458 | 459 | move.w %d0,%d2 /* d2 = REM << 16 + Alo */ 460 | divu %d1,%d2 /* d2 = REM:ANS of stuff/B */ 461 | 462 | move.l %d2,%d1 463 | clr.w %d1 464 | swap %d1 /* d1 = REM */ 465 | 466 | clr.l %d0 467 | move.w %d2,%d0 468 | add.l %d3,%d0 /* d0 = ANS */ 469 | move.l %a2,%d3 /* restore d3 */ 470 | rts 471 | * A>B, B > 1 472 | slower: 473 | move.l #1,%d2 474 | clr.l %d3 475 | moreadj: 476 | cmp.l %d0,%d1 477 | bhs adj 478 | add.l %d2,%d2 479 | add.l %d1,%d1 480 | bpl moreadj 481 | * we shifted B until its >A or sign bit set 482 | * we shifted #1 (d2) along with it 483 | adj: 484 | cmp.l %d0,%d1 485 | bhi ltuns 486 | or.l %d2,%d3 487 | sub.l %d1,%d0 488 | ltuns: 489 | lsr.l #1,%d1 490 | lsr.l #1,%d2 491 | bne adj 492 | * d3=answer, d0=rem 493 | move.l %d0,%d1 494 | move.l %d3,%d0 495 | move.l %a2,%d3 /* restore d3 */ 496 | rts 497 | -------------------------------------------------------------------------------- /PlatformerEngine/src/camera.c: -------------------------------------------------------------------------------- 1 | #include "../inc/camera.h" 2 | 3 | #include "../inc/global.h" 4 | 5 | #include "../res/resources.h" 6 | 7 | Vect2D_s16 cameraPosition; 8 | 9 | AABB cameraDeadzone; 10 | 11 | void setupCamera(Vect2D_u16 deadZoneCenter, u16 deadZoneWidth, u16 deadZoneHeight) { 12 | //Calculates the bounds of the deadZone 13 | cameraDeadzone.min.x = deadZoneCenter.x - (deadZoneWidth >> 1); 14 | cameraDeadzone.max.x = deadZoneCenter.x + (deadZoneWidth >> 1); 15 | cameraDeadzone.min.y = deadZoneCenter.y - (deadZoneHeight >> 1); 16 | cameraDeadzone.max.y = deadZoneCenter.y + (deadZoneHeight >> 1); 17 | 18 | updateCamera(); 19 | 20 | //We force to update the whole layer in order to prevent wrong tile being loaded depending on the position 21 | MAP_scrollToEx(bga, cameraPosition.x, cameraPosition.y, TRUE); 22 | } 23 | 24 | void updateCamera() { 25 | //Update camera only if the center of the player is outside the deadZone of the camera 26 | if (playerBody.globalPosition.x + playerBody.centerOffset.x > cameraPosition.x + cameraDeadzone.max.x) { 27 | cameraPosition.x = playerBody.globalPosition.x + playerBody.centerOffset.x - cameraDeadzone.max.x; 28 | 29 | }else if (playerBody.globalPosition.x + playerBody.centerOffset.x < cameraPosition.x + cameraDeadzone.min.x) { 30 | cameraPosition.x = playerBody.globalPosition.x + playerBody.centerOffset.x - cameraDeadzone.min.x; 31 | } 32 | 33 | if (playerBody.globalPosition.y + playerBody.centerOffset.y > cameraPosition.y + cameraDeadzone.max.y) { 34 | cameraPosition.y = playerBody.globalPosition.y + playerBody.centerOffset.y - cameraDeadzone.max.y; 35 | 36 | }else if (playerBody.globalPosition.y + playerBody.centerOffset.y < cameraPosition.y + cameraDeadzone.min.y) { 37 | cameraPosition.y = playerBody.globalPosition.y + playerBody.centerOffset.y - cameraDeadzone.min.y; 38 | } 39 | 40 | //Clamp camera to the limits of the level 41 | cameraPosition.x = clamp(cameraPosition.x, 0, 448); // 768 - 320 = 448 (level width - screen width) 42 | cameraPosition.y = clamp(cameraPosition.y, 0, 544); // 768 - 224 = 544 (level height - screen height) 43 | 44 | //Finally we update the position of the camera 45 | MAP_scrollTo(bga, cameraPosition.x, cameraPosition.y); 46 | } -------------------------------------------------------------------------------- /PlatformerEngine/src/global.c: -------------------------------------------------------------------------------- 1 | #include "../inc/global.h" 2 | 3 | //Global constant that could be used in other files 4 | const fix16 gravityScale = FIX16(0.5); 5 | 6 | //Level tilemap 7 | Map* bga; 8 | 9 | //Size in pixels of the room 10 | AABB roomSize; 11 | //Player collider bounds position 12 | AABB playerBounds; 13 | 14 | //Index of the last tile that has been placed, useful to avoid overlapping 15 | u16 VDPTilesFilled = TILE_USER_INDEX; -------------------------------------------------------------------------------- /PlatformerEngine/src/levelgenerator.c: -------------------------------------------------------------------------------- 1 | #include "../inc/levelgenerator.h" 2 | 3 | #include "../res/resources.h" 4 | #include "../inc/global.h" 5 | #include "../inc/map.h" 6 | 7 | //Dynamic 2D array where we store the collision map data 8 | //We could read that directly from ROM but in the long term it's cleaner and/or more performant 9 | u8** currentMap; 10 | 11 | //Downlscaled size of the map in order to match the collision map size 12 | Vect2D_u16 roomTileSize; 13 | 14 | void freeCollisionMap() { 15 | //We have to free the collision map data in this way in order to avoid memory leaks 16 | for (u16 i = 0; i < roomTileSize.y; i++) { 17 | MEM_free(currentMap[i]); 18 | } 19 | MEM_free(currentMap); 20 | } 21 | 22 | void generateCollisionMap(const u8 map[][48]) { 23 | roomSize = newAABB(0, 768, 0, 768); 24 | 25 | //Each tile is 16x16px so we divide 768(size of the room in pixels) / 16, we use bitshifts because it is more performant than divisions 26 | roomTileSize = newVector2D_u16(768 >> 4, 768 >> 4); 27 | 28 | //To store a 2D array with pointers we have to do it in that way 29 | currentMap = (u8**)MEM_alloc(roomTileSize.y * sizeof(u8*)); 30 | for (u16 i = 0; i < roomTileSize.y; i++) { 31 | currentMap[i] = (u8*)MEM_alloc(roomTileSize.x); 32 | memcpy(currentMap[i], map[i], roomTileSize.x); 33 | } 34 | } 35 | 36 | u16 getTileValue(s16 x, s16 y) { 37 | if (x >= roomTileSize.x || x < 0 || y < 0 || y >= roomTileSize.y) 38 | return 0; 39 | 40 | //If the position is inside the collision map return the value of the tile from it 41 | return currentMap[y][x]; 42 | } -------------------------------------------------------------------------------- /PlatformerEngine/src/levels.c: -------------------------------------------------------------------------------- 1 | #include "../inc/levels.h" 2 | 3 | #include "../inc/levelgenerator.h" 4 | #include "../inc/map.h" 5 | #include "../inc/global.h" 6 | 7 | #include "../res/resources.h" 8 | 9 | void loadLevel() { 10 | //Setup the level background with the MAP tool from SGDK 11 | PAL_setPalette(LEVEL_PALETTE, level_palette.data, DMA); 12 | VDP_loadTileSet(&level_tileset, VDPTilesFilled, DMA); 13 | bga = MAP_create(&level_map, TILEMAP_PLANE, TILE_ATTR_FULL(LEVEL_PALETTE, FALSE, FALSE, FALSE, VDPTilesFilled)); 14 | 15 | //Update the number of tiles filled in order to avoid overlaping them when loading more 16 | VDPTilesFilled += level_tileset.numTile; 17 | 18 | //We need to call this function at some point, this place seems to be a good one for doing it 19 | generateCollisionMap(collisionMap); 20 | 21 | //Start play the level's song 22 | XGM_startPlay(song); 23 | } -------------------------------------------------------------------------------- /PlatformerEngine/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "../inc/levels.h" 4 | #include "../inc/camera.h" 5 | #include "../inc/player.h" 6 | 7 | void inGameJoyEvent(u16 joy, u16 changed, u16 state); 8 | 9 | int main(u16 resetType) { 10 | //Soft resets don't clear RAM, this can bring some bugs so we hard reset every time we detect a soft reset 11 | if (!resetType) 12 | SYS_hardReset(); 13 | 14 | //Initialize joypad and sprite engine in order to use them 15 | JOY_init(); 16 | SPR_init(); 17 | 18 | //Setup the basic things we need for this demo 19 | loadLevel(); 20 | playerInit(); 21 | setupCamera(newVector2D_u16(160, 112), 20, 20); //We have to setup always after the player, it directly depends on player's data 22 | 23 | //Setup a callback when a button is pressed, we could call it a "pseudo parallel" joypad handler 24 | JOY_setEventHandler(inGameJoyEvent); 25 | 26 | //Infinite loop where the game is run 27 | while (TRUE) { 28 | //First we update all the things that have to be updated each frame 29 | updatePlayer(); 30 | updateCamera(); 31 | 32 | //Then we update sprites and after that we tell the Mega Drive that we have finished processing all the frame data 33 | SPR_update(); 34 | SYS_doVBlankProcess(); 35 | } 36 | 37 | return 0; 38 | } 39 | 40 | //In order to make this data more accessible from all scripts we write them into a struct from global.h 41 | void inGameJoyEvent(u16 joy, u16 changed, u16 state) { 42 | input.joy = joy; 43 | input.changed = changed; 44 | input.state = state; 45 | 46 | playerInputChanged(); 47 | } -------------------------------------------------------------------------------- /PlatformerEngine/src/map.c: -------------------------------------------------------------------------------- 1 | #include "../inc/map.h" 2 | 3 | const Vect2D_s16 levelStartPos = { 74, 665 }; 4 | 5 | //Collision map generated from a mix of LDtk and a MadeWithUnity conversor 6 | const u8 collisionMap[48][48] = { 7 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 8 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 9 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 10 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 11 | { 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, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 12 | { 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, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 13 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 14 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 15 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 17 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 18 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 19 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 20 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 21 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 22 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 23 | { 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, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 24 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 25 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 26 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 0, 0, 0, 0, 0, 0, }, 27 | { 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, }, 28 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, }, 29 | { 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 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, 4, 4, 4, 4, 4, 4, 4, 4, 4, }, 30 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 31 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 32 | { 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, }, 33 | { 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, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, }, 34 | { 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, }, 35 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, }, 36 | { 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, }, 37 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 2, 4, 4, 4, }, 38 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 0, 0, 0, }, 39 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 2, 0, 0, 0, }, 40 | { 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 2, 0, 0, 0, }, 41 | { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, }, 42 | { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, }, 43 | { 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, }, 44 | { 1, 1, 1, 1, 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, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 45 | { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 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, }, 46 | { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, }, 47 | { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 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, 0, }, 48 | { 1, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 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, 0, 0, 0, 0, 0, 0, }, 49 | { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }, 50 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 51 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 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, 4, 4, 4, 4, }, 52 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 53 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, }, 54 | { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, }, 55 | }; -------------------------------------------------------------------------------- /PlatformerEngine/src/physics.c: -------------------------------------------------------------------------------- 1 | #include "../inc/physics.h" 2 | 3 | //Used to get the left edge of a tile by inputting the tile position 4 | u16 getTileLeftEdge(u16 x) { 5 | return (x << 4); 6 | } 7 | //Used to get the right edge of a tile by inputting the tile position 8 | u16 getTileRightEdge(u16 x) { 9 | return (x << 4) + 16; 10 | } 11 | //Used to get the top edge of a tile by inputting the tile position 12 | u16 getTileTopEdge(u16 y) { 13 | return (y << 4); 14 | } 15 | //Used to get the bottom edge of a tile by inputting the tile position 16 | u16 getTileBottomEdge(u16 y) { 17 | return (y << 4) + 16; 18 | } 19 | //Used to get the bounds of a tile by inputting the tile position 20 | AABB getTileBounds(s16 x, s16 y) { 21 | return newAABB((x << 4), (x << 4) + 16, (y << 4), (y << 4) + 16); 22 | } 23 | 24 | //Used to get the tile position out of a pixel position 25 | Vect2D_u16 posToTile(Vect2D_s16 position) { 26 | return newVector2D_u16((position.x >> 4), (position.y >> 4)); 27 | } -------------------------------------------------------------------------------- /PlatformerEngine/src/player.c: -------------------------------------------------------------------------------- 1 | #include "../inc/player.h" 2 | 3 | #include "../inc/global.h" 4 | #include "../inc/map.h" 5 | 6 | #include "../res/resources.h" 7 | 8 | struct pBody playerBody; 9 | 10 | void checkCollisions(); 11 | void updateAnimations(); 12 | 13 | const s16 coyoteTime = 10; 14 | s16 currentCoyoteTime; 15 | const s16 jumpBufferTime = 10; 16 | s16 currentJumpBufferTime; 17 | 18 | bool collidingAgainstStair; 19 | bool runningAnim; 20 | 21 | u16 dyingSteps; 22 | const u16 dieDelay = 10; 23 | 24 | const u16 oneWayPlatformErrorCorrection = 5; 25 | 26 | s16 stairLeftEdge; 27 | const u16 stairPositionOffset = 4; 28 | 29 | void playerInit() { 30 | //Create the sprite and palette for the player 31 | playerBody.sprite = SPR_addSprite(&player_sprite, levelStartPos.x, levelStartPos.y, TILE_ATTR(PLAYER_PALETTE, FALSE, FALSE, FALSE)); 32 | PAL_setPalette(PLAYER_PALETTE, player_sprite.palette->data, DMA); 33 | 34 | //Set the global position of the player, the local position will be updated once we are in the main loop 35 | playerBody.globalPosition = levelStartPos; 36 | 37 | //We set collider size of the player 38 | playerBody.aabb = newAABB(4, 20, 4, 24); 39 | //This collider is thinner because if the width is >=16 it could interfere with the lateral walls 40 | playerBody.climbingStairAABB = newAABB(8, 20, playerBody.aabb.min.y, playerBody.aabb.max.y); 41 | 42 | //Calculate where's the center point of the player 43 | playerBody.centerOffset.x = ((playerBody.aabb.min.x + playerBody.aabb.max.x) >> 1); 44 | playerBody.centerOffset.y = ((playerBody.aabb.min.y + playerBody.aabb.max.y) >> 1); 45 | 46 | //Default movement values 47 | playerBody.speed = 2; 48 | playerBody.climbingSpeed = 1; 49 | playerBody.maxFallSpeed = 6; 50 | playerBody.jumpSpeed = 7; 51 | playerBody.facingDirection = 1; 52 | playerBody.acceleration = FIX16(.25); 53 | playerBody.deceleration = FIX16(.2); 54 | 55 | //Setup the jump SFX with an index between 64 and 255 56 | XGM_setPCM(64, jump, sizeof(jump)); 57 | } 58 | 59 | void playerInputChanged() { 60 | u16 joy = input.joy; 61 | u16 state = input.state; 62 | u16 changed = input.changed; 63 | 64 | //We only read data from the joypad 1 65 | if (joy == JOY_1) { 66 | //Update x velocity 67 | if (state & BUTTON_RIGHT) { 68 | playerBody.input.x = 1; 69 | }else if (state & BUTTON_LEFT) { 70 | playerBody.input.x = -1; 71 | }else if ((changed & BUTTON_RIGHT) | (changed & BUTTON_LEFT)) { 72 | playerBody.input.x = 0; 73 | } 74 | 75 | //Jump button via jumpbuffer 76 | //Also used to stop climbing the stairs 77 | if (changed & (BUTTON_A | BUTTON_B | BUTTON_C)) { 78 | if (state & (BUTTON_A | BUTTON_B | BUTTON_C)) { 79 | if (playerBody.climbingStair) { 80 | playerBody.climbingStair = FALSE; 81 | }else { 82 | currentJumpBufferTime = jumpBufferTime; 83 | } 84 | }else if (playerBody.jumping && playerBody.velocity.fixY < 0) { 85 | //If the button is released we remove half of the velocity 86 | playerBody.velocity.fixY = fix16Mul(playerBody.velocity.fixY, FIX16(.5)); 87 | } 88 | } 89 | 90 | //Down and up buttons are only used when it is climbing stair 91 | //NOTE: Up direction is -1 and down direction is 1, this is because the Mega Drive draws the screen from top to bottom 92 | if (changed & BUTTON_DOWN) { 93 | if (state & BUTTON_DOWN) { 94 | playerBody.input.y = 1; 95 | if (playerBody.climbingStair) { 96 | playerBody.velocity.fixY = FIX16(playerBody.climbingSpeed); 97 | }else if (playerBody.onStair) { 98 | playerBody.velocity.fixY = FIX16(playerBody.climbingSpeed); 99 | playerBody.climbingStair = TRUE; 100 | } 101 | }else { 102 | playerBody.input.y = 0; 103 | if (playerBody.climbingStair) { 104 | playerBody.velocity.fixY = 0; 105 | } 106 | } 107 | } 108 | if (changed & BUTTON_UP) { 109 | if (state & BUTTON_UP) { 110 | playerBody.input.y = -1; 111 | if (collidingAgainstStair && !playerBody.onStair) { 112 | playerBody.climbingStair = TRUE; 113 | playerBody.velocity.fixY = FIX16(-playerBody.climbingSpeed); 114 | } 115 | }else { 116 | playerBody.input.y = 0; 117 | if (playerBody.climbingStair) { 118 | playerBody.velocity.fixY = 0; 119 | } 120 | } 121 | } 122 | } 123 | } 124 | 125 | void updatePlayer() { 126 | //Check if the player wants to climb a stair 127 | if(collidingAgainstStair && ((playerBody.onStair && playerBody.input.y > 0) || (!playerBody.onStair && playerBody.input.y < 0))){ 128 | playerBody.climbingStair = TRUE; 129 | playerBody.velocity.fixY = FIX16(playerBody.climbingSpeed * playerBody.input.y); 130 | } 131 | 132 | //Check if player wants to jump by looking the coyote time and jump buffer 133 | if (currentCoyoteTime > 0 && currentJumpBufferTime > 0) { 134 | playerBody.jumping = TRUE; 135 | //Play the SFX with the index 64 (jump sfx) with the highest priority 136 | XGM_startPlayPCM(64, 15, SOUND_PCM_CH1); 137 | playerBody.velocity.fixY = FIX16(-playerBody.jumpSpeed); 138 | 139 | currentCoyoteTime = 0; 140 | currentJumpBufferTime = 0; 141 | } 142 | //The ground hasn't been checked yet so we only decrease the jump buffer time for now 143 | currentJumpBufferTime = clamp((currentJumpBufferTime - 1), 0, jumpBufferTime); //Clamp to avoid underflowing, it is unlikely to happen but can happen 144 | 145 | //If the player is climbing a stair, it only needs to go upward, if not, we apply horizontal movement 146 | if (playerBody.climbingStair) { 147 | playerBody.velocity.x = playerBody.velocity.fixX = 0; 148 | playerBody.globalPosition.x = stairLeftEdge - stairPositionOffset; 149 | }else { 150 | if (playerBody.input.x > 0) { 151 | if (playerBody.velocity.x != playerBody.speed) 152 | playerBody.velocity.fixX += playerBody.acceleration; 153 | }else if (playerBody.input.x < 0) { 154 | if (playerBody.velocity.x != -playerBody.speed) 155 | playerBody.velocity.fixX -= playerBody.acceleration; 156 | }else if (playerBody.onGround) { 157 | if (playerBody.velocity.x > 0) 158 | playerBody.velocity.fixX -= playerBody.deceleration; 159 | else if (playerBody.velocity.x < 0) 160 | playerBody.velocity.fixX += playerBody.deceleration; 161 | else 162 | playerBody.velocity.fixX = 0; 163 | } 164 | playerBody.velocity.x = clamp(fix16ToInt(playerBody.velocity.fixX), -playerBody.speed, playerBody.speed); 165 | } 166 | 167 | //Apply gravity with a terminal velocity 168 | if (!playerBody.onGround && !playerBody.climbingStair) { 169 | if (fix16ToInt(playerBody.velocity.fixY) <= playerBody.maxFallSpeed) { 170 | playerBody.velocity.fixY = fix16Add(playerBody.velocity.fixY, gravityScale); 171 | }else { 172 | playerBody.velocity.fixY = FIX16(playerBody.maxFallSpeed); 173 | } 174 | } 175 | 176 | //Once all the input-related have been calculated, we apply the velocities to the global positions 177 | playerBody.globalPosition.x += playerBody.velocity.x; 178 | playerBody.globalPosition.y += fix16ToInt(playerBody.velocity.fixY); 179 | 180 | //Now we can check for collisions and correct those positions 181 | checkCollisions(); 182 | 183 | //Now that the collisions have been checked, we know if the player is on a stair or not 184 | if (!collidingAgainstStair && playerBody.climbingStair) { 185 | playerBody.climbingStair = FALSE; 186 | playerBody.input.y = 0; 187 | } 188 | 189 | //Once the positions are correct, we position the player taking into account the camera position 190 | playerBody.position.x = playerBody.globalPosition.x - cameraPosition.x; 191 | playerBody.position.y = playerBody.globalPosition.y - cameraPosition.y; 192 | SPR_setPosition(playerBody.sprite, playerBody.position.x, playerBody.position.y); 193 | 194 | //Update the player animations 195 | updateAnimations(); 196 | 197 | //Reset when falling off the screen 198 | if (playerBody.falling) { 199 | dyingSteps++; 200 | if(dyingSteps > dieDelay){ 201 | SYS_hardReset(); 202 | } 203 | } 204 | } 205 | 206 | void updateAnimations() { 207 | //Sprite flip depending on the horizontal input 208 | if (playerBody.input.x > 0) { 209 | SPR_setHFlip(playerBody.sprite, TRUE); 210 | playerBody.facingDirection = 1; 211 | }else if (playerBody.input.x < 0) { 212 | SPR_setHFlip(playerBody.sprite, FALSE); 213 | playerBody.facingDirection = -1; 214 | } 215 | 216 | //If the player is on ground and not climbing the stair it can be idle or running 217 | if (playerBody.velocity.fixY == 0 && !playerBody.climbingStair) { 218 | if (playerBody.velocity.x != 0 && runningAnim == FALSE && playerBody.onGround) { 219 | SPR_setAnim(playerBody.sprite, 1); 220 | runningAnim = TRUE; 221 | }else if (playerBody.velocity.x == 0 && playerBody.onGround) { 222 | SPR_setAnim(playerBody.sprite, 0); 223 | runningAnim = FALSE; 224 | } 225 | } 226 | 227 | //Climb animation 228 | if (playerBody.climbingStair) { 229 | SPR_setAnim(playerBody.sprite, 2); 230 | } 231 | } 232 | 233 | void checkCollisions() { 234 | //As we now have to check for collisions, we will later check if it is true or false, but for now it is false 235 | collidingAgainstStair = FALSE; 236 | 237 | //Create level limits 238 | AABB levelLimits = roomSize; 239 | 240 | //Easy access to the bounds in global pos 241 | if (playerBody.climbingStair) { 242 | playerBounds = newAABB( 243 | playerBody.globalPosition.x + playerBody.climbingStairAABB.min.x, 244 | playerBody.globalPosition.x + playerBody.climbingStairAABB.max.x, 245 | playerBody.globalPosition.y + playerBody.climbingStairAABB.min.y, 246 | playerBody.globalPosition.y + playerBody.climbingStairAABB.max.y 247 | ); 248 | }else { 249 | playerBounds = newAABB( 250 | playerBody.globalPosition.x + playerBody.aabb.min.x, 251 | playerBody.globalPosition.x + playerBody.aabb.max.x, 252 | playerBody.globalPosition.y + playerBody.aabb.min.y, 253 | playerBody.globalPosition.y + playerBody.aabb.max.y 254 | ); 255 | } 256 | 257 | //We can see this variables as a way to avoid thinking that a ground tile is a wall tile 258 | //Skin width (yIntVelocity) changes depending on the vertical velocity 259 | s16 yIntVelocity = fix16ToRoundedInt(playerBody.velocity.fixY); 260 | s16 playerHeadPos = playerBody.aabb.min.y - yIntVelocity + playerBody.globalPosition.y; 261 | s16 playerFeetPos = playerBody.aabb.max.y - yIntVelocity + playerBody.globalPosition.y; 262 | 263 | //Positions in tiles 264 | Vect2D_u16 minTilePos = posToTile(newVector2D_s16(playerBounds.min.x, playerBounds.min.y)); 265 | Vect2D_u16 maxTilePos = posToTile(newVector2D_s16(playerBounds.max.x, playerBounds.max.y)); 266 | 267 | //Used to limit how many tiles we have to check for collision 268 | Vect2D_u16 tileBoundDifference = newVector2D_u16(maxTilePos.x - minTilePos.x, maxTilePos.y - minTilePos.y); 269 | 270 | //First we check for horizontal collisions 271 | for (u16 i = 0; i <= tileBoundDifference.y; i++) { 272 | //Height position constant as a helper 273 | const u16 y = minTilePos.y + i; 274 | 275 | //Right position constant as a helper 276 | const u16 rx = maxTilePos.x; 277 | 278 | u16 rTileValue = getTileValue(rx, y); 279 | //After getting the tile value, we check if that is one of whom we can collide/trigger with horizontally 280 | if (rTileValue == GROUND_TILE) { 281 | AABB tileBounds = getTileBounds(rx, y); 282 | //Before taking that tile as a wall, we have to check if that is within the player hitbox, e.g. not seeing ground as a wall 283 | if (tileBounds.min.x < levelLimits.max.x && tileBounds.min.y < playerFeetPos && tileBounds.max.y > playerHeadPos) { 284 | levelLimits.max.x = tileBounds.min.x; 285 | break; 286 | } 287 | }else if (rTileValue == LADDER_TILE) { 288 | stairLeftEdge = getTileLeftEdge(rx); 289 | collidingAgainstStair = TRUE; 290 | } 291 | 292 | //Left position constant as a helper 293 | const s16 lx = minTilePos.x; 294 | 295 | u16 lTileValue = getTileValue(lx, y); 296 | //We do the same here but for the left side 297 | if (lTileValue == GROUND_TILE) { 298 | AABB tileBounds = getTileBounds(lx, y); 299 | if (tileBounds.max.x > levelLimits.min.x && tileBounds.min.y < playerFeetPos && tileBounds.max.y > playerHeadPos) { 300 | levelLimits.min.x = tileBounds.max.x; 301 | break; 302 | } 303 | }else if (lTileValue == LADDER_TILE) { 304 | stairLeftEdge = getTileLeftEdge(lx); 305 | collidingAgainstStair = TRUE; 306 | } 307 | } 308 | 309 | //After checking for horizontal positions we can modify the positions if the player is colliding 310 | if (levelLimits.min.x > playerBounds.min.x) { 311 | playerBody.globalPosition.x = levelLimits.min.x - playerBody.aabb.min.x; 312 | playerBody.velocity.x = playerBody.velocity.fixX = 0; 313 | } 314 | if (levelLimits.max.x < playerBounds.max.x) { 315 | playerBody.globalPosition.x = levelLimits.max.x - playerBody.aabb.max.x; 316 | playerBody.velocity.x = playerBody.velocity.fixX = 0; 317 | } 318 | 319 | //Then, we modify the player position so we can use them to check for vertical collisions 320 | if (playerBody.climbingStair) { 321 | playerBounds = newAABB( 322 | playerBody.globalPosition.x + playerBody.climbingStairAABB.min.x, 323 | playerBody.globalPosition.x + playerBody.climbingStairAABB.max.x, 324 | playerBody.globalPosition.y + playerBody.climbingStairAABB.min.y, 325 | playerBody.globalPosition.y + playerBody.climbingStairAABB.max.y 326 | ); 327 | }else { 328 | playerBounds = newAABB( 329 | playerBody.globalPosition.x + playerBody.aabb.min.x, 330 | playerBody.globalPosition.x + playerBody.aabb.max.x, 331 | playerBody.globalPosition.y + playerBody.aabb.min.y, 332 | playerBody.globalPosition.y + playerBody.aabb.max.y 333 | ); 334 | } 335 | 336 | //And do the same to the variables that are used to check for them 337 | minTilePos = posToTile(newVector2D_s16(playerBounds.min.x, playerBounds.min.y)); 338 | maxTilePos = posToTile(newVector2D_s16(playerBounds.max.x - 1, playerBounds.max.y)); 339 | tileBoundDifference = newVector2D_u16(maxTilePos.x - minTilePos.x, maxTilePos.y - minTilePos.y); 340 | 341 | bool onStair = FALSE; 342 | 343 | //To avoid having troubles with player snapping to ground ignoring the upward velocity, we separate top and bottom collisions depending on the velocity 344 | if (yIntVelocity >= 0) { 345 | for (u16 i = 0; i <= tileBoundDifference.x; i++) { 346 | s16 x = minTilePos.x + i; 347 | u16 y = maxTilePos.y; 348 | 349 | //This is the exact same method that we use for horizontal collisions 350 | u16 bottomTileValue = getTileValue(x, y); 351 | if (bottomTileValue == GROUND_TILE || bottomTileValue == ONE_WAY_PLATFORM_TILE) { 352 | if (getTileRightEdge(x) == levelLimits.min.x || getTileLeftEdge(x) == levelLimits.max.x) 353 | continue; 354 | 355 | u16 bottomEdgePos = getTileTopEdge(y); 356 | //The error correction is used to add some extra width pixels in case the player isn't high enough by just some of them 357 | if (bottomEdgePos < levelLimits.max.y && bottomEdgePos >= (playerFeetPos - oneWayPlatformErrorCorrection)) { 358 | levelLimits.max.y = bottomEdgePos; 359 | } 360 | }else if (bottomTileValue == LADDER_TILE) { 361 | stairLeftEdge = getTileLeftEdge(x); 362 | 363 | u16 bottomEdgePos = getTileTopEdge(y); 364 | //Only in this case we check for ladder collisions, as we need them to climb them down 365 | if (bottomEdgePos <= levelLimits.max.y && bottomEdgePos >= playerFeetPos && !playerBody.climbingStair && getTileValue(x, y - 1) != LADDER_TILE) { 366 | collidingAgainstStair = TRUE; 367 | onStair = TRUE; 368 | levelLimits.max.y = bottomEdgePos; 369 | break; 370 | } 371 | } 372 | } 373 | }else { 374 | for (u16 i = 0; i <= tileBoundDifference.x; i++) { 375 | s16 x = minTilePos.x + i; 376 | u16 y = minTilePos.y; 377 | 378 | //And the same once again 379 | u16 topTileValue = getTileValue(x, y); 380 | if (topTileValue == GROUND_TILE) { 381 | if (getTileRightEdge(x) == levelLimits.min.x || getTileLeftEdge(x) == levelLimits.max.x) 382 | continue; 383 | 384 | u16 upperEdgePos = getTileBottomEdge(y); 385 | if (upperEdgePos < levelLimits.max.y) { 386 | levelLimits.min.y = upperEdgePos; 387 | break; 388 | } 389 | }else if (topTileValue == LADDER_TILE) { 390 | stairLeftEdge = getTileLeftEdge(x); 391 | collidingAgainstStair = TRUE; 392 | } 393 | } 394 | } 395 | 396 | //Now we modify the player position and some properties if necessary 397 | if (levelLimits.min.y > playerBounds.min.y) { 398 | playerBody.globalPosition.y = levelLimits.min.y - playerBody.aabb.min.y; 399 | playerBody.velocity.fixY = 0; 400 | } 401 | if (levelLimits.max.y <= playerBounds.max.y) { 402 | if (levelLimits.max.y == 768) { 403 | playerBody.falling = TRUE; 404 | }else { 405 | playerBody.onStair = onStair; 406 | playerBody.onGround = TRUE; 407 | playerBody.climbingStair = FALSE; 408 | currentCoyoteTime = coyoteTime; 409 | playerBody.jumping = FALSE; 410 | playerBody.globalPosition.y = levelLimits.max.y - playerBody.aabb.max.y; 411 | playerBody.velocity.fixY = 0; 412 | } 413 | }else { 414 | playerBody.onStair = playerBody.onGround = FALSE; 415 | currentCoyoteTime--; 416 | } 417 | //This time we don't need to update the playerBounds as they will be updated at the beginning of the function the next frame 418 | } -------------------------------------------------------------------------------- /PlatformerEngine/src/types.c: -------------------------------------------------------------------------------- 1 | #include "../inc/types.h" 2 | 3 | AABB newAABB(s16 x1, s16 x2, s16 y1, s16 y2) { 4 | return (AABB) { {x1, y1}, { x2, y2 } }; 5 | } 6 | 7 | Vect2D_f16 newVector2D_f16(f16 x, f16 y) { 8 | return (Vect2D_f16) { x, y }; 9 | } 10 | Vect2D_f32 newVector2D_f32(f32 x, f32 y) { 11 | return (Vect2D_f32) { x, y }; 12 | } 13 | 14 | Vect2D_s8 newVector2D_s8(s8 x, s8 y) { 15 | return (Vect2D_s8) { x, y }; 16 | } 17 | Vect2D_s16 newVector2D_s16(s16 x, s16 y) { 18 | return (Vect2D_s16) { x, y }; 19 | } 20 | Vect2D_s32 newVector2D_s32(s32 x, s32 y) { 21 | return (Vect2D_s32) { x, y }; 22 | } 23 | 24 | Vect2D_u8 newVector2D_u8(u8 x, u8 y) { 25 | return (Vect2D_u8) { x, y }; 26 | } 27 | Vect2D_u16 newVector2D_u16(u16 x, u16 y) { 28 | return (Vect2D_u16) { x, y }; 29 | } 30 | Vect2D_u32 newVector2D_u32(u32 x, u32 y) { 31 | return (Vect2D_u32) { x, y }; 32 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Platformer Engine 2 | 3 | Basic platformer engine for the Mega Drive made using SGDK. 4 | 5 | ## Features 6 | 7 | - Basic platformer character with physics. 8 | - Some platformer features like coyote time or jump buffer. 9 | - A tool to convert LDtk maps into collision maps for the Mega Drive. --------------------------------------------------------------------------------