diff options
| -rw-r--r-- | data/maps/dm1.map | bin | 0 -> 3448 bytes | |||
| -rw-r--r-- | src/game/client/gc_map_image.cpp | 19 |
2 files changed, 15 insertions, 4 deletions
diff --git a/data/maps/dm1.map b/data/maps/dm1.map new file mode 100644 index 00000000..d595402a --- /dev/null +++ b/data/maps/dm1.map Binary files differdiff --git a/src/game/client/gc_map_image.cpp b/src/game/client/gc_map_image.cpp index c2c695ba..174a412e 100644 --- a/src/game/client/gc_map_image.cpp +++ b/src/game/client/gc_map_image.cpp @@ -1,4 +1,5 @@ /* copyright (c) 2007 magnus auvinen, see licence.txt for more info */ +#include <stdio.h> #include <engine/e_system.h> #include <engine/e_client_interface.h> #include <game/g_mapitems.h> @@ -97,7 +98,7 @@ int img_init() if(map_textures[i]) { gfx_unload_texture(map_textures[i]); - map_textures[i] = 0; + map_textures[i] = -1; } } @@ -105,9 +106,19 @@ int img_init() for(int i = 0; i < count; i++) { MAPITEM_IMAGE *img = (MAPITEM_IMAGE *)map_get_item(start+i, 0, 0); - void *data = map_get_data(img->image_data); - map_textures[i] = gfx_load_texture_raw(img->width, img->height, IMG_RGBA, data, IMG_RGBA); - map_unload_data(img->image_data); + if(img->external) + { + char buf[256]; + char *name = (char *)map_get_data(img->image_name); + sprintf(buf, "data/mapres/%s.png", name); + map_textures[i] = gfx_load_texture(buf, IMG_AUTO); + } + else + { + void *data = map_get_data(img->image_data); + map_textures[i] = gfx_load_texture_raw(img->width, img->height, IMG_RGBA, data, IMG_RGBA); + map_unload_data(img->image_data); + } } return count; |