about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authorDominik Geyer <dominik.geyer@gmx.de>2008-10-01 17:16:22 +0000
committerDominik Geyer <dominik.geyer@gmx.de>2008-10-01 17:16:22 +0000
commit397b9a764b435a7b8c410bd9edc445009a7a9564 (patch)
treef7d5c80cdd8b0998c3267e064a20f8a56405d029 /src/game
parentfb3e8dec7905611a170c6b069cbaac34c4e04e70 (diff)
downloadzcatch-397b9a764b435a7b8c410bd9edc445009a7a9564.tar.gz
zcatch-397b9a764b435a7b8c410bd9edc445009a7a9564.zip
data-dir autodetection; data-dir override; compiled-in data-dir; messagebox if detection fails; does chdir into data-dir
Diffstat (limited to 'src/game')
-rw-r--r--src/game/client/components/mapimages.cpp2
-rw-r--r--src/game/client/components/menus.cpp2
-rw-r--r--src/game/client/components/skins.cpp4
-rw-r--r--src/game/client/gameclient.cpp2
-rw-r--r--src/game/editor/ed_editor.cpp28
-rw-r--r--src/game/editor/ed_io.cpp2
6 files changed, 20 insertions, 20 deletions
diff --git a/src/game/client/components/mapimages.cpp b/src/game/client/components/mapimages.cpp
index d13524cd..9dc2447a 100644
--- a/src/game/client/components/mapimages.cpp
+++ b/src/game/client/components/mapimages.cpp
@@ -31,7 +31,7 @@ void MAPIMAGES::on_reset()
 		{
 			char buf[256];
 			char *name = (char *)map_get_data(img->image_name);
-			str_format(buf, sizeof(buf), "data/mapres/%s.png", name);
+			str_format(buf, sizeof(buf), "mapres/%s.png", name);
 			textures[i] = gfx_load_texture(buf, IMG_AUTO, 0);
 		}
 		else
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index f28a3197..5fe2bbaa 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -1030,7 +1030,7 @@ void MENUS::render_background()
 	//gfx_clear(1,1,1);
 	//render_sunrays(0,0);
 	if(texture_blob == -1)
-		texture_blob = gfx_load_texture("data/blob.png", IMG_AUTO, 0);
+		texture_blob = gfx_load_texture("blob.png", IMG_AUTO, 0);
 
 
 	float sw = 300*gfx_screenaspect();
diff --git a/src/game/client/components/skins.cpp b/src/game/client/components/skins.cpp
index eae45c4d..b12bc1cf 100644
--- a/src/game/client/components/skins.cpp
+++ b/src/game/client/components/skins.cpp
@@ -24,7 +24,7 @@ void SKINS::skinscan(const char *name, int is_dir, void *user)
 		return;
 		
 	char buf[512];
-	str_format(buf, sizeof(buf), "data/skins/%s", name);
+	str_format(buf, sizeof(buf), "skins/%s", name);
 	IMAGE_INFO info;
 	if(!gfx_load_png(&info, buf))
 	{
@@ -119,7 +119,7 @@ void SKINS::init()
 {
 	// load skins
 	num_skins = 0;
-	fs_listdir("data/skins", skinscan, this);
+	fs_listdir("skins", skinscan, this);
 }
 
 int SKINS::num()
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp
index 2696e185..3aed1cd1 100644
--- a/src/game/client/gameclient.cpp
+++ b/src/game/client/gameclient.cpp
@@ -179,7 +179,7 @@ void GAMECLIENT::on_init()
 	int64 start = time_get();
 	
 	int before = gfx_memory_usage();
-	font_set_load(&default_font, "data/fonts/default_font%d.tfnt", "data/fonts/default_font%d.png", "data/fonts/default_font%d_b.png", 14, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 36);
+	font_set_load(&default_font, "fonts/default_font%d.tfnt", "fonts/default_font%d.png", "fonts/default_font%d_b.png", 14, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 36);
 	dbg_msg("font", "gfx memory used for font textures: %d", gfx_memory_usage()-before);
 	
 	gfx_text_set_default_font(&default_font);
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 54b8fcb6..ca4f354f 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -541,11 +541,11 @@ static void do_toolbar(RECT toolbar)
 	
 	// ctrl+o to open
 	if(inp_key_down('O') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))
-		editor.invoke_file_dialog("Open Map", "Open", "data/maps/", "", callback_open_map);
+		editor.invoke_file_dialog("Open Map", "Open", "maps/", "", callback_open_map);
 	
 	// ctrl+s to save
 	if(inp_key_down('S') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))
-		editor.invoke_file_dialog("Save Map", "Save", "data/maps/", "", callback_save_map);
+		editor.invoke_file_dialog("Save Map", "Save", "maps/", "", callback_save_map);
 
 	// animate button
 	ui_vsplit_l(&toolbar, 30.0f, &button, &toolbar);
@@ -1670,7 +1670,7 @@ static int popup_image(RECT view)
 	ui_hsplit_t(&view, 12.0f, &slot, &view);
 	if(do_editor_button(&replace_button, "Replace", 0, &slot, draw_editor_button_menuitem, 0, "Replaces the image with a new one"))
 	{
-		editor.invoke_file_dialog("Replace Image", "Replace", "data/mapres/", "", replace_image);
+		editor.invoke_file_dialog("Replace Image", "Replace", "mapres/", "", replace_image);
 		return 1;
 	}
 
@@ -1751,7 +1751,7 @@ static void render_images(RECT toolbox, RECT toolbar, RECT view)
 	ui_hsplit_t(&toolbox, 10.0f, &slot, &toolbox);
 	ui_hsplit_t(&toolbox, 12.0f, &slot, &toolbox);
 	if(do_editor_button(&new_image_button, "Add", 0, &slot, draw_editor_button, 0, "Load a new image to use in the map"))
-		editor.invoke_file_dialog("Add Image", "Add", "data/mapres/", "", add_image);
+		editor.invoke_file_dialog("Add Image", "Add", "mapres/", "", add_image);
 }
 
 
@@ -2288,7 +2288,7 @@ static int popup_menu_file(RECT view)
 	ui_hsplit_t(&view, 12.0f, &slot, &view);
 	if(do_editor_button(&open_button, "Open", 0, &slot, draw_editor_button_menuitem, 0, "Opens a map for editing"))
 	{
-		editor.invoke_file_dialog("Open Map", "Open", "data/maps/", "", callback_open_map);
+		editor.invoke_file_dialog("Open Map", "Open", "maps/", "", callback_open_map);
 		return 1;
 	}
 
@@ -2296,7 +2296,7 @@ static int popup_menu_file(RECT view)
 	ui_hsplit_t(&view, 12.0f, &slot, &view);
 	if(do_editor_button(&append_button, "Append", 0, &slot, draw_editor_button_menuitem, 0, "Opens a map and adds everything from that map to the current one"))
 	{
-		editor.invoke_file_dialog("Append Map", "Append", "data/maps/", "", callback_append_map);
+		editor.invoke_file_dialog("Append Map", "Append", "maps/", "", callback_append_map);
 		return 1;
 	}
 
@@ -2311,7 +2311,7 @@ static int popup_menu_file(RECT view)
 	ui_hsplit_t(&view, 12.0f, &slot, &view);
 	if(do_editor_button(&save_as_button, "Save As", 0, &slot, draw_editor_button_menuitem, 0, "Saves the current map under a new name"))
 	{
-		editor.invoke_file_dialog("Save Map", "Save", "data/maps/", "", callback_save_map);
+		editor.invoke_file_dialog("Save Map", "Save", "maps/", "", callback_save_map);
 		return 1;
 	}
 		
@@ -2523,10 +2523,10 @@ void MAP::create_default(int entities_texture)
 
 extern "C" void editor_init()
 {
-	checker_texture = gfx_load_texture("data/editor/checker.png", IMG_AUTO, 0);
-	background_texture = gfx_load_texture("data/editor/background.png", IMG_AUTO, 0);
-	cursor_texture = gfx_load_texture("data/editor/cursor.png", IMG_AUTO, 0);
-	entities_texture = gfx_load_texture("data/editor/entities.png", IMG_AUTO, 0);
+	checker_texture = gfx_load_texture("editor/checker.png", IMG_AUTO, 0);
+	background_texture = gfx_load_texture("editor/background.png", IMG_AUTO, 0);
+	cursor_texture = gfx_load_texture("editor/cursor.png", IMG_AUTO, 0);
+	entities_texture = gfx_load_texture("editor/entities.png", IMG_AUTO, 0);
 	
 	tileset_picker.make_palette();
 	tileset_picker.readonly = true;
@@ -2599,13 +2599,13 @@ extern "C" void editor_update_and_render()
 		editor.gui_active = !editor.gui_active;
 
 	if(inp_key_down(KEY_F5))
-		editor.save("data/maps/debug_test2.map");
+		editor.save("maps/debug_test2.map");
 
 	if(inp_key_down(KEY_F6))
-		editor.load("data/maps/debug_test2.map");
+		editor.load("maps/debug_test2.map");
 	
 	if(inp_key_down(KEY_F8))
-		editor.load("data/maps/debug_test.map");
+		editor.load("maps/debug_test.map");
 	
 	if(inp_key_down(KEY_F10))
 		editor.show_mouse_pointer = false;
diff --git a/src/game/editor/ed_io.cpp b/src/game/editor/ed_io.cpp
index b27dd25e..dfaa0e2c 100644
--- a/src/game/editor/ed_io.cpp
+++ b/src/game/editor/ed_io.cpp
@@ -398,7 +398,7 @@ int MAP::load(const char *filename)
 				if(item->external)
 				{
 					char buf[256];
-					sprintf(buf, "data/mapres/%s.png", name);
+					sprintf(buf, "mapres/%s.png", name);
 					
 					// load external
 					EDITOR_IMAGE imginfo;