From c7019911efbed7976542ee942bc4018bb3a77bec Mon Sep 17 00:00:00 2001 From: eukos Date: Tue, 4 Aug 2015 12:11:23 +0200 Subject: [PATCH] temporary crap fix, also added -notracker --- WinQuake/draw.c | 5 ++- WinQuake/model.c | 4 +- WinQuake/r_misc.c | 86 +++++++--------------------------------- WinQuake/tracker_linux.c | 19 +++++++++ 4 files changed, 41 insertions(+), 73 deletions(-) diff --git a/WinQuake/draw.c b/WinQuake/draw.c index ea867f5..d21646f 100644 --- a/WinQuake/draw.c +++ b/WinQuake/draw.c @@ -1511,7 +1511,10 @@ void MassiveLookupTablesInit (void) else{ if (inthedos) fprintf(stderr,"!\n"); - + +#ifdef linux + inthedos = 0; +#endif } diff --git a/WinQuake/model.c b/WinQuake/model.c index c230bdb..73d1ded 100644 --- a/WinQuake/model.c +++ b/WinQuake/model.c @@ -308,11 +308,13 @@ void R_LoadRTLights(void) style = atoi(com_token); file->data = COM_Parse(file->data); corona = atof(com_token); - + // We got a corona, so let's make it happen. if (corona){ + #ifdef DEBUG Con_Printf("we got a %f %f %f %f %f %f %f %i %i %f in here\n", org[0], org[1], org[2], radius, rgb[0], rgb[1], rgb[2], style, style, corona); + #endif R_FlareTest(org,11,(int)(rgb[0] * 255),(int)(rgb[1] * 255),(int)(rgb[2] * 255),0,NULL); } file->data = end+1; diff --git a/WinQuake/r_misc.c b/WinQuake/r_misc.c index b207ca6..8278bca 100644 --- a/WinQuake/r_misc.c +++ b/WinQuake/r_misc.c @@ -483,81 +483,24 @@ void R_SetupFrame (void) if ((r_dowarp != r_dowarpold) || r_viewchanged || r_virtualmode->value || lcd_x->value || v_detail->value) { - if (r_docrap == 1) - { - if ((vid.width <= vid.maxlowwidth) && - (vid.height <= vid.maxlowheight)) - { - - - vrect.x = 0; - vrect.y = 0; - vrect.width = vid.width; - vrect.height = vid.height; - if (reflectpass){ - R_SetVrect (&vrect, &r_refdef.vrect, 0); - R_ViewChanged (&vrect, 0, vid.aspect); - } - else - { - R_SetVrect (&vrect, &r_refdef.vrect, (sb_what_lines / scalefactoid)); - R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect); - } - - } - else - { - w = vid.width; - h = vid.height; - - if (w > vid.maxlowwidth) - { - h *= (float)vid.maxlowwidth / w; - w = vid.maxlowwidth; - } - - if (h > vid.maxlowheight) - { - h = vid.maxlowheight; - w *= (float)vid.maxlowheight / h; - } - - vrect.x = 0; - vrect.y = 0; - vrect.width = (int)w; - vrect.height = (int)h; - - if (reflectpass) - { - R_SetVrect (&vrect, &r_refdef.vrect, (h/(float)vid.height)); - R_ViewChanged (&vrect, 0, vid.aspect * (h / w) * ((float)vid.width / (float)vid.height)); - }else{ - R_SetVrect (&vrect, &r_refdef.vrect, (int)((float)sb_lines * (h/(float)vid.height))); - R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect * (h / w) * ((float)vid.width / (float)vid.height)); - } - // R_ViewChanged (&vrect, - // (int)((float)(sb_what_lines / scalefactoid) * (h/(float)vid.height)), - // vid.aspect * (h / w) * - // ((float)vid.width / (float)vid.height)); - } - } - else if (r_docrap > 1) + if (r_docrap) { if ((vid.width <= vid.maxwarpwidth) && (vid.height <= vid.maxwarpheight)) { - - vrect.x = 0; vrect.y = 0; vrect.width = vid.width; vrect.height = vid.height; if (reflectpass){ - R_SetVrect (&vrect, &r_refdef.vrect, ((float)vid.height)); - R_ViewChanged (&vrect, 0, vid.aspect); - }else{ - R_SetVrect (&vrect, &r_refdef.vrect, (int)((float)sb_lines * ((float)vid.height))); - R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect); + R_SetVrect (&vrect, &r_refdef.vrect, ((float)vid.height)); + R_ViewChanged (&vrect, 0, vid.aspect); + } + else + { + R_SetVrect (&vrect, &r_refdef.vrect, + (int)((float)sb_lines * ((float)vid.height))); + R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect); } } else @@ -587,12 +530,13 @@ void R_SetupFrame (void) (h/(float)vid.height), vid.aspect * (h / w) * ((float)vid.width / (float)vid.height)); - }else{ + } + else + { R_SetVrect (&vrect, &r_refdef.vrect, (int)((float)sb_lines * (h/(float)vid.height))); R_ViewChanged (&vrect, - (int)((float)(sb_what_lines / scalefactoid) * (h/(float)vid.height)), - vid.aspect * (h / w) * - ((float)vid.width / (float)vid.height)); + (int)((float)(sb_what_lines / scalefactoid) * (h/(float)vid.height)), + vid.aspect * (h / w) * ((float)vid.width / (float)vid.height)); } } } @@ -883,4 +827,4 @@ void R_SetupFrameSplit (void) -#endif \ No newline at end of file +#endif diff --git a/WinQuake/tracker_linux.c b/WinQuake/tracker_linux.c index 0c2efc1..ec17375 100644 --- a/WinQuake/tracker_linux.c +++ b/WinQuake/tracker_linux.c @@ -37,6 +37,7 @@ char name[256]; DUH *trackmod; // The music file ~eukara DUH_SIGRENDERER *sr; // The DUMB renderer int oss_device; // output device (by default /dev/dsp for OSS) +static qboolean bTracker_Initialized = false; // Set up the renderer options static int depth = 16; // by default 16bit, only affects output not internal 32bit processing @@ -57,6 +58,9 @@ union { void Tracker_Play(byte track, qboolean looping) { + if(bTracker_Initialized == false) + return; + dumb_register_stdfiles(); // Initialize loading files // Attempt to load every format imaginable, TODO: better method? @@ -96,6 +100,11 @@ void Tracker_Play(byte track, qboolean looping) void Tracker_Stop(void) { + if(bTracker_Initialized == false) + return; + if(!trackmod || !sr) + return; + playing = false; // Not playing the song anymore to prevent Tracker_Update Con_Printf("Stopping %s\n", name); // Just print that we are stopping whatever track duh_end_sigrenderer(sr); // Stop the renderer safely @@ -104,12 +113,18 @@ void Tracker_Stop(void) void Tracker_Pause(void) { + if(bTracker_Initialized == false) + return; + playing = false; // Prevent from Tracker_Update from happening Con_Printf("Paused %s\n", name); } void Tracker_Resume(void) { + if(bTracker_Initialized == false) + return; + // Just making sure we aren't calling Tracker_Update with no song... if(!trackmod || !sr) return; @@ -190,12 +205,16 @@ void Tracker_Update(void) int Tracker_Init(void) { + if (COM_CheckParm("-notracker")) + return -1; + if((oss_device = open ("/dev/dsp", O_RDWR)) == -1){ // /dev/dsp is the standard OSS output perror("/dev/dsp"); return 0; // just get out if there's none } Cmd_AddCommand ("dumb", Tracker_f); // link DUMB + bTracker_Initialized = true; Con_Printf("DUMB Initialized\n"); // Tell them we are ready return 1; // return that we have successfully initialised }