From c29849f137ac9f8d413c684f8c8a8b829ec6d8af Mon Sep 17 00:00:00 2001 From: eukos Date: Fri, 24 Jul 2015 00:34:51 +0200 Subject: [PATCH] Fixed colored light temporarily --- WinQuake/d_polyse.c | 14 ++++++++------ WinQuake/sys_linux.c | 15 ++++++++------- WinQuake/vid_x.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/WinQuake/d_polyse.c b/WinQuake/d_polyse.c index b9a1e37..391b136 100644 --- a/WinQuake/d_polyse.c +++ b/WinQuake/d_polyse.c @@ -475,12 +475,12 @@ void D_PolysetScanLeftEdge (int height) d_pedgespanpackage->zi = d_zi; // leilei - colored lights on models -if (coloredlights){ + if (coloredlights){ d_pedgespanpackage->lightr = d_lightrgb[0]; d_pedgespanpackage->lightg = d_lightrgb[1]; d_pedgespanpackage->lightb = d_lightrgb[2]; -} + } d_pedgespanpackage++; @@ -1208,10 +1208,12 @@ void D_PolysetDrawSpans8_C (spanpackage_t *pspanpackage) int dodith, doshine; int s, t; int s2, t2; -// if (coloredmethod == 1){ -// D_PolysetDrawSpans8_Low_C (pspanpackage); -// return; -// } +#ifdef linux + if (coloredmethod == 1){ + D_PolysetDrawSpans8_Low_C (pspanpackage); + return; + } +#endif dodith = r_shadedither->value; doshine = r_shinygrays->value; if (currententity->effects & EF_NODRAW || currententity->leifect) diff --git a/WinQuake/sys_linux.c b/WinQuake/sys_linux.c index a10aa18..8ece1df 100644 --- a/WinQuake/sys_linux.c +++ b/WinQuake/sys_linux.c @@ -107,23 +107,23 @@ void Sys_Printf (char *fmt, ...) fflush(stdout); // 2000-07-11 Piped output of a dedicated server not written immediately fix by Hendrik Lipka } -#if 0 + static char end1[] = "\x1b[?7h\x1b[40m\x1b[2J\x1b[0;1;41m\x1b[1;1H QUAKE: The Doomed Dimension \x1b[33mby \x1b[44mid\x1b[41m Software \x1b[2;1H ---------------------------------------------------------------------------- \x1b[3;1H CALL 1-800-IDGAMES TO ORDER OR FOR TECHNICAL SUPPORT \x1b[4;1H PRICE: $45.00 (PRICES MAY VARY OUTSIDE THE US.) \x1b[5;1H \x1b[6;1H \x1b[37mYes! You only have one fourth of this incredible epic. That is because most \x1b[7;1H of you have paid us nothing or at most, very little. You could steal the \x1b[8;1H game from a friend. But we both know you'll be punished by God if you do. \x1b[9;1H \x1b[33mWHY RISK ETERNAL DAMNATION? CALL 1-800-IDGAMES AND BUY NOW! \x1b[10;1H \x1b[37mRemember, we love you almost as much as He does. \x1b[11;1H \x1b[12;1H \x1b[33mProgramming: \x1b[37mJohn Carmack, Michael Abrash, John Cash \x1b[13;1H \x1b[33mDesign: \x1b[37mJohn Romero, Sandy Petersen, American McGee, Tim Willits \x1b[14;1H \x1b[33mArt: \x1b[37mAdrian Carmack, Kevin Cloud \x1b[15;1H \x1b[33mBiz: \x1b[37mJay Wilbur, Mike Wilson, Donna Jackson \x1b[16;1H \x1b[33mProjects: \x1b[37mShawn Green \x1b[33mSupport: \x1b[37mBarrett Alexander \x1b[17;1H \x1b[33mSound Effects: \x1b[37mTrent Reznor and Nine Inch Nails \x1b[18;1H For other information or details on ordering outside the US, check out the \x1b[19;1H files accompanying QUAKE or our website at http://www.idsoftware.com. \x1b[20;1H \x1b[0;41mQuake is a trademark of Id Software, inc., (c)1996 Id Software, inc. \x1b[21;1H All rights reserved. NIN logo is a registered trademark licensed to \x1b[22;1H Nothing Interactive, Inc. All rights reserved. \x1b[40m\x1b[23;1H\x1b[0m"; static char end2[] = "\x1b[?7h\x1b[40m\x1b[2J\x1b[0;1;41m\x1b[1;1H QUAKE \x1b[33mby \x1b[44mid\x1b[41m Software \x1b[2;1H ----------------------------------------------------------------------------- \x1b[3;1H \x1b[37mWhy did you quit from the registered version of QUAKE? Did the \x1b[4;1H scary monsters frighten you? Or did Mr. Sandman tug at your \x1b[5;1H little lids? No matter! What is important is you love our \x1b[6;1H game, and gave us your money. Congratulations, you are probably \x1b[7;1H not a thief. \x1b[8;1H Thank You. \x1b[9;1H \x1b[33;44mid\x1b[41m Software is: \x1b[10;1H PROGRAMMING: \x1b[37mJohn Carmack, Michael Abrash, John Cash \x1b[11;1H \x1b[33mDESIGN: \x1b[37mJohn Romero, Sandy Petersen, American McGee, Tim Willits \x1b[12;1H \x1b[33mART: \x1b[37mAdrian Carmack, Kevin Cloud \x1b[13;1H \x1b[33mBIZ: \x1b[37mJay Wilbur, Mike Wilson \x1b[33mPROJECTS MAN: \x1b[37mShawn Green \x1b[14;1H \x1b[33mBIZ ASSIST: \x1b[37mDonna Jackson \x1b[33mSUPPORT: \x1b[37mBarrett Alexander \x1b[15;1H \x1b[33mSOUND EFFECTS AND MUSIC: \x1b[37mTrent Reznor and Nine Inch Nails \x1b[16;1H \x1b[17;1H If you need help running QUAKE refer to the text files in the \x1b[18;1H QUAKE directory, or our website at http://www.idsoftware.com. \x1b[19;1H If all else fails, call our technical support at 1-800-IDGAMES. \x1b[20;1H \x1b[0;41mQuake is a trademark of Id Software, inc., (c)1996 Id Software, inc. \x1b[21;1H All rights reserved. NIN logo is a registered trademark licensed \x1b[22;1H to Nothing Interactive, Inc. All rights reserved. \x1b[23;1H\x1b[40m\x1b[0m"; -#endif + void Sys_Quit (void) { Host_Shutdown(); - fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY); -#if 0 + fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY); + if (registered->value) printf("%s", end2); else printf("%s", end1); -#endif + fflush(stdout); exit(0); } @@ -346,7 +346,7 @@ void Sys_LowFPPrecision (void) { } #endif - +void VID_CreateSplash(void); int main (int c, char **v) { @@ -384,7 +384,8 @@ int main (int c, char **v) fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY); - Host_Init(&parms); + VID_CreateSplash(); + Host_Init(&parms); Sys_Init(); diff --git a/WinQuake/vid_x.c b/WinQuake/vid_x.c index e44dbd0..13834fc 100644 --- a/WinQuake/vid_x.c +++ b/WinQuake/vid_x.c @@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include // eukara: X11 Quake noborder +//#include "engoo.xbm" // eukara: splash screen #include "quakedef.h" #include "d_local.h" @@ -1094,6 +1095,44 @@ void VID_DitherOff(void) } } +void VID_CreateSplash(void){ +#if 0 + Display *d; + Window w; + XEvent e; + Pixmap i; + GC gc; + int s; + + d = XOpenDisplay(NULL); + if (d == NULL) { + fprintf(stderr, "Cannot open display\n"); + exit(1); + } + + s = DefaultScreen(d); + w = XCreateSimpleWindow(d, RootWindow(d, s), 10, 10, engoo_width, engoo_height, 1, + BlackPixel(d, s), WhitePixel(d, s)); + i = XCreateBitmapFromData(d, DefaultRootWindow(d), engoo_bits, engoo_width, engoo_height); + XSetWindowBackgroundPixmap(d, w, i); + XClearWindow(d, w); + XSelectInput(d, w, ExposureMask | KeyPressMask); + XMapWindow(d, w); + + while (1) { + XNextEvent(d, &e); + if (e.type == KeyPress) + break; + } + + /* Cleanup */ + XFreeGC(d, gc); + XDestroyWindow(d, w); + XCloseDisplay(d); + return 0; +#endif +} + int Sys_OpenWindow(void) { return 0;