about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-29 11:55:42 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-29 11:55:42 +0000
commit1f246d9dcbc32e1049f4a8a6ac1777b313d9e547 (patch)
tree4a4e025a6211fedf7732d837e0027aa37e6e4d1a /src/engine/client
parent7a3874745ca370a799d95b5f86e85fcc8eadefbb (diff)
downloadzcatch-1f246d9dcbc32e1049f4a8a6ac1777b313d9e547.tar.gz
zcatch-1f246d9dcbc32e1049f4a8a6ac1777b313d9e547.zip
fixed protection so that the fonts doesn't get resampled
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/ec_client.c2
-rw-r--r--src/engine/client/ec_font.c9
-rw-r--r--src/engine/client/ec_gfx.c10
3 files changed, 11 insertions, 10 deletions
diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c
index 72b5536f..b12fa503 100644
--- a/src/engine/client/ec_client.c
+++ b/src/engine/client/ec_client.c
@@ -508,7 +508,7 @@ void client_disconnect()
 
 static int client_load_data()
 {
-	debug_font = gfx_load_texture("data/debug_font.png", IMG_AUTO);
+	debug_font = gfx_load_texture("data/debug_font.png", IMG_AUTO, TEXLOAD_NORESAMPLE);
 	return 1;
 }
 
diff --git a/src/engine/client/ec_font.c b/src/engine/client/ec_font.c
index 707c481f..5d5c6df4 100644
--- a/src/engine/client/ec_font.c
+++ b/src/engine/client/ec_font.c
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <engine/e_system.h>
+#include <engine/e_client_interface.h>
 #include "ec_font.h"
 
 typedef struct
@@ -87,8 +88,8 @@ int font_load(FONT *font, const char *filename)
         return -1;
 }
 
-int gfx_load_texture(const char *filename, int store_format);
-#define IMG_ALPHA 2
+/*int gfx_load_texture(const char *filename, int store_format, int flags);
+#define IMG_ALPHA 2*/
 
 int font_set_load(FONT_SET *font_set, const char *font_filename, const char *text_texture_filename, const char *outline_texture_filename, int fonts, ...)
 {
@@ -119,8 +120,8 @@ int font_set_load(FONT_SET *font_set, const char *font_filename, const char *tex
         }
 
         font->size = size;
-        font->text_texture = gfx_load_texture(composed_text_texture_filename, IMG_ALPHA);
-        font->outline_texture = gfx_load_texture(composed_outline_texture_filename, IMG_ALPHA);
+        font->text_texture = gfx_load_texture(composed_text_texture_filename, IMG_ALPHA, TEXLOAD_NORESAMPLE);
+        font->outline_texture = gfx_load_texture(composed_outline_texture_filename, IMG_ALPHA, TEXLOAD_NORESAMPLE);
     }
 
     va_end(va);
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c
index 3efcdac7..661820ea 100644
--- a/src/engine/client/ec_gfx.c
+++ b/src/engine/client/ec_gfx.c
@@ -242,7 +242,7 @@ int gfx_init()
 	inp_init();
 	
 	/* create null texture, will get id=0 */
-	gfx_load_texture_raw(4,4,IMG_RGBA,null_texture_data,IMG_RGBA);
+	gfx_load_texture_raw(4,4,IMG_RGBA,null_texture_data,IMG_RGBA,TEXLOAD_NORESAMPLE);
 
 	/* set vsync as needed */
 	gfx_set_vsync(config.gfx_vsync);
@@ -373,7 +373,7 @@ static unsigned char sample(int w, int h, const unsigned char *data, int u, int
 	data[((v+1)*w+u+1)*4+offset])/4;
 }
 
-int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_format)
+int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_format, int flags)
 {
 	int mipmap = 1;
 	unsigned char *texdata = (unsigned char *)data;
@@ -392,7 +392,7 @@ int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_f
 	textures[tex].next = -1;
 	
 	/* resample if needed */
-	if(config.gfx_texture_quality==0)
+	if(!(flags&TEXLOAD_NORESAMPLE) && config.gfx_texture_quality==0)
 	{
 		if(w > 16 && h > 16 && format == IMG_RGBA)
 		{
@@ -476,7 +476,7 @@ int gfx_load_texture_raw(int w, int h, int format, const void *data, int store_f
 }
 
 /* simple uncompressed RGBA loaders */
-int gfx_load_texture(const char *filename, int store_format)
+int gfx_load_texture(const char *filename, int store_format, int flags)
 {
 	int l = strlen(filename);
 	int id;
@@ -489,7 +489,7 @@ int gfx_load_texture(const char *filename, int store_format)
 		if (store_format == IMG_AUTO)
 			store_format = img.format;
 
-		id = gfx_load_texture_raw(img.width, img.height, img.format, img.data, store_format);
+		id = gfx_load_texture_raw(img.width, img.height, img.format, img.data, store_format, flags);
 		mem_free(img.data);
 		return id;
 	}