r10107 - in packages/trunk/asylum/debian: . patches

Peter De Wachter pdewacht-guest at alioth.debian.org
Fri Jul 31 19:41:58 UTC 2009


Author: pdewacht-guest
Date: 2009-07-31 19:41:58 +0000 (Fri, 31 Jul 2009)
New Revision: 10107

Added:
   packages/trunk/asylum/debian/patches/redraw-after-expose.patch
Modified:
   packages/trunk/asylum/debian/changelog
   packages/trunk/asylum/debian/patches/series
Log:
asylum: patched to redraw the screen after receiving an expose event (#525727)


Modified: packages/trunk/asylum/debian/changelog
===================================================================
--- packages/trunk/asylum/debian/changelog	2009-07-31 19:19:52 UTC (rev 10106)
+++ packages/trunk/asylum/debian/changelog	2009-07-31 19:41:58 UTC (rev 10107)
@@ -1,6 +1,7 @@
 asylum (0.3.0-4) unstable; urgency=low
 
-  * Recognize input from the numeric keypad. (Closes: #538772)
+  * Make the menus work with internationalized keyboards. (Closes: #538772)
+  * Redraw the window after receiving an expose event. (Closes: #525727)
   * Bumped Standards-Version to 3.8.2. No changes needed.
 
  -- Peter De Wachter <pdewacht at gmail.com>  Tue, 28 Jul 2009 22:09:01 +0200

Added: packages/trunk/asylum/debian/patches/redraw-after-expose.patch
===================================================================
--- packages/trunk/asylum/debian/patches/redraw-after-expose.patch	                        (rev 0)
+++ packages/trunk/asylum/debian/patches/redraw-after-expose.patch	2009-07-31 19:41:58 UTC (rev 10107)
@@ -0,0 +1,356 @@
+Redraw the screen when receiving an expose event. Debian bug #525727.
+Only the menu code needs to be updated, the game window is redrawn every frame
+anyway.
+
+--- a/asylum.c
++++ b/asylum.c
+@@ -173,7 +173,7 @@
+                 bonusplot();
+                 scoreadd();
+                 update_show_strength();
+-                texthandler();
++                texthandler(1);
+                 seeifdead();
+ //makesounds();
+                 wakeupal(xpos, ypos);
+@@ -217,7 +217,7 @@
+ 
+ void showtext()
+ {
+-    texthandler();
++    texthandler(0);
+     switchbank();
+ }
+ 
+@@ -426,7 +426,6 @@
+     initweapon();
+     initprojtab();
+     initbultab();
+-    setfullclip();
+     initrockettab();
+     getvars();
+     prepstrength();
+@@ -523,7 +522,6 @@
+ int getfiles()
+ {
+     getvitalfiles();
+-    setfullclip();
+     showloading();
+     init_sounds();
+     getmusicfiles();
+--- a/asylum.h
++++ b/asylum.h
+@@ -150,7 +150,7 @@
+ void switchcolch();
+ void switchbank();
+ void showtext();
+-void texthandler();
++void texthandler(int do_animation);
+ void deathmessage();
+ void endgamemessage();
+ void alfire();
+@@ -359,7 +359,6 @@
+ void rejoin();
+ void adjustopt();
+ void copyscreen();
+-void setfullclip();
+ void set_player_clip();
+ void writeclip();
+ void releaseclip();
+@@ -545,3 +544,5 @@
+ void init_chunk_maze();
+ void init_chunk_alien();
+ void init_chunk_player();
++
++int need_redraw();
+--- a/keyboard.c
++++ b/keyboard.c
+@@ -23,6 +23,7 @@
+ static int keybuf;
+ static int unibuf;
+ static int mouse;
++static int exposed;
+ 
+ #define ESC_VALUE 27
+ 
+@@ -132,6 +133,9 @@
+             case SDL_BUTTON_RIGHT: mouse &= ~1; break;
+             }
+             break;
++        case SDL_VIDEOEXPOSE:
++            exposed = 1;
++            break;
+         case SDL_QUIT:
+             exithandler();
+             break;
+@@ -213,3 +217,9 @@
+         ks->keypressed = 1;
+ }
+ 
++int need_redraw()
++{
++    int e = exposed;
++    exposed = 0;
++    return e;
++}
+--- a/menus.c
++++ b/menus.c
+@@ -32,7 +32,6 @@
+ {
+     //frameinc = 1;
+     showchatscreen();
+-    swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+     swi_fastspr_clearwindow();
+     wipetexttab();
+     message(36, 40-256, 0, 4, "¤ Game Interrupted ¤");
+@@ -52,7 +51,12 @@
+             r9--;
+             switchbank();
+             swi_fastspr_clearwindow();
+-            texthandler();
++            texthandler(1);
++        }
++        else if (need_redraw())
++        {
++            showchatscreen();
++            showtext();
+         }
+         switch (osbyte_79_unicode(1))
+         {
+@@ -90,7 +94,6 @@
+         clearkeybuf();
+         wipetexttab();
+         showchatscreen();
+-        swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+         swi_fastspr_clearwindow();
+         message(128, 48, 0, 0, "Options");
+         message(32, 96, 0, 0, "1. Define Controls");
+@@ -266,7 +269,6 @@
+ void tunesound()
+ {
+     showchatscreen();
+-    swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+     for (;; /*tunesoundloop:*/ soundupdate(), swi_stasis_link(1, 1), swi_sound_control(1, -15, 0x20, 0xfe))
+     {
+        tunesoundins:
+@@ -319,7 +321,6 @@
+     wipetexttab();
+     if (sound_available && (options.soundtype == 2)) swi_bodgemusic_start(1, 0);
+     swi_bodgemusic_volume(options.musicvol);
+-    swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+     message(80, 32, 0, 0, "Change volume");
+     message(48, 96, 0, 0, "1. Louder effects");
+     message(48, 116, 0, 0, "2. Quieter effects");
+@@ -384,7 +385,6 @@
+     do
+     {
+         showchatscreen();
+-        swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+         do
+         {
+            tunespeedloop:
+@@ -462,11 +462,12 @@
+     showtext();
+     do
+     {
+-        //do choosekeyloop:; // read key
+-        //while (osbyte_79(0)!=0xff); //no key pressed
+-        //if ((r4=osbyte_81(1))==ESC_VALUE) // read key
+-        //{ chooseescape: osbyte_7c();
+-        //return 0;} //early exit
++        if (need_redraw())
++        {
++            showchatscreen();
++            showtext();
++        }
++        swi_blitz_wait(1);
+     }
+     while ((r1 = osbyte_79(0)) == -1); // scan keyboard
+     if (swi_readescapestate()) return 0;
+@@ -498,6 +499,12 @@
+             return r1 - '0';
+         if (osbyte_81(options.firekey) == 0xff)
+             return 0;
++        if (need_redraw())
++        {
++            showchatscreen();
++            showtext();
++        }
++        swi_blitz_wait(1);
+     }
+ }
+ 
+@@ -508,9 +515,7 @@
+ {
+     int cheatpermit = 0;
+     //frameinc = 1;
+-    setfullclip();
+     showchatscreen();
+-    swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+     swi_fastspr_clearwindow();
+     wipetexttab();
+     message(2048, _x, 0, _v, "Digital Psychosis");
+@@ -539,7 +544,12 @@
+             scroll--;
+             switchbank();
+             swi_fastspr_clearwindow();
+-            texthandler();
++            texthandler(1);
++        }
++        else if (need_redraw())
++        {
++            showchatscreen();
++            showtext();
+         }
+        preludetextstop:;
+         int r1 = osbyte_7a();
+@@ -630,7 +640,6 @@
+ {
+     //frameinc = 1;
+     showchatscreen();
+-    swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+     swi_fastspr_clearwindow();
+     wipetexttab();
+     message(72, 200, 0, 0, "RET - Try Again");
+@@ -641,7 +650,6 @@
+ {
+     //frameinc = 1;
+     showchatscreen();
+-    swi_fastspr_setclipwindow(20, 20, 319-20, 255-20);
+     swi_fastspr_clearwindow();
+     wipetexttab();
+     message(72, 200, 0, 0, "RET - OK");
+@@ -682,7 +690,6 @@
+     loadscores(highscorearea, options.mentalzone);
+     updatehst();
+     showhst();
+-    wipetexttab();
+     message(96, 224, 0, 0, "press fire");
+     releaseclip();
+     showtext();
+@@ -781,20 +788,20 @@
+     showchatscores();
+     wipetexttab();
+     message(64, 32, 0, 0, "Zone High Scores");
+-    texthandler();
+-    char* r10 = highscorearea;
+-    int x = 32, y = 64;
+-    for (int r3 = 5; r3 > 0; r3--)
+-    {
+-        for (; *r10 > 0xa; r10++)
+-        {
+-           showhstloop:
+-            if (*r10 != ' ') fspplot(charsadr, *r10-'0', x, y);
+-            x += 16;
+-        }
+-       showhstnewline:
+-        x = 32; y += 32; r10++;
+-    }
+-    if (hstindex == 5) return;
+-    fspplot(charsadr, 13, 280, (hstindex+2)<<5);
++
++    int x = 32, y = 64, i, j;
++    char * ptr = highscorearea;
++    for (i = 0; i < 5; ++i)
++    {
++        char line[13];
++        for (j = 0; j < 12 && *ptr > 0xa; ++j, ++ptr)
++            line[j] = *ptr;
++        line[j] = 0;
++        message(x, y, 0, 0, line);
++        y += 32;
++        ++ptr; /*skip over newline*/
++    }
++    if (hstindex < 5)
++        message(280, (hstindex+2)<<5, 0, 0, "=");
++    texthandler(0);
+ }
+--- a/vdu.c
++++ b/vdu.c
+@@ -261,24 +261,27 @@
+         *(r10++) = 0;
+ }
+ 
+-void texthandler()
++void texthandler(int do_animation)
+ {
+     textinfo* r11 = texttabofs;
+     int r9 = _textno;
+ 
+     for (; r9 > 0; r11++, r9--)
+     {
+-       loopa6: if (r11->count == 0) continue;
+-       textproc:;
+-        int r4 = (frameinc > 4) ? 4 : frameinc;
+-        r11->count -= r4; if (r11->count < 0) r11->count = 0;
+-
+-        for (; r4 > 0; r4--)
+-        {
+-           loopb1:
+-            r11->x += r11->dx;
+-            r11->y += r11->dy;
++        if (r11->count == 0) continue;
++
++        if (do_animation)
++        {
++            int r4 = (frameinc > 4) ? 4 : frameinc;
++            r11->count -= r4; if (r11->count < 0) r11->count = 0;
++
++            for (; r4 > 0; r4--)
++            {
++                r11->x += r11->dx;
++                r11->y += r11->dy;
++            }
+         }
++
+         int XxX = r11->x>>8;
+         int YyY = r11->y>>8;
+         for (char* r10 = r11->text; *r10 != 0; r10++)
+@@ -542,14 +545,6 @@
+     }
+ }
+ 
+-void setfullclip()
+-{
+-    clip.x = vduvar.gamex; clip.y = vduvar.gamey;
+-    clip.w = vduvar.gamew;
+-    clip.h = vduvar.gameh;
+-    writeclip();
+-}
+-
+ void writeclip()
+ {
+     swi_fastspr_setclipwindow(clip.x, clip.y, clip.x+clip.w, clip.y+clip.h);
+@@ -589,8 +584,16 @@
+     releaseclip();
+     //SDL_BlitSurface(GameScreen, NULL, ArcScreen, NULL);
+     fspplot(&GameScreen, 0, 0, 0);
++    #if 0
+     if (!vduvar.opengl) switchbank();
++    #endif
++
++    clip.x = vduvar.gamex;
++    clip.y = vduvar.gamey;
++    clip.w = vduvar.gamew;
++    clip.h = vduvar.gameh;
+     writeclip();
++
+     scorewiperead();
+     showlives();
+ }
+@@ -600,8 +603,15 @@
+     releaseclip();
+     //SDL_BlitSurface(ChatScreen, NULL, ArcScreen, NULL);
+     fspplot(&ChatScreen, 0, 0, 0);
++    #if 0
+     switchbank();
+     if (vduvar.opengl) fspplot(&ChatScreen, 0, 0, 0);
++    #endif
++
++    clip.x = 20;
++    clip.y = 20;
++    clip.w = 319 - 20*2;
++    clip.h = 255 - 20*2;
+     writeclip();
+ }
+ 

Modified: packages/trunk/asylum/debian/patches/series
===================================================================
--- packages/trunk/asylum/debian/patches/series	2009-07-31 19:19:52 UTC (rev 10106)
+++ packages/trunk/asylum/debian/patches/series	2009-07-31 19:41:58 UTC (rev 10107)
@@ -1,2 +1,3 @@
 opengl-endianness.patch
-numer-input.patch
+number-input.patch
+redraw-after-expose.patch




More information about the Pkg-games-commits mailing list