From 855e39880e8acd94d9b811d0a7d524ecf1d40cd8 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sat, 7 Sep 2024 13:43:11 +0100 Subject: [PATCH] Add Jorge texture to res --- project/code/TMV/ModelLoader.cs | 3 ++- project/code/TMV/TextureLoader.cs | 5 ++--- project/jorge.png | Bin 0 -> 361 bytes project/jorge.png.import | 34 ++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 project/jorge.png create mode 100644 project/jorge.png.import diff --git a/project/code/TMV/ModelLoader.cs b/project/code/TMV/ModelLoader.cs index d2b243f..3877c15 100644 --- a/project/code/TMV/ModelLoader.cs +++ b/project/code/TMV/ModelLoader.cs @@ -57,7 +57,8 @@ public class ModelLoader var (_, path) = pathManager.GetResourcePath(ResourceType.ObjectTexture, campaignName, resName); if (path == null) { - path = "user://textures/jorge.png"; + // Might fail in exported projects + path = "res://project/jorge.png"; GD.Print($"Failed to load model texture: {material.Name}"); } diff --git a/project/code/TMV/TextureLoader.cs b/project/code/TMV/TextureLoader.cs index 42bd9da..f3ef513 100644 --- a/project/code/TMV/TextureLoader.cs +++ b/project/code/TMV/TextureLoader.cs @@ -21,9 +21,8 @@ public partial class TextureLoader private void LoadDefaultTexture() { - // TODO: This should be a resource loaded from RES - const string path = "user://textures/jorge.png"; - var texture = ImageTexture.CreateFromImage(Image.LoadFromFile(path)); + const string path = "res://project/jorge.png"; + var texture = ResourceLoader.Load(path); _textureCache.Add(texture); } diff --git a/project/jorge.png b/project/jorge.png new file mode 100644 index 0000000000000000000000000000000000000000..6e813611f410039bef8a9429b166fd51b52cbe69 GIT binary patch literal 361 zcmV-v0ha!WP)Px$BS}O-R9J<@moW~4FcgM=2wuT^IFlG=yn(K6ny9mfASSZ0$`PCmiL<*$@DjM# zU>_mvqp$RvO53D=fByFZ(e8F`@yB7F{XgRJdBEp-T-GVdIz=cFHBcfB$7uz`bfPH= zG(|C)fT+rIEd$$VuWfiAXWFxLCVCD~d^?huw{$`P0GoxV0HXsG>8gpax@#Gz+N-vK zW`eH2h$HMiV5@WpS4XTfU?T+J_Yr3YDBP+s_5p4txP3(20gA~Hu?*M<0nqCs-W{OO zs&VcEuIrP%0?P7q3L`)rte8x|ZvFg?GHpJ1AMobD(2XhL0=k3k5EG!n^&%FV2>v}V z+JUh*rmzLjI(EfcfNiR|1phA>bimh*DLnz)Iu;Wkm1-_uiQl0%rhNGY00000NkvXX Hu0mjf<42i~ literal 0 HcmV?d00001 diff --git a/project/jorge.png.import b/project/jorge.png.import new file mode 100644 index 0000000..7d50397 --- /dev/null +++ b/project/jorge.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b208ufsau5jhb" +path="res://.godot/imported/jorge.png-d1d5cd5a7775d205c32df9d2770127a7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://project/jorge.png" +dest_files=["res://.godot/imported/jorge.png-d1d5cd5a7775d205c32df9d2770127a7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1