temporary crap fix, also added -notracker

This commit is contained in:
eukos 2015-08-04 12:11:23 +02:00
parent b4639d533f
commit c7019911ef
4 changed files with 41 additions and 73 deletions

View file

@ -1511,7 +1511,10 @@ void MassiveLookupTablesInit (void)
else{
if (inthedos)
fprintf(stderr,"!\n");
#ifdef linux
inthedos = 0;
#endif
}

View file

@ -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;

View file

@ -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
#endif

View file

@ -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
}