]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_sprit.c
==== old BG rendering is back ====
[16.git] / src / lib / 16_sprit.c
index 1c37d46d81f7b7b569b8499d7d698a44baf192ec..9f699e1963ceea1231b610d990391b01262d2c59 100755 (executable)
@@ -158,17 +158,16 @@ void animate_spri(entity_t *enti, video_t *video)
        // render box bounds. y does not need modification, but x and width must be multiple of 4\r
        if(!video->rss)\r
        {\r
-               if(!video->bgps)\r
-               {\r
-                       if (x >= enti->overdraww) rx = (x - enti->overdraww) & (~3);\r
-                               else rx = -(video->page[0].dx);\r
-                       if (y >= enti->overdrawh) ry = (y - enti->overdrawh);\r
-                               else ry = -(video->page[0].dy);\r
-                       h = enti->spri->sprite_vrl_cont->vrl_header->height + enti->overdrawh + y - ry;\r
-                       w = (x + enti->spri->sprite_vrl_cont->vrl_header->width + (enti->overdraww*2) + 3 - rx) & (~3) - enti->overdraww;//round up\r
-                       if ((rx+w) > video->page[0].width) w = video->page[0].width-rx;\r
-                       if ((ry+h) > video->page[0].height) h = video->page[0].height-ry;\r
-\r
+               if (x >= enti->overdraww) rx = (x - enti->overdraww) & (~3);\r
+                       else rx = -(video->page[0].dx);\r
+               if (y >= enti->overdrawh) ry = (y - enti->overdrawh);\r
+                       else ry = -(video->page[0].dy);\r
+               h = enti->spri->sprite_vrl_cont->vrl_header->height + enti->overdrawh + y - ry;\r
+               w = (x + enti->spri->sprite_vrl_cont->vrl_header->width + (enti->overdraww*2) + 3 - rx) & (~3) - enti->overdraww;//round up\r
+               if ((rx+w) > video->page[0].width) w = video->page[0].width-rx;\r
+               if ((ry+h) > video->page[0].height) h = video->page[0].height-ry;\r
+\r
+               if(!video->bgps){\r
                        // block copy pattern to where we will draw the sprite\r
                        vga_setup_wm1_block_copy();\r
                        o2 = video->ofs.offscreen_ofs;\r
@@ -177,14 +176,10 @@ void animate_spri(entity_t *enti, video_t *video)
 \r
                        // must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally\r
                        vga_restore_rm0wm0();\r
-\r
-                       // replace VGA stride with our own and mem ptr. then sprite rendering at this stage is just (0,0)\r
-                       vga_state.vga_draw_stride = w >> 2;\r
-                       vga_state.vga_graphics_ram = omemptr + video->ofs.offscreen_ofs;\r
-               }else{\r
-                       w=h=i=o=o2=0;\r
-                       modexCopyPageRegion(&video->page[2], &video->page[0], enti->x, enti->y, 0, 0, 24, 32);\r
                }\r
+               // replace VGA stride with our own and mem ptr. then sprite rendering at this stage is just (0,0)\r
+               vga_state.vga_draw_stride = w >> 2;\r
+               vga_state.vga_graphics_ram = omemptr + video->ofs.offscreen_ofs;\r
        }else{ rx=ry=w=h=0; vga_state.vga_graphics_ram = (VGA_RAM_PTR)video->page[0].data; }\r
        vga_state.vga_draw_stride_limit = (video->page[0].width + 3 - x) >> 2;//round up\r
 \r
@@ -203,11 +198,10 @@ void animate_spri(entity_t *enti, video_t *video)
 #endif\r
        if(!video->rss)\r
        {\r
-               if(!video->bgps)\r
-               {\r
-                       // restore ptr\r
-                       vga_state.vga_graphics_ram = omemptr;\r
+               // restore ptr\r
+               vga_state.vga_graphics_ram = omemptr;\r
 \r
+               if(!video->bgps){\r
                        // block copy to visible RAM from offscreen\r
                        vga_setup_wm1_block_copy();\r
                        o = video->ofs.offscreen_ofs; // source offscreen\r
@@ -215,8 +209,6 @@ void animate_spri(entity_t *enti, video_t *video)
                        for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += video->page[0].stridew) vga_wm1_mem_block_copy(o2,o,w >> 2);\r
                        // must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally\r
                        vga_restore_rm0wm0();\r
-               }else{\r
-                       //modexCopyPageRegion(&video->page[0], &video->page[2], 0, 0, enti->x, enti->y, 24, 32);\r
                }\r
        }\r
        // restore stride\r