about summary refs log tree commit diff
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/client/gfx.cpp8
-rw-r--r--src/engine/client/snd.cpp1
-rw-r--r--src/engine/client/ui.cpp1
-rw-r--r--src/engine/interface.h2
4 files changed, 8 insertions, 4 deletions
diff --git a/src/engine/client/gfx.cpp b/src/engine/client/gfx.cpp
index 1c871e28..dafdfa06 100644
--- a/src/engine/client/gfx.cpp
+++ b/src/engine/client/gfx.cpp
@@ -790,7 +790,7 @@ double extra_kerning[256*256] = {0};
 
 pretty_font *current_font = &default_font;
 
-void gfx_pretty_text(float x, float y, float size, const char *text)
+void gfx_pretty_text(float x, float y, float size, const char *text, int max_width)
 {
 	const float spacing = 0.05f;
 	gfx_texture_set(current_font->font_texture);
@@ -826,6 +826,12 @@ void gfx_pretty_text(float x, float y, float size, const char *text)
 				x_nudge = extra_kerning[text[0] + text[1] * 256];
 
 			x += (width + current_font->m_CharStartTable[c] + spacing + x_nudge) * size;
+
+			if (max_width != -1 && x - startx > max_width)
+			{
+				x = startx;
+				y += size - 2;
+			}
 		}
 
 		text++;
diff --git a/src/engine/client/snd.cpp b/src/engine/client/snd.cpp
index 69cca0f5..c28efe05 100644
--- a/src/engine/client/snd.cpp
+++ b/src/engine/client/snd.cpp
@@ -269,7 +269,6 @@ int snd_load_wv(const char *filename)
 	{
 		int samples = WavpackGetNumSamples(context);
 		int bitspersample = WavpackGetBitsPerSample(context);
-		int bytespersample = WavpackGetBytesPerSample(context);
 		unsigned int samplerate = WavpackGetSampleRate(context);
 		int channels = WavpackGetNumChannels(context);
 
diff --git a/src/engine/client/ui.cpp b/src/engine/client/ui.cpp
index d7a0a4d8..7b309539 100644
--- a/src/engine/client/ui.cpp
+++ b/src/engine/client/ui.cpp
@@ -15,7 +15,6 @@ struct pretty_font
 };
 
 extern pretty_font *current_font;
-void gfx_pretty_text(float x, float y, float size, const char *text);
 
 static void *hot_item = 0;
 static void *active_item = 0;
diff --git a/src/engine/interface.h b/src/engine/interface.h
index 4d92e87f..f7a95c61 100644
--- a/src/engine/interface.h
+++ b/src/engine/interface.h
@@ -768,7 +768,7 @@ int client_tickspeed();
 int client_state();
 const char *client_error_string();
 
-void gfx_pretty_text(float x, float y, float size, const char *text);
+void gfx_pretty_text(float x, float y, float size, const char *text, int max_width = -1);
 float gfx_pretty_text_width(float size, const char *text, int length = -1);
 
 void gfx_getscreen(float *tl_x, float *tl_y, float *br_x, float *br_y);