diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jake2/render/fast/Draw.java | 11 | ||||
-rw-r--r-- | src/jake2/render/fast/Image.java | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/jake2/render/fast/Draw.java b/src/jake2/render/fast/Draw.java index b13891d..db6dfb2 100644 --- a/src/jake2/render/fast/Draw.java +++ b/src/jake2/render/fast/Draw.java @@ -2,7 +2,7 @@ * Draw.java * Copyright (C) 2003 * - * $Id: Draw.java,v 1.2 2006-11-21 00:50:46 cawe Exp $ + * $Id: Draw.java,v 1.3 2007-05-12 23:20:29 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -101,17 +101,12 @@ public abstract class Draw extends Image { ============= */ public image_t Draw_FindPic(String name) { - image_t image = null; - String fullname; - if (!name.startsWith("/") && !name.startsWith("\\")) { - fullname = "pics/" + name + ".pcx"; - image = GL_FindImage(fullname, it_pic); + return GL_FindImage(name, it_pic); } else { - image = GL_FindImage(name.substring(1), it_pic); + return GL_FindImage(name.substring(1), it_pic); } - return image; } diff --git a/src/jake2/render/fast/Image.java b/src/jake2/render/fast/Image.java index 4561693..49a143d 100644 --- a/src/jake2/render/fast/Image.java +++ b/src/jake2/render/fast/Image.java @@ -1451,7 +1451,7 @@ public abstract class Image extends Main { */ image_t GL_FindImage(String name, int type) { - if (name == null || name.length() < 5) + if (name == null || name.length() < 1) return null; // look for it @@ -1490,9 +1490,16 @@ public abstract class Image extends Main { image = GL_LoadPic(name, pic, dim.width, dim.height, type, 32); + } else { + + pic = LoadPCX("pics/" + name + ".pcx", null, dim); + if (pic == null) + return null; + image = GL_LoadPic(name, pic, dim.width, dim.height, type, 8); + } - imageCache.put(image.name, image); + imageCache.put(image.name, image); return image; } |