亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? scroll.c

?? 在DOS13號中斷下開發圖形顯示程序的例程
?? C
字號:
/*****************************************************************************
 SCROLL.C

 This is a simple demo of how to use VGL to create scrolling tile effects.
 It loads a 320x200 "map" and allows you to pan around it using the arrow
 keys.  The map is stored as a GIF file.  The map is lame.  I tried, but I
 just didn't have the time nor talent to create an "interesting" and detailed
 map.  Sorry...

 Once you run this program you can use the arrow keys to scroll around.  It
 makes use of the VGLKEY.C module, so you can try holding down combinations
 of keys to see it in action.  The '+' and '-' keys will increase (double)
 and decrease (half) the scrolling "speed".  The speed is actually how many
 pixels we scroll the tiles per frame.  Pressing 'T' will toggle the display
 of some text that shows the current X, Y, and Speed.  Pressing 'C' will
 toggle the cycling of part of the palette (the colors that the water tile
 happens to use).  Press ESCAPE to exit.

 NOTE: Because displaying text is quite time-consuming, the FPS rate will
       likely slow down quite a bit when the text flag is set.  Play with
       it a bit to see how it effects the FPS on your machine.
       For the record, I get 70+ FPS on my 486DX/33 when no text is displayed.
       I get around 45 FPS when the text is turned on.  On my 486DX/50 I
       get 70+ FPS either way.

 Finally: this is a demo.  It is not intended to demonstrate the best method
 of doing a tile based game.  It is simply meant to show *one* possible
 method.  I'm sure you'll think of others.  Hopefully this'll get your
 imagination going.

 Mark
 morley@camosun.bc.ca
*****************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include "keys.h"
#include "vgl.h"

#define MAPW            320             /* Width of the map in tiles        */
#define MAPH            200             /* Height of the map in tiles       */
#define MAXTILES        32              /* Max number of tiles allowed      */

char far  VS[64000];                    /* Out virtual screen               */
char far  Tile[MAXTILES][256];          /* Array of tile bitmaps            */
char far  Map[MAPH][MAPW];              /* The map data                     */
char far  Pal[768];                     /* Our palette                      */

Intro()
{
  /* Black the palette */
   vglBlack();

   /* Load in a font */
   vglLoadFont( "fonts\\tuxedo.fon" );

   /* Set text color to bright red */
   vglTextColor( 12 );

   /* Position the "cursor" */
   vglGotoXY( 14, 110 );

   /* Display a string */
   vglPuts( "VGL Scrolling Demo" );

   /* Fade in */
   vglFadeIn( Pal );

   /* Delay a bit */
   sleep( 1 );

   /* Fade out */
   vglFadeOut( Pal );

   /* Clear the screen */
   vglClear( 0 );

   /* Set text color to bright purple */
   vglTextColor( 13 );

   /* Position the "cursor" */
   vglGotoXY( 38, 110 );

   /* Display some text */
   vglPuts( "By Mark Morley" );

   /* Fade in */
   vglFadeIn( Pal );

   /* Delay a bit */
   sleep( 1 );

   /* Fade out */
   vglFadeOut( Pal );
}

main()
{
   int  cx, cy;                         /* Current X and Y position (tile)  */
   int  ox, oy;                         /* Offset within the current tile   */
   int  x, y;                           /* Used in for loops                */
   int  key;                            /* To get keypresses                */
   int  ok = 1;                         /* Loop until ok==0                 */
   int  s = 2;                          /* Scroll speed (2 pixels per frame)*/
   long t1, t2, n;                      /* For calculating FPS              */
   int  text = 0;                       /* Text display flag                */
   int  c = 0;                          /* Counter for cycling              */
   int  cycle = 0;                      /* Cycle flag                       */
   int  i;                              /* Miscellaneous variable           */
   char buf[20];                        /* For formatting text              */

   /* Enter mode 13h */
   vglInit();

   /* Load in the map data */
   vglGif( "map.gif", (char far*) Map, 0, 0, 0 );

   /* Load a couple tiles.  You can load additonal tiles here.  Color 0 in
      the map represents tile number 0.  Color 1 in the map represents tile
      number 1, and so on.  If you load, say, a brick wall in tile number 2,
      then anywhere color 2 appears in the map you'll see a brick wall. */
   vglGif( "water.gif", Tile[0], Pal, 0, 0 );
   vglGif( "grass.gif", Tile[1], Pal, 0, 0 );

   /* Display a little intro screen */
   Intro();

   /* Load and set up the font characteristics */
   vglLoadFont( "fonts\\comix.fon" );
   vglShadowColor( 1 );
   vglShadowOn( 1 );
   vglTextColor( 15 );

   /* Display the "game" screen directly to video memory */
   vglGif( "scroll.gif", VIDMEM, 0, 0, 0 );

   /* We'll start at the top left corner of the map */
   cx = 0;
   cy = 0;
   ox = 0;
   oy = 0;

   /* Frame count starts at 0 */
   n = 0;

   /* We'll draw into our virtual screen */
   vglBuffer( VS );

   /* Display the initial tiles (only so there's something to fade in to) */
   for( x = 0; x < 11; x++ )
      for( y = 0; y < 11; y++ )
         vglPut( (x << 4) + 15 - ox, (y << 4) + 15 - oy, 16, 16, Tile[Map[cy + y][cx + x]] );
   vglCopyW( 16, 16, 160, 160 );

   /* Fade in from black */
   vglFadeIn( Pal );

   /* Enable the trapping of keys */
   vglTrapKeys();

   t1 = time( 0 );

   /* Loop until we're done */
   while( ok )
   {
      /* Increment the frame count */
      n++;

      /* Update the real screen */
      vglCopyW( 16, 16, 160, 160 );

      /* Draw the tiles */
      for( x = 0; x < 11; x++ )
         for( y = 0; y < 11; y++ )
            vglPut( (x << 4) + 15 - ox, (y << 4) + 15 - oy, 16, 16, Tile[Map[cy + y][cx + x]] );

      /* If the text flag is set, display some coordinate info */
      if( text )
      {
         sprintf( buf, "X=%d Y=%d S=%d", (cx << 4) + ox, (cy << 4) + oy, s );
         vglGotoXY( 18, 25 );
         vglPuts( buf );
      }

      /* If a key is hit, check it out */
      if( kbhit() )
      {
         if( (key = getch()) == 0 )
            key = 256 * getch();
         switch( key )
         {
            case Escape            : ok = 0;
                                     break;
            case 't'               :
            case 'T'               : text = 1 - text;
                                     break;
            case 'c'               :
            case 'C'               : cycle = 1 - cycle;
                                     break;
            case '+'               : if( s < 16 )
                                        s <<= 1;
                                     break;
            case '-'               : if( s > 1 )
                                        s >>= 1;
                                     break;
         }
      }

      /* Check the arrow key status bytes and change the cx,cy and ox,oy
         variables as appropriate */
      if( vglKeyStatus[0] )
      {
         for( i = 0; i < s; i++ )
         {
            if( oy )
               oy--;
            else if( cy  )
            {
               oy = 15;
               cy--;
            }
         }
      }
      if( vglKeyStatus[1] )
      {
         for( i = 0; i < s; i++ )
         {
            if( oy < 15 )
               oy++;
            else if( cy < MAPH - 11 )
            {
               oy = 0;
               cy++;
            }
         }
      }
      if( vglKeyStatus[2] )
      {
         for( i = 0; i < s; i++ )
         {
            if( ox )
               ox--;
            else if( cx )
            {
               ox = 15;
               cx--;
            }
         }
      }
      if( vglKeyStatus[3] )
      {
         for( i = 0; i < s; i++ )
         {
            if( ox < 15 )
               ox++;
            else if( cx < MAPW - 11 )
            {
               ox = 0;
               cx++;
            }
         }
      }

      /* If the cycle flag is set, cycle the palette */
      if( cycle && ++c == 8 )
      {
         c = 0;
         vglPartCycleR( 232, 8, &Pal[232 * 3] );
      }
   }
   t2 = time( 0 );

   /* Stop trapping the arrow keys */
   vglReleaseKeys();

   /* Fade out to black */
   vglFadeOut( Pal );

   /* Return to text mode */
   vglTerm();

   /* Display some stats */
   printf( "%ld seconds, %ld frames (%ld FPS)\n", t2 - t1, n, n / (t2 - t1 ) );

   return;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久久久秋霞影院 | 成人h动漫精品一区二区| 高清国产午夜精品久久久久久| 色中色一区二区| 日韩欧美在线网站| 一区二区三区在线视频观看58| 国内成+人亚洲+欧美+综合在线| 一本在线高清不卡dvd| 精品国产一区二区三区av性色 | 色先锋资源久久综合| 欧美精品一区二区三区在线| 午夜精品久久久久久久99樱桃| 国产成人免费在线观看| 日韩三级电影网址| 午夜视黄欧洲亚洲| 色老综合老女人久久久| 欧美国产成人精品| 国产精品综合一区二区三区| 91麻豆精品国产自产在线观看一区| 亚洲欧美自拍偷拍色图| 国产一区二区三区久久久| 91精品国产色综合久久不卡蜜臀 | 国产色综合一区| 免费在线观看一区二区三区| 欧美午夜精品电影| 亚洲欧美日韩在线| 不卡av在线免费观看| 欧美国产丝袜视频| 粉嫩aⅴ一区二区三区四区五区| 精品久久久网站| 狠狠色丁香久久婷婷综合丁香| 欧美一卡2卡三卡4卡5免费| 午夜电影网亚洲视频| 欧美亚洲丝袜传媒另类| 亚洲综合网站在线观看| 91福利视频久久久久| 亚洲香蕉伊在人在线观| 欧美日韩三级视频| 日韩高清在线电影| 91精品欧美久久久久久动漫| 免费久久精品视频| 久久午夜电影网| 国产成人小视频| 国产精品电影一区二区| 91老司机福利 在线| 一区二区在线观看不卡| 欧美三片在线视频观看| 日韩精品色哟哟| 精品国产欧美一区二区| 国产成人免费在线| 亚洲欧美国产77777| 欧美日韩精品一区视频| 美国三级日本三级久久99| 2024国产精品视频| 成人亚洲一区二区一| 一区二区三区色| 欧美日本免费一区二区三区| 久久99在线观看| 国产女人aaa级久久久级 | 欧美日本在线一区| 国内精品免费**视频| 国产精品久久久久久久浪潮网站| 91网址在线看| 视频一区二区三区入口| 欧美大胆人体bbbb| 成人黄动漫网站免费app| 亚洲第一福利视频在线| 欧美v亚洲v综合ⅴ国产v| 99久久久国产精品免费蜜臀| 五月婷婷激情综合网| 久久亚洲精品小早川怜子| 色香色香欲天天天影视综合网| 麻豆国产欧美一区二区三区| 国产精品乱码人人做人人爱| 欧美日韩午夜在线视频| 国产成人午夜99999| 亚洲大型综合色站| 欧美激情一区二区三区不卡 | 国产亚洲美州欧州综合国| 日本精品免费观看高清观看| 国产乱码精品1区2区3区| 亚洲主播在线观看| 中文子幕无线码一区tr| 5月丁香婷婷综合| bt7086福利一区国产| 蜜臀av亚洲一区中文字幕| 亚洲色图欧美在线| 久久久久久免费毛片精品| 欧美喷水一区二区| 99久久综合狠狠综合久久| 麻豆久久一区二区| 亚洲一级二级三级| 自拍偷拍亚洲综合| 久久久久国产精品人| 91精品国模一区二区三区| 99久精品国产| 国产+成+人+亚洲欧洲自线| 青娱乐精品在线视频| 亚洲大片精品永久免费| 亚洲精品久久久久久国产精华液| 久久亚洲一区二区三区明星换脸| 日韩一区二区三区视频在线 | 亚洲一二三四区不卡| 亚洲欧洲精品一区二区精品久久久 | 亚洲色大成网站www久久九九| 久久久久99精品一区| 欧美一卡二卡在线观看| 在线不卡中文字幕播放| 欧美中文字幕不卡| 色婷婷激情一区二区三区| 不卡一二三区首页| 国产精品亚洲视频| 国产美女娇喘av呻吟久久| 日本最新不卡在线| 日本美女一区二区三区视频| 视频一区二区中文字幕| 日韩成人dvd| 日韩国产欧美三级| 日本系列欧美系列| 日韩电影一区二区三区四区| 日韩在线观看一区二区| 轻轻草成人在线| 黄色成人免费在线| 国产老女人精品毛片久久| 精品在线播放免费| 国产一区二区网址| 粉嫩蜜臀av国产精品网站| www.亚洲在线| 一本大道久久a久久综合| 在线观看免费视频综合| 欧美剧情电影在线观看完整版免费励志电影| 色综合色狠狠综合色| 欧美亚洲综合网| 欧美精品自拍偷拍动漫精品| 日韩一区二区免费高清| 久久蜜桃av一区二区天堂| 国产精品色一区二区三区| 亚洲色图丝袜美腿| 日韩av午夜在线观看| 国产成人免费在线观看不卡| 成人免费福利片| 在线观看日韩电影| 精品不卡在线视频| 亚洲日穴在线视频| 日韩精彩视频在线观看| 国产一区二区三区四区在线观看| 国产91丝袜在线观看| 97超碰欧美中文字幕| 欧美精品丝袜中出| 久久精品夜色噜噜亚洲aⅴ| 亚洲男人都懂的| 久久精品国产亚洲高清剧情介绍| 国产成人一区二区精品非洲| 欧美午夜免费电影| 久久久激情视频| 亚洲第一激情av| 国产不卡视频在线播放| 欧洲一区二区av| 精品成人私密视频| 亚洲一区国产视频| 国产传媒欧美日韩成人| 91久久奴性调教| 久久久久久久久久久久久夜| 亚洲一区视频在线观看视频| 国产精品12区| 日韩一区二区在线播放| 亚洲品质自拍视频| 国产成人午夜电影网| 欧美精品第1页| 自拍av一区二区三区| 久久99热这里只有精品| 色老头久久综合| 欧美国产精品专区| 美女网站一区二区| 欧美午夜在线观看| 国产精品久久久久久久久动漫 | 日韩欧美电影在线| 亚洲小说欧美激情另类| 97久久精品人人澡人人爽| 精品国产乱码久久久久久免费| 亚洲成人av中文| 欧美唯美清纯偷拍| 最新欧美精品一区二区三区| 国产乱国产乱300精品| 日韩一区二区电影| 亚洲第一在线综合网站| 色呦呦网站一区| 国产精品国产成人国产三级| 久久疯狂做爰流白浆xx| 欧美一级理论片| 首页国产丝袜综合| 欧美日韩卡一卡二| 亚洲图片欧美视频| 日本道色综合久久| 尤物在线观看一区| 欧洲一区二区三区在线| 亚洲宅男天堂在线观看无病毒| 色综合久久中文综合久久97 | 亚洲综合在线第一页| 欧美做爰猛烈大尺度电影无法无天|