From eb44193d3ec196a200a627735694f51220f07714 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Wed, 10 Jan 2007 00:50:07 +0000 Subject: [PATCH] joystick axes can be reassigned; higher offset for axes moving detection; correction for menus that are bigger than screen; plxver correction (is actually used) --- dxx-changelog.txt | 6 +++++- main/kconfig.c | 16 +++++++--------- main/newmenu.c | 10 ++++++++-- main/playsave.c | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/dxx-changelog.txt b/dxx-changelog.txt index a7fe282c4..d1856a83a 100755 --- a/dxx-changelog.txt +++ b/dxx-changelog.txt @@ -1,8 +1,12 @@ D1X-Rebirth Changelog +20070110 +-------- +main/kconfig.c, main/newmenu.c, main/playsave.c: joystick axes can be reassigned; higher offset for axes moving detection; correction for menus that are bigger than screen; plxver correction (is actually used) + 20070109 -------- -arch/ogl/gr.c, arch/ogl/ogl.c, arch/ogl/include/ogl_init.h, main/playsave.c, texmap/scanline.c, texmap/tmapflat.c: allocate 'pixels' and 'texbuf' according to current screen resolution, saving over a hundred megabytes of memory; divide negative light rates of change properly (fix bug #2575) (from D2X CVS); divide negative window x-coordinates properly, fixing random crashes (from D2X CVS); make sscanf look for "%i.%i" instead of "v%i.%i" because the 'v' isn't written to file; added missing changelog entries +dxx-changelog.txt, arch/ogl/gr.c, arch/ogl/ogl.c, arch/ogl/include/ogl_init.h, main/playsave.c, texmap/scanline.c, texmap/tmapflat.c: allocate 'pixels' and 'texbuf' according to current screen resolution, saving over a hundred megabytes of memory; divide negative light rates of change properly (fix bug #2575) (from D2X CVS); divide negative window x-coordinates properly, fixing random crashes (from D2X CVS); make sscanf look for "%i.%i" instead of "v%i.%i" because the 'v' isn't written to file; added missing changelog entries 20061212 -------- diff --git a/main/kconfig.c b/main/kconfig.c index 03dff135e..58775e9eb 100755 --- a/main/kconfig.c +++ b/main/kconfig.c @@ -1302,11 +1302,8 @@ void kc_change_joyaxis( kc_item * item ) joystick_read_raw_axis( JOY_ALL_AXIS, axis ); for (i=0; i1024 ) { -#else - if ( abs(axis[i]-old_axis[i])>200 ) { -#endif + if ( abs(axis[i]-old_axis[i])>1024 ) + { code = i; #ifndef NDEBUG printf("Axis Movement detected: Axis %i\n", i); @@ -1314,13 +1311,13 @@ void kc_change_joyaxis( kc_item * item ) } //old_axis[i] = axis[i]; } - for (i=0; ivalue = code; } + kc_drawitem( item, 1 ); nm_restore_background( 0, INFO_Y, GWIDTH-10, FONTSCALE_Y(grd_curcanv->cv_font->ft_h) ); game_flush_inputs(); diff --git a/main/newmenu.c b/main/newmenu.c index 5751c9ad9..bbb3c82b1 100755 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -697,8 +697,14 @@ int newmenu_do3_real( char * title, char * subtitle, int nitems, newmenu_item * w += 30*MENSCALE_X; h += 30*MENSCALE_Y; - if ( w > SWIDTH ) w = SWIDTH-3; - if ( h > SHEIGHT ) h = SHEIGHT-3; +// if ( w > SWIDTH ) w = SWIDTH; +// if ( h > SHEIGHT ) h = SHEIGHT; + /* If window is as or almost as big as screen define hard size so it fits (with borders and stuff). + Also make use of MENSCALE_* so we are sure it does scale correct if font does scale or not */ + if (w >= 320*MENSCALE_X-3) + w=318*MENSCALE_X; + if (h >= 200*MENSCALE_Y-3) + h=198*MENSCALE_Y; x = (GWIDTH-w)/2; y = (GHEIGHT-h)/2; diff --git a/main/playsave.c b/main/playsave.c index 845ed0f81..4fd372756 100755 --- a/main/playsave.c +++ b/main/playsave.c @@ -278,7 +278,7 @@ int read_player_d1x(const char *filename) if(!strcmp(word,"PLX VERSION")) { int maj,min; - sscanf(line,"%i.%i",&maj,&min); + sscanf(line,"v%i.%i",&maj,&min); sprintf(plxver,"v%i.%i",maj,min); } free(line); free(word);