Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 871 → Rev 872

/polymer/build/src/osd.c
680,11 → 680,11
 
if (osdeditwinstart<0)
osdeditwinend-=osdeditwinstart,
osdeditwinstart=0;
osdeditwinstart=0;
}
else if (osdeditcursor>=osdeditwinend)
osdeditwinstart+=(osdeditcursor-osdeditwinend),
osdeditwinend+=(osdeditcursor-osdeditwinend);
osdeditwinend+=(osdeditcursor-osdeditwinend);
}
 
static void OSD_HistoryNext(void)
712,11 → 712,11
 
if (osdeditwinstart<0)
osdeditwinend-=osdeditwinstart,
osdeditwinstart=0;
osdeditwinstart=0;
}
else if (osdeditcursor>=osdeditwinend)
osdeditwinstart+=(osdeditcursor-osdeditwinend),
osdeditwinend+=(osdeditcursor-osdeditwinend);
osdeditwinend+=(osdeditcursor-osdeditwinend);
}
 
int OSD_HandleChar(char ch)
885,7 → 885,7
osdhistorytotal++;
if (osdexeccount == HISTORYDEPTH)
OSD_Printf("Command Buffer Warning: Failed queueing command "
"for execution. Buffer full.\n");
"for execution. Buffer full.\n");
else
osdexeccount++;
}
893,7 → 893,7
{
if (osdexeccount == HISTORYDEPTH)
OSD_Printf("Command Buffer Warning: Failed queueing command "
"for execution. Buffer full.\n");
"for execution. Buffer full.\n");
else
osdexeccount++;
}
/polymer/build/src/sdlayer.c
213,9 → 213,9
int initsystem(void)
{
/*
#ifdef DEBUGGINGAIDS
#ifdef DEBUGGINGAIDS
const SDL_VideoInfo *vid;
#endif
#endif
*/
const SDL_version *linked = SDL_Linked_Version();
SDL_version compiled;
276,7 → 276,7
 
/*
// dump a quick summary of the graphics hardware
#ifdef DEBUGGINGAIDS
#ifdef DEBUGGINGAIDS
vid = SDL_GetVideoInfo();
initprintf("Video device information:\n");
initprintf(" Can create hardware surfaces? %s\n", (vid->hw_available)?"Yes":"No");
289,8 → 289,8
initprintf(" Accelerated software alpha blits? %s\n", (vid->blit_sw_A)?"Yes":"No");
initprintf(" Accelerated colour fills? %s\n", (vid->blit_fill)?"Yes":"No");
initprintf(" Total video memory: %dKB\n", vid->video_mem);
#endif
*/
#endif
*/
return 0;
}
 
1367,23 → 1367,23
{
int i;
unsigned short gammaTable[768];
float gamma = max(0.1f,min(4.f,vid_gamma));
float contrast = max(0.1f,min(3.f,vid_contrast));
float bright = max(-0.8f,min(0.8f,vid_brightness));
 
double invgamma = 1 / gamma;
double norm = pow(255., invgamma - 1);
float gamma = max(0.1f,min(4.f,vid_gamma));
float contrast = max(0.1f,min(3.f,vid_contrast));
float bright = max(-0.8f,min(0.8f,vid_brightness));
 
// This formula is taken from Doomsday
 
for (i = 0; i < 256; i++)
{
double val = i * contrast - (contrast - 1) * 127;
if (gamma != 1) val = pow(val, invgamma) / norm;
val += bright * 128;
 
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (unsigned short)max(0.f,(double)min(0xffff,val*256));
}
double invgamma = 1 / gamma;
double norm = pow(255., invgamma - 1);
 
// This formula is taken from Doomsday
 
for (i = 0; i < 256; i++)
{
double val = i * contrast - (contrast - 1) * 127;
if (gamma != 1) val = pow(val, invgamma) / norm;
val += bright * 128;
 
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (unsigned short)max(0.f,(double)min(0xffff,val*256));
}
return SDL_SetGammaRamp(&gammaTable[0],&gammaTable[256],&gammaTable[512]);
}
 
/polymer/build/src/winlayer.c
514,7 → 514,7
initprintf("OS: Windows %s (%lu.%lu.%lu) %s\n", ver, osv.dwMajorVersion, osv.dwMinorVersion,
awful_windows_9x?osv.dwBuildNumber&0xffff:osv.dwBuildNumber,osv.szCSDVersion);
// if (osv.szCSDVersion[0])
// initprintf(" - %s\n", osv.szCSDVersion);
// initprintf(" - %s\n", osv.szCSDVersion);
}
}
 
2662,26 → 2662,26
{
int i;
WORD gammaTable[768];
float gamma = max(0.1f,min(4.f,vid_gamma));
float contrast = max(0.1f,min(3.f,vid_contrast));
float bright = max(-0.8f,min(0.8f,vid_brightness));
 
double invgamma = 1 / gamma;
double norm = pow(255., invgamma - 1);
float gamma = max(0.1f,min(4.f,vid_gamma));
float contrast = max(0.1f,min(3.f,vid_contrast));
float bright = max(-0.8f,min(0.8f,vid_brightness));
 
double invgamma = 1 / gamma;
double norm = pow(255., invgamma - 1);
 
if (!hWindow) return -1;
 
// This formula is taken from Doomsday
 
for (i = 0; i < 256; i++)
{
double val = i * contrast - (contrast - 1) * 127;
if (gamma != 1) val = pow(val, invgamma) / norm;
val += bright * 128;
 
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (WORD)max(0.f,(double)min(0xffff,val*256));
}
return setgammaramp(gammaTable);
// This formula is taken from Doomsday
 
for (i = 0; i < 256; i++)
{
double val = i * contrast - (contrast - 1) * 127;
if (gamma != 1) val = pow(val, invgamma) / norm;
val += bright * 128;
 
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (WORD)max(0.f,(double)min(0xffff,val*256));
}
return setgammaramp(gammaTable);
}
 
static int getgammaramp(WORD gt[3][256])
/polymer/eduke32/source/config.c
653,6 → 653,16
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenGamma",&ud.brightness);
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size);
 
tempbuf[0] = 0;
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidGamma",&tempbuf[0]);
if (tempbuf[0]) vid_gamma = atof(tempbuf);
tempbuf[0] = 0;
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidBrightness",&tempbuf[0]);
if (tempbuf[0]) vid_brightness = atof(tempbuf);
tempbuf[0] = 0;
SCRIPT_GetString(ud.config.scripthandle, "Screen Setup", "VidContrast",&tempbuf[0]);
if (tempbuf[0]) vid_contrast = atof(tempbuf);
 
#if defined(POLYMOST) && defined(USE_OPENGL)
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP", &ud.config.ScreenBPP);
if (ud.config.ScreenBPP < 8) ud.config.ScreenBPP = 32;
801,15 → 811,15
fprintf(fp,"// this file automatically generated by EDuke32\n// do not modify if you lack common sense\n");
for (i=0;i<MAXBOUNDKEYS;i++)
if (boundkeys[i].cmd[0] && boundkeys[i].key)
fprintf(fp,"bind %s%s \"%s\"\n",boundkeys[i].key,boundkeys[i].repeat?"":" norepeat",boundkeys[i].cmd);
fprintf(fp,"bind \"%s\"%s \"%s\"\n",boundkeys[i].key,boundkeys[i].repeat?"":" norepeat",boundkeys[i].cmd);
 
for (i=0;i<MAXMOUSEBUTTONS;i++)
if (mousebind[i].cmd[0])
fprintf(fp,"bind %s%s \"%s\"\n",mousebind[i].key,mousebind[i].repeat?"":" norepeat",mousebind[i].cmd);
fprintf(fp,"bind \"%s\"%s \"%s\"\n",mousebind[i].key,mousebind[i].repeat?"":" norepeat",mousebind[i].cmd);
 
for (symb=symbols; symb!=NULL; symb=symb->next)
if (symb->func == (void *)OSD_ALIAS)
fprintf(fp,"alias %s \"%s\"\n", symb->name, symb->help);
fprintf(fp,"alias \"%s\" \"%s\"\n", symb->name, symb->help);
 
/* for (i = 0; i < sizeof(cvar)/sizeof(cvarmappings); i++)
if (!(cvar[i].type&CVAR_NOSAVE))
926,6 → 936,13
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "SoundToggle",ud.config.SoundToggle,false,false);
SCRIPT_PutNumber(ud.config.scripthandle, "Sound Setup", "VoiceToggle",ud.config.VoiceToggle,false,false);
 
Bsprintf(tempbuf,"%.2f",vid_gamma);
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidGamma",tempbuf);
Bsprintf(tempbuf,"%.2f",vid_brightness);
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidBrightness",tempbuf);
Bsprintf(tempbuf,"%.2f",vid_contrast);
SCRIPT_PutString(ud.config.scripthandle, "Screen Setup", "VidContrast",tempbuf);
 
#ifdef _WIN32
SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", ud.config.CheckForUpdates, false, false);
SCRIPT_PutNumber(ud.config.scripthandle, "Updates", "LastUpdateCheck", ud.config.LastUpdateCheck, false, false);
/polymer/eduke32/source/osdfuncs.c
32,10 → 32,10
// use the format byte if the text falls within the bounds of the console buffer
if (ch > ptr && ch < (ptr + TEXTSIZE))
rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, (*(OSD_GetFmt(ch))&~0x1F)>>4,
*(OSD_GetFmt(ch))&~0xE0, 8|16, 0, 0, xdim-1, ydim-1);
*(OSD_GetFmt(ch))&~0xE0, 8|16, 0, 0, xdim-1, ydim-1);
else
rotatesprite(x<<16, (y<<3)<<16, 65536l, 0, ac, shade,
pal, 8|16, 0, 0, xdim-1, ydim-1);
pal, 8|16, 0, 0, xdim-1, ydim-1);
x += OSDCHAR_WIDTH;
}
}
/polymer/eduke32/source/premap.c
1379,11 → 1379,11
if (numplayersprites == MAXPLAYERS)
gameexit("\nToo many player sprites (max 16.)");
 
/* if (numplayersprites == 0)
{
firstx = g_player[0].ps->posx;
firsty = g_player[0].ps->posy;
}*/
/* if (numplayersprites == 0)
{
firstx = g_player[0].ps->posx;
firsty = g_player[0].ps->posy;
}*/
 
g_PlayerSpawnPoints[(unsigned char)numplayersprites].ox = s->x;
g_PlayerSpawnPoints[(unsigned char)numplayersprites].oy = s->y;