Cosmetic code/comments improvements

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@1825 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 26987d14a405e276ba4d94b6a29b7f71e1692d5b
Former-commit-id: 5eb722eaaefff49b8b3e40ad5d3ea532aac9dc08
This commit is contained in:
pouillot 2009-11-11 17:43:53 +00:00
parent 4a513adbaf
commit e15a8ca7ca
3 changed files with 27 additions and 27 deletions

View file

@ -989,7 +989,7 @@ GfuiScreenAddBgImg(void *scr, const char *filename)
}
sprintf(buf, "%s%s", GetLocalDir(), GFSCR_CONF_FILE);
handle = GfParmReadFile(buf, GFPARM_RMODE_STD | GFPARM_RMODE_CREAT);
handle = GfParmReadFile(buf, GFPARM_RMODE_STD);
screen_gamma = (float)GfParmGetNum(handle, GFSCR_SECT_PROP, GFSCR_ATT_GAMMA, (char*)NULL, 2.0);
tex = (GLbyte*)GfImgReadPng(filename, &w, &h, screen_gamma);
if (!tex) {

View file

@ -408,14 +408,14 @@ GfuiButtonCreate(void *scr, const char *text, int font, int x, int y, int width,
}
label->align = align;
switch(align&0xF0) {
case 0x00 /* LEFT */:
case GFUI_ALIGN_HL_VB /* LEFT */:
label->x = object->xmin = x;
label->y = y - 2 * gfuiFont[font]->getDescender();
object->ymin = y;
object->xmax = x + width;
object->ymax = y + gfuiFont[font]->getHeight() - gfuiFont[font]->getDescender();
break;
case 0x10 /* CENTER */:
case GFUI_ALIGN_HC_VB /* CENTER */:
object->xmin = x - width / 2;
label->x = x - gfuiFont[font]->getWidth((const char *)text) / 2;
label->y = y - 2 * gfuiFont[font]->getDescender();
@ -423,7 +423,7 @@ GfuiButtonCreate(void *scr, const char *text, int font, int x, int y, int width,
object->xmax = x + width / 2;
object->ymax = y + gfuiFont[font]->getHeight() - gfuiFont[font]->getDescender();
break;
case 0x20 /* RIGHT */:
case GFUI_ALIGN_HR_VB /* RIGHT */:
label->x = object->xmin = x - width;
label->y = y - 2 * gfuiFont[font]->getDescender();
object->ymin = y;

View file

@ -320,19 +320,19 @@ void GfScrInit(int argc, char *argv[])
fullscreen = 0;
#if !defined(FREEGLUT) && !defined(WIN32)
if (strcmp(fscr, GFSCR_VAL_YES) == 0) { // Resize the screen
GfOut ("Freeglut not detected...\n");
GfOut ("Freeglut not detected :");
for (i = maxfreq; i > 59; i--) {
sprintf(buf, "%dx%d:%d@%d", winX, winY, depth, i);
GfOut("Trying %s video mode\n", buf);
GfOut("\n1 - Trying %s video mode : ", buf);
fglutGameModeString(buf);
if (fglutEnterGameMode()) {
GfTrace("OK for %s video mode\n", buf);
GfTrace("\nOK for %s video mode\n", buf);
usedFG = 1;
break;
}
}
if (!usedFG)
GfError("Could not find any usable video mode\n");
GfError("\nCould not find any usable video mode\n");
}
#endif
@ -466,7 +466,7 @@ void GfScrInit(int argc, char *argv[])
glutSetIconTitle(buf);
}
if ((strcmp(fscr, GFSCR_VAL_YES) == 0) && (!fullscreen)) {
if (!strcmp(fscr, GFSCR_VAL_YES) && !fullscreen) {
/* glutVideoResize(0, 0, winX, winY); */
glutFullScreen();
}
@ -563,24 +563,24 @@ GfScrReinit(void * /* dummy */)
saveParams();
#ifdef WIN32
snprintf(cmd, CMDSIZE, "%sspeed-dreams.exe", GetDataDir());
int i;
for (i = 0; i < CMDSIZE && cmd[i] != NULL; i++) {
if (cmd[i] == '/') {
cmd[i] = '\\';
}
snprintf(cmd, CMDSIZE, "%sspeed-dreams.exe", GetDataDir());
int i;
for (i = 0; i < CMDSIZE && cmd[i] != NULL; i++) {
if (cmd[i] == '/') {
cmd[i] = '\\';
}
char cmdarg[CMDSIZE];
strcpy(cmdarg, "speed-dreams.exe");
//snprintf(cmdarg, CMDSIZE, "speed-dreams.exe", GetDataDir());
for (i = 0; i < CMDSIZE && cmdarg[i] != NULL; i++) {
if (cmdarg[i] == '/') {
cmdarg[i] = '\\';
}
}
char cmdarg[CMDSIZE];
strcpy(cmdarg, "speed-dreams.exe");
//snprintf(cmdarg, CMDSIZE, "speed-dreams.exe", GetDataDir());
for (i = 0; i < CMDSIZE && cmdarg[i] != NULL; i++) {
if (cmdarg[i] == '/') {
cmdarg[i] = '\\';
}
retcode = execlp(cmd, cmdarg, (const char *)NULL);
}
retcode = execlp(cmd, cmdarg, (const char *)NULL);
#else
GfScrShutdown();
@ -808,8 +808,8 @@ GfScrMenuInit(void *prevMenu)
CreateButtonControl(scrHandle,param,"resrightarrow",(void*)1,ResPrevNext);
ResLabelId = CreateLabelControl(scrHandle,param,"reslabel");
CreateButtonControl(scrHandle, param, "apply", NULL, GfScrReinit);
CreateButtonControl(scrHandle, param, "back", prevMenu, GfuiScreenActivate);
CreateButtonControl(scrHandle, param, "apply", NULL, GfScrReinit);
CreateButtonControl(scrHandle, param, "back", prevMenu, GfuiScreenActivate);
CreateButtonControl(scrHandle,param,"depthleftarrow",(void*)-1,DepthPrevNext);
CreateButtonControl(scrHandle,param,"depthrightarrow",(void*)1,DepthPrevNext);