ref: 1df9202dbf484818cb46ba94e30b37af5a1cce60
parent: 50a842586467d4311ad59cc34aa8076ff619a8e4
author: Simon Howard <[email protected]>
date: Sat Jul 23 14:54:30 EDT 2005
Fix quit prompt not displayed properly Subversion-branch: /trunk/chocolate-doom Subversion-revision: 17
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: m_menu.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: m_menu.c 17 2005-07-23 18:54:30Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.3 2005/07/23 18:54:30 fraggle
+// Fix quit prompt not displayed properly
+//
// Revision 1.2 2005/07/23 16:44:55 fraggle
// Update copyright to GNU GPL
//
@@ -36,7 +39,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: m_menu.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: m_menu.c 17 2005-07-23 18:54:30Z fraggle $";
#include <unistd.h>
#include <sys/types.h>
@@ -1769,21 +1772,24 @@
y = 100 - M_StringHeight(messageString)/2;
while(*(messageString+start))
{
+ int foundnewline = 0;
+
for (i = 0;i < strlen(messageString+start);i++)
if (*(messageString+start+i) == '\n')
{
memset(string,0,40);
strncpy(string,messageString+start,i);
+ foundnewline = 1;
start += i+1;
break;
}
- if (i == strlen(messageString+start))
+ if (!foundnewline)
{
strcpy(string,messageString+start);
- start += i;
+ start += strlen(string);
}
-
+
x = 160 - M_StringWidth(string)/2;
M_WriteText(x,y,string);
y += SHORT(hu_font[0]->height);