foxygit / doom Log in
commit 443163fc15088ab226234e9a4509eb3183574217
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Oct 9 20:19:21 2005 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Oct 9 20:19:21 2005 +0000

    Handle blinking text in ENDOOM lumps properly.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 183
---
 src/i_system.c        | 13 ++++++++-----
 textscreen/txt_main.c | 15 ++++++++++++++-
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/i_system.c b/src/i_system.c
index d876baee..3914c791 100644
--- a/src/i_system.c
+++ b/src/i_system.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: i_system.c 148 2005-10-02 03:23:54Z fraggle $
+// $Id: i_system.c 183 2005-10-09 20:19:21Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.13  2005/10/09 20:19:21  fraggle
+// Handle blinking text in ENDOOM lumps properly.
+//
 // Revision 1.12  2005/10/02 03:23:54  fraggle
 // Fix the length of time that ENDOOM is displayed for
 //
@@ -66,7 +69,7 @@
 //-----------------------------------------------------------------------------

 static const char
-rcsid[] = "$Id: i_system.c 148 2005-10-02 03:23:54Z fraggle $";
+rcsid[] = "$Id: i_system.c 183 2005-10-09 20:19:21Z fraggle $";


 #include <stdlib.h>
@@ -191,8 +194,6 @@ void I_Endoom(void)
     screendata = TXT_GetScreenData();
     memcpy(screendata, endoom_data, 4000);

-    TXT_UpdateScreen();
-
     // Wait for 10 seconds, or until a keypress or mouse click

     waiting = true;
@@ -200,9 +201,11 @@ void I_Endoom(void)

     while (waiting && I_GetTime() < start_ms + 350)
     {
+        TXT_UpdateScreen();
+
         if (!SDL_PollEvent(&ev))
         {
-            I_Sleep(100);
+            I_Sleep(50);
             continue;
         }

diff --git a/textscreen/txt_main.c b/textscreen/txt_main.c
index 530e4bd3..049549e3 100644
--- a/textscreen/txt_main.c
+++ b/textscreen/txt_main.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*-
 //-----------------------------------------------------------------------------
 //
-// $Id: txt_main.c 181 2005-10-09 16:42:46Z fraggle $
+// $Id: txt_main.c 183 2005-10-09 20:19:21Z 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/10/09 20:19:21  fraggle
+// Handle blinking text in ENDOOM lumps properly.
+//
 // Revision 1.2  2005/10/09 16:42:46  fraggle
 // Cannot do arithmetic on void pointers in standard C
 //
@@ -118,6 +121,16 @@ static inline void UpdateCharacter(int x, int y)
     fg = p[1] & 0xf;
     bg = (p[1] >> 4) & 0xf;

+    if (bg & 0x8)
+    {
+        // blinking
+
+        bg &= ~0x8;
+
+        if (SDL_GetTicks() % 500 < 250)
+            fg = bg;
+    }
+
     p = &int10_font_16[character * CHAR_H];

     s = ((unsigned char *) screen->pixels)