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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? display.c

?? 乒乓球游戲程序
?? C
字號(hào):
/*----------------------------------------------------------------
 * display.c -- display routines
 *----------------------------------------------------------------
 *  This module takes care of everything relating to the
 *  screen display.
 */


#include <math.h>
#include <stdio.h>
#include <string.h>
#include <allegro.h>

#include "error.h"
#include "display.h"
#include "objdisp.h"
#include "layout.h"
#include "gamevars.h"


/* Various bitmaps used in the game:
 *	`arena' will be a subbitmap of the screen; all of the 
 *		objects in the game will be drawn there.
 *	`arena_bkgnd' will hold the image of the empty arena;
 *		game objects will use this to restore the background
 *		as they move.
 *	`status_bar' will be a subbitmap of the top of the screen,
 *		for writing status information to.
 *	`palette' will be the palette in use during the game.
 */
static BITMAP *arena, *arena_bkgnd, *status_bar;
static PALETTE palette;


/* write_colour: (local)
 *  This function just updates an entry in a palette, given the
 *  palette, a colour index, and the new R, G and B values.
 */
static void write_colour (RGB *pal, int i, int r, int g, int b) {
	pal[i].r = r;
	pal[i].g = g;
	pal[i].b = b;
}

/* make_palette: (local)
 *  This function puts the palette we want into the variable.  In
 *  this game the palette is determined algorithmically (i.e. we
 *  calculate it); if the game used sprites we'd probably load a
 *  palette in from the sprite image file and use that, for
 *  obvious reasons.
 */
static void make_palette (RGB *pal) {
	int i, r, g, b;

	/* Start with a black palette */
	memset (pal, 0, 256 * sizeof (RGB));

	/* Let's use the EGA palette for the bottom 16 colours... */ 
	for (i = 0; i < 8; i++) {
		r = ((i & 4) != 0);
		g = ((i & 2) != 0);
		b = ((i & 1) != 0);
		write_colour (pal, i, r * 31, g * 31, b * 31);
		write_colour (pal, i + 8, r * 63, g * 63, b * 63);
	}
	write_colour (pal, 8, 15, 15, 15);

	/* ... and make a gradient in blue for the next 16 */
	for (i = 0; i < 16; i++)
		write_colour (pal, i + 16, 0, 0, 16 + 2 * i);
}

/* make_background: (local)
 *  This function draws a background to the given bitmap.  A
 *  solid colour gets a bit boring to look at...
 */
static void make_background (BITMAP *bmp) {
	int x, y, w, h, col, blocksize = 32;

	w = (bmp->w / blocksize) + 1;
	h = (bmp->h / blocksize) + 1;

	for (x = 0; x < blocksize; x++)
		for (y = x; y < blocksize; y++) {
			col = (sin (x * 2 * 3.141592654 / blocksize) + sin (y * 2 * 3.141592654 / blocksize)) * 4;
			if (col < -7) col = -7;
			else if (col > 7) col = 7;
			col += 24;
			putpixel (bmp, x, y, col);
			if (y != x) putpixel (bmp, y, x, col);
		}

	for (x = 0; x < w; x++)
		for (y = 0; y < h; y++)
			if (x + y) blit (bmp, bmp, 0, 0, x * blocksize, y * blocksize, blocksize, blocksize);
}

/* display_init:
 *  Called once, at the start of the game.
 */
void display_init() {
	if (set_gfx_mode (GFX_AUTODETECT, screen_width, screen_height, 0, 0) < 0)
		error ("Unable to set video mode", allegro_error);

	make_palette(palette);
	set_palette(black_palette);     /* for now */

	/* Make subbitmaps to simplify access to certain parts of the screen */
	arena = create_sub_bitmap (screen, arena_x, arena_y, arena_width, arena_height);
	status_bar = create_sub_bitmap (screen, status_x, status_y, status_width, status_height);

	/* arena_bkgnd is the background bitmap of the arena */
	arena_bkgnd = create_bitmap (arena_width, arena_height);

	if (!arena || !status_bar || !arena_bkgnd)
		error ("Error creating bitmaps", NULL);

	clear (arena_bkgnd);
	make_background (arena_bkgnd);
	line (arena_bkgnd, 0, arena_height - 1, 0, 0, 7);
	line (arena_bkgnd, 0, 0, arena_width - 1, 0, 7);
	line (arena_bkgnd, arena_width - 1, 0, arena_width - 1, arena_height - 1, 7);

	blit (arena_bkgnd, arena, 0, 0, 0, 0, arena_width, arena_height);

	fade_in (palette, 10);
}

/* display_shutdown:
 *  Called after the game; should undo everything ~_init does.
 */
void display_shutdown() {
	fade_out (5);
	destroy_bitmap (arena);
	destroy_bitmap (arena_bkgnd);
	destroy_bitmap (status_bar);
}


/* draw_status_bar: (local)
 *  Not surprisingly, this draws the status bar.
 */
static void draw_status_bar() {
	char string[100];
	sprintf (string, "Score: %d", game_score);
	text_mode (0);    /* you should always update this before writing text */
	textout (status_bar, font, string, 0, 0, 15);
}

/* display_update:
 *  This is called every cycle, to update the screen display.
 *
 *  Note that it is a slow routine; display routines tend to 
 *  be slow, and this one includes a vsync.
 */
void display_update() {
	vsync();
	draw_status_bar();
	objects_erase (arena, arena_bkgnd);
	objects_draw (arena);
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
26uuu色噜噜精品一区二区| 天天色图综合网| 国产米奇在线777精品观看| 欧美视频一区二区三区在线观看| 1区2区3区精品视频| 国产91精品欧美| 久久久久久免费网| 国产在线观看一区二区| 亚洲精品一区二区三区蜜桃下载 | 麻豆精品一二三| 欧美日韩在线播放一区| 极品少妇xxxx精品少妇| 777色狠狠一区二区三区| 日韩一区精品字幕| 2021国产精品久久精品| 国产成人精品免费一区二区| 欧美国产一区二区| 91小视频在线| 肉肉av福利一精品导航| 欧美va亚洲va在线观看蝴蝶网| 久久国产生活片100| 18欧美亚洲精品| 91精品国产综合久久蜜臀| 久久激情五月激情| 悠悠色在线精品| 欧美一区二区三区在线看| 国产宾馆实践打屁股91| 亚洲一区中文在线| 26uuu精品一区二区| 色综合色狠狠天天综合色| 日本va欧美va瓶| 国产精品美女久久久久久久久久久 | 波多野结衣精品在线| 亚洲福利国产精品| 欧美国产精品v| 91精品国产91久久综合桃花| 99久久亚洲一区二区三区青草| 婷婷六月综合亚洲| 亚洲免费资源在线播放| 欧美成人精品高清在线播放 | 99久久精品免费| 美女在线观看视频一区二区| 亚洲精品v日韩精品| 久久久精品中文字幕麻豆发布| 欧美另类videos死尸| 99国产精品久久久久| 国产毛片一区二区| 蜜桃av一区二区三区电影| 亚洲综合视频在线| 亚洲人成7777| 中文字幕欧美一| 亚洲国产高清aⅴ视频| 2023国产精品自拍| 久久综合狠狠综合久久激情| 日韩精品一区在线观看| 日韩欧美国产成人一区二区| 欧美日韩成人综合天天影院| 欧美日韩国产首页| 欧美一级片免费看| 日韩精品一区二区三区蜜臀| 精品久久久影院| 国产亚洲va综合人人澡精品| 久久精品人人做人人爽人人| 国产精品入口麻豆原神| 成人免费在线播放视频| 亚洲免费在线视频| 丝袜a∨在线一区二区三区不卡| 日本在线不卡视频一二三区| 男女男精品网站| 成人爱爱电影网址| 欧美视频中文字幕| 欧美tickling挠脚心丨vk| 欧美国产一区视频在线观看| 一卡二卡欧美日韩| 另类的小说在线视频另类成人小视频在线| 六月丁香婷婷色狠狠久久| 成人网在线播放| 91精品国产丝袜白色高跟鞋| 中文字幕第一区综合| 亚洲大型综合色站| 成人av电影在线| 欧美一区二区三区啪啪| 久久精品人人做人人爽97| 亚洲成av人片一区二区三区| 国内成+人亚洲+欧美+综合在线| 91麻豆国产在线观看| 国产色综合久久| 日本成人超碰在线观看| 欧美影院一区二区三区| 国产日本亚洲高清| 国内成+人亚洲+欧美+综合在线| 在线精品视频小说1| 综合中文字幕亚洲| 国产精品一二一区| 欧美精品一区二区蜜臀亚洲| 日本欧美一区二区| 欧美精品视频www在线观看| 亚洲欧美日韩综合aⅴ视频| 国产一区二区三区不卡在线观看 | 91麻豆精品国产91久久久更新时间| 国产精品成人一区二区艾草 | 中文在线一区二区| 国产成人亚洲综合a∨婷婷图片| 精品国精品自拍自在线| 美女脱光内衣内裤视频久久影院| 欧美精品第1页| 久久超碰97中文字幕| 欧美精品一区二区三区四区| 久久爱另类一区二区小说| 日韩一级成人av| 国产综合色视频| 国产精品天天看| 色婷婷精品久久二区二区蜜臀av| 国产精品国产精品国产专区不蜜 | 久久成人av少妇免费| 久久人人97超碰com| 91丨porny丨首页| 亚洲成精国产精品女| 欧美成人精精品一区二区频| 国产成人免费xxxxxxxx| 亚洲欧美日韩国产成人精品影院| 色综合咪咪久久| 激情综合一区二区三区| 国产精品国产三级国产a| 欧美日韩高清不卡| 高清不卡在线观看| 日韩av一二三| 日韩一区中文字幕| 欧美一区二区三区视频在线| 成人av影视在线观看| 日韩av电影一区| 亚洲欧洲国产日韩| 精品日产卡一卡二卡麻豆| zzijzzij亚洲日本少妇熟睡| 亚洲va韩国va欧美va精品| **性色生活片久久毛片| 日韩欧美一区二区久久婷婷| 色综合久久久网| 国产精品亚洲а∨天堂免在线| 丝袜国产日韩另类美女| 亚洲少妇最新在线视频| 久久精品亚洲麻豆av一区二区| 欧美精品aⅴ在线视频| 99久久99久久久精品齐齐| 国产福利91精品一区二区三区| 日韩在线a电影| 日本女优在线视频一区二区| 洋洋av久久久久久久一区| 中文字幕制服丝袜成人av| 国产精品欧美综合在线| 久久蜜桃av一区二区天堂| 欧美一区二区三区四区在线观看| 欧美日韩二区三区| 91精品麻豆日日躁夜夜躁| 欧美日高清视频| 欧美日韩国产美女| 日韩欧美区一区二| 欧美不卡一区二区三区| 欧美一级欧美三级在线观看| 欧美一级理论片| www国产精品av| 国产精品乱码妇女bbbb| 亚洲美女偷拍久久| 日韩精品欧美精品| 精品夜夜嗨av一区二区三区| 国产精品综合一区二区三区| 国产一二三精品| 欧亚洲嫩模精品一区三区| 欧美精品xxxxbbbb| 久久久www成人免费毛片麻豆 | 美女精品一区二区| 成人免费va视频| 欧美日韩国产美女| 久久久久久久久久久黄色| 亚洲乱码国产乱码精品精的特点 | 欧美午夜一区二区| 日韩欧美一级二级三级| 最新欧美精品一区二区三区| 日韩国产高清影视| 99久久久久免费精品国产| 91精品中文字幕一区二区三区| 久久精品视频一区二区三区| 亚洲国产精品视频| 福利一区二区在线| 精品国产免费人成在线观看| 亚洲视频免费观看| 国产精品自拍一区| 日韩久久精品一区| 五月天一区二区| 色综合久久久久综合体桃花网| 久久久久久电影| 久久精品国产秦先生| 欧美日韩国产美| 亚洲综合免费观看高清完整版在线 | 国产精品伊人色| 精品国产乱子伦一区| 午夜伦欧美伦电影理论片| 色欧美88888久久久久久影院| 国产精品久久久久久久久晋中 | 精品久久久网站|