From 69a7dbf2181df2514bb0d74eccbc36e25877a032 Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Sat, 15 Mar 2003 06:59:09 +0000
Subject: [PATCH] Clip text for smaller resolutions

---
 src/stratagus/stratagus.cpp | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp
index 33bc0c6e7..9e4a0c764 100644
--- a/src/stratagus/stratagus.cpp
+++ b/src/stratagus/stratagus.cpp
@@ -857,31 +857,36 @@ local void DebugDrawFonts(void)
     VideoLockScreen();
     VideoClearScreen();
 
+    PushClipping();
+    SetClipping(0,0,VideoWidth-1,VideoHeight-1);
+
     VideoFillRectangle(ColorWhite,0,0,40,VideoHeight-1);
-    VideoDrawText(8,   0+ 10,SmallFont,"FreeCraft");
-    VideoDrawText(8,   0+ 20,SmallFont,
+    VideoDrawTextClip(8,   0+ 10,SmallFont,"FreeCraft");
+    VideoDrawTextClip(8,   0+ 20,SmallFont,
 	"~00~11~22~33~44~55~66~77~88~99~aa~bb~cc~dd~ee~ff");
-    VideoDrawText(8,   0+ 30,SmallFont,"abdefgABCDEFQ");
+    VideoDrawTextClip(8,   0+ 30,SmallFont,"abdefgABCDEFQ");
 
-    VideoDrawText(8,  40+ 10,GameFont,"FreeCraft");
-    VideoDrawText(8,  40+ 25,GameFont,
+    VideoDrawTextClip(8,  40+ 10,GameFont,"FreeCraft");
+    VideoDrawTextClip(8,  40+ 25,GameFont,
 	"~00~11~22~33~44~55~66~77~88~99~aa~bb~cc~dd~ee~ff");
-    VideoDrawText(8,  40+ 40,GameFont,"abdefgABCDEFQ");
+    VideoDrawTextClip(8,  40+ 40,GameFont,"abdefgABCDEFQ");
 
-    VideoDrawText(8, 100+ 10,LargeFont,"FreeCraft");
-    VideoDrawText(8, 100+ 25,LargeFont,
+    VideoDrawTextClip(8, 100+ 10,LargeFont,"FreeCraft");
+    VideoDrawTextClip(8, 100+ 25,LargeFont,
 	"~00~11~22~33~44~55~66~77~88~99~aa~bb~cc~dd~ee~ff");
-    VideoDrawText(8, 100+ 40,LargeFont,"abdefgABCDEFQ");
+    VideoDrawTextClip(8, 100+ 40,LargeFont,"abdefgABCDEFQ");
 
-    VideoDrawText(8, 160+ 10,SmallTitleFont,"FreeCraft");
-    VideoDrawText(8, 160+ 35,SmallTitleFont,
+    VideoDrawTextClip(8, 160+ 10,SmallTitleFont,"FreeCraft");
+    VideoDrawTextClip(8, 160+ 35,SmallTitleFont,
 	"~00~11~22~33~44~55~66~77~88~99~aa~bb~cc~dd~ee~ff");
-    VideoDrawText(8, 160+ 60,SmallTitleFont,"abdefgABCDEFQ");
+    VideoDrawTextClip(8, 160+ 60,SmallTitleFont,"abdefgABCDEFQ");
 
-    VideoDrawText(8, 260+ 10,LargeTitleFont,"FreeCraft");
-    VideoDrawText(8, 260+ 55,LargeTitleFont,
+    VideoDrawTextClip(8, 260+ 10,LargeTitleFont,"FreeCraft");
+    VideoDrawTextClip(8, 260+ 55,LargeTitleFont,
 	"~00~11~22~33~44~55~66~77~88~99~aa~bb~cc~dd~ee~ff");
-    VideoDrawText(8, 260+ 100,LargeTitleFont,"abdefgABCDEFQ");
+    VideoDrawTextClip(8, 260+ 100,LargeTitleFont,"abdefgABCDEFQ");
+
+    PopClipping();
 
     VideoUnlockScreen();
     Invalidate();