From 82bcbbfe01a78a3e6263efd134e2b29b011825ec Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Mon, 17 Mar 2003 09:33:49 +0000 Subject: [PATCH] enable experimental console support --- ChangeLog | 2 ++ configure.ac | 8 ++++++++ main/console.c | 19 ++++++++++--------- main/game.c | 6 ++++-- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 619976f3..527e1a94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2003-03-17 Bradley Bell + * main/console.c, main/game.c: enable experimental console support + * main/gamerend.c: fixed location of fps meter in multi 2003-03-16 Bradley Bell diff --git a/configure.ac b/configure.ac index bec9747a..e8fcd9e7 100644 --- a/configure.ac +++ b/configure.ac @@ -142,6 +142,14 @@ if test x$enable_fastfileio != xno; then D2X_FEATURES="fastfileio ${D2X_FEATURES}" fi +dnl Build with CONSOLE? +AC_ARG_ENABLE(console, + [ --enable-console Enable console (very experimental) ],,) +if test x$enable_console = xyes; then + AC_DEFINE(CONSOLE,,[Define to enable console]) + D2X_FEATURES="console ${D2X_FEATURES}" +fi + AC_ARG_WITH(sharepath, [[ --with-sharepath=DIR Use DIR for shared game data (unix only) [DATADIR/games/d2x]]], sharepath=$withval, sharepath="auto") diff --git a/main/console.c b/main/console.c index fdc06625..1eaa0c60 100644 --- a/main/console.c +++ b/main/console.c @@ -1,4 +1,4 @@ -/* $Id: console.c,v 1.8 2002-08-01 23:28:57 btb Exp $ */ +/* $Id: console.c,v 1.9 2003-03-17 09:33:49 btb Exp $ */ /* * * FIXME: put description here @@ -20,6 +20,7 @@ #include "error.h" #include "console.h" #include "cmd.h" +#include "gr.h" #ifndef __MSDOS__ int text_console_enabled = 1; @@ -93,14 +94,14 @@ void con_printf(int priority, char *fmt, ...) */ void con_update(void) { -// char buffer[CMD_MAX_LENGTH], *t; + char buffer[CMD_MAX_LENGTH], *t; /* Check for new input */ -/* t = fgets(buffer, sizeof(buffer), stdin); + t = fgets(buffer, sizeof(buffer), stdin); if (t == NULL) return; - cmd_parse(buffer);*/ -// con_draw(); + cmd_parse(buffer); + con_draw(); } /* ====== @@ -165,12 +166,12 @@ float cvar (char *cvar_name) */ void con_draw(void) { -/* char buffer[CON_LINE_LEN+1]; - int i,j; */ -/* for (i = con_line, j=0; j < 20; i = (i+1) % CON_NUM_LINES, j++) + char buffer[CON_LINE_LEN+1]; + int i,j; + for (i = con_line, j=0; j < 20; i = (i+1) % CON_NUM_LINES, j++) { memcpy(buffer, con_display[i], CON_LINE_LEN); buffer[CON_LINE_LEN] = 0; gr_string(1,j*10,buffer); - }*/ + } } diff --git a/main/game.c b/main/game.c index 77ad2659..850d75d5 100644 --- a/main/game.c +++ b/main/game.c @@ -1,4 +1,4 @@ -/* $Id: game.c,v 1.19 2003-03-13 07:16:46 btb Exp $ */ +/* $Id: game.c,v 1.20 2003-03-17 09:33:49 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -17,7 +17,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -char game_rcsid[] = "$Id: game.c,v 1.19 2003-03-13 07:16:46 btb Exp $"; +char game_rcsid[] = "$Id: game.c,v 1.20 2003-03-17 09:33:49 btb Exp $"; #endif #ifdef WINDOWS @@ -2605,7 +2605,9 @@ void flicker_lights(); void GameLoop(int RenderFlag, int ReadControlsFlag ) { +#ifdef CONSOLE con_update(); +#endif #ifndef NDEBUG // Used to slow down frame rate for testing things. // RenderFlag = 1; // DEBUG -- 2.39.2