Externalized most of the editor's built-in textures. You can find (and replace) them in the "[GZDB]\Textures" folder.

This commit is contained in:
MaxED 2015-12-30 13:58:58 +00:00
parent 64b822b903
commit 0ecd5285dd
9 changed files with 41 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

View file

@ -64,6 +64,7 @@ Source: Plugins\TagRange.dll; DestDir: {app}\Plugins; Flags: ignoreversion
Source: Plugins\VisplaneExplorer.dll; DestDir: {app}\Plugins; Flags: ignoreversion
Source: Plugins\Loadorder.cfg; DestDir: {app}\Plugins; Flags: ignoreversion onlyifdoesntexist
Source: Sprites\*; DestDir: {app}\Sprites; Flags: ignoreversion recursesubdirs
Source: Textures\*; DestDir: {app}\Textures; Flags: ignoreversion
[Icons]
Name: {group}\GZDoom Builder; Filename: {app}\Builder.exe

View file

@ -173,17 +173,7 @@ namespace CodeImp.DoomBuilder.Data
glowingflats = new Dictionary<long, GlowingFlatData>();
soundsequences = new List<string>();
// Load special images
missingtexture3d = new ResourceImage("CodeImp.DoomBuilder.Resources.MissingTexture3D.png");
missingtexture3d.LoadImage();
unknowntexture3d = new ResourceImage("CodeImp.DoomBuilder.Resources.UnknownTexture3D.png");
unknowntexture3d.LoadImage();
hourglass3d = new ResourceImage("CodeImp.DoomBuilder.Resources.Hourglass3D.png");
hourglass3d.LoadImage();
crosshair = new ResourceImage("CodeImp.DoomBuilder.Resources.Crosshair.png");
crosshair.LoadImage();
crosshairbusy = new ResourceImage("CodeImp.DoomBuilder.Resources.CrosshairBusy.png");
crosshairbusy.LoadImage();
// Load special images (mxd: the rest is loaded in LoadInternalTextures())
whitetexture = new ResourceImage("CodeImp.DoomBuilder.Resources.White.png") { UseColorCorrection = false };
whitetexture.LoadImage();
whitetexture.CreateTexture();
@ -359,6 +349,7 @@ namespace CodeImp.DoomBuilder.Data
int thingcount = LoadDecorateThings(spawnnums, doomednums);
int spritecount = LoadThingSprites();
LoadInternalSprites();
LoadInternalTextures(); //mxd
//mxd. Load more stuff
LoadReverbs();
@ -1043,6 +1034,35 @@ namespace CodeImp.DoomBuilder.Data
if(textures.ContainsKey(hash) && textures[hash] is HighResImage) return hash; //TEXTURES textures should still override regular ones...
return (General.Map.Config.UseLongTextureNames && texturenamesshorttofull.ContainsKey(hash) ? texturenamesshorttofull[hash] : hash);
}
//mxd
private void LoadInternalTextures()
{
missingtexture3d = LoadInternalTexture("MissingTexture3D.png"); //mxd
unknowntexture3d = LoadInternalTexture("UnknownTexture3D.png"); //mxd
hourglass3d = LoadInternalTexture("Hourglass3D.png"); //mxd
crosshair = LoadInternalTexture("Crosshair.png"); //mxd
crosshairbusy = LoadInternalTexture("CrosshairBusy.png"); //mxd
}
//mxd
private static ImageData LoadInternalTexture(string name)
{
ImageData result;
string path = Path.Combine(General.TexturesPath, name);
if(File.Exists(path))
{
result = new FileImage(name, path) { AllowUnload = false };
}
else
{
General.ErrorLogger.Add(ErrorType.Warning, "Unable to load editor texture '" + name + "'. Using built-in one instead.");
result = new ResourceImage("CodeImp.DoomBuilder.Resources." + name);
}
result.LoadImage();
return result;
}
#endregion

View file

@ -94,7 +94,7 @@ namespace CodeImp.DoomBuilder.Data
loadfailed = true;
}
int failCount = 0; //mxd
int missingpatches = 0; //mxd
if(!loadfailed)
{
@ -126,7 +126,7 @@ namespace CodeImp.DoomBuilder.Data
// Data is in an unknown format!
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?");
loadfailed = true;
failCount++; //mxd
missingpatches++; //mxd
}
}
@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.Data
// Data cannot be read!
General.ErrorLogger.Add(ErrorType.Error, "Patch lump '" + p.lumpname + "' data format could not be read, while loading texture '" + this.Name + "'. Does this lump contain valid picture data at all?");
loadfailed = true;
failCount++; //mxd
missingpatches++; //mxd
}
}
@ -152,7 +152,7 @@ namespace CodeImp.DoomBuilder.Data
// Missing a patch lump!
General.ErrorLogger.Add(ErrorType.Error, "Missing patch lump '" + p.lumpname + "' while loading texture '" + this.Name + "'. Did you forget to include required resources?");
loadfailed = true;
failCount++; //mxd
missingpatches++; //mxd
}
}
@ -161,7 +161,7 @@ namespace CodeImp.DoomBuilder.Data
}
// Dispose bitmap if load failed
if((bitmap != null) && (loadfailed || failCount >= patches.Count)) //mxd. We can still display texture if at least one of the patches was loaded
if((bitmap != null) && (loadfailed || missingpatches >= patches.Count)) //mxd. We can still display texture if at least one of the patches was loaded
{
bitmap.Dispose();
bitmap = null;

View file

@ -130,6 +130,7 @@ namespace CodeImp.DoomBuilder
private const string MAP_RESTORE_DIR = "Restore"; //mxd
private const string SETUP_DIR = "Setup";
private const string SPRITES_DIR = "Sprites";
private const string TEXTURES_DIR = "Textures"; //mxd
private const string HELP_FILE = "Refmanual.chm";
// SCROLLINFO structure
@ -162,6 +163,7 @@ namespace CodeImp.DoomBuilder
private static string screenshotspath; //mxd
private static string pluginspath;
private static string spritespath;
private static string texturespath; //mxd
// Main objects
private static Assembly thisasm;
@ -216,6 +218,7 @@ namespace CodeImp.DoomBuilder
public static string CompilersPath { get { return compilerspath; } }
public static string PluginsPath { get { return pluginspath; } }
public static string SpritesPath { get { return spritespath; } }
internal static string TexturesPath { get { return texturespath; } } //mxd
public static string SnippetsPath { get { return snippetspath; } } //mxd
public static string DefaultScreenshotsPath { get { return screenshotspath; } } //mxd
public static ICollection<string> CommandArgs { get { return Array.AsReadOnly(cmdargs); } }
@ -583,6 +586,7 @@ namespace CodeImp.DoomBuilder
snippetspath = Path.Combine(apppath, SNIPPETS_DIR); //mxd
screenshotspath = Path.Combine(apppath, SCREENSHOTS_DIR).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); //mxd
spritespath = Path.Combine(apppath, SPRITES_DIR);
texturespath = Path.Combine(apppath, TEXTURES_DIR); //mxd
logfile = Path.Combine(settingspath, LOG_FILE);
// Make program settings directory if missing