rogueclone-cvs Mailing List for Rogue Clone IV
Brought to you by:
mlehotay
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(8) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(23) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
2009 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: William A. <wil...@au...> - 2016-02-04 00:01:30
|
Rogue Clone IV Developers, I have a fix to an annoying issue in Rogue Clone IV for the newer Windows environments. Evidently, around about Windows 7 and since, the Visual Studio console environment has not supported a "bell" function. That is, there no sound generated when you send ASCII 7 (or CTL-g or '\a', whatever your preference) to stdout. Moreover, on my system, when the bell character was sent to the console, the console promptly dies, leaving a zombie rogue.exe process spinning in the background. So you lose your game, and you are burning cycles; not good. If you play Rogue at a reasonable pace (like me - my brain doesn't play the game, my fingers do) then a bell will inevitably come, and there goes the game. I have tested the download from sourceforge on my machine, and sure enough, it exhibits this same behavior. I have a relatively simple solution that I have implemented and tested. It uses the Windows multimedia system and plays a .wav file (my default file is the sound of a metal-on-metal "clank") whenever the bell is invoked. Admittedly, this is more like Windows than Unix, where I first played BSD Rogue. But, hey, it works. There are other issues to work around when compiling this code with a modern language system like, ahem, Visual Studio 2015. The issue of const string literals will kill you if you try to compile in a modern C/C++ syntax. Luckily, Visual Studio seems to have the flags that allows old, crazy C code to be compiled. I spent most of a day figuring this out. Since this is a structural change (one more source file, plus the .wav sound file), I wanted to find out if this mailing list would approve this update. Let me know. Willie Anderson |
From: Michael L. <mle...@us...> - 2009-01-02 22:11:37
|
Update of /cvsroot/rogueclone/rogue/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31910 Modified Files: Tag: curses curses.c rogue.h Log Message: stubs for standard curses functions Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.9.2.6 retrieving revision 1.9.2.7 diff -C2 -d -r1.9.2.6 -r1.9.2.7 *** rogue.h 2 Jan 2009 20:58:36 -0000 1.9.2.6 --- rogue.h 2 Jan 2009 22:11:29 -0000 1.9.2.7 *************** *** 605,610 **** int addch(const chtype ch); int addstr(const char *str); ! int attroff(chtype); ! int attron(chtype); int clear(void); int clrtoeol(void); --- 605,610 ---- int addch(const chtype ch); int addstr(const char *str); ! int attroff(chtype attrs); ! int attron(chtype attrs); int clear(void); int clrtoeol(void); *************** *** 626,631 **** int standout(void); int start_color(void); ! int wgetch(WINDOW *); ! int wrefresh(WINDOW *); #endif --- 626,631 ---- int standout(void); int start_color(void); ! int wgetch(WINDOW *win); ! int wrefresh(WINDOW *win); #endif Index: curses.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/curses.c,v retrieving revision 1.11.2.6 retrieving revision 1.11.2.7 diff -C2 -d -r1.11.2.6 -r1.11.2.7 *** curses.c 2 Jan 2009 20:58:36 -0000 1.11.2.6 --- curses.c 2 Jan 2009 22:11:29 -0000 1.11.2.7 *************** *** 69,75 **** */ - #ifdef ROGUECURSES - #include "rogue.h" #include <stdio.h> --- 69,108 ---- */ #include "rogue.h" + + int LINES=DROWS; /* terminal height */ + int COLS=DCOLS; /* terminal width */ + WINDOW *stdscr; /* the default screen window */ + WINDOW *curscr; /* the current screen image */ + + /* stubs for now */ + int addch(const chtype ch) {return 0;}; + int addstr(const char *str) {return 0;}; + int attroff(chtype attrs) {return 0;}; + int attron(chtype attrs) {return 0;}; + int clear(void) {return 0;}; + int clrtoeol(void) {return 0;}; + int crmode(void) {return 0;}; + int def_prog_mode(void) {return 0;}; + int endwin(void) {return 0;}; + bool has_colors(void) {return 0;}; + int init_pair(short pair, short f, short b) {return 0;}; + WINDOW *initscr(void) {return 0;}; + int move(int row, int col) {return 0;}; + int mvaddch(int row, int col, const chtype ch) {return 0;}; + int mvaddchnstr(int y, int x, const chtype *chstr, int n) {return 0;}; + int mvaddstr(int row, int col, const char *str) {return 0;}; + chtype mvinch(int row, int col) {return 0;}; + int noecho(void) {return 0;}; + int nonl(void) {return 0;}; + int refresh(void) {return 0;}; + int standend(void) {return 0;}; + int standout(void) {return 0;}; + int start_color(void) {return 0;}; + int wgetch(WINDOW *win) {return 0;}; + int wrefresh(WINDOW *win) {return 0;}; + + #ifdef OLDROGUECURSES + #include <stdio.h> *************** *** 97,104 **** /* ============== CONSTANTS AND TYPEDEFS =============== */ - /* ================== GLOBAL VARIABLES ================== */ - - int LINES=DROWS, COLS=DCOLS; - /* ================= PRIVATE PROTOTYPES ================= */ --- 130,133 ---- *************** *** 804,806 **** } ! #endif /* ROGUECURSES */ --- 833,835 ---- } ! #endif /* OLDROGUECURSES */ |
From: Michael L. <mle...@us...> - 2009-01-02 20:58:42
|
Update of /cvsroot/rogueclone/rogue/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29053/src Modified Files: Tag: curses curses.c rogue.h Log Message: use standard curses interface for ROGUECURSES Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.9.2.5 retrieving revision 1.9.2.6 diff -C2 -d -r1.9.2.5 -r1.9.2.6 *** rogue.h 7 Dec 2008 01:51:26 -0000 1.9.2.5 --- rogue.h 2 Jan 2009 20:58:36 -0000 1.9.2.6 *************** *** 241,250 **** #ifdef ROGUECURSES ! extern int LINES, COLS; ! typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ typedef chtype attr_t; ! /* Support for color GUI... ! */ #define COLOR_BLACK 0x00 #define COLOR_BLUE 0x01 --- 241,258 ---- #ifdef ROGUECURSES ! typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ typedef chtype attr_t; ! typedef struct _win_st { ! short _cury, _curx; ! short _maxy, _maxx; ! } WINDOW; ! ! typedef unsigned char bool; /* PDCurses Boolean type */ ! ! extern int LINES, COLS; ! extern WINDOW *stdscr; /* the default screen window */ ! extern WINDOW *curscr; /* the current screen image */ ! #define COLOR_BLACK 0x00 #define COLOR_BLUE 0x01 *************** *** 267,303 **** #define PDC_COLOR_SHIFT 11 - #define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR) ! /* ! #define GRAY 0x08 ! #define BRIGHT_BLUE 0x09 ! #define BRIGHT_GREEN 0x0A ! #define BRIGHT_CYAN 0x0B ! #define BRIGHT_RED 0x0C ! #define BRIGHT_MAGENTA 0x0D ! #define BRIGHT_YELLOW 0x0E ! #define BRIGHT_WHITE 0x0F ! ! union _colorChar { ! struct { ! byte color; ! char ch; ! } b8; ! unsigned short b16; ! }; ! //typedef union _colorChar color_char; ! ! #define MAKE_COLOR(fg,bg) (byte)(((fg) & 0x0F) | (((bg) & 0x0F) << 4)) ! #define MAKE_COLOR_CHAR(fg,bg,ch) (unsigned short) \ ! (((unsigned short) (ch) << 8) | MAKE_COLOR((fg),(bg))) ! ! #define INVERT_COLOR(col) (byte)( (((col) >> 4) & 0x0F) \ ! | (((col) << 4) & 0xF0) ) ! #define BGCOLOR_OF(col) (byte)(((col) >> 4) & 0x0F) ! #define FGCOLOR_OF(col) (byte)((col) & 0x0F) ! */ ! #else /* link with pdcurses. maybe other curses would work too? */ #ifdef __MSDOS__ --- 275,283 ---- #define PDC_COLOR_SHIFT 11 #define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR) ! #define getch() wgetch(stdscr) ! #else /* link with pdcurses or ncurses, other curses will work too */ #ifdef __MSDOS__ *************** *** 307,311 **** #include "curses.h" ! #endif /* ROGUECURSES */ #define COLOR_STAIRS COLOR_WHITE+1 --- 287,291 ---- #include "curses.h" ! #endif */ ROGUECURSES */ #define COLOR_STAIRS COLOR_WHITE+1 *************** *** 353,357 **** short picked_up; /* sleep from wand of sleep */ unsigned short in_use_flags; ! chtype cchar; /* character underneath monster */ int dchar_ix; /* imitator's character index */ struct obj *next_object; /* next monster */ --- 333,337 ---- short picked_up; /* sleep from wand of sleep */ unsigned short in_use_flags; ! chtype cchar; /* character underneath monster */ int dchar_ix; /* imitator's character index */ struct obj *next_object; /* next monster */ *************** *** 623,655 **** /* curses.c */ #ifdef ROGUECURSES ! int has_colors(void); ! int start_color(void); int init_pair(short pair, short f, short b); int mvaddchnstr(int y, int x, const chtype *chstr, int n); ! int getch(void); ! void initscr(void); ! void move(const short row, const short col); ! void addstr(char *str); ! void mvaddstr(const short row, const short col, char *str); ! void mvaddstr_in_color(const short row, const short col, char *str, const byte color); ! void mvaddcstr(const short row, const short col, chtype *cstr); ! void addch(const int ch); ! void mvaddch(const short row, const short col, const int ch); ! void addcch(const chtype cc); ! void mvaddcch(const short row, const short col, const chtype cc); ! void refresh(void); ! void redraw(void); ! chtype mvinch(const short row, const short col); ! chtype mvincch(const short row, const short col); ! void clear(void); ! void clrtoeol(void); ! void standout(void); ! void standend(void); ! void draw_box(const chtype cset[6], const short ulrow, const short ulcol, const short height, const short width); ! void endwin(void); ! void crmode(void); ! void noecho(void); ! void nonl(void); ! #endif /* ROGUECURSES */ /* hit.c */ --- 603,632 ---- /* curses.c */ #ifdef ROGUECURSES ! int addch(const chtype ch); ! int addstr(const char *str); ! int attroff(chtype); ! int attron(chtype); ! int clear(void); ! int clrtoeol(void); ! int crmode(void); ! int def_prog_mode(void); ! int endwin(void); ! bool has_colors(void); int init_pair(short pair, short f, short b); + WINDOW *initscr(void); + int move(int row, int col); + int mvaddch(int row, int col, const chtype ch); int mvaddchnstr(int y, int x, const chtype *chstr, int n); ! int mvaddstr(int row, int col, const char *str); ! chtype mvinch(int row, int col); ! int noecho(void); ! int nonl(void); ! int refresh(void); ! int standend(void); ! int standout(void); ! int start_color(void); ! int wgetch(WINDOW *); ! int wrefresh(WINDOW *); ! #endif /* hit.c */ Index: curses.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/curses.c,v retrieving revision 1.11.2.5 retrieving revision 1.11.2.6 diff -C2 -d -r1.11.2.5 -r1.11.2.6 *** curses.c 7 Dec 2008 01:51:26 -0000 1.11.2.5 --- curses.c 2 Jan 2009 20:58:36 -0000 1.11.2.6 *************** *** 97,118 **** /* ============== CONSTANTS AND TYPEDEFS =============== */ ! struct _win_st { ! short _cury, _curx; ! short _maxy, _maxx; ! }; ! typedef struct _win_st WINDOW; - typedef union _colorChar COLORBUF; - #define BLANKCH MAKE_COLOR_CHAR(WHITE,BLACK,' ') ! /* ================== GLOBAL VARIABLES ================== */ ! int LINES=DROWS, COLS=DCOLS; ! /* static char terminal[DROWS][DCOLS]; */ ! /* static char buffer[DROWS][DCOLS]; */ ! static COLORBUF terminal[DROWS][DCOLS]; ! static COLORBUF buffer[DROWS][DCOLS]; static boolean screen_dirty; --- 97,111 ---- /* ============== CONSTANTS AND TYPEDEFS =============== */ ! /* ================== GLOBAL VARIABLES ================== */ + int LINES=DROWS, COLS=DCOLS; ! /* ================= PRIVATE PROTOTYPES ================= */ ! #define BLANKCH MAKE_COLOR_CHAR(WHITE,BLACK,' ') ! static chtype terminal[DROWS][DCOLS]; ! static chtype buffer[DROWS][DCOLS]; static boolean screen_dirty; *************** *** 130,135 **** #endif - /* ================= PRIVATE PROTOTYPES ================= */ - static void addstr_in_color(char *str, const byte color); /* only used within this file */ static void addcstr(chtype *cstr); /* only used within this file */ --- 123,126 ---- *************** *** 142,145 **** --- 133,181 ---- static void wrefresh(WINDOW *scr); /* only used within this file */ + #if 0 + /* #ifdef OLDROGUECURSES */ + void mvaddstr_in_color(const short row, const short col, char *str, const byte color); + void mvaddcstr(const short row, const short col, chtype *cstr); + void addcch(const chtype cc); + void mvaddcch(const short row, const short col, const chtype cc); + void redraw(void); + chtype mvincch(const short row, const short col); + void draw_box(const chtype cset[6], const short ulrow, const short ulcol, const short height, const short width); + + /* Support for color GUI... + */ + + /* + #define GRAY 0x08 + #define BRIGHT_BLUE 0x09 + #define BRIGHT_GREEN 0x0A + #define BRIGHT_CYAN 0x0B + #define BRIGHT_RED 0x0C + #define BRIGHT_MAGENTA 0x0D + #define BRIGHT_YELLOW 0x0E + #define BRIGHT_WHITE 0x0F + + union _colorChar { + struct { + byte color; + char ch; + } b8; + unsigned short b16; + }; + //typedef union _colorChar color_char; + + #define MAKE_COLOR(fg,bg) (byte)(((fg) & 0x0F) | (((bg) & 0x0F) << 4)) + #define MAKE_COLOR_CHAR(fg,bg,ch) (unsigned short) \ + (((unsigned short) (ch) << 8) | MAKE_COLOR((fg),(bg))) + + #define INVERT_COLOR(col) (byte)( (((col) >> 4) & 0x0F) \ + | (((col) << 4) & 0xF0) ) + #define BGCOLOR_OF(col) (byte)(((col) >> 4) & 0x0F) + #define FGCOLOR_OF(col) (byte)((col) & 0x0F) + */ + + /* #endif OLDROGUECURSES */ + #endif + /* ================== PUBLIC FUNCTIONS ================== */ |
From: Michael L. <mle...@us...> - 2009-01-02 20:58:42
|
Update of /cvsroot/rogueclone/rogue/doc In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29053/doc Modified Files: Tag: curses changelog.txt Log Message: use standard curses interface for ROGUECURSES Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.5.2.6 retrieving revision 1.5.2.7 diff -C2 -d -r1.5.2.6 -r1.5.2.7 *** changelog.txt 7 Dec 2008 17:53:47 -0000 1.5.2.6 --- changelog.txt 2 Jan 2009 20:58:36 -0000 1.5.2.7 *************** *** 1,2 **** --- 1,9 ---- + to do + ----- + fix roguecurses + fix bugs from sf tracker + compile with current gcc (fwritable-strings) + verbose/terse modes + bugs with gcc & ncurses: 1. some hi ascii chars not displayed properly *************** *** 6,9 **** --- 13,17 ---- Changelog --------- + 3:23 PM 2009-01-02 - standardized roguecurses interface in rogue.h 12:40 PM 2008-12-07 - created pdcurses visual studio project configurations 7:24 PM 2008-12-06 - compiles with cygwin gcc 3.3.1, links with ncurses |
From: Michael L. <mle...@us...> - 2009-01-02 20:58:41
|
Update of /cvsroot/rogueclone/rogue/sys In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29053/sys Modified Files: Tag: curses makefile.dj Log Message: use standard curses interface for ROGUECURSES Index: makefile.dj =================================================================== RCS file: /cvsroot/rogueclone/rogue/sys/makefile.dj,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** makefile.dj 2 Apr 2005 16:47:52 -0000 1.2 --- makefile.dj 2 Jan 2009 20:58:36 -0000 1.2.2.1 *************** *** 1,5 **** # rogue clone IV makefile for DJGPP Make ! CFLAGS = -O2 -DHAVECURSES # -Wall LDFLAGS = -s LDLIBS = -lpdcurses --- 1,5 ---- # rogue clone IV makefile for DJGPP Make ! CFLAGS = -O2 -DROGUECURSES # -Wall LDFLAGS = -s LDLIBS = -lpdcurses |
From: Michael L. <mle...@us...> - 2009-01-02 20:55:16
|
Update of /cvsroot/rogueclone/rogue/sys In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28902 Added Files: Tag: curses rogue.sln rogue.vcproj Log Message: Visual Studio 2008 project files --- NEW FILE: rogue.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="9.00" Name="rogue" ProjectGUID="{760AF40F-9E02-4F43-A3BF-39AD040F4E7B}" TargetFrameworkVersion="0" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Release|Win32" OutputDirectory=".\Release" [...1175 lines suppressed...] > </File> <File RelativePath="..\src\rogue.h" > </File> <File RelativePath="..\src\version.h" > </File> </Filter> <Filter Name="Resource Files" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" > </Filter> </Files> <Globals> </Globals> </VisualStudioProject> --- NEW FILE: rogue.sln --- (This appears to be a binary file; contents omitted.) |
From: Michael L. <mle...@us...> - 2009-01-02 16:25:05
|
Update of /cvsroot/rogueclone/rogue/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15683 Modified Files: Tag: curses version.h Log Message: updating todo list Index: version.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/version.h,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** version.h 2 Apr 2005 13:28:05 -0000 1.6 --- version.h 2 Jan 2009 16:24:53 -0000 1.6.2.1 *************** *** 12,16 **** * todo: port to Linux * todo: fix some bugs - * todo: apply some patches (but not ansification patches, not yet) */ --- 12,15 ---- |
From: Michael L. <mle...@us...> - 2008-12-07 17:53:59
|
Update of /cvsroot/rogueclone/rogue/sys In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3852/sys Modified Files: Tag: curses rogue.dsp Log Message: new visual studio project configurations for linking with pdcurses Index: rogue.dsp =================================================================== RCS file: /cvsroot/rogueclone/rogue/sys/rogue.dsp,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** rogue.dsp 19 Jun 2008 02:50:20 -0000 1.3.2.2 --- rogue.dsp 7 Dec 2008 17:53:47 -0000 1.3.2.3 *************** *** 5,9 **** # TARGTYPE "Win32 (x86) Console Application" 0x0103 ! CFG=rogue - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run --- 5,9 ---- # TARGTYPE "Win32 (x86) Console Application" 0x0103 ! CFG=rogue - Win32 Debug with pdcurses !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run *************** *** 14,18 **** !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE ! !MESSAGE NMAKE /f "rogue.mak" CFG="rogue - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: --- 14,18 ---- !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE ! !MESSAGE NMAKE /f "rogue.mak" CFG="rogue - Win32 Debug with pdcurses" !MESSAGE !MESSAGE Possible choices for configuration are: *************** *** 20,23 **** --- 20,25 ---- !MESSAGE "rogue - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "rogue - Win32 Debug" (based on "Win32 (x86) Console Application") + !MESSAGE "rogue - Win32 Debug with pdcurses" (based on "Win32 (x86) Console Application") + !MESSAGE "rogue - Win32 Release with pdcurses" (based on "Win32 (x86) Console Application") !MESSAGE *************** *** 43,47 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # ADD BASE RSC /l 0x1009 /d "NDEBUG" # ADD RSC /l 0x1009 /d "NDEBUG" --- 45,49 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "ROGUECURSES" /FD /c # ADD BASE RSC /l 0x1009 /d "NDEBUG" # ADD RSC /l 0x1009 /d "NDEBUG" *************** *** 67,71 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /I../sys/pdcurses /c # ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x1009 /d "_DEBUG" --- 69,73 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "ROGUECURSES" /FR /FD /GZ /c # ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x1009 /d "_DEBUG" *************** *** 75,81 **** --- 77,136 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + # ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"oldnames" /pdbtype:sept /warn:3 + # SUBTRACT LINK32 /pdb:none + + !ELSEIF "$(CFG)" == "rogue - Win32 Debug with pdcurses" + + # PROP BASE Use_MFC 0 + # PROP BASE Use_Debug_Libraries 1 + # PROP BASE Output_Dir "rogue___Win32_Debug_with_pdcurses" + # PROP BASE Intermediate_Dir "rogue___Win32_Debug_with_pdcurses" + # PROP BASE Ignore_Export_Lib 0 + # PROP BASE Target_Dir "" + # PROP Use_MFC 0 + # PROP Use_Debug_Libraries 1 + # PROP Output_Dir "Debug" + # PROP Intermediate_Dir "Debug" + # PROP Ignore_Export_Lib 0 + # PROP Target_Dir "" + # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /I../sys/pdcurses /c + # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /I../sys/pdcurses /c + # ADD BASE RSC /l 0x1009 /d "_DEBUG" + # ADD RSC /l 0x1009 /d "_DEBUG" + BSC32=bscmake.exe + # ADD BASE BSC32 /nologo + # ADD BSC32 /nologo + LINK32=link.exe + # ADD BASE LINK32 ../sys/pdcurses/pdcurses.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"oldnames" /pdbtype:sept /warn:3 + # SUBTRACT BASE LINK32 /pdb:none # ADD LINK32 ../sys/pdcurses/pdcurses.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"oldnames" /pdbtype:sept /warn:3 # SUBTRACT LINK32 /pdb:none + !ELSEIF "$(CFG)" == "rogue - Win32 Release with pdcurses" + + # PROP BASE Use_MFC 0 + # PROP BASE Use_Debug_Libraries 0 + # PROP BASE Output_Dir "rogue___Win32_Release_with_pdcurses" + # PROP BASE Intermediate_Dir "rogue___Win32_Release_with_pdcurses" + # PROP BASE Ignore_Export_Lib 0 + # PROP BASE Target_Dir "" + # PROP Use_MFC 0 + # PROP Use_Debug_Libraries 0 + # PROP Output_Dir "Release" + # PROP Intermediate_Dir "Release" + # PROP Ignore_Export_Lib 0 + # PROP Target_Dir "" + # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c + # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /I../sys/pdcurses /c + # ADD BASE RSC /l 0x1009 /d "NDEBUG" + # ADD RSC /l 0x1009 /d "NDEBUG" + BSC32=bscmake.exe + # ADD BASE BSC32 /nologo + # ADD BSC32 /nologo + LINK32=link.exe + # ADD BASE LINK32 /nologo /machine:I386 /nodefaultlib:"oldnames" /warn:3 + # ADD LINK32 ../sys/pdcurses/pdcurses.lib /nologo /machine:I386 /nodefaultlib:"oldnames" /warn:3 + # SUBTRACT LINK32 /pdb:none + !ENDIF *************** *** 84,87 **** --- 139,144 ---- # Name "rogue - Win32 Release" # Name "rogue - Win32 Debug" + # Name "rogue - Win32 Debug with pdcurses" + # Name "rogue - Win32 Release with pdcurses" # Begin Group "Source Files" |
From: Michael L. <mle...@us...> - 2008-12-07 17:53:53
|
Update of /cvsroot/rogueclone/rogue/doc In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3852/doc Modified Files: Tag: curses changelog.txt Log Message: new visual studio project configurations for linking with pdcurses Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.5.2.5 retrieving revision 1.5.2.6 diff -C2 -d -r1.5.2.5 -r1.5.2.6 *** changelog.txt 7 Dec 2008 01:51:25 -0000 1.5.2.5 --- changelog.txt 7 Dec 2008 17:53:47 -0000 1.5.2.6 *************** *** 1,4 **** --- 1,10 ---- + bugs with gcc & ncurses: + 1. some hi ascii chars not displayed properly + 2. old monster position not cleared when moving + + Changelog --------- + 12:40 PM 2008-12-07 - created pdcurses visual studio project configurations 7:24 PM 2008-12-06 - compiles with cygwin gcc 3.3.1, links with ncurses 7:07 PM 2008-08-17 - fixed curses colour, now links with pdcurses |
From: Michael L. <mle...@us...> - 2008-12-07 01:52:11
|
Update of /cvsroot/rogueclone/rogue/doc In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11732/doc Modified Files: Tag: curses changelog.txt Log Message: compiles with cygwin gcc 3.3.1, links with ncurses 5.3 Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.5.2.4 retrieving revision 1.5.2.5 diff -C2 -d -r1.5.2.4 -r1.5.2.5 *** changelog.txt 17 Aug 2008 23:19:05 -0000 1.5.2.4 --- changelog.txt 7 Dec 2008 01:51:25 -0000 1.5.2.5 *************** *** 1,4 **** --- 1,5 ---- Changelog --------- + 7:24 PM 2008-12-06 - compiles with cygwin gcc 3.3.1, links with ncurses 7:07 PM 2008-08-17 - fixed curses colour, now links with pdcurses 1:35 AM 2008-06-22 - moved colorize() to message.c |
From: Michael L. <mle...@us...> - 2008-12-07 01:52:05
|
Update of /cvsroot/rogueclone/rogue/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11732/src Modified Files: Tag: curses curses.c init.c invent.c machdep.c main.c message.c rogue.h Log Message: compiles with cygwin gcc 3.3.1, links with ncurses 5.3 Index: message.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/message.c,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -C2 -d -r1.7.2.3 -r1.7.2.4 *** message.c 17 Aug 2008 23:19:05 -0000 1.7.2.3 --- message.c 7 Dec 2008 01:51:26 -0000 1.7.2.4 *************** *** 96,100 **** if (did_int) { did_int = 0; ! #ifdef _MSC_VER onintr(0); #else --- 96,100 ---- if (did_int) { did_int = 0; ! #if defined(_MSC_VER) || defined(unix) onintr(0); #else Index: init.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/init.c,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** init.c 18 Jun 2008 03:16:13 -0000 1.9.2.1 --- init.c 7 Dec 2008 01:51:26 -0000 1.9.2.2 *************** *** 46,49 **** --- 46,50 ---- #include <stdio.h> + #include <string.h> #include "rogue.h" #include "version.h" *************** *** 161,165 **** (rest_file ? "back " : "")); ! return (rest_file!=NULL); } --- 162,166 ---- (rest_file ? "back " : "")); ! return (rest_file!=NULL); } *************** *** 270,274 **** ! #ifdef _MSC_VER void byebye(int foo) #else --- 271,275 ---- ! #if defined(_MSC_VER) || defined(unix) void byebye(int foo) #else *************** *** 285,290 **** } ! ! #ifdef _MSC_VER void onintr(int foo) #else --- 286,290 ---- } ! #if defined(_MSC_VER) || defined(unix) void onintr(int foo) #else Index: invent.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/invent.c,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -C2 -d -r1.8.2.2 -r1.8.2.3 *** invent.c 17 Aug 2008 23:19:05 -0000 1.8.2.2 --- invent.c 7 Dec 2008 01:51:26 -0000 1.8.2.3 *************** *** 45,49 **** */ ! #include <stddef.h> /* for NULL */ #include "rogue.h" #include "paths.h" --- 45,50 ---- */ ! #include <stdio.h> ! #include <string.h> #include "rogue.h" #include "paths.h" Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.9.2.4 retrieving revision 1.9.2.5 diff -C2 -d -r1.9.2.4 -r1.9.2.5 *** rogue.h 17 Aug 2008 23:19:05 -0000 1.9.2.4 --- rogue.h 7 Dec 2008 01:51:26 -0000 1.9.2.5 *************** *** 49,53 **** *****************************************************************************/ ! /* #define ROGUECURSES */ /* instead of linking with pdcurses, ncurses, etc */ /* #define DISCOVERY */ /* D command to list discovered items -NS */ #define KNOWN_ITEMS /* \ command to list known items -steve_ued */ --- 49,53 ---- *****************************************************************************/ ! /* #define ROGUECURSES */ /* instead of linking with pdcurses, ncurses, etc */ /* #define DISCOVERY */ /* D command to list discovered items -NS */ #define KNOWN_ITEMS /* \ command to list known items -steve_ued */ *************** *** 301,307 **** #else /* link with pdcurses. maybe other curses would work too? */ ! #ifdef __MSDOS__ ! #define DOS /* kludge for pdcurses */ ! #endif #include "curses.h" --- 301,308 ---- #else /* link with pdcurses. maybe other curses would work too? */ ! #ifdef __MSDOS__ ! #define DOS /* for pdcurses */ ! #endif ! #include "curses.h" *************** *** 623,627 **** #ifdef ROGUECURSES int has_colors(void); ! int start_color(void); int init_pair(short pair, short f, short b); int mvaddchnstr(int y, int x, const chtype *chstr, int n); --- 624,628 ---- #ifdef ROGUECURSES int has_colors(void); ! int start_color(void); int init_pair(short pair, short f, short b); int mvaddchnstr(int y, int x, const chtype *chstr, int n); *************** *** 675,679 **** void error_save(void); void strip(char *s, const boolean add_blank); ! #ifdef _MSC_VER void onintr(int foo); void byebye(int foo); --- 676,680 ---- void error_save(void); void strip(char *s, const boolean add_blank); ! #if defined(_MSC_VER) || defined(unix) void onintr(int foo); void byebye(int foo); Index: curses.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/curses.c,v retrieving revision 1.11.2.4 retrieving revision 1.11.2.5 diff -C2 -d -r1.11.2.4 -r1.11.2.5 *** curses.c 17 Aug 2008 23:19:05 -0000 1.11.2.4 --- curses.c 7 Dec 2008 01:51:26 -0000 1.11.2.5 *************** *** 149,153 **** } ! int start_color(void) { return 0; } --- 149,153 ---- } ! int start_color(void) { return 0; } Index: machdep.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/machdep.c,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -C2 -d -r1.7.2.2 -r1.7.2.3 *** machdep.c 17 Aug 2008 23:19:05 -0000 1.7.2.2 --- machdep.c 7 Dec 2008 01:51:26 -0000 1.7.2.3 *************** *** 84,91 **** /* #include <conio.h> */ #include <time.h> - #include <io.h> #include <fcntl.h> #include <signal.h> #include <process.h> #include "paths.h" #include "version.h" --- 84,93 ---- /* #include <conio.h> */ #include <time.h> #include <fcntl.h> #include <signal.h> #include <process.h> + #ifndef unix + #include <io.h> + #endif #include "paths.h" #include "version.h" *************** *** 114,117 **** --- 116,122 ---- #ifdef _MSC_VER FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); + #elif defined(unix) + /* while(getc(stdin) != EOF); */ + return; #else while(kbhit()) *************** *** 163,168 **** void md_heed_signals(void) { ! signal(SIGINT, onintr); ! signal(SIGTERM, byebye); } --- 168,173 ---- void md_heed_signals(void) { ! signal(SIGINT, onintr); ! signal(SIGTERM, byebye); } *************** *** 375,379 **** /*char *getenv(); already defined in stdlib.h */ ! value = getenv(name); return(value); --- 380,384 ---- /*char *getenv(); already defined in stdlib.h */ ! value = (char *) getenv(name); return(value); *************** *** 394,398 **** char *t; ! t = malloc(n); return(t); } --- 399,403 ---- char *t; ! t = (char *) malloc(n); return(t); } *************** *** 495,502 **** void md_shell(const char *shell) { ! #ifndef _MSC_VER ! spawnl(P_WAIT, shell, shell, NULL); ! #else (void) _spawnl(_P_WAIT, shell, shell, NULL); #endif } --- 500,509 ---- void md_shell(const char *shell) { ! #ifdef _MSC_VER (void) _spawnl(_P_WAIT, shell, shell, NULL); + #elif defined (unix) + spawnl(_P_WAIT, shell, shell, NULL); + #else + spawnl(P_WAIT, shell, shell, NULL); #endif } Index: main.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/main.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** main.c 11 Jun 2008 06:16:35 -0000 1.3 --- main.c 7 Dec 2008 01:51:26 -0000 1.3.2.1 *************** *** 51,55 **** ! void main(int argc, char *argv[]) { boolean welcomed = 0; --- 51,55 ---- ! int main(int argc, char *argv[]) { boolean welcomed = 0; *************** *** 78,80 **** --- 78,82 ---- free_stuff(&level_monsters); } + + return 0; } |
From: Michael L. <mle...@us...> - 2008-12-07 01:52:05
|
Update of /cvsroot/rogueclone/rogue/sys In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11732/sys Modified Files: Tag: curses makefile.gcc Added Files: Tag: curses setup.sh Log Message: compiles with cygwin gcc 3.3.1, links with ncurses 5.3 --- NEW FILE: setup.sh --- #!/bin/sh # shell script to prepare rogue clone for compilation linux echo Setting up for gcc... echo Copying Makefile... cp makefile.gcc ../Makefile echo Creating directories... mkdir -p ../o mkdir -p ../exe echo Done Index: makefile.gcc =================================================================== RCS file: /cvsroot/rogueclone/rogue/sys/makefile.gcc,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** makefile.gcc 28 Jun 2003 15:38:52 -0000 1.2 --- makefile.gcc 7 Dec 2008 01:51:26 -0000 1.2.4.1 *************** *** 1,4 **** --- 1,8 ---- # RogueClone makefile for GNU Make + CFLAGS = # -fwritable-strings + LDFLAGS = + LDLIBS = -lncurses + OBJ = o EXE = exe *************** *** 12,16 **** $(OBJ)/trap.o $(OBJ)/use.o $(OBJ)/zap.o ! GAME = $(EXE)/rogue.exe ###################### --- 16,20 ---- $(OBJ)/trap.o $(OBJ)/use.o $(OBJ)/zap.o ! GAME = $(EXE)/rogue ###################### *************** *** 18,91 **** $(GAME) : $(OBJECTS) ! gcc $(OBJECTS) -o $(GAME) $(OBJ)/curses.o : $(SRC)/curses.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/hit.o : $(SRC)/hit.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/init.o : $(SRC)/init.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc -c $< -o $@ $(OBJ)/invent.o : $(SRC)/invent.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/level.o : $(SRC)/level.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/machdep.o : $(SRC)/machdep.c $(SRC)/rogue.h $(SRC)/paths.h $(SRC)/version.h ! gcc -c $< -o $@ $(OBJ)/main.o : $(SRC)/main.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/message.o : $(SRC)/message.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc -c $< -o $@ $(OBJ)/monster.o : $(SRC)/monster.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/move.o : $(SRC)/move.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/object.o : $(SRC)/object.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc -c $< -o $@ $(OBJ)/pack.o : $(SRC)/pack.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/play.o : $(SRC)/play.c $(SRC)/rogue.h $(SRC)/version.h ! gcc -c $< -o $@ $(OBJ)/random.o : $(SRC)/random.c ! gcc -c $< -o $@ $(OBJ)/ring.o : $(SRC)/ring.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/room.o : $(SRC)/room.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/save.o : $(SRC)/save.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/score.o : $(SRC)/score.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc -c $< -o $@ $(OBJ)/spec_hit.o : $(SRC)/spec_hit.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/throw.o : $(SRC)/throw.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/trap.o : $(SRC)/trap.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/use.o : $(SRC)/use.c $(SRC)/rogue.h ! gcc -c $< -o $@ $(OBJ)/zap.o : $(SRC)/zap.c $(SRC)/rogue.h ! gcc -c $< -o $@ --- 22,95 ---- $(GAME) : $(OBJECTS) ! gcc $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $(GAME) $(OBJ)/curses.o : $(SRC)/curses.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/hit.o : $(SRC)/hit.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/init.o : $(SRC)/init.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/invent.o : $(SRC)/invent.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/level.o : $(SRC)/level.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/machdep.o : $(SRC)/machdep.c $(SRC)/rogue.h $(SRC)/paths.h $(SRC)/version.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/main.o : $(SRC)/main.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/message.o : $(SRC)/message.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/monster.o : $(SRC)/monster.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/move.o : $(SRC)/move.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/object.o : $(SRC)/object.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/pack.o : $(SRC)/pack.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/play.o : $(SRC)/play.c $(SRC)/rogue.h $(SRC)/version.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/random.o : $(SRC)/random.c ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/ring.o : $(SRC)/ring.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/room.o : $(SRC)/room.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/save.o : $(SRC)/save.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/score.o : $(SRC)/score.c $(SRC)/rogue.h $(SRC)/paths.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/spec_hit.o : $(SRC)/spec_hit.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/throw.o : $(SRC)/throw.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/trap.o : $(SRC)/trap.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/use.o : $(SRC)/use.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ $(OBJ)/zap.o : $(SRC)/zap.c $(SRC)/rogue.h ! gcc $(CFLAGS) -c $< -o $@ |
From: Michael L. <mle...@us...> - 2008-08-17 23:19:09
|
Update of /cvsroot/rogueclone/rogue/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9151/src Modified Files: Tag: curses curses.c invent.c machdep.c message.c object.c rogue.h Log Message: fixed curses colour, now links with pdcurses Index: message.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/message.c,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -C2 -d -r1.7.2.2 -r1.7.2.3 *** message.c 19 Jun 2008 04:32:13 -0000 1.7.2.2 --- message.c 17 Aug 2008 23:19:05 -0000 1.7.2.3 *************** *** 344,347 **** --- 344,361 ---- + /* Turns a dull B&W string into a vibrant color one. :-) + */ + + void colorize(char *str, attr_t color, chtype *cstr) + { + while (*str != '\0') { + (*cstr) = *str | color; + str++; + cstr++; + } + (*cstr) = 0; + } + + /* NS: We convert to ASCII characters before saving, if necessary. */ Index: invent.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/invent.c,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** invent.c 18 Jun 2008 03:16:13 -0000 1.8.2.1 --- invent.c 17 Aug 2008 23:19:05 -0000 1.8.2.2 *************** *** 224,238 **** static int pr_motion_char(int ch); /* only used within this file */ - colorize(char *str, attr_t color, chtype *cstr) - { - while (*str != '\0') { - (*cstr) = *str | color; - str++; - cstr++; - } - (*cstr) = 0; - } - - void inventory(object *pack, const unsigned short mask) { --- 224,227 ---- *************** *** 273,277 **** get_desc(obj, bwdesc); ! (void) colorize(bwdesc, item_color, descs[i]+4); if ((n = (short) (strlen(bwdesc)+4) ) > maxlen) { maxlen = n; --- 262,266 ---- get_desc(obj, bwdesc); ! colorize(bwdesc, item_color, descs[i]+4); if ((n = (short) (strlen(bwdesc)+4) ) > maxlen) { maxlen = n; *************** *** 281,285 **** obj = obj->next_object; } ! (void) colorize(press_space, COLOR_PAIR(COLOR_WHITE), descs[i++]); if (maxlen < 27) maxlen = 27; col = DCOLS - (maxlen + 2); --- 270,274 ---- obj = obj->next_object; } ! colorize(press_space, COLOR_PAIR(COLOR_WHITE), descs[i++]); if (maxlen < 27) maxlen = 27; col = DCOLS - (maxlen + 2); Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.9.2.3 retrieving revision 1.9.2.4 diff -C2 -d -r1.9.2.3 -r1.9.2.4 *** rogue.h 19 Jun 2008 04:32:15 -0000 1.9.2.3 --- rogue.h 17 Aug 2008 23:19:05 -0000 1.9.2.4 *************** *** 49,55 **** *****************************************************************************/ ! /* #define ROGUECURSES */ ! /* #define DISCOVERY */ ! #define KNOWN_ITEMS /* #define ONE_SCORE */ --- 49,55 ---- *****************************************************************************/ ! /* #define ROGUECURSES */ /* instead of linking with pdcurses, ncurses, etc */ ! /* #define DISCOVERY */ /* D command to list discovered items -NS */ ! #define KNOWN_ITEMS /* \ command to list known items -steve_ued */ /* #define ONE_SCORE */ *************** *** 247,258 **** /* Support for color GUI... */ ! #define BLACK 0x00 ! #define BLUE 0x01 ! #define GREEN 0x02 ! #define CYAN 0x03 ! #define RED 0x04 ! #define MAGENTA 0x05 ! #define YELLOW 0x06 ! #define WHITE 0x07 #define GRAY 0x08 #define BRIGHT_BLUE 0x09 --- 247,274 ---- /* Support for color GUI... */ ! #define COLOR_BLACK 0x00 ! #define COLOR_BLUE 0x01 ! #define COLOR_GREEN 0x02 ! #define COLOR_CYAN 0x03 ! #define COLOR_RED 0x04 ! #define COLOR_MAGENTA 0x05 ! #define COLOR_YELLOW 0x06 ! #define COLOR_WHITE 0x07 ! ! #define A_ATTRIBUTES (chtype)0xff00 /* X/Open */ ! #define A_CHARTEXT (chtype)0x00ff /* X/Open */ ! #define A_COLOR (chtype)0xf800 /* System V */ ! ! #define A_ALTCHARSET A_NORMAL /* X/Open */ ! ! #define A_NORMAL (chtype)0 ! #define A_BOLD (chtype)0x0100 /* X/Open */ ! #define A_BLINK (chtype)0x0400 /* X/Open */ ! ! #define PDC_COLOR_SHIFT 11 ! ! #define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR) ! ! /* #define GRAY 0x08 #define BRIGHT_BLUE 0x09 *************** *** 271,275 **** unsigned short b16; }; ! /* typedef union _colorChar color_char; */ #define MAKE_COLOR(fg,bg) (byte)(((fg) & 0x0F) | (((bg) & 0x0F) << 4)) --- 287,291 ---- unsigned short b16; }; ! //typedef union _colorChar color_char; #define MAKE_COLOR(fg,bg) (byte)(((fg) & 0x0F) | (((bg) & 0x0F) << 4)) *************** *** 281,284 **** --- 297,301 ---- #define BGCOLOR_OF(col) (byte)(((col) >> 4) & 0x0F) #define FGCOLOR_OF(col) (byte)((col) & 0x0F) + */ #else /* link with pdcurses. maybe other curses would work too? */ *************** *** 289,296 **** #include "curses.h" - #define COLOR_STAIRS COLOR_WHITE+1 - #endif /* ROGUECURSES */ /* The following #defines provide more meaningful names for some of the --- 306,313 ---- #include "curses.h" #endif /* ROGUECURSES */ + #define COLOR_STAIRS COLOR_WHITE+1 + /* The following #defines provide more meaningful names for some of the *************** *** 605,609 **** /* curses.c */ #ifdef ROGUECURSES ! char getch(void); void initscr(void); void move(const short row, const short col); --- 622,630 ---- /* curses.c */ #ifdef ROGUECURSES ! int has_colors(void); ! int start_color(void); ! int init_pair(short pair, short f, short b); ! int mvaddchnstr(int y, int x, const chtype *chstr, int n); ! int getch(void); void initscr(void); void move(const short row, const short col); *************** *** 616,620 **** void addcch(const chtype cc); void mvaddcch(const short row, const short col, const chtype cc); - void colorize(char *str, const byte color, chtype *cstr); void refresh(void); void redraw(void); --- 637,640 ---- *************** *** 689,693 **** void show_average_hp(void); - /* machdep.c */ void md_slurp(void); --- 709,712 ---- *************** *** 720,723 **** --- 739,743 ---- char rgetchar(void); void print_stats(const int stat_mask); + void colorize(char *str, attr_t color, chtype *cstr); void save_screen(void); void sound_bell(void); Index: curses.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/curses.c,v retrieving revision 1.11.2.3 retrieving revision 1.11.2.4 diff -C2 -d -r1.11.2.3 -r1.11.2.4 *** curses.c 19 Jun 2008 04:32:13 -0000 1.11.2.3 --- curses.c 17 Aug 2008 23:19:05 -0000 1.11.2.4 *************** *** 93,98 **** #define intr_fn(N,R) __dpmi_int(N,R) - #else - #error curses.c only compiles with Open Watcom, Microsoft C, or DJGPP #endif --- 93,96 ---- *************** *** 109,114 **** #define BLANKCH MAKE_COLOR_CHAR(WHITE,BLACK,' ') - - /* ================== GLOBAL VARIABLES ================== */ --- 107,110 ---- *************** *** 148,155 **** /* ================== PUBLIC FUNCTIONS ================== */ ! /* Returns a keystroke, translated into a Rogue command. */ ! char getch(void) { char ch; --- 144,169 ---- /* ================== PUBLIC FUNCTIONS ================== */ ! ! int has_colors(void) { ! return 0; ! } ! ! int start_color(void) { ! return 0; ! } ! ! int init_pair(short pair, short f, short b) { ! return 0; ! } ! ! int mvaddchnstr(int y, int x, const chtype *chstr, int n) { ! return 0; ! } ! ! ! /* Returns a keystroke. */ ! int getch(void) { char ch; *************** *** 372,393 **** } - - - /* Turns a dull B&W string into a vibrant color one. :-) - */ - - void colorize(char *str, const byte color, chtype *cstr) - { - while (*str != '\0') { - (*cstr).b8.color = color; - (*cstr).b8.ch = *str; - str++; - cstr++; - } - (*cstr).b16 = 0; - } - - - /* These functions redraw the whole screen (redraw) or just the dirty lines * of the current screen (refresh) --- 386,389 ---- Index: object.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/object.c,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** object.c 18 Jun 2008 03:16:13 -0000 1.8.2.1 --- object.c 17 Aug 2008 23:19:05 -0000 1.8.2.2 *************** *** 857,861 **** get_desc(obj, bwdesc); ! (void) colorize(bwdesc, item_color, descs[i]+4); if ((n = (short) strlen(bwdesc)+4) > maxlen) { maxlen = n; --- 857,861 ---- get_desc(obj, bwdesc); ! colorize(bwdesc, item_color, descs[i]+4); if ((n = (short) strlen(bwdesc)+4) > maxlen) { maxlen = n; *************** *** 865,869 **** obj = obj->next_object; } ! (void) colorize(press_space, COLOR_PAIR(COLOR_WHITE), descs[i++]); /* (void) strcpy(descs[i++], press_space); */ if (maxlen < 27) maxlen = 27; --- 865,869 ---- obj = obj->next_object; } ! colorize(press_space, COLOR_PAIR(COLOR_WHITE), descs[i++]); /* (void) strcpy(descs[i++], press_space); */ if (maxlen < 27) maxlen = 27; Index: machdep.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/machdep.c,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** machdep.c 18 Jun 2008 03:16:13 -0000 1.7.2.1 --- machdep.c 17 Aug 2008 23:19:05 -0000 1.7.2.2 *************** *** 80,85 **** */ #include <stdio.h> ! #include <conio.h> #include <time.h> #include <io.h> --- 80,86 ---- */ + #include "rogue.h" #include <stdio.h> ! /* #include <conio.h> */ #include <time.h> #include <io.h> *************** *** 87,91 **** #include <signal.h> #include <process.h> - #include "rogue.h" #include "paths.h" #include "version.h" --- 88,91 ---- |
From: Michael L. <mle...@us...> - 2008-08-17 23:19:09
|
Update of /cvsroot/rogueclone/rogue/doc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9151/doc Modified Files: Tag: curses changelog.txt Log Message: fixed curses colour, now links with pdcurses Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** changelog.txt 19 Jun 2008 04:32:11 -0000 1.5.2.3 --- changelog.txt 17 Aug 2008 23:19:05 -0000 1.5.2.4 *************** *** 1,4 **** --- 1,6 ---- Changelog --------- + 7:07 PM 2008-08-17 - fixed curses colour, now links with pdcurses + 1:35 AM 2008-06-22 - moved colorize() to message.c 12:29 AM 2008-06-19 - moved rgetchar() back to message.c 10:34 PM 2008-06-18 - ifdef'd out broken curses code |
From: Michael L. <mle...@us...> - 2008-06-19 04:48:55
|
Update of /cvsroot/rogueclone/rogue/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20671/src Modified Files: Tag: curses curses.c message.c rogue.h Log Message: moved rgetchar() back to message.c Index: message.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/message.c,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** message.c 18 Jun 2008 03:16:13 -0000 1.7.2.1 --- message.c 19 Jun 2008 04:32:13 -0000 1.7.2.2 *************** *** 196,199 **** --- 196,219 ---- } + char rgetchar(void) + { + char ch; + + for(;;) { + ch = getch(); + + switch(ch) { + case '\022': /* ^R */ + wrefresh(curscr); + break; + case '&': + save_screen(); + break; + default: + return(ch); + } + } + } + /* Level: 99 Gold: 999999 Hp: 999(999) Str: 99(99) Arm: 99 Exp: 21/10000000 Hungry Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.9.2.2 retrieving revision 1.9.2.3 diff -C2 -d -r1.9.2.2 -r1.9.2.3 *** rogue.h 19 Jun 2008 02:49:54 -0000 1.9.2.2 --- rogue.h 19 Jun 2008 04:32:15 -0000 1.9.2.3 *************** *** 244,251 **** typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ typedef chtype attr_t; - chtype mvinch(short row, short col); - - #if 0 /* Support for color GUI... */ --- 244,248 ---- *************** *** 284,288 **** #define BGCOLOR_OF(col) (byte)(((col) >> 4) & 0x0F) #define FGCOLOR_OF(col) (byte)((col) & 0x0F) - #endif /* Support for color GUI...*/ #else /* link with pdcurses. maybe other curses would work too? */ --- 281,284 ---- *************** *** 608,613 **** /* curses.c */ - char rgetchar(void); #ifdef ROGUECURSES void initscr(void); void move(const short row, const short col); --- 604,609 ---- /* curses.c */ #ifdef ROGUECURSES + char getch(void); void initscr(void); void move(const short row, const short col); *************** *** 623,627 **** void refresh(void); void redraw(void); ! /* int mvinch(const short row, const short col); */ chtype mvincch(const short row, const short col); void clear(void); --- 619,623 ---- void refresh(void); void redraw(void); ! chtype mvinch(const short row, const short col); chtype mvincch(const short row, const short col); void clear(void); *************** *** 722,725 **** --- 718,722 ---- void check_message(void); short get_input_line(char *prompt, char *insert, char *buf, char *if_cancelled, const boolean add_blank, const boolean do_echo); + char rgetchar(void); void print_stats(const int stat_mask); void save_screen(void); Index: curses.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/curses.c,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -C2 -d -r1.11.2.2 -r1.11.2.3 *** curses.c 19 Jun 2008 02:49:54 -0000 1.11.2.2 --- curses.c 19 Jun 2008 04:32:13 -0000 1.11.2.3 *************** *** 69,181 **** */ - - #include "rogue.h" - - /* Returns a keystroke, translated into a Rogue command. - */ - - char rgetchar(void) - { - char ch; - #ifdef ROGUECURSES - #ifdef _MSC_VER - INPUT_RECORD ir; - DWORD n; - - put_cursor(curscr->_cury, curscr->_curx); - #else - int scancode; - regs_t regs; - #endif - #endif /* ROGUECURSES */ - - for(;;) { - ch = getch(); - - #ifdef ROGUECURSES - #ifdef _MSC_VER - if(!ReadConsoleInput(hStdIn, &ir, 1, &n) || - ir.EventType != KEY_EVENT || !ir.Event.KeyEvent.bKeyDown) - continue; - - /* convert keypad input to rogue commands */ - switch(ir.Event.KeyEvent.wVirtualKeyCode) { - case VK_NUMPAD9: case VK_PRIOR: - ir.Event.KeyEvent.uChar.AsciiChar = 'u'; break; - case VK_NUMPAD3: case VK_NEXT: - ir.Event.KeyEvent.uChar.AsciiChar = 'n'; break; - case VK_NUMPAD1: case VK_END: - ir.Event.KeyEvent.uChar.AsciiChar = 'b'; break; - case VK_NUMPAD7: case VK_HOME: - ir.Event.KeyEvent.uChar.AsciiChar = 'y'; break; - case VK_NUMPAD4: case VK_LEFT: - ir.Event.KeyEvent.uChar.AsciiChar = 'h'; break; - case VK_NUMPAD8: case VK_UP: - ir.Event.KeyEvent.uChar.AsciiChar = 'k'; break; - case VK_NUMPAD6: case VK_RIGHT: - ir.Event.KeyEvent.uChar.AsciiChar = 'l'; break; - case VK_NUMPAD2: case VK_DOWN: - ir.Event.KeyEvent.uChar.AsciiChar = 'j'; break; - case VK_DELETE: - ir.Event.KeyEvent.uChar.AsciiChar = '.'; break; - } - - if(!ir.Event.KeyEvent.uChar.AsciiChar) - continue; - - /* apply shift or control to keypad movement keys */ - if((ir.Event.KeyEvent.wVirtualKeyCode>=VK_PRIOR && - ir.Event.KeyEvent.wVirtualKeyCode<=VK_DOWN) || - (ir.Event.KeyEvent.wVirtualKeyCode>=VK_NUMPAD1 && - ir.Event.KeyEvent.wVirtualKeyCode<=VK_NUMPAD9)) { - if(ir.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED) - ir.Event.KeyEvent.uChar.AsciiChar -= ('a' - 'A'); - else if(ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | - RIGHT_CTRL_PRESSED)) - ir.Event.KeyEvent.uChar.AsciiChar -= ('a' - 1); - - /* Check for fast play mode, but only for the keypad. The current - * method of converting y to ^y can mess up answers to y/n questions. */ - if(ir.Event.KeyEvent.dwControlKeyState & SCROLLLOCK_ON) { - if(strchr("hjklyubn", ir.Event.KeyEvent.uChar.AsciiChar)) - ir.Event.KeyEvent.uChar.AsciiChar -= ('a' - 1); - else if(strchr("HJKLYUBN", ir.Event.KeyEvent.uChar.AsciiChar)) - ir.Event.KeyEvent.uChar.AsciiChar += ('a' - 'A'); - else if(strchr("\010\012\013\014\031\025\002\016", - ir.Event.KeyEvent.uChar.AsciiChar)) - ir.Event.KeyEvent.uChar.AsciiChar += ('a' - 1); - } - } - - ch = ir.Event.KeyEvent.uChar.AsciiChar; - #else - regs.h.ah = 0x00; /* get keystroke */ - intr_fn(0x16, ®s); - scancode = regs.h.ah; /* BIOS scancode */ - - if(scancode>0x46 && scancode<0x54) - ch = translate_keypad(scancode); - else - ch = regs.h.al; /* ASCII code */ - #endif - #endif /* ROGUECURSES */ - - switch(ch) { - case '\022': /* ^R */ - wrefresh(curscr); - break; - case '&': - save_screen(); - break; - default: - return(ch); - } - } - } - - - #ifdef ROGUECURSES #include <stdio.h> --- 69,75 ---- */ #ifdef ROGUECURSES + #include "rogue.h" #include <stdio.h> *************** *** 254,257 **** --- 148,235 ---- /* ================== PUBLIC FUNCTIONS ================== */ + /* Returns a keystroke, translated into a Rogue command. + */ + + char getch(void) + { + char ch; + + #ifdef _MSC_VER + INPUT_RECORD ir; + DWORD n; + + put_cursor(curscr->_cury, curscr->_curx); + + if(!ReadConsoleInput(hStdIn, &ir, 1, &n) || + ir.EventType != KEY_EVENT || !ir.Event.KeyEvent.bKeyDown) + return 0; + + /* convert keypad input to rogue commands */ + switch(ir.Event.KeyEvent.wVirtualKeyCode) { + case VK_NUMPAD9: case VK_PRIOR: + ir.Event.KeyEvent.uChar.AsciiChar = 'u'; break; + case VK_NUMPAD3: case VK_NEXT: + ir.Event.KeyEvent.uChar.AsciiChar = 'n'; break; + case VK_NUMPAD1: case VK_END: + ir.Event.KeyEvent.uChar.AsciiChar = 'b'; break; + case VK_NUMPAD7: case VK_HOME: + ir.Event.KeyEvent.uChar.AsciiChar = 'y'; break; + case VK_NUMPAD4: case VK_LEFT: + ir.Event.KeyEvent.uChar.AsciiChar = 'h'; break; + case VK_NUMPAD8: case VK_UP: + ir.Event.KeyEvent.uChar.AsciiChar = 'k'; break; + case VK_NUMPAD6: case VK_RIGHT: + ir.Event.KeyEvent.uChar.AsciiChar = 'l'; break; + case VK_NUMPAD2: case VK_DOWN: + ir.Event.KeyEvent.uChar.AsciiChar = 'j'; break; + case VK_DELETE: + ir.Event.KeyEvent.uChar.AsciiChar = '.'; break; + } + + if(!ir.Event.KeyEvent.uChar.AsciiChar) + return 0; + + /* apply shift or control to keypad movement keys */ + if((ir.Event.KeyEvent.wVirtualKeyCode>=VK_PRIOR && + ir.Event.KeyEvent.wVirtualKeyCode<=VK_DOWN) || + (ir.Event.KeyEvent.wVirtualKeyCode>=VK_NUMPAD1 && + ir.Event.KeyEvent.wVirtualKeyCode<=VK_NUMPAD9)) { + if(ir.Event.KeyEvent.dwControlKeyState & SHIFT_PRESSED) + ir.Event.KeyEvent.uChar.AsciiChar -= ('a' - 'A'); + else if(ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED | + RIGHT_CTRL_PRESSED)) + ir.Event.KeyEvent.uChar.AsciiChar -= ('a' - 1); + + /* Check for fast play mode, but only for the keypad. The current + * method of converting y to ^y can mess up answers to y/n questions. */ + if(ir.Event.KeyEvent.dwControlKeyState & SCROLLLOCK_ON) { + if(strchr("hjklyubn", ir.Event.KeyEvent.uChar.AsciiChar)) + ir.Event.KeyEvent.uChar.AsciiChar -= ('a' - 1); + else if(strchr("HJKLYUBN", ir.Event.KeyEvent.uChar.AsciiChar)) + ir.Event.KeyEvent.uChar.AsciiChar += ('a' - 'A'); + else if(strchr("\010\012\013\014\031\025\002\016", + ir.Event.KeyEvent.uChar.AsciiChar)) + ir.Event.KeyEvent.uChar.AsciiChar += ('a' - 1); + } + } + + ch = ir.Event.KeyEvent.uChar.AsciiChar; + #else + int scancode; + regs_t regs; + + regs.h.ah = 0x00; /* get keystroke */ + intr_fn(0x16, ®s); + scancode = regs.h.ah; /* BIOS scancode */ + + if(scancode>0x46 && scancode<0x54) + ch = translate_keypad(scancode); + else + ch = regs.h.al; /* ASCII code */ + #endif + + return(ch); + } + /* Initializes the screen and pulls in the DPMI mode and page in use */ *************** *** 454,458 **** /* Returns the character currently at the specified current position */ ! int mvinch(const short row, const short col) { move(row, col); --- 432,436 ---- /* Returns the character currently at the specified current position */ ! chtype mvinch(const short row, const short col) { move(row, col); |
From: Michael L. <mle...@us...> - 2008-06-19 04:48:26
|
Update of /cvsroot/rogueclone/rogue/doc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20671/doc Modified Files: Tag: curses changelog.txt Log Message: moved rgetchar() back to message.c Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** changelog.txt 19 Jun 2008 02:50:49 -0000 1.5.2.2 --- changelog.txt 19 Jun 2008 04:32:11 -0000 1.5.2.3 *************** *** 1,5 **** Changelog --------- ! 10:34 PM 2008-06-18 - ifdef'd out most of curses.c 11:30 PM 2008-06-17 - created curses branch in cvs 9:53 PM 2008-06-17 - applied patch [ 1176457 ] curses support (very preliminary) --- 1,6 ---- Changelog --------- ! 12:29 AM 2008-06-19 - moved rgetchar() back to message.c ! 10:34 PM 2008-06-18 - ifdef'd out broken curses code 11:30 PM 2008-06-17 - created curses branch in cvs 9:53 PM 2008-06-17 - applied patch [ 1176457 ] curses support (very preliminary) |
From: Michael L. <mle...@us...> - 2008-06-19 02:50:52
|
Update of /cvsroot/rogueclone/rogue/doc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10076 Modified Files: Tag: curses changelog.txt Log Message: #ifdef ROGUECURSES for broken curses code Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** changelog.txt 18 Jun 2008 03:17:17 -0000 1.5.2.1 --- changelog.txt 19 Jun 2008 02:50:49 -0000 1.5.2.2 *************** *** 1,4 **** --- 1,6 ---- Changelog --------- + 10:34 PM 2008-06-18 - ifdef'd out most of curses.c + 11:30 PM 2008-06-17 - created curses branch in cvs 9:53 PM 2008-06-17 - applied patch [ 1176457 ] curses support (very preliminary) 12:35 AM 2008-06-16 - applied steve_ued's patch [ 1079744 ] Known Items |
From: Michael L. <mle...@us...> - 2008-06-19 02:50:22
|
Update of /cvsroot/rogueclone/rogue/sys In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10026 Modified Files: Tag: curses rogue.dsp Log Message: #ifdef ROGUECURSES for broken curses code Index: rogue.dsp =================================================================== RCS file: /cvsroot/rogueclone/rogue/sys/rogue.dsp,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** rogue.dsp 18 Jun 2008 03:16:34 -0000 1.3.2.1 --- rogue.dsp 19 Jun 2008 02:50:20 -0000 1.3.2.2 *************** *** 67,71 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "KNOWN_ITEMS" /D "HAVECURSES" /FR /FD /GZ /I../sys/pdcurses /c # ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x1009 /d "_DEBUG" --- 67,71 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /I../sys/pdcurses /c # ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x1009 /d "_DEBUG" |
From: Michael L. <mle...@us...> - 2008-06-19 02:49:59
|
Update of /cvsroot/rogueclone/rogue/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9641 Modified Files: Tag: curses curses.c rogue.h Log Message: #ifdef ROGUECURSES for broken curses code Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** rogue.h 18 Jun 2008 03:16:13 -0000 1.9.2.1 --- rogue.h 19 Jun 2008 02:49:54 -0000 1.9.2.2 *************** *** 44,47 **** --- 44,60 ---- */ + + /***************************************************************************** + * CONFIGURATION MACROS * + *****************************************************************************/ + + /* #define ROGUECURSES */ + /* #define DISCOVERY */ + #define KNOWN_ITEMS + /* #define ONE_SCORE */ + + /*****************************************************************************/ + + #ifdef _MSC_VER /* supress warnings about parameters and return values, *************** *** 226,238 **** }; ! #ifdef HAVECURSES ! #ifdef __MSDOS__ ! #define DOS /* kludge for pdcurses */ ! #endif ! #include "curses.h" ! ! #define COLOR_STAIRS COLOR_WHITE+1 - #else extern int LINES, COLS; typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ --- 239,244 ---- }; ! #ifdef ROGUECURSES extern int LINES, COLS; typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ *************** *** 278,284 **** #define BGCOLOR_OF(col) (byte)(((col) >> 4) & 0x0F) #define FGCOLOR_OF(col) (byte)((col) & 0x0F) ! #endif ! #endif /* !HAVECURSES */ --- 284,299 ---- #define BGCOLOR_OF(col) (byte)(((col) >> 4) & 0x0F) #define FGCOLOR_OF(col) (byte)((col) & 0x0F) ! #endif /* Support for color GUI...*/ ! #else /* link with pdcurses. maybe other curses would work too? */ ! ! #ifdef __MSDOS__ ! #define DOS /* kludge for pdcurses */ ! #endif ! #include "curses.h" ! ! #define COLOR_STAIRS COLOR_WHITE+1 ! ! #endif /* ROGUECURSES */ *************** *** 594,598 **** /* curses.c */ char rgetchar(void); ! #ifndef HAVECURSES void initscr(void); void move(const short row, const short col); --- 609,613 ---- /* curses.c */ char rgetchar(void); ! #ifdef ROGUECURSES void initscr(void); void move(const short row, const short col); *************** *** 608,612 **** void refresh(void); void redraw(void); ! int mvinch(const short row, const short col); chtype mvincch(const short row, const short col); void clear(void); --- 623,627 ---- void refresh(void); void redraw(void); ! /* int mvinch(const short row, const short col); */ chtype mvincch(const short row, const short col); void clear(void); *************** *** 619,623 **** void noecho(void); void nonl(void); ! #endif /* hit.c */ --- 634,638 ---- void noecho(void); void nonl(void); ! #endif /* ROGUECURSES */ /* hit.c */ Index: curses.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/curses.c,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** curses.c 18 Jun 2008 03:16:13 -0000 1.11.2.1 --- curses.c 19 Jun 2008 02:49:54 -0000 1.11.2.2 *************** *** 46,63 **** /* - * patch [ 1176457 ] curses support (very preliminary) -ML - * - * to build with visual studio: - * 1. download pdcurses from - * http://voxel.dl.sourceforge.net/sourceforge/pdcurses/pdc33dll.zip - * 2. the zip file contains 4 files. put the dll in your sys\debug directory - * 3. create a sys\pdcurses directory and put the other three files there - * 4. add /D "HAVECURSES" /I../sys/pdcurses to your project options in - * Project | Settings | C/C++ from the visual studio menu - * 5. add ../sys/pdcurses/pdcurses.lib to your object/library modules in - * Project | Settings | Link from the visual studio menu - */ - - /* * ML, 31 Jan 2004: added support for win32 console applications * --- 46,49 ---- *************** *** 86,170 **** #include "rogue.h" - #ifndef HAVECURSES /* curses isn't available, so use our own UI code */ - - #include <stdio.h> - - /* ============== COMPILER-SPECIFIC CONSTANTS AND TYPEDEFS =============== */ - - #ifdef __WATCOMC__ - - #include <dos.h> - typedef union REGPACK regs_t; - #define intr_fn(N,R) intr(N,R) - - #elif _MSC_VER /* Microsoft C (tested with VC98) */ - - #define WIN32_LEAN_AND_MEAN - #include <windows.h> - - #elif __DJGPP__ - - #include <dpmi.h> - typedef __dpmi_regs regs_t; - #define intr_fn(N,R) __dpmi_int(N,R) - - #else - #error curses.c only compiles with Open Watcom, Microsoft C, or DJGPP - #endif - - /* ============== CONSTANTS AND TYPEDEFS =============== */ - - struct _win_st { - short _cury, _curx; - short _maxy, _maxx; - }; - typedef struct _win_st WINDOW; - - - typedef union _colorChar COLORBUF; - #define BLANKCH MAKE_COLOR_CHAR(WHITE,BLACK,' ') - - - - /* ================== GLOBAL VARIABLES ================== */ - - int LINES=DROWS, COLS=DCOLS; - - /* static char terminal[DROWS][DCOLS]; */ - /* static char buffer[DROWS][DCOLS]; */ - static COLORBUF terminal[DROWS][DCOLS]; - static COLORBUF buffer[DROWS][DCOLS]; - - static boolean screen_dirty; - static boolean lines_dirty[DROWS]; - static boolean buf_stand_out = 0; - - static WINDOW scr_buf; - static WINDOW *curscr = &scr_buf; - static short cur_row, cur_col; - - #ifdef _MSC_VER - static HANDLE hStdIn, hStdOut; - #else - static unsigned char videomode, videopage; - #endif - - /* ================= PRIVATE PROTOTYPES ================= */ - - static void addstr_in_color(char *str, const byte color); /* only used within this file */ - static void addcstr(chtype *cstr); /* only used within this file */ - static char translate_keypad(int scancode); /* only used within this file */ - /* static void put_char_at(int row, int col, char ch) only used within this file*/ - static void put_color_char_at(int row, int col, COLORBUF cb); /* only used within this file */ - static void put_cursor(int row, int col); /* only used within this file */ - static void clear_buffers(void); /* only used within this file */ - static void cls(void); /* only uwed within this file */ - static void wrefresh(WINDOW *scr); /* only used within this file */ - - - /* ================== PUBLIC FUNCTIONS ================== */ - - #endif /* !HAVECURSES */ - /* Returns a keystroke, translated into a Rogue command. */ --- 72,75 ---- *************** *** 173,177 **** { char ch; ! #ifndef HAVECURSES #ifdef _MSC_VER INPUT_RECORD ir; --- 78,82 ---- { char ch; ! #ifdef ROGUECURSES #ifdef _MSC_VER INPUT_RECORD ir; *************** *** 183,192 **** regs_t regs; #endif ! #endif for(;;) { - #ifdef HAVECURSES ch = getch(); ! #elif defined(_MSC_VER) && !defined(HAVECURSES) if(!ReadConsoleInput(hStdIn, &ir, 1, &n) || ir.EventType != KEY_EVENT || !ir.Event.KeyEvent.bKeyDown) --- 88,98 ---- regs_t regs; #endif ! #endif /* ROGUECURSES */ for(;;) { ch = getch(); ! ! #ifdef ROGUECURSES ! #ifdef _MSC_VER if(!ReadConsoleInput(hStdIn, &ir, 1, &n) || ir.EventType != KEY_EVENT || !ir.Event.KeyEvent.bKeyDown) *************** *** 253,256 **** --- 159,164 ---- ch = regs.h.al; /* ASCII code */ #endif + #endif /* ROGUECURSES */ + switch(ch) { case '\022': /* ^R */ *************** *** 266,270 **** } ! #ifndef HAVECURSES /* Initializes the screen and pulls in the DPMI mode and page in use --- 174,256 ---- } ! ! ! #ifdef ROGUECURSES ! ! #include <stdio.h> ! ! /* ============== COMPILER-SPECIFIC CONSTANTS AND TYPEDEFS =============== */ ! ! #ifdef __WATCOMC__ ! ! #include <dos.h> ! typedef union REGPACK regs_t; ! #define intr_fn(N,R) intr(N,R) ! ! #elif _MSC_VER /* Microsoft C (tested with VC98) */ ! ! #define WIN32_LEAN_AND_MEAN ! #include <windows.h> ! ! #elif __DJGPP__ ! ! #include <dpmi.h> ! typedef __dpmi_regs regs_t; ! #define intr_fn(N,R) __dpmi_int(N,R) ! ! #else ! #error curses.c only compiles with Open Watcom, Microsoft C, or DJGPP ! #endif ! ! /* ============== CONSTANTS AND TYPEDEFS =============== */ ! ! struct _win_st { ! short _cury, _curx; ! short _maxy, _maxx; ! }; ! typedef struct _win_st WINDOW; ! ! ! typedef union _colorChar COLORBUF; ! #define BLANKCH MAKE_COLOR_CHAR(WHITE,BLACK,' ') ! ! ! ! /* ================== GLOBAL VARIABLES ================== */ ! ! int LINES=DROWS, COLS=DCOLS; ! ! /* static char terminal[DROWS][DCOLS]; */ ! /* static char buffer[DROWS][DCOLS]; */ ! static COLORBUF terminal[DROWS][DCOLS]; ! static COLORBUF buffer[DROWS][DCOLS]; ! ! static boolean screen_dirty; ! static boolean lines_dirty[DROWS]; ! static boolean buf_stand_out = 0; ! ! static WINDOW scr_buf; ! static WINDOW *curscr = &scr_buf; ! static short cur_row, cur_col; ! ! #ifdef _MSC_VER ! static HANDLE hStdIn, hStdOut; ! #else ! static unsigned char videomode, videopage; ! #endif ! ! /* ================= PRIVATE PROTOTYPES ================= */ ! ! static void addstr_in_color(char *str, const byte color); /* only used within this file */ ! static void addcstr(chtype *cstr); /* only used within this file */ ! static char translate_keypad(int scancode); /* only used within this file */ ! /* static void put_char_at(int row, int col, char ch) only used within this file*/ ! static void put_color_char_at(int row, int col, COLORBUF cb); /* only used within this file */ ! static void put_cursor(int row, int col); /* only used within this file */ ! static void clear_buffers(void); /* only used within this file */ ! static void cls(void); /* only uwed within this file */ ! static void wrefresh(WINDOW *scr); /* only used within this file */ ! ! /* ================== PUBLIC FUNCTIONS ================== */ /* Initializes the screen and pulls in the DPMI mode and page in use *************** *** 808,810 **** } ! #endif /* !HAVECURSES */ --- 794,796 ---- } ! #endif /* ROGUECURSES */ |
From: Michael L. <mle...@us...> - 2008-06-18 03:17:22
|
Update of /cvsroot/rogueclone/rogue/doc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11321 Modified Files: Tag: curses changelog.txt Log Message: applied patch [ 1176457 ] curses support (very preliminary) Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** changelog.txt 16 Jun 2008 04:42:22 -0000 1.5 --- changelog.txt 18 Jun 2008 03:17:17 -0000 1.5.2.1 *************** *** 1,4 **** --- 1,5 ---- Changelog --------- + 9:53 PM 2008-06-17 - applied patch [ 1176457 ] curses support (very preliminary) 12:35 AM 2008-06-16 - applied steve_ued's patch [ 1079744 ] Known Items 12:32 AM 2008-06-14 - applied patch [ 1077029 ] move.c - gr_dir() optimization |
From: Michael L. <mle...@us...> - 2008-06-18 03:16:38
|
Update of /cvsroot/rogueclone/rogue/sys In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10905 Modified Files: Tag: curses rogue.dsp Log Message: applied patch [ 1176457 ] curses support (very preliminary) Index: rogue.dsp =================================================================== RCS file: /cvsroot/rogueclone/rogue/sys/rogue.dsp,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** rogue.dsp 13 Jun 2008 04:09:48 -0000 1.3 --- rogue.dsp 18 Jun 2008 03:16:34 -0000 1.3.2.1 *************** *** 67,71 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c # ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x1009 /d "_DEBUG" --- 67,71 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ! # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "KNOWN_ITEMS" /D "HAVECURSES" /FR /FD /GZ /I../sys/pdcurses /c # ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x1009 /d "_DEBUG" *************** *** 75,79 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"oldnames" /pdbtype:sept /warn:3 # SUBTRACT LINK32 /pdb:none --- 75,79 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 ../sys/pdcurses/pdcurses.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"oldnames" /pdbtype:sept /warn:3 # SUBTRACT LINK32 /pdb:none |
From: Michael L. <mle...@us...> - 2008-06-18 03:16:20
|
Update of /cvsroot/rogueclone/rogue/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10465 Modified Files: Tag: curses curses.c hit.c init.c invent.c level.c machdep.c message.c monster.c move.c object.c rogue.h room.c save.c score.c spec_hit.c throw.c trap.c use.c zap.c Log Message: applied patch [ 1176457 ] curses support (very preliminary) Index: score.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/score.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** score.c 13 Jun 2008 00:19:06 -0000 1.7 --- score.c 18 Jun 2008 03:16:13 -0000 1.7.2.1 *************** *** 61,65 **** static int name_cmp(char *s1, char *s2); /* only used within this file */ static void center(const short row, char *buf); /* only used within this file */ ! static void center_in_color(const short row, char *buf, const byte color); /* only used within this file */ static void sf_error(void); /* only used within this file */ --- 61,65 ---- static int name_cmp(char *s1, char *s2); /* only used within this file */ static void center(const short row, char *buf); /* only used within this file */ ! static void center_in_color(const short row, char *buf, attr_t color); /* only used within this file */ static void sf_error(void); /* only used within this file */ *************** *** 72,76 **** char buf[128]; char gold[128]; - color_char boxchars[6]; md_ignore_signals(); --- 72,75 ---- *************** *** 136,147 **** } else {/* modern tombstone, pulled from PC-Rogue with apologies */ ! boxchars[0] = get_terrain_char(HORWALL); ! boxchars[1] = get_terrain_char(VERTWALL); ! boxchars[2] = get_terrain_char(ULCORNER); ! boxchars[3] = get_terrain_char(URCORNER); ! boxchars[4] = get_terrain_char(LLCORNER); ! boxchars[5] = get_terrain_char(LRCORNER); - draw_box(boxchars, 4, 25, 19, 30); center( 8, "R E S T"); center( 9, "I N"); --- 135,155 ---- } else {/* modern tombstone, pulled from PC-Rogue with apologies */ ! short i; ! chtype horz = get_terrain_char(HORWALL); ! chtype vert = get_terrain_char(VERTWALL); ! ! for (i = 26; i < 54; i++) { ! mvaddch(4, i, horz); ! mvaddch(22, i, horz); ! } ! for (i = 5; i < 22; i++) { ! mvaddch(i, 25, vert); ! mvaddch(i, 54, vert); ! } ! mvaddch(4, 25, get_terrain_char(ULCORNER)); ! mvaddch(4, 54, get_terrain_char(URCORNER)); ! mvaddch(22, 25, get_terrain_char(LLCORNER)); ! mvaddch(22, 54, get_terrain_char(LRCORNER)); center( 8, "R E S T"); center( 9, "I N"); *************** *** 151,157 **** center(16, gold); /* NS: ought to put the date here for effect. */ ! center_in_color(21, " * * * ", MAKE_COLOR(RED,BLACK)); center_in_color(22, "___\\/(\\/)/(\\/ \\\\(//)\\)\\/(//)\\\\)//(\\__", ! MAKE_COLOR(GREEN,BLACK)); } } else { --- 159,165 ---- center(16, gold); /* NS: ought to put the date here for effect. */ ! center_in_color(21, " * * * ", COLOR_PAIR(COLOR_RED)); center_in_color(22, "___\\/(\\/)/(\\/ \\\\(//)\\)\\/(//)\\\\)//(\\__", ! COLOR_PAIR(COLOR_GREEN)); } } else { *************** *** 561,575 **** static void center(const short row, char *buf) /* only used within this file */ { ! center_in_color(row, buf, MAKE_COLOR(WHITE,BLACK)); } ! static void center_in_color(const short row, char *buf, const byte color) /* only used within this file */ { short margin; margin = (short) ((DCOLS - strlen(buf)) / 2); ! mvaddstr_in_color(row, margin, buf, ! (unsigned char) ((use_color) ? color : MAKE_COLOR(WHITE,BLACK))); } --- 569,585 ---- static void center(const short row, char *buf) /* only used within this file */ { ! center_in_color(row, buf, COLOR_PAIR(COLOR_WHITE)); } ! static void center_in_color(const short row, char *buf, attr_t color) /* only used within this file */ { short margin; margin = (short) ((DCOLS - strlen(buf)) / 2); ! ! attron(use_color ? color : COLOR_PAIR(COLOR_WHITE)); ! mvaddstr(row, margin, buf); ! attroff(use_color ? color : COLOR_PAIR(COLOR_WHITE)); } Index: use.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/use.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** use.c 16 Jun 2008 04:42:04 -0000 1.8 --- use.c 18 Jun 2008 03:16:14 -0000 1.8.2.1 *************** *** 494,498 **** void tele(void) { ! mvaddcch(rogue.row, rogue.col, get_dungeon_char(rogue.row, rogue.col)); if (cur_room >= 0) { --- 494,498 ---- void tele(void) { ! mvaddch(rogue.row, rogue.col, get_dungeon_char(rogue.row, rogue.col)); if (cur_room >= 0) { *************** *** 510,514 **** short ch; static char steadychars[10] = ""; ! color_char cch; if (blind) return; --- 510,514 ---- short ch; static char steadychars[10] = ""; ! chtype cch; if (blind) return; *************** *** 521,528 **** */ if (steadychars[0] == '\0') { ! steadychars[0] = get_terrain_char(NOTHING).b8.ch; ! steadychars[1] = get_terrain_char(FLOOR).b8.ch; ! steadychars[2] = get_terrain_char(TUNNEL).b8.ch; ! steadychars[3] = get_terrain_char(DOOR).b8.ch; steadychars[4] = '\0'; } --- 521,528 ---- */ if (steadychars[0] == '\0') { ! steadychars[0] = (char) (get_terrain_char(NOTHING) | A_CHARTEXT); ! steadychars[1] = (char) (get_terrain_char(FLOOR) | A_CHARTEXT); ! steadychars[2] = (char) (get_terrain_char(TUNNEL) | A_CHARTEXT); ! steadychars[3] = (char) (get_terrain_char(DOOR) | A_CHARTEXT); steadychars[4] = '\0'; } *************** *** 535,543 **** /* if ((ch != ' ') && (ch != '.') && (ch != '\xB1') && (ch != '+')) { */ if (strchr(steadychars, ch) == 0) { ! cch.b16 = gr_obj_char(-1).b16; if (!use_color) { ! cch.b8.color = MAKE_COLOR(WHITE,BLACK); } ! addcch(cch); } obj = obj->next_object; --- 535,543 ---- /* if ((ch != ' ') && (ch != '.') && (ch != '\xB1') && (ch != '+')) { */ if (strchr(steadychars, ch) == 0) { ! cch = gr_obj_char(-1); if (!use_color) { ! cch |= COLOR_PAIR(COLOR_WHITE); } ! addch(cch); } obj = obj->next_object; *************** *** 584,588 **** light_up_room(cur_room); } ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); } --- 584,588 ---- light_up_room(cur_room); } ! mvaddch(rogue.row, rogue.col, get_rogue_char()); } *************** *** 618,622 **** while (monster) { ! mvaddcch(monster->row, monster->col, monster->trail_char); monster = monster->next_monster; } --- 618,622 ---- while (monster) { ! mvaddch(monster->row, monster->col, monster->trail_char); monster = monster->next_monster; } *************** *** 631,635 **** } } ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); } --- 631,635 ---- } } ! mvaddch(rogue.row, rogue.col, get_rogue_char()); } Index: room.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/room.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** room.c 14 Jun 2008 02:38:02 -0000 1.11 --- room.c 18 Jun 2008 03:16:13 -0000 1.11.2.1 *************** *** 53,57 **** extern short halluc; extern boolean detect_monster, jump, passgo, display_skull; ! extern boolean use_doschars, use_color, beep; extern char *login_name, *fruit, *press_space; --- 53,57 ---- extern short halluc; extern boolean detect_monster, jump, passgo, display_skull; ! extern boolean use_doschars, use_color, use_bell; extern char *login_name, *fruit, *press_space; *************** *** 92,96 **** { "Use the terminal bell (\"beep\"): ", ! 1, (char **) 0, &beep, 0, 0 }, { --- 92,96 ---- { "Use the terminal bell (\"beep\"): ", ! 1, (char **) 0, &use_bell, 0, 0 }, { *************** *** 110,147 **** struct _screenchars { unsigned short mask; /* as defined in rogue.h */ ! char ch; /* classic screen character */ ! char dosch; /* DOS screen character */ ! unsigned char fgcolor; /* foreground color */ ! unsigned char bgcolor; /* background color */ boolean canBeMimicked; /* Xeroc disguise or hallucination char? */ }; struct _screenchars scrObjects[OBJECTTYPES] = { ! { ARMOR, ']', '\x08', BRIGHT_BLUE, BLACK, 1 }, ! { WEAPON, ')', '\x18', BRIGHT_BLUE, BLACK, 1 }, ! { SCROL, '?', '\x0D', BRIGHT_BLUE, BLACK, 1 }, ! { POTION, '!', '\xAD', BRIGHT_BLUE, BLACK, 1 }, ! { GOLD, '*', '\x0F', BRIGHT_YELLOW, BLACK, 1 }, ! { FOOD, ':', '\x05', RED, BLACK, 1 }, ! { WAND, '/', '\xE7', BRIGHT_BLUE, BLACK, 1 }, ! { RING, '=', '\x09', BRIGHT_BLUE, BLACK, 1 }, ! { AMULET, ',', '\x0C', BRIGHT_BLUE, BLACK, 0 } }; struct _screenchars scrTerrain[TERRAINTYPES] = { ! { NOTHING, ' ', ' ', WHITE, BLACK, 0 }, ! { OBJECT, '~', '~', WHITE, BLACK, 0 }, /* error */ ! { MONSTER, 'm', 'm', WHITE, BLACK, 0 }, /* error */ ! { STAIRS, '%', '\xF0', BLACK, BRIGHT_GREEN, 1 }, ! { HORWALL, '-', '\xCD', YELLOW, BLACK, 0 }, ! { VERTWALL,'|', '\xBA', YELLOW, BLACK, 0 }, ! { ULCORNER,'-', '\xC9', YELLOW, BLACK, 0 }, ! { URCORNER,'-', '\xBB', YELLOW, BLACK, 0 }, ! { LLCORNER,'-', '\xC8', YELLOW, BLACK, 0 }, ! { LRCORNER,'-', '\xBC', YELLOW, BLACK, 0 }, ! { DOOR, '+', '\xCE', YELLOW, BLACK, 0 }, ! { FLOOR, '.', '\xFA', BRIGHT_GREEN, BLACK, 0 }, ! { TUNNEL, '#', '\xB1', WHITE, BLACK, 0 }, ! { TRAP, '^', '\x04', MAGENTA, BLACK, 0 } }; --- 110,146 ---- struct _screenchars { unsigned short mask; /* as defined in rogue.h */ ! chtype ch; /* classic screen character */ ! chtype dosch; /* DOS screen character */ ! attr_t color; /* color */ boolean canBeMimicked; /* Xeroc disguise or hallucination char? */ }; struct _screenchars scrObjects[OBJECTTYPES] = { ! { ARMOR, ']', 0x08|A_ALTCHARSET, COLOR_PAIR(COLOR_BLUE)|A_BOLD, 1 }, ! { WEAPON, ')', 0x18|A_ALTCHARSET, COLOR_PAIR(COLOR_BLUE)|A_BOLD, 1 }, ! { SCROL, '?', 0x0D|A_ALTCHARSET, COLOR_PAIR(COLOR_BLUE)|A_BOLD, 1 }, ! { POTION, '!', 0xAD|A_ALTCHARSET, COLOR_PAIR(COLOR_BLUE)|A_BOLD, 1 }, ! { GOLD, '*', 0x0F|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW)|A_BOLD, 1 }, ! { FOOD, ':', 0x05|A_ALTCHARSET, COLOR_PAIR(COLOR_RED), 1 }, ! { WAND, '/', 0xE7|A_ALTCHARSET, COLOR_PAIR(COLOR_BLUE)|A_BOLD, 1 }, ! { RING, '=', 0x09|A_ALTCHARSET, COLOR_PAIR(COLOR_BLUE)|A_BOLD, 1 }, ! { AMULET, ',', 0x0C|A_ALTCHARSET, COLOR_PAIR(COLOR_BLUE)|A_BOLD, 0 } }; struct _screenchars scrTerrain[TERRAINTYPES] = { ! { NOTHING, ' ', ' ', COLOR_PAIR(COLOR_WHITE), 0 }, ! { OBJECT, '~', '~', COLOR_PAIR(COLOR_WHITE), 0 }, /* error */ ! { MONSTER, 'm', 'm', COLOR_PAIR(COLOR_WHITE), 0 }, /* error */ ! { STAIRS, '%', 0xF0|A_ALTCHARSET, COLOR_PAIR(COLOR_STAIRS)|A_BLINK, 1 }, ! { HORWALL, '-', 0xCD|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW), 0 }, ! { VERTWALL,'|', 0xBA|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW), 0 }, ! { ULCORNER,'-', 0xC9|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW), 0 }, ! { URCORNER,'-', 0xBB|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW), 0 }, ! { LLCORNER,'-', 0xC8|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW), 0 }, ! { LRCORNER,'-', 0xBC|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW), 0 }, ! { DOOR, '+', 0xCE|A_ALTCHARSET, COLOR_PAIR(COLOR_YELLOW), 0 }, ! { FLOOR, '.', 0xFA|A_ALTCHARSET, COLOR_PAIR(COLOR_GREEN)|A_BOLD, 0 }, ! { TUNNEL, '#', 0xB1|A_ALTCHARSET, COLOR_PAIR(COLOR_WHITE), 0 }, ! { TRAP, '^', 0x04|A_ALTCHARSET, COLOR_PAIR(COLOR_MAGENTA), 0 } }; *************** *** 181,188 **** } } ! mvaddcch(i, j, get_dungeon_char(i, j)); } } ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); /* NS - added this so that hallucinating characters don't see the --- 180,187 ---- } } ! mvaddch(i, j, get_dungeon_char(i, j)); } } ! mvaddch(rogue.row, rogue.col, get_rogue_char()); /* NS - added this so that hallucinating characters don't see the *************** *** 209,213 **** for (j = ((col > 0) ? -1 : 0); j <= j_end; j++) { if (can_move(row, col, (short) (row+i), (short) (col+j))) { ! mvaddcch((short) (row+i), (short) (col+j), get_dungeon_char((short) (row+i), (short) (col+j))); } --- 208,212 ---- for (j = ((col > 0) ? -1 : 0); j <= j_end; j++) { if (can_move(row, col, (short) (row+i), (short) (col+j))) { ! mvaddch((short) (row+i), (short) (col+j), get_dungeon_char((short) (row+i), (short) (col+j))); } *************** *** 232,236 **** } if ((dungeon[i][j] & TRAP) && (!(dungeon[i][j] & HIDDEN))) { ! mvaddcch(i, j, get_terrain_char(TRAP)); } } --- 231,235 ---- } if ((dungeon[i][j] & TRAP) && (!(dungeon[i][j] & HIDDEN))) { ! mvaddch(i, j, get_terrain_char(TRAP)); } } *************** *** 241,247 **** ! color_char get_terrain_char(const unsigned short mask) { ! color_char cc; int i; --- 240,246 ---- ! chtype get_terrain_char(const unsigned short mask) { ! chtype cc; int i; *************** *** 249,257 **** for (i=0; i<TERRAINTYPES; i++) { if (scrTerrain[i].mask == mask) { ! cc.b8.color = use_color ? ! MAKE_COLOR(scrTerrain[i].fgcolor, scrTerrain[i].bgcolor) : ! MAKE_COLOR(WHITE, BLACK); ! cc.b8.ch = use_doschars ? scrTerrain[i].dosch : scrTerrain[i].ch; ! return cc; } --- 248,253 ---- for (i=0; i<TERRAINTYPES; i++) { if (scrTerrain[i].mask == mask) { ! cc = use_doschars ? scrTerrain[i].dosch : scrTerrain[i].ch; ! cc |= use_color ? scrTerrain[i].color : COLOR_PAIR(COLOR_WHITE); return cc; } *************** *** 259,264 **** /* error! */ ! cc.b8.color = MAKE_COLOR(BRIGHT_WHITE, BLACK); ! cc.b8.ch = '~'; return cc; } --- 255,259 ---- /* error! */ ! cc = COLOR_PAIR(COLOR_WHITE)|A_BOLD | '~'; return cc; } *************** *** 266,273 **** ! color_char get_dungeon_char(const short row, const short col) { unsigned short mask = dungeon[row][col]; ! color_char cc; /* monsters are at the top layer and overlay all else */ --- 261,268 ---- ! chtype get_dungeon_char(const short row, const short col) { unsigned short mask = dungeon[row][col]; ! chtype cc; /* monsters are at the top layer and overlay all else */ *************** *** 281,288 **** obj = object_at(&level_objects, row, col); ! cc.b16 = get_mask_char(obj->what_is).b16; ! if ((mask & TUNNEL) && use_doschars) cc.b8.color = MAKE_COLOR(FGCOLOR_OF(cc.b8.color), ! use_color ? WHITE : GRAY); return cc; } --- 276,285 ---- obj = object_at(&level_objects, row, col); ! cc = get_mask_char(obj->what_is); ! ! /* make this work with curses */ ! /* if ((mask & TUNNEL) && use_doschars) cc.b8.color = MAKE_COLOR(FGCOLOR_OF(cc.b8.color), ! use_color ? WHITE : GRAY); */ return cc; } *************** *** 344,354 **** ! /* Returns the screen character of the specified item. ! * NS: This now returns a 16-bit color_char. ! */ ! color_char get_mask_char(const unsigned short mask) { ! color_char cc; int i; --- 341,349 ---- ! /* Returns the screen character of the specified item. */ ! chtype get_mask_char(const unsigned short mask) { ! chtype cc; int i; *************** *** 356,363 **** for (i=0; i<OBJECTTYPES; i++) { if (scrObjects[i].mask == mask) { ! cc.b8.color = use_color ? ! MAKE_COLOR(scrObjects[i].fgcolor, scrObjects[i].bgcolor) : ! MAKE_COLOR(WHITE, BLACK); ! cc.b8.ch = use_doschars ? scrObjects[i].dosch : scrObjects[i].ch; return cc; } --- 351,356 ---- for (i=0; i<OBJECTTYPES; i++) { if (scrObjects[i].mask == mask) { ! cc = use_doschars ? scrObjects[i].dosch : scrObjects[i].ch; ! cc |= use_color ? scrObjects[i].color : COLOR_PAIR(COLOR_WHITE); return cc; } *************** *** 365,370 **** /* error! */ ! cc.b8.color = MAKE_COLOR(BRIGHT_WHITE, BLACK); ! cc.b8.ch = '~'; return cc; } --- 358,362 ---- /* error! */ ! cc = COLOR_PAIR(COLOR_WHITE)|A_BOLD | '~'; return cc; } *************** *** 374,383 **** */ ! color_char get_rogue_char(void) { ! color_char cc; ! cc.b8.color = (use_color) ? rogue.color : MAKE_COLOR(WHITE,BLACK); ! cc.b8.ch = (use_doschars) ? rogue.dosfchar : rogue.fchar; return cc; } --- 366,375 ---- */ ! chtype get_rogue_char(void) { ! chtype cc; ! cc = (use_doschars) ? rogue.dosfchar : rogue.fchar; ! cc |= (use_color) ? rogue.color : COLOR_PAIR(COLOR_WHITE); return cc; } *************** *** 411,419 **** /* draw the character */ ! addcch(get_dungeon_char(i, j)); } } } ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); print_stats(STAT_ALL); } --- 403,411 ---- /* draw the character */ ! addch(get_dungeon_char(i, j)); } } } ! mvaddch(rogue.row, rogue.col, get_rogue_char()); print_stats(STAT_ALL); } *************** *** 544,548 **** { short i, j, ch; ! color_char cch, occh; unsigned short mask = (ANYROOMSIDE | DOOR | TUNNEL | TRAP | STAIRS | MONSTER); --- 536,540 ---- { short i, j, ch; ! chtype cch, occh; unsigned short mask = (ANYROOMSIDE | DOOR | TUNNEL | TRAP | STAIRS | MONSTER); *************** *** 554,562 **** if (s & mask) { ch = (short) mvinch(i,j); ! cch.b16 = mvincch(i,j).b16; if ((ch == ' ') || ((ch >= 'A') && (ch <= 'Z')) || (s & (TRAP | HIDDEN))) { ! occh.b16 = cch.b16; dungeon[i][j] &= (~HIDDEN); if (s & HORWALL) { --- 546,554 ---- if (s & mask) { ch = (short) mvinch(i,j); ! cch = mvinch(i,j); if ((ch == ' ') || ((ch >= 'A') && (ch <= 'Z')) || (s & (TRAP | HIDDEN))) { ! occh = cch; dungeon[i][j] &= (~HIDDEN); if (s & HORWALL) { *************** *** 584,588 **** } if ((!(s & MONSTER)) || (ch == ' ')) { ! addcch(cch); } if (s & MONSTER) { --- 576,580 ---- } if ((!(s & MONSTER)) || (ch == ' ')) { ! addch(cch); } if (s & MONSTER) { *************** *** 590,594 **** if (monster = object_at(&level_monsters, i, j)) { ! monster->trail_char.b16 = cch.b16; } } --- 582,586 ---- if (monster = object_at(&level_monsters, i, j)) { ! monster->trail_char = cch; } } *************** *** 597,601 **** } } ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); } --- 589,593 ---- } } ! mvaddch(rogue.row, rogue.col, get_rogue_char()); } *************** *** 703,707 **** void edit_opts(void) { ! color_char save[NOPTS+1][DCOLS]; short i, j; short ch; --- 695,699 ---- void edit_opts(void) { ! chtype save[NOPTS+1][DCOLS]; short i, j; short ch; *************** *** 714,718 **** for (i = 0; i < NOPTS+1; i++) { for (j = 0; j < DCOLS; j++) { ! save[i][j] = mvincch(i, j); } if (i < NOPTS) { --- 706,710 ---- for (i = 0; i < NOPTS+1; i++) { for (j = 0; j < DCOLS; j++) { ! save[i][j] = mvinch(i, j); } if (i < NOPTS) { *************** *** 801,805 **** move(i, 0); for (j = 0; j < DCOLS; j++) { ! addcch(save[i][j]); } if (options[i].is_bool && options[i].redraw_necc --- 793,797 ---- move(i, 0); for (j = 0; j < DCOLS; j++) { ! addch(save[i][j]); } if (options[i].is_bool && options[i].redraw_necc *************** *** 837,843 **** struct option *opt = &options[i]; ! mvaddstr_in_color(i, 0, opt->prompt, ! (unsigned char) (use_color ? MAKE_COLOR(CYAN, BLACK) : ! MAKE_COLOR(WHITE,BLACK))); clrtoeol(); } --- 829,836 ---- struct option *opt = &options[i]; ! attron(use_color ? COLOR_PAIR(COLOR_CYAN) : COLOR_PAIR(COLOR_WHITE)); ! mvaddstr(i, 0, opt->prompt); ! attroff(use_color ? COLOR_PAIR(COLOR_CYAN) : COLOR_PAIR(COLOR_WHITE)); ! clrtoeol(); } *************** *** 860,868 **** move( (short) (LINES-1), 0); refresh(); stop_window(); printf("\n\nSpawning new shell. Type 'exit' to return to rogue...\n"); md_shell(sh); start_window(); ! redraw(); md_heed_signals(); } --- 853,862 ---- move( (short) (LINES-1), 0); refresh(); + def_prog_mode(); stop_window(); printf("\n\nSpawning new shell. Type 'exit' to return to rogue...\n"); md_shell(sh); start_window(); ! wrefresh(curscr); md_heed_signals(); } *************** *** 877,884 **** */ ! color_char gr_obj_char(const int ix) { struct _screenchars *sc; ! color_char cc; /* initialize groc array and check for failing case */ --- 871,878 ---- */ ! chtype gr_obj_char(const int ix) { struct _screenchars *sc; ! chtype cc; /* initialize groc array and check for failing case */ *************** *** 887,892 **** } if (dc_len <= 0) { /* ugh */ ! cc.b8.color = MAKE_COLOR(WHITE, BLACK); ! cc.b8.ch = '~'; return cc; } --- 881,885 ---- } if (dc_len <= 0) { /* ugh */ ! cc = COLOR_PAIR(COLOR_WHITE) | '~'; return cc; } *************** *** 900,906 **** /* construct the color character */ ! cc.b8.ch = (use_doschars) ? sc->dosch : sc->ch; ! cc.b8.color = (use_color) ? MAKE_COLOR(sc->fgcolor, sc->bgcolor) : ! MAKE_COLOR(WHITE, BLACK); return cc; } --- 893,898 ---- /* construct the color character */ ! cc = (use_doschars) ? sc->dosch : sc->ch; ! cc |= (use_color) ? sc->color : COLOR_PAIR(COLOR_WHITE); return cc; } Index: hit.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/hit.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** hit.c 16 Jun 2008 04:42:04 -0000 1.6 --- hit.c 18 Jun 2008 03:16:13 -0000 1.6.2.1 *************** *** 292,296 **** col = monster->col; dungeon[row][col] &= ~MONSTER; ! mvaddcch(row, col, get_dungeon_char(row, col)); fight_monster = 0; --- 292,296 ---- col = monster->col; dungeon[row][col] &= ~MONSTER; ! mvaddch(row, col, get_dungeon_char(row, col)); fight_monster = 0; Index: spec_hit.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/spec_hit.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** spec_hit.c 13 Jun 2008 00:19:06 -0000 1.6 --- spec_hit.c 18 Jun 2008 03:16:13 -0000 1.6.2.1 *************** *** 236,240 **** dungeon[row][col] &= ~MONSTER; if (rogue_can_see(row, col)) { ! mvaddcch(row, col, get_dungeon_char(row, col)); } take_from_pack(monster, &level_monsters); --- 236,240 ---- dungeon[row][col] &= ~MONSTER; if (rogue_can_see(row, col)) { ! mvaddch(row, col, get_dungeon_char(row, col)); } take_from_pack(monster, &level_monsters); *************** *** 293,297 **** static int try_to_cough(const short row, const short col, object *obj) /*only used within this file*/ { ! color_char cc; object *monster; --- 293,297 ---- static int try_to_cough(const short row, const short col, object *obj) /*only used within this file*/ { ! chtype cc; object *monster; *************** *** 305,313 **** if ((row != rogue.row) || (col != rogue.col)) { if (!(dungeon[row][col] & MONSTER)) { ! mvaddcch(row, col, cc); } else { monster = object_at(&level_monsters, row, col); if (monster != 0) ! monster->trail_char.b16 = cc.b16; } } --- 305,313 ---- if ((row != rogue.row) || (col != rogue.col)) { if (!(dungeon[row][col] & MONSTER)) { ! mvaddch(row, col, cc); } else { monster = object_at(&level_monsters, row, col); if (monster != 0) ! monster->trail_char = cc; } } *************** *** 377,381 **** wake_up(monster); if (!blind) { ! mvaddcch(monster->row, monster->col, get_dungeon_char(monster->row, monster->col)); check_message(); --- 377,381 ---- wake_up(monster); if (!blind) { ! mvaddch(monster->row, monster->col, get_dungeon_char(monster->row, monster->col)); check_message(); Index: machdep.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/machdep.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** machdep.c 16 Jun 2008 04:42:04 -0000 1.7 --- machdep.c 18 Jun 2008 03:16:13 -0000 1.7.2.1 *************** *** 93,96 **** --- 93,97 ---- #ifdef _MSC_VER #define WIN32_LEAN_AND_MEAN + #undef MOUSE_MOVED /* kludge for pdcurses */ #include <windows.h> #endif Index: message.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/message.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** message.c 14 Jun 2008 02:38:02 -0000 1.7 --- message.c 18 Jun 2008 03:16:13 -0000 1.7.2.1 *************** *** 56,60 **** extern boolean cant_int, did_int, interrupted, save_is_interactive; ! extern boolean use_doschars, use_color, beep; extern short add_strength; extern short cur_level; --- 56,60 ---- extern boolean cant_int, did_int, interrupted, save_is_interactive; ! extern boolean use_doschars, use_color, use_bell; extern short add_strength; extern short cur_level; *************** *** 206,237 **** boolean label; short row = DROWS - 1; ! byte color; label = (stat_mask & STAT_LABEL) ? 1 : 0; ! color = use_color ? BRIGHT_YELLOW : MAKE_COLOR(WHITE,BLACK); if (stat_mask & STAT_LEVEL) { if (label) { ! mvaddstr_in_color(row, 0, "Level: ", color); } /* max level taken care of in make_level() */ sprintf(buf, "%d", cur_level); ! mvaddstr_in_color(row, 7, buf, color); pad(buf, 2); } if (stat_mask & STAT_GOLD) { if (label) { ! mvaddstr_in_color(row, 10, "Gold: ", color); } if (rogue.gold > MAX_GOLD) { rogue.gold = MAX_GOLD; } ! sprintf(buf, "%ld", rogue.gold); ! mvaddstr_in_color(row, 16, buf, color); pad(buf, 6); } if (stat_mask & STAT_HP) { if (label) { ! mvaddstr_in_color(row, 23, "Hp: ", color); } if (rogue.hp_max > MAX_HP) { --- 206,247 ---- boolean label; short row = DROWS - 1; ! attr_t color; label = (stat_mask & STAT_LABEL) ? 1 : 0; ! color = use_color ? COLOR_PAIR(COLOR_YELLOW)|A_BOLD : COLOR_PAIR(COLOR_WHITE); if (stat_mask & STAT_LEVEL) { if (label) { ! attron(color); ! mvaddstr(row, 0, "Level: "); ! attroff(color); } /* max level taken care of in make_level() */ sprintf(buf, "%d", cur_level); ! attron(color); ! mvaddstr(row, 7, buf); ! attroff(color); pad(buf, 2); } if (stat_mask & STAT_GOLD) { if (label) { ! attron(color); ! mvaddstr(row, 10, "Gold: "); ! attroff(color); } if (rogue.gold > MAX_GOLD) { rogue.gold = MAX_GOLD; } ! sprintf(buf, "%ld", rogue.gold); ! attron(color); ! mvaddstr(row, 16, buf); ! attroff(color); pad(buf, 6); } if (stat_mask & STAT_HP) { if (label) { ! attron(color); ! mvaddstr(row, 23, "Hp: "); ! attroff(color); } if (rogue.hp_max > MAX_HP) { *************** *** 240,249 **** } sprintf(buf, "%d(%d)", rogue.hp_current, rogue.hp_max); ! mvaddstr_in_color(row, 27, buf, color); pad(buf, 8); } if (stat_mask & STAT_STRENGTH) { if (label) { ! mvaddstr_in_color(row, 36, "Str: ", color); } if (rogue.str_max > MAX_STRENGTH) { --- 250,263 ---- } sprintf(buf, "%d(%d)", rogue.hp_current, rogue.hp_max); ! attron(color); ! mvaddstr(row, 27, buf); ! attroff(color); pad(buf, 8); } if (stat_mask & STAT_STRENGTH) { if (label) { ! attron(color); ! mvaddstr(row, 36, "Str: "); ! attroff(color); } if (rogue.str_max > MAX_STRENGTH) { *************** *** 253,262 **** sprintf(buf, "%d(%d)", (rogue.str_current + add_strength), rogue.str_max); ! mvaddstr_in_color(row, 41, buf, color); pad(buf, 6); } if (stat_mask & STAT_ARMOR) { if (label) { ! mvaddstr_in_color(row, 48, "Arm: ", color); } if (rogue.armor && (rogue.armor->d_enchant > MAX_ARMOR)) { --- 267,280 ---- sprintf(buf, "%d(%d)", (rogue.str_current + add_strength), rogue.str_max); ! attron(color); ! mvaddstr(row, 41, buf); ! attroff(color); pad(buf, 6); } if (stat_mask & STAT_ARMOR) { if (label) { ! attron(color); ! mvaddstr(row, 48, "Arm: "); ! attroff(color); } if (rogue.armor && (rogue.armor->d_enchant > MAX_ARMOR)) { *************** *** 264,273 **** } sprintf(buf, "%d", get_armor_class(rogue.armor)); ! mvaddstr_in_color(row, 53, buf, color); pad(buf, 2); } if (stat_mask & STAT_EXP) { if (label) { ! mvaddstr_in_color(row, 56, "Exp: ", color); } if (rogue.exp_points > MAX_EXP) { --- 282,295 ---- } sprintf(buf, "%d", get_armor_class(rogue.armor)); ! attron(color); ! mvaddstr(row, 53, buf); ! attroff(color); pad(buf, 2); } if (stat_mask & STAT_EXP) { if (label) { ! attron(color); ! mvaddstr(row, 56, "Exp: "); ! attroff(color); } if (rogue.exp_points > MAX_EXP) { *************** *** 278,287 **** } sprintf(buf, "%d/%ld", rogue.exp, rogue.exp_points); ! mvaddstr_in_color(row, 61, buf, color); pad(buf, 11); } if (stat_mask & STAT_HUNGER) { ! mvaddstr_in_color(row, 73, hunger_str, color); ! clrtoeol(); } refresh(); --- 300,313 ---- } sprintf(buf, "%d/%ld", rogue.exp, rogue.exp_points); ! attron(color); ! mvaddstr(row, 61, buf); ! attroff(color); pad(buf, 11); } if (stat_mask & STAT_HUNGER) { ! attron(color); ! mvaddstr(row, 73, hunger_str); ! attroff(color); ! clrtoeol(); } refresh(); *************** *** 342,346 **** void sound_bell(void) { ! if(beep) { putchar(7); } --- 368,372 ---- void sound_bell(void) { ! if(use_bell) { putchar(7); } Index: monster.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/monster.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** monster.c 16 Jun 2008 04:42:04 -0000 1.6 --- monster.c 18 Jun 2008 03:16:13 -0000 1.6.2.1 *************** *** 281,288 **** * except for imitators. */ ! color_char gmc_row_col(const short row, const short col) { object *monster; ! color_char cc; if (monster = object_at(&level_monsters, row, col)) { --- 281,288 ---- * except for imitators. */ ! chtype gmc_row_col(const short row, const short col) { object *monster; ! chtype cc; if (monster = object_at(&level_monsters, row, col)) { *************** *** 290,295 **** } else { /* BUG if this ever happens */ ! cc.b8.color = MAKE_COLOR(WHITE,BLACK); ! cc.b8.ch = '&'; return (cc); } --- 290,294 ---- } else { /* BUG if this ever happens */ ! cc = COLOR_PAIR(COLOR_WHITE) | '&'; return (cc); } *************** *** 297,303 **** ! color_char gmc(const object *monster) { ! color_char cc; /* invisible/blinded */ --- 296,302 ---- ! chtype gmc(const object *monster) { ! chtype cc; /* invisible/blinded */ *************** *** 309,319 **** /* imitator */ if (monster->m_flags & IMITATES) { ! cc.b16 = gr_obj_char(monster->disguise).b16; return(cc); } /* your garden variety monster */ ! cc.b8.color = MAKE_COLOR(WHITE,BLACK); ! cc.b8.ch = (char) monster->m_char; return(cc); } --- 308,317 ---- /* imitator */ if (monster->m_flags & IMITATES) { ! cc = gr_obj_char(monster->disguise); return(cc); } /* your garden variety monster */ ! cc = COLOR_PAIR(COLOR_WHITE) | monster->m_char; return(cc); } *************** *** 483,503 **** if ((c >= 'A') && (c <= 'Z')) { if (!detect_monster) { ! mvaddcch(mrow, mcol, monster->trail_char); } else { if (rogue_can_see(mrow, mcol)) { ! mvaddcch(mrow, mcol, monster->trail_char); } else { ! if (monster->trail_char.b16 == get_terrain_char(FLOOR).b16) { monster->trail_char = get_terrain_char(NOTHING); } ! mvaddcch(mrow, mcol, monster->trail_char); } } } ! monster->trail_char.b16 = mvincch(row, col).b16; if (!blind && (detect_monster || rogue_can_see(row, col))) { if ((!(monster->m_flags & INVISIBLE) || (detect_monster || see_invisible || r_see_invisible))) { ! mvaddcch(row, col, gmc(monster)); } } --- 481,501 ---- if ((c >= 'A') && (c <= 'Z')) { if (!detect_monster) { ! mvaddch(mrow, mcol, monster->trail_char); } else { if (rogue_can_see(mrow, mcol)) { ! mvaddch(mrow, mcol, monster->trail_char); } else { ! if (monster->trail_char == get_terrain_char(FLOOR)) { monster->trail_char = get_terrain_char(NOTHING); } ! mvaddch(mrow, mcol, monster->trail_char); } } } ! monster->trail_char = mvinch(row, col); if (!blind && (detect_monster || rogue_can_see(row, col))) { if ((!(monster->m_flags & INVISIBLE) || (detect_monster || see_invisible || r_see_invisible))) { ! mvaddch(row, col, gmc(monster)); } } *************** *** 672,676 **** while (monster) { ! mvaddcch(monster->row, monster->col, gmc(monster)); if (monster->m_flags & IMITATES) { monster->m_flags &= (~IMITATES); --- 670,674 ---- while (monster) { ! mvaddch(monster->row, monster->col, gmc(monster)); if (monster->m_flags & IMITATES) { monster->m_flags &= (~IMITATES); *************** *** 708,712 **** monster = gr_monster((object *) 0, 0); put_m_at(row, col, monster); ! mvaddcch(row, col, gmc(monster)); if (monster->m_flags & (WANDERS | WAKENS)) { wake_up(monster); --- 706,710 ---- monster = gr_monster((object *) 0, 0); put_m_at(row, col, monster); ! mvaddch(row, col, gmc(monster)); if (monster->m_flags & (WANDERS | WAKENS)) { wake_up(monster); *************** *** 723,727 **** monster->col = col; dungeon[row][col] |= MONSTER; ! monster->trail_char.b16 = mvincch(row, col).b16; (void) add_to_pack(monster, &level_monsters, 0); aim_monster(monster); --- 721,725 ---- monster->col = col; dungeon[row][col] |= MONSTER; ! monster->trail_char = mvinch(row, col); (void) add_to_pack(monster, &level_monsters, 0); aim_monster(monster); *************** *** 842,846 **** monster->m_flags &= (~IMITATES); if (rogue_can_see(monster->row, monster->col)) { ! mvaddcch(monster->row, monster->col, gmc(monster)); } monster = monster->next_monster; --- 840,844 ---- monster->m_flags &= (~IMITATES); if (rogue_can_see(monster->row, monster->col)) { ! mvaddch(monster->row, monster->col, gmc(monster)); } monster = monster->next_monster; Index: level.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/level.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** level.c 13 Jun 2008 00:19:06 -0000 1.5 --- level.c 18 Jun 2008 03:16:13 -0000 1.5.2.1 *************** *** 775,779 **** new_level_message = 0; } ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); } --- 775,779 ---- new_level_message = 0; } ! mvaddch(rogue.row, rogue.col, get_rogue_char()); } Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** rogue.h 16 Jun 2008 04:42:04 -0000 1.9 --- rogue.h 18 Jun 2008 03:16:13 -0000 1.9.2.1 *************** *** 226,231 **** --- 226,245 ---- }; + #ifdef HAVECURSES + #ifdef __MSDOS__ + #define DOS /* kludge for pdcurses */ + #endif + #include "curses.h" + + #define COLOR_STAIRS COLOR_WHITE+1 + + #else + extern int LINES, COLS; + typedef unsigned short chtype; /* 8-bit attr + 8-bit char */ + typedef chtype attr_t; + chtype mvinch(short row, short col); + #if 0 /* Support for color GUI... */ *************** *** 254,258 **** unsigned short b16; }; ! typedef union _colorChar color_char; #define MAKE_COLOR(fg,bg) (byte)(((fg) & 0x0F) | (((bg) & 0x0F) << 4)) --- 268,272 ---- unsigned short b16; }; ! /* typedef union _colorChar color_char; */ #define MAKE_COLOR(fg,bg) (byte)(((fg) & 0x0F) | (((bg) & 0x0F) << 4)) *************** *** 264,268 **** --- 278,284 ---- #define BGCOLOR_OF(col) (byte)(((col) >> 4) & 0x0F) #define FGCOLOR_OF(col) (byte)((col) & 0x0F) + #endif + #endif /* !HAVECURSES */ *************** *** 308,312 **** short picked_up; /* sleep from wand of sleep */ unsigned short in_use_flags; ! color_char cchar; /* character underneath monster */ int dchar_ix; /* imitator's character index */ struct obj *next_object; /* next monster */ --- 324,328 ---- short picked_up; /* sleep from wand of sleep */ unsigned short in_use_flags; ! chtype cchar; /* character underneath monster */ int dchar_ix; /* imitator's character index */ struct obj *next_object; /* next monster */ *************** *** 324,330 **** #define INIT_PACK {0} #define INIT_GOLD 0 ! #define INIT_CHAR_COLOR MAKE_COLOR(BRIGHT_YELLOW, BLACK) #define INIT_CHAR '@' ! #define INIT_DOSCHAR '\x1' #define INIT_MOVES 1250 --- 340,346 ---- #define INIT_PACK {0} #define INIT_GOLD 0 ! #define INIT_CHAR_COLOR COLOR_PAIR(COLOR_YELLOW)|A_BOLD #define INIT_CHAR '@' ! #define INIT_DOSCHAR 0x01|A_ALTCHARSET #define INIT_MOVES 1250 *************** *** 342,348 **** long exp_points; short row, col; ! byte color; ! char fchar; ! char dosfchar; short moves_left; }; --- 358,364 ---- long exp_points; short row, col; ! attr_t color; ! chtype fchar; ! chtype dosfchar; short moves_left; }; *************** *** 575,583 **** typedef struct rogue_time_struct_definition rogue_time; /* fixes many compiler wanings */ - extern int LINES, COLS; - /* curses.c */ char rgetchar(void); void initscr(void); void move(const short row, const short col); --- 591,598 ---- typedef struct rogue_time_struct_definition rogue_time; /* fixes many compiler wanings */ /* curses.c */ char rgetchar(void); + #ifndef HAVECURSES void initscr(void); void move(const short row, const short col); *************** *** 585,608 **** void mvaddstr(const short row, const short col, char *str); void mvaddstr_in_color(const short row, const short col, char *str, const byte color); ! void mvaddcstr(const short row, const short col, color_char *cstr); void addch(const int ch); void mvaddch(const short row, const short col, const int ch); ! void addcch(const color_char cc); ! void mvaddcch(const short row, const short col, const color_char cc); ! void colorize(char *str, const byte color, color_char *cstr); void refresh(void); void redraw(void); int mvinch(const short row, const short col); ! color_char mvincch(const short row, const short col); void clear(void); void clrtoeol(void); void standout(void); void standend(void); ! void draw_box(const color_char cset[6], const short ulrow, const short ulcol, const short height, const short width); void endwin(void); void crmode(void); void noecho(void); void nonl(void); ! /* hit.c */ --- 600,623 ---- void mvaddstr(const short row, const short col, char *str); void mvaddstr_in_color(const short row, const short col, char *str, const byte color); ! void mvaddcstr(const short row, const short col, chtype *cstr); void addch(const int ch); void mvaddch(const short row, const short col, const int ch); ! void addcch(const chtype cc); ! void mvaddcch(const short row, const short col, const chtype cc); ! void colorize(char *str, const byte color, chtype *cstr); void refresh(void); void redraw(void); int mvinch(const short row, const short col); ! chtype mvincch(const short row, const short col); void clear(void); void clrtoeol(void); void standout(void); void standend(void); ! void draw_box(const chtype cset[6], const short ulrow, const short ulcol, const short height, const short width); void endwin(void); void crmode(void); void noecho(void); void nonl(void); ! #endif /* hit.c */ *************** *** 703,708 **** void mv_mons(void); void party_monsters(const int rn, int n); ! color_char gmc_row_col(const short row, const short col); ! color_char gmc(const object *monster); void mv_1_monster(object *monster, short row, short col); void move_mon_to(object *monster, const short row, const short col); --- 718,723 ---- void mv_mons(void); void party_monsters(const int rn, int n); ! chtype gmc_row_col(const short row, const short col); ! chtype gmc(const object *monster); void mv_1_monster(object *monster, short row, short col); void move_mon_to(object *monster, const short row, const short col); *************** *** 810,817 **** void light_passage(const short row, const short col); void darken_room(const short rn); ! color_char get_terrain_char(const unsigned short mask); ! color_char get_dungeon_char(const short row, const short col); ! color_char get_mask_char(const unsigned short mask); ! color_char get_rogue_char(void); void regenerate_screen(void); void gr_row_col(short *row, short *col, const unsigned short mask); --- 825,832 ---- void light_passage(const short row, const short col); void darken_room(const short rn); ! chtype get_terrain_char(const unsigned short mask); ! chtype get_dungeon_char(const short row, const short col); ! chtype get_mask_char(const unsigned short mask); ! chtype get_rogue_char(void); void regenerate_screen(void); void gr_row_col(short *row, short *col, const unsigned short mask); *************** *** 824,828 **** void edit_opts(void); void do_shell(void); ! color_char gr_obj_char(const int ix); int gr_obj_index(void); --- 839,843 ---- void edit_opts(void); void do_shell(void); ! chtype gr_obj_char(const int ix); int gr_obj_index(void); Index: move.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/move.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** move.c 15 Jun 2008 19:22:46 -0000 1.7 --- move.c 18 Jun 2008 03:16:13 -0000 1.7.2.1 *************** *** 123,128 **** light_passage(row, col); } ! mvaddcch(rogue.row, rogue.col, get_dungeon_char(rogue.row, rogue.col)); ! mvaddcch(row, col, get_rogue_char()); if (!jump) { --- 123,128 ---- light_passage(row, col); } ! mvaddch(rogue.row, rogue.col, get_dungeon_char(rogue.row, rogue.col)); ! mvaddch(row, col, get_rogue_char()); if (!jump) { Index: zap.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/zap.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** zap.c 13 Jun 2008 00:19:06 -0000 1.7 --- zap.c 18 Jun 2008 03:16:14 -0000 1.7.2.1 *************** *** 139,143 **** short row, col; object *nm; ! color_char tc; row = monster->row; --- 139,143 ---- short row, col; object *nm; ! chtype tc; row = monster->row; *************** *** 171,180 **** } nm = monster->next_monster; ! tc.b16 = monster->trail_char.b16; (void) gr_monster(monster, get_rand(0, MONSTERS-1)); monster->row = row; monster->col = col; monster->next_monster = nm; ! monster->trail_char.b16 = tc.b16; if (!(monster->m_flags & IMITATES)) { wake_up(monster); --- 171,180 ---- } nm = monster->next_monster; ! tc = monster->trail_char; (void) gr_monster(monster, get_rand(0, MONSTERS-1)); monster->row = row; monster->col = col; monster->next_monster = nm; ! monster->trail_char = tc; if (!(monster->m_flags & IMITATES)) { wake_up(monster); *************** *** 209,219 **** } gr_row_col(&row, &col, (FLOOR | TUNNEL | STAIRS | OBJECT)); ! mvaddcch(monster->row, monster->col, monster->trail_char); dungeon[monster->row][monster->col] &= ~MONSTER; monster->row = row; monster->col = col; dungeon[row][col] |= MONSTER; ! monster->trail_char.b16 = mvincch(row, col).b16; if (detect_monster || rogue_can_see(row, col)) { ! mvaddcch(row, col, gmc(monster)); } } --- 209,219 ---- } gr_row_col(&row, &col, (FLOOR | TUNNEL | STAIRS | OBJECT)); ! mvaddch(monster->row, monster->col, monster->trail_char); dungeon[monster->row][monster->col] &= ~MONSTER; monster->row = row; monster->col = col; dungeon[row][col] |= MONSTER; ! monster->trail_char = mvinch(row, col); if (detect_monster || rogue_can_see(row, col)) { ! mvaddch(row, col, gmc(monster)); } } *************** *** 284,292 **** while (orow!=row || ocol!=col) { get_dir_rc(dir, &orow, &ocol, 1); ! mvaddcch(orow, ocol, get_dungeon_char(orow, ocol)); /* ch = mvinch(orow, ocol); */ /* mvaddch(orow, ocol, ch); */ } ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); refresh(); } --- 284,292 ---- while (orow!=row || ocol!=col) { get_dir_rc(dir, &orow, &ocol, 1); ! mvaddch(orow, ocol, get_dungeon_char(orow, ocol)); /* ch = mvinch(orow, ocol); */ /* mvaddch(orow, ocol, ch); */ } ! mvaddch(rogue.row, rogue.col, get_rogue_char()); refresh(); } *************** *** 341,346 **** const char *s; short damage; ! color_char cch; ! byte bolt_color; static short btime; --- 341,346 ---- const char *s; short damage; ! chtype cch; ! attr_t bolt_color; static short btime; *************** *** 353,366 **** if (ball == FIRE) { s = "fire"; ! bolt_color = MAKE_COLOR(BRIGHT_RED, BLACK); } else if (ball == COLD) { s = "ice"; ! bolt_color = MAKE_COLOR(BRIGHT_CYAN, BLACK); } else { /* for future wants of lightning, etc. */ s = "bolt"; ! bolt_color = MAKE_COLOR(BRIGHT_YELLOW, BLACK); } if (!use_color) { ! bolt_color = MAKE_COLOR(BRIGHT_WHITE, BLACK); } --- 353,366 ---- if (ball == FIRE) { s = "fire"; ! bolt_color = COLOR_PAIR(COLOR_RED); } else if (ball == COLD) { s = "ice"; ! bolt_color = COLOR_PAIR(COLOR_CYAN); } else { /* for future wants of lightning, etc. */ s = "bolt"; ! bolt_color = COLOR_PAIR(COLOR_YELLOW) | A_BOLD; } if (!use_color) { ! bolt_color = COLOR_PAIR(COLOR_WHITE) | A_BOLD; } *************** *** 370,376 **** do { get_dir_rc(dir, &row, &col, 1); ! cch = mvincch(row, col); ! cch.b8.color = bolt_color; ! mvaddcch(row, col, cch); } while (!( (col <= 0) || (col >= DCOLS-1) || --- 370,376 ---- do { get_dir_rc(dir, &row, &col, 1); ! cch = mvinch(row, col) | A_CHARTEXT; ! cch |= bolt_color; ! mvaddch(row, col, cch); } while (!( (col <= 0) || (col >= DCOLS-1) || Index: init.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/init.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** init.c 16 Jun 2008 04:42:04 -0000 1.9 --- init.c 18 Jun 2008 03:16:13 -0000 1.9.2.1 *************** *** 63,67 **** boolean use_doschars = 1; boolean use_color = 1; ! boolean beep = 0; char *byebye_string = "Okay, bye bye!"; --- 63,67 ---- boolean use_doschars = 1; boolean use_color = 1; ! boolean use_bell = 0; char *byebye_string = "Okay, bye bye!"; *************** *** 119,122 **** --- 119,137 ---- clean_up("must be played on 24 x 80 screen"); } + + if(has_colors()) { + start_color(); + + /* should check values of COLORS and COLOR_PAIRS here */ + init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK); + init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK); + init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK); + init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK); + init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); + init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK); + init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK); + init_pair(COLOR_STAIRS, COLOR_BLACK, COLOR_GREEN); + } + start_window(); init_curses = 1; *************** *** 364,368 **** use_color = optval; } else if (!strncmp(eptr, "beep", 4)) { ! beep = optval; } } --- 379,383 ---- use_color = optval; } else if (!strncmp(eptr, "beep", 4)) { ! use_bell = optval; } } Index: object.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/object.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** object.c 16 Jun 2008 04:42:04 -0000 1.8 --- object.c 18 Jun 2008 03:16:13 -0000 1.8.2.1 *************** *** 674,678 **** { object *obj; ! color_char rc; short mc, row, col; object *monster; --- 674,678 ---- { object *obj; ! chtype rc; short mc, row, col; object *monster; *************** *** 688,692 **** if (dungeon[row][col] & MONSTER) { if (monster = object_at(&level_monsters, row, col)) { ! monster->trail_char.b16 = rc.b16; } } --- 688,692 ---- if (dungeon[row][col] & MONSTER) { if (monster = object_at(&level_monsters, row, col)) { ! monster->trail_char = rc; } } *************** *** 694,698 **** if (((mc < 'A') || (mc > 'Z')) && ((row != rogue.row) || (col != rogue.col))) { ! mvaddcch(row, col, rc); } obj = obj->next_object; --- 694,698 ---- if (((mc < 'A') || (mc > 'Z')) && ((row != rogue.row) || (col != rogue.col))) { ! mvaddch(row, col, rc); } obj = obj->next_object; *************** *** 703,708 **** while (monster) { if (monster->m_flags & IMITATES) { ! rc.b16 = gr_obj_char(monster->disguise).b16; ! mvaddcch(monster->row, monster->col, rc); } monster = monster->next_monster; --- 703,708 ---- while (monster) { if (monster->m_flags & IMITATES) { ! rc = gr_obj_char(monster->disguise); ! mvaddch(monster->row, monster->col, rc); } monster = monster->next_monster; *************** *** 819,823 **** short i = 0, j, maxlen = 0, n; char bwdesc[DCOLS]; ! color_char descs[MAX_PACK_COUNT+1][DCOLS]; short row, col; byte letter_color, protect_color, item_color; --- 819,823 ---- short i = 0, j, maxlen = 0, n; char bwdesc[DCOLS]; ! chtype descs[MAX_PACK_COUNT+1][DCOLS]; short row, col; byte letter_color, protect_color, item_color; *************** *** 865,869 **** obj = obj->next_object; } ! (void) colorize(press_space, MAKE_COLOR(WHITE, BLACK), descs[i++]); /* (void) strcpy(descs[i++], press_space); */ if (maxlen < 27) maxlen = 27; --- 865,869 ---- obj = obj->next_object; } ! (void) colorize(press_space, COLOR_PAIR(COLOR_WHITE), descs[i++]); /* (void) strcpy(descs[i++], press_space); */ if (maxlen < 27) maxlen = 27; *************** *** 873,881 **** if (row > 0) { for (j = col; j < DCOLS; j++) { ! descs[row-1][j-col].b16 = mvincch(row, j).b16; } descs[row-1][j-col].b16 = 0; } ! mvaddcstr(row, col, descs[row]); clrtoeol(); } --- 873,881 ---- if (row > 0) { for (j = col; j < DCOLS; j++) { ! descs[row-1][j-col].b16 = mvinch(row, j).b16; } descs[row-1][j-col].b16 = 0; } ! mvaddstr(row, col, descs[row]); clrtoeol(); } *************** *** 887,891 **** for (j = 1; ((j < i) && (j < DROWS)); j++) { ! mvaddcstr(j, col, descs[j-1]); } } --- 887,891 ---- for (j = 1; ((j < i) && (j < DROWS)); j++) { ! mvaddstr(j, col, descs[j-1]); } } *************** *** 1036,1040 **** short current_row_number, row_ctr, col_ctr, something_is_known; unsigned int ctr; ! color_char save[DROWS][DCOLS]; something_is_known = 0; --- 1036,1040 ---- short current_row_number, row_ctr, col_ctr, something_is_known; unsigned int ctr; ! chtype save[DROWS][DCOLS]; something_is_known = 0; *************** *** 1062,1066 **** for (col_ctr = 0; col_ctr < DCOLS; col_ctr++) { ! save[row_ctr][col_ctr] = mvincch(row_ctr, col_ctr); } } --- 1062,1066 ---- for (col_ctr = 0; col_ctr < DCOLS; col_ctr++) { ! save[row_ctr][col_ctr] = mvinch(row_ctr, col_ctr); } } *************** *** 1120,1128 **** for (col_ctr = 0; col_ctr < DCOLS; col_ctr++) { ! addcch(save[row_ctr][col_ctr]); } } ! redraw(); /*redraw screen*/ } --- 1120,1128 ---- for (col_ctr = 0; col_ctr < DCOLS; col_ctr++) { ! addch(save[row_ctr][col_ctr]); } } ! wrefresh(curscr); /*redraw screen*/ } Index: trap.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/trap.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** trap.c 13 Jun 2008 00:19:06 -0000 1.5 --- trap.c 18 Jun 2008 03:16:14 -0000 1.5.2.1 *************** *** 109,113 **** break; case TELE_TRAP: ! mvaddcch(rogue.row, rogue.col, get_terrain_char(TRAP)); tele(); break; --- 109,113 ---- break; case TELE_TRAP: ! mvaddch(rogue.row, rogue.col, get_terrain_char(TRAP)); tele(); break; *************** *** 218,222 **** for (j = 0; j < DCOLS; j++) { if (dungeon[i][j] & TRAP) { ! mvaddcch(i, j, get_terrain_char(TRAP)); } } --- 218,222 ---- for (j = 0; j < DCOLS; j++) { if (dungeon[i][j] & TRAP) { ! mvaddch(i, j, get_terrain_char(TRAP)); } } *************** *** 258,262 **** if ((!blind) && ((row != rogue.row) || (col != rogue.col))) { ! mvaddcch(row, col, get_dungeon_char(row, col)); } shown++; --- 258,262 ---- if ((!blind) && ((row != rogue.row) || (col != rogue.col))) { ! mvaddch(row, col, get_dungeon_char(row, col)); } shown++; Index: throw.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/throw.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** throw.c 11 Jun 2008 06:16:35 -0000 1.4 --- throw.c 18 Jun 2008 03:16:14 -0000 1.4.2.1 *************** *** 102,110 **** } monster = get_thrown_at_monster(weapon, d, &row, &col); ! mvaddcch(rogue.row, rogue.col, get_rogue_char()); refresh(); if (rogue_can_see(row, col) && ((row != rogue.row) || (col != rogue.col))){ ! mvaddcch(row, col, get_dungeon_char(row, col)); } if (monster) { --- 102,110 ---- } monster = get_thrown_at_monster(weapon, d, &row, &col); ! mvaddch(rogue.row, rogue.col, get_rogue_char()); refresh(); if (rogue_can_see(row, col) && ((row != rogue.row) || (col != rogue.col))){ ! mvaddch(row, col, get_dungeon_char(row, col)); } if (monster) { *************** *** 161,165 **** short orow, ocol; short i; ! color_char cc; orow = *row; ocol = *col; --- 161,165 ---- short orow, ocol; short i; ! chtype cc; orow = *row; ocol = *col; *************** *** 178,186 **** } if ((i != 0) && rogue_can_see(orow, ocol)) { ! mvaddcch(orow, ocol, get_dungeon_char(orow, ocol)); } if (rogue_can_see(*row, *col)) { if (!(dungeon[*row][*col] & MONSTER)) { ! mvaddcch(*row, *col, cc); } refresh(); --- 178,186 ---- } if ((i != 0) && rogue_can_see(orow, ocol)) { ! mvaddch(orow, ocol, get_dungeon_char(orow, ocol)); } if (rogue_can_see(*row, *col)) { if (!(dungeon[*row][*col] & MONSTER)) { ! mvaddch(*row, *col, cc); } refresh(); *************** *** 207,211 **** boolean found = 0; short mch; ! color_char dcch; unsigned short mon; --- 207,211 ---- boolean found = 0; short mch; ! chtype dcch; unsigned short mon; *************** *** 232,246 **** mon = dungeon[row][col] & MONSTER; dungeon[row][col] &= (~MONSTER); ! dcch.b16 = get_dungeon_char(row, col).b16; if (mon) { mch = (short) mvinch(row, col); if (monster = object_at(&level_monsters, row, col)) { ! monster->trail_char.b16 = dcch.b16; } if ((mch < 'A') || (mch > 'Z')) { ! mvaddcch(row, col, dcch); } } else { ! mvaddcch(row, col, dcch); } dungeon[row][col] |= mon; --- 232,246 ---- mon = dungeon[row][col] & MONSTER; dungeon[row][col] &= (~MONSTER); ! dcch = get_dungeon_char(row, col); if (mon) { mch = (short) mvinch(row, col); if (monster = object_at(&level_monsters, row, col)) { ! monster->trail_char = dcch; } if ((mch < 'A') || (mch > 'Z')) { ! mvaddch(row, col, dcch); } } else { ! mvaddch(row, col, dcch); } dungeon[row][col] |= mon; Index: invent.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/invent.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** invent.c 13 Jun 2008 00:19:06 -0000 1.8 --- invent.c 18 Jun 2008 03:16:13 -0000 1.8.2.1 *************** *** 215,224 **** extern char *m_names[], *more; - - #define INV_LETTER_COLOR BRIGHT_MAGENTA - #define INV_PROTECT_COLOR BRIGHT_YELLOW - #define INV_ITEM_COLOR WHITE - - extern struct id id_scrolls[]; --- 215,218 ---- *************** *** 230,233 **** --- 224,236 ---- static int pr_motion_char(int ch); /* only used within this file */ + colorize(char *str, attr_t color, chtype *cstr) + { + while (*str != '\0') { + (*cstr) = *str | color; + str++; + cstr++; + } + (*cstr) = 0; + } *************** *** 237,243 **** short i = 0, j, maxlen = 0, n; char bwdesc[DCOLS]; ! color_char descs[MAX_PACK_COUNT+1][DCOLS]; short row, col; ! byte letter_color, protect_color, item_color; obj = pack->next_object; --- 240,246 ---- short i = 0, j, maxlen = 0, n; char bwdesc[DCOLS]; ! chtype descs[MAX_PACK_COUNT+1][DCOLS]; short row, col; ! attr_t letter_color, protect_color, item_color; obj = pack->next_object; *************** *** 249,276 **** if (use_color) { ! letter_color = MAKE_COLOR(INV_LETTER_COLOR, BLACK); ! protect_color = MAKE_COLOR(INV_PROTECT_COLOR, BLACK); ! item_color = MAKE_COLOR(INV_ITEM_COLOR, BLACK); } else { ! letter_color = MAKE_COLOR(WHITE,BLACK); ! protect_color = MAKE_COLOR(WHITE,BLACK); ! item_color = MAKE_COLOR(WHITE,BLACK); } while (obj) { if (obj->what_is & mask) { ! descs[i][0].b8.color = MAKE_COLOR(WHITE, BLACK); ! descs[i][0].b8.ch = ' '; ! descs[i][1].b8.color = letter_color; ! descs[i][1].b8.ch = (char) obj->ichar; if ((obj->what_is & ARMOR) && obj->is_protected) { ! descs[i][2].b8.color = protect_color; ! descs[i][2].b8.ch = '}'; } else { ! descs[i][2].b8.color = letter_color; ! descs[i][2].b8.ch = ')'; } ! descs[i][3].b8.color = MAKE_COLOR(WHITE, BLACK); ! descs[i][3].b8.ch = ' '; get_desc(obj, bwdesc); --- 252,274 ---- if (use_color) { ! letter_color = COLOR_PAIR(COLOR_MAGENTA) | A_BOLD; ! protect_color = COLOR_PAIR(COLOR_YELLOW) | A_BOLD; ! item_color = COLOR_PAIR(COLOR_WHITE); } else { ! letter_color = COLOR_PAIR(COLOR_WHITE); ! protect_color = COLOR_PAIR(COLOR_WHITE); ! item_color = COLOR_PAIR(COLOR_WHITE); } while (obj) { if (obj->what_is & mask) { ! descs[i][0] = COLOR_PAIR(COLOR_WHITE) | ' '; ! descs[i][1] = letter_color | obj->ichar; if ((obj->what_is & ARMOR) && obj->is_protected) { ! descs[i][2] = protect_color | '}'; } else { ! descs[i][2] = letter_color | ')'; } ! descs[i][3] = COLOR_PAIR(COLOR_WHITE) | ' '; get_desc(obj, bwdesc); *************** *** 283,288 **** obj = obj->next_object; } ! (void) colorize(press_space, MAKE_COLOR(WHITE, BLACK), descs[i++]); ! /* (void) strcpy(descs[i++], press_space); */ if (maxlen < 27) maxlen = 27; col = DCOLS - (maxlen + 2); --- 281,285 ---- obj = obj->next_object; } ! (void) colorize(press_space, COLOR_PAIR(COLOR_WHITE), descs[i++]); if (maxlen < 27) maxlen = 27; co... [truncated message content] |
From: Michael L. <mle...@us...> - 2008-06-16 04:42:27
|
Update of /cvsroot/rogueclone/rogue/doc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28334 Modified Files: changelog.txt Log Message: steve_ued's known items patch Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** changelog.txt 15 Jun 2008 19:23:02 -0000 1.4 --- changelog.txt 16 Jun 2008 04:42:22 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- Changelog --------- + 12:35 AM 2008-06-16 - applied steve_ued's patch [ 1079744 ] Known Items 12:32 AM 2008-06-14 - applied patch [ 1077029 ] move.c - gr_dir() optimization 7:29 PM 2008-06-13 - added the nobeep option |
From: Michael L. <mle...@us...> - 2008-06-16 04:42:19
|
Update of /cvsroot/rogueclone/rogue/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27902 Modified Files: hit.c init.c machdep.c monster.c object.c play.c rogue.h use.c Log Message: steve_ued's known items patch Index: use.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/use.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** use.c 13 Jun 2008 00:19:06 -0000 1.7 --- use.c 16 Jun 2008 04:42:04 -0000 1.8 *************** *** 95,98 **** --- 95,103 ---- return; } + + #ifdef KNOWN_ITEMS + known_items_add_new_known_item(obj->what_is, obj->which_kind); + #endif + switch(obj->which_kind) { case INCREASE_STRENGTH: *************** *** 211,214 **** --- 216,224 ---- return; } + + #ifdef KNOWN_ITEMS + known_items_add_new_known_item(obj->what_is, obj->which_kind); + #endif + switch(obj->which_kind) { case SCARE_MONSTER: *************** *** 396,400 **** --- 406,415 ---- id_table = get_id_table(obj); id_table[obj->which_kind].id_status = IDENTIFIED; + + #ifdef KNOWN_ITEMS + known_items_add_new_known_item(obj->what_is, obj->which_kind); + #endif } + get_desc(obj, desc); message(desc, 0); Index: init.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/init.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** init.c 14 Jun 2008 02:38:02 -0000 1.8 --- init.c 16 Jun 2008 04:42:04 -0000 1.9 *************** *** 95,98 **** --- 95,103 ---- do_args(argc, argv); + #ifdef KNOWN_ITEMS + known_items_initialize(); + known_monsters_initialize(); + #endif + if (!score_only && !rest_file) { FILE *fp; Index: rogue.h =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/rogue.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rogue.h 13 Jun 2008 00:19:06 -0000 1.8 --- rogue.h 16 Jun 2008 04:42:04 -0000 1.9 *************** *** 510,513 **** --- 510,516 ---- #define MIN_ROW 1 + #ifdef KNOWN_ITEMS + #define MAX_KNOWN_ITEM_STRING_LENGTH 60 + #endif /* external routine declarations. *************** *** 636,639 **** --- 639,645 ---- /* invent.c */ + #ifdef KNOWN_ITEMS + extern char *press_space; + #endif void inventory(object *pack, const unsigned short mask); void id_com(void); *************** *** 647,651 **** void id_type(void); - /* level.c */ void make_level(void); --- 653,656 ---- *************** *** 680,683 **** --- 685,691 ---- /* message.c */ + #ifdef KNOWN_ITEMS + extern char *more; + #endif void message(char *msg, const boolean intrpt); void remessage(short c); *************** *** 710,714 **** boolean mon_sees(const object *monster, const short row, const short col); void mv_aquatars(void); ! /* move.c */ --- 718,726 ---- boolean mon_sees(const object *monster, const short row, const short col); void mv_aquatars(void); ! #ifdef KNOWN_ITEMS ! void known_monsters_initialize(void); ! void known_monsters_add_killed_monster(const char *monster_name); ! void known_monsters_print_known_monsters(void); ! #endif /* move.c */ *************** *** 744,748 **** void discovery(void); #endif ! /* pack.c */ --- 756,766 ---- void discovery(void); #endif ! #ifdef KNOWN_ITEMS ! void known_items_initialize(void); ! void known_items_add_new_known_item(const unsigned short tmp_known_item_what_type, ! const unsigned short item_type); ! void do_show_items_known(void); ! void known_items_print_known_items(void); ! #endif /* pack.c */ Index: object.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/object.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** object.c 14 Jun 2008 02:48:28 -0000 1.7 --- object.c 16 Jun 2008 04:42:04 -0000 1.8 *************** *** 891,892 **** --- 891,1146 ---- } #endif + + #ifdef KNOWN_ITEMS + /* + * Patch [ 1079744 ] Known Items + * Submitted By: steve_ued + */ + + struct known_items_struct_details + { + unsigned short is_known; /* 0 if not known, if >= 1 then this is the + number of times this item is known (e.g., so you + could use this as the number of times this item + was used */ + + unsigned short known_item_what_is; /* what type of object (wand, scroll, potion, etc) */ + unsigned short known_item_type; /* subtype type of the item */ + char printable_string[MAX_KNOWN_ITEM_STRING_LENGTH + 1]; /* user friendly printable string */ + }; + + typedef struct known_items_struct_details known_items_struct; + + #define MAX_KNOWN_ITEMS 250 + + static known_items_struct known_items_list[MAX_KNOWN_ITEMS]; + static unsigned int number_of_known_items = 0; + + /*-------------------------------------------------------------------------------------------*/ + static void known_items_initialize_single_item( + const unsigned short tmp_known_item_what_is, + const unsigned short tmp_known_item_type, + const char *tmp_item_printable_string) + { + known_items_struct *tmp; + + /* make sure that there is room to add the item to the list */ + if (number_of_known_items == MAX_KNOWN_ITEMS) + { + return; /*do nothing - this should eventually cause some error message */ + } + + /* make sure that printable string length is not too long */ + + + tmp = &known_items_list[number_of_known_items]; + + ++number_of_known_items; + + tmp->is_known = 0; + tmp->known_item_what_is = tmp_known_item_what_is; + tmp->known_item_type = tmp_known_item_type; + + strncpy(tmp->printable_string, tmp_item_printable_string, MAX_KNOWN_ITEM_STRING_LENGTH); + + tmp->printable_string[ MAX_KNOWN_ITEM_STRING_LENGTH ] = 0; /* force the null termination of string*/ + } + + + + /*-------------------------------------------------------------------------------------------*/ + void known_items_initialize(void) + { + known_items_initialize_single_item(SCROL, PROTECT_ARMOR, "Scroll of Protect Armor"); + known_items_initialize_single_item(SCROL, HOLD_MONSTER, "Scroll of Hold Monster"); + known_items_initialize_single_item(SCROL, ENCH_WEAPON, "Scroll of Enchant Weapon"); + known_items_initialize_single_item(SCROL, ENCH_ARMOR, "Scroll of Enchant Armor"); + known_items_initialize_single_item(SCROL, IDENTIFY, "Scroll of Identify"); + known_items_initialize_single_item(SCROL, TELEPORT, "Scroll of Teleport"); + known_items_initialize_single_item(SCROL, SLEEP, "Scroll of Sleep"); + known_items_initialize_single_item(SCROL, SCARE_MONSTER, "Scroll of Scare Monster"); + known_items_initialize_single_item(SCROL, REMOVE_CURSE, "Scroll of Remove Curse"); + known_items_initialize_single_item(SCROL, CREATE_MONSTER, "Scroll of Create Monster"); + known_items_initialize_single_item(SCROL, AGGRAVATE_MONSTER, "Scroll of Aggravate Monster"); + known_items_initialize_single_item(SCROL, MAGIC_MAPPING, "Scroll of Magic Mapping"); + known_items_initialize_single_item(SCROL, CON_MON, "Scroll of Confuse Monster"); + + known_items_initialize_single_item(POTION, INCREASE_STRENGTH, "Potion of Increase Strength"); + known_items_initialize_single_item(POTION, RESTORE_STRENGTH, "Potion of Restore Strength"); + known_items_initialize_single_item(POTION, HEALING, "Potion of Healing"); + known_items_initialize_single_item(POTION, EXTRA_HEALING, "Potion of Extra Healing"); + known_items_initialize_single_item(POTION, POISON, "Potion of Poison"); + known_items_initialize_single_item(POTION, RAISE_LEVEL, "Potion of Raise Level"); + known_items_initialize_single_item(POTION, BLINDNESS, "Potion of Blindness"); + known_items_initialize_single_item(POTION, HALLUCINATION, "Potion of Hallucination"); + known_items_initialize_single_item(POTION, DETECT_MONSTER, "Potion of Detect Monsters"); + known_items_initialize_single_item(POTION, DETECT_OBJECTS, "Potion of Detect Objects"); + known_items_initialize_single_item(POTION, CONFUSION, "Potion of Confusion"); + known_items_initialize_single_item(POTION, LEVITATION, "Potion of Levitation"); + known_items_initialize_single_item(POTION, HASTE_SELF, "Potion of Haste Self"); + known_items_initialize_single_item(POTION, SEE_INVISIBLE, "Potion of See Invisible"); + + known_items_initialize_single_item(WAND, TELE_AWAY, "Wand of Teleport Away"); + known_items_initialize_single_item(WAND, SLOW_MONSTER, "Wand of Slow Monster"); + known_items_initialize_single_item(WAND, INVISIBILITY, "Wand of Invisibility"); + known_items_initialize_single_item(WAND, POLYMORPH, "Wand of Polymorph"); + known_items_initialize_single_item(WAND, HASTE_MONSTER, "Wand of Haste Monster"); + known_items_initialize_single_item(WAND, MAGIC_MISSILE, "Wand of Magic Missile"); + known_items_initialize_single_item(WAND, CANCELLATION, "Wand of Cancellation"); + known_items_initialize_single_item(WAND, DO_NOTHING, "Wand of Do Nothing"); + known_items_initialize_single_item(WAND, DRAIN_LIFE, "Wand of Drain Life"); + known_items_initialize_single_item(WAND, COLD, "Wand of Cold"); + known_items_initialize_single_item(WAND, FIRE, "Wand of Fire"); + + known_items_initialize_single_item(RING, STEALTH, "Ring of Stealth"); + known_items_initialize_single_item(RING, R_TELEPORT, "Ring of Teleport"); + known_items_initialize_single_item(RING, REGENERATION, "Ring of Regeneration"); + known_items_initialize_single_item(RING, SLOW_DIGEST, "Ring of Slow Digestion"); + known_items_initialize_single_item(RING, ADD_STRENGTH, "Ring of Add Strength"); + known_items_initialize_single_item(RING, SUSTAIN_STRENGTH, "Ring of Sustain Strength"); + known_items_initialize_single_item(RING, DEXTERITY, "Ring of Dexterity"); + known_items_initialize_single_item(RING, ADORNMENT, "Ring of Adornment"); + known_items_initialize_single_item(RING, R_SEE_INVISIBLE, "Ring of See Invisible"); + known_items_initialize_single_item(RING, MAINTAIN_ARMOR, "Ring of Maintain Armor"); + known_items_initialize_single_item(RING, SEARCHING, "Ring of Searching"); + } + + + /*----------------------------------------------------------------*/ + void known_items_add_new_known_item(const unsigned short what_is, + const unsigned short item_type) + { + unsigned int ctr; + unsigned short tmp_what_is; + + /*we only want the item type what is field for usable items*/ + + tmp_what_is = what_is & (SCROL | POTION | WEAPON | ARMOR | WAND | RING); + + for (ctr = 0; ctr < number_of_known_items; ctr++) + { + if (known_items_list[ctr].known_item_what_is == tmp_what_is) + if (known_items_list[ctr].known_item_type == item_type) + { + known_items_list[ctr].is_known++; + return; + } + } + /*-------------------------------------------------*/ + /*should never get here*/ + } + + + void do_show_items_known() + { + short current_row_number, row_ctr, col_ctr, something_is_known; + unsigned int ctr; + color_char save[DROWS][DCOLS]; + + something_is_known = 0; + for (ctr = 0; ctr < number_of_known_items; ctr++) + { + if (known_items_list[ctr].is_known) + { + something_is_known = 1; + break; + } + } + + + if (something_is_known == 0) + { + check_message(); + message("You have not found anything yet...", 0); + refresh(); + return; + } + + /*save current screen*/ + for (row_ctr = 0; row_ctr < DROWS; row_ctr++) + { + for (col_ctr = 0; col_ctr < DCOLS; col_ctr++) + { + save[row_ctr][col_ctr] = mvincch(row_ctr, col_ctr); + } + } + + + clear(); /*clear entire screen*/ + + check_message(); + message("List of things known...", 0); + + current_row_number = 0; + + for (ctr = 0; ctr < number_of_known_items; ctr++) + { + if (known_items_list[ctr].is_known) + { + char *p = known_items_list[ctr].printable_string; + + ++current_row_number; + mvaddstr(current_row_number, 5, p); + + if ((current_row_number == DROWS) || (ctr + 1 == number_of_known_items)) + { /*give a more prompt*/ + char *m = more; + if (ctr + 1 == number_of_known_items) + m = press_space; + + mvaddstr(current_row_number, 0, m); + current_row_number = 0; + + refresh(); + wait_for_ack(); + + if (rgetchar() == CANCEL) + break; + + clear(); /*clear entire screen*/ + } + } + } + + /*-------------------------------------------------*/ + if (current_row_number > 0) + { /*new items known on screen - need to give 'press space to contiue' prompt*/ + ++current_row_number; + mvaddstr(current_row_number, 0, press_space); + + refresh(); + wait_for_ack(); + } + + clear(); + for (row_ctr = 0; row_ctr < DROWS; row_ctr++) + { + move(row_ctr, 0); + + for (col_ctr = 0; col_ctr < DCOLS; col_ctr++) + { + addcch(save[row_ctr][col_ctr]); + } + } + + redraw(); /*redraw screen*/ + } + + + + + /*----------------------------------------------------------------*/ + void known_items_print_known_items(void) + { + unsigned int ctr; + + for (ctr = 0; ctr < number_of_known_items; ctr++) + { + if (known_items_list[ctr].is_known) + { + printf(known_items_list[ctr].printable_string); + printf("\n"); + } + } + } + #endif /* KNOWN_ITEMS */ Index: play.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/play.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** play.c 11 Jun 2008 06:16:35 -0000 1.6 --- play.c 16 Jun 2008 04:42:04 -0000 1.7 *************** *** 187,190 **** --- 187,195 ---- id_com(); break; + #ifdef KNOWN_ITEMS + case '\\': + do_show_items_known(); + break; + #endif case '!': do_shell(); Index: monster.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/monster.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** monster.c 13 Jun 2008 00:19:06 -0000 1.5 --- monster.c 16 Jun 2008 04:42:04 -0000 1.6 *************** *** 888,889 **** --- 888,981 ---- } } + + #ifdef KNOWN_ITEMS + /*---------------------------------------------------------------*/ + + struct known_monsters_type_struct + { + unsigned short is_known; /* 0 if not known, if >= 1 then this is the + number of times this item is known (e.g., so you + could use this as the number of times this item + was used */ + + char monster_name[MAX_KNOWN_ITEM_STRING_LENGTH + 1]; /* user friendly printable string */ + }; + + typedef struct known_monsters_type_struct KNOWN_MONSTERS_STRUCT; + + static KNOWN_MONSTERS_STRUCT KNOWN_MONSTERS[MONSTERS]; + + + /*---------------------------------------------------------------*/ + void known_monsters_initialize(void) + { + extern char *m_names[]; + + char *monster_names_list_tmp[MONSTERS]; + int ctr; + + /* create a temporary list of monster names and then sort */ + + for (ctr = 0; ctr < MONSTERS; ctr++) + monster_names_list_tmp[ctr] = m_names[ctr]; + + for (ctr = 0; ctr < MONSTERS -1;ctr++) + { + int ctr2; + for (ctr2 = ctr + 1; ctr2 < MONSTERS;ctr2++) + { + const int c = strcmp(monster_names_list_tmp[ctr], monster_names_list_tmp[ctr2]); + + if (c > 0) + { + char *p = monster_names_list_tmp[ctr]; + + monster_names_list_tmp[ctr] = monster_names_list_tmp[ctr2]; + monster_names_list_tmp[ctr2] = p; + } + } + } + + + /*------------------------------------------------------*/ + for (ctr = 0; ctr < MONSTERS; ctr++) + { + KNOWN_MONSTERS[ctr].is_known = 0; + + strncpy(KNOWN_MONSTERS[ctr].monster_name, monster_names_list_tmp[ctr], MAX_KNOWN_ITEM_STRING_LENGTH); + } + + } + + /*---------------------------------------------------------------*/ + void known_monsters_add_killed_monster(const char *monster_name) + { + int ctr; + + for (ctr = 0;ctr < MONSTERS; ctr++) + { + if (strcmp(monster_name, KNOWN_MONSTERS[ctr].monster_name) == 0) + { + KNOWN_MONSTERS[ctr].is_known++; + } + + } + } + + + /*-------------------------------------------------------*/ + void known_monsters_print_known_monsters(void) + { + int ctr; + + for (ctr = 0;ctr < MONSTERS;ctr++) + { + const unsigned short killed_count = KNOWN_MONSTERS[ctr].is_known; + + if (killed_count > 0) + { + printf("%s, %u killed\n", KNOWN_MONSTERS[ctr].monster_name, killed_count); + } + } + } + #endif /* KNOWN_ITEMS */ Index: machdep.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/machdep.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** machdep.c 13 Jun 2008 00:19:06 -0000 1.6 --- machdep.c 16 Jun 2008 04:42:04 -0000 1.7 *************** *** 439,442 **** --- 439,447 ---- void md_exit(int status) { + #ifdef KNOWN_ITEMS + known_items_print_known_items(); + known_monsters_print_known_monsters(); + #endif + exit(status); } Index: hit.c =================================================================== RCS file: /cvsroot/rogueclone/rogue/src/hit.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hit.c 11 Jun 2008 06:16:35 -0000 1.5 --- hit.c 16 Jun 2008 04:42:04 -0000 1.6 *************** *** 297,300 **** --- 297,305 ---- cough_up(monster); mn = mon_name(monster); + + #ifdef KNOWN_ITEMS + known_monsters_add_killed_monster(mn); /*add killed monster*/ + #endif + sprintf(hit_message+strlen(hit_message), "defeated the %s", mn); message(hit_message, 1); |
From: Michael L. <mle...@us...> - 2008-06-15 19:23:05
|
Update of /cvsroot/rogueclone/rogue/doc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26579 Modified Files: changelog.txt Log Message: applied patch [ 1077029 ] move.c - gr_dir() optimization Index: changelog.txt =================================================================== RCS file: /cvsroot/rogueclone/rogue/doc/changelog.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** changelog.txt 14 Jun 2008 02:38:26 -0000 1.3 --- changelog.txt 15 Jun 2008 19:23:02 -0000 1.4 *************** *** 1,11 **** - To Do - ----- - 1:18 AM 2008-06-11 - fix remaining vc98 compiler warnings - 9:11 PM 2008-06-10 - apply patches - 9:13 PM 2008-06-10 - fix bugs - 9:11 PM 2008-06-10 - get linux port working - Changelog --------- 7:29 PM 2008-06-13 - added the nobeep option 10:35 PM 2008-06-12 - fixed linker warning --- 1,5 ---- Changelog --------- + 12:32 AM 2008-06-14 - applied patch [ 1077029 ] move.c - gr_dir() optimization 7:29 PM 2008-06-13 - added the nobeep option 10:35 PM 2008-06-12 - fixed linker warning |