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

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

?? display.c

?? 乒乓球游戲程序
?? C
字號:
/*----------------------------------------------------------------
 * 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 "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)
		abort();

	make_palette(palette);
	set_palette(palette);

	/* 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)
		abort();

	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);
}

/* display_shutdown:
 *  Called after the game; should undo everything ~_init does.
 */
void display_shutdown() {
	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);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃一区二区三区四区| 国产精品国产三级国产专播品爱网| 高清beeg欧美| 国产乱子轮精品视频| 青青国产91久久久久久| 亚洲444eee在线观看| 午夜精品一区二区三区免费视频| 亚洲一区二区美女| 亚洲国产精品久久艾草纯爱| 午夜欧美电影在线观看| 亚洲国产美女搞黄色| 日韩专区一卡二卡| 久久99日本精品| 国产一区二区91| 成人免费观看男女羞羞视频| 91亚洲国产成人精品一区二区三| 91高清视频在线| 欧美精品精品一区| 精品日韩在线观看| 中文字幕一区二区三| 亚洲色图20p| 日本欧美肥老太交大片| 大陆成人av片| 欧美图区在线视频| 精品盗摄一区二区三区| 国产欧美一区二区精品性色| 18欧美乱大交hd1984| 亚洲国产中文字幕在线视频综合| 免费成人在线观看视频| 成人av电影在线| 欧美日韩国产综合视频在线观看 | 偷窥少妇高潮呻吟av久久免费| 日韩高清不卡在线| 国产宾馆实践打屁股91| 欧美性生交片4| 久久色.com| 亚洲乱码中文字幕综合| 久久国产麻豆精品| 91在线国产观看| 欧美va在线播放| 亚洲乱码国产乱码精品精98午夜| 天堂一区二区在线| 99精品偷自拍| 久久久不卡影院| 首页欧美精品中文字幕| 91视频一区二区三区| 欧美va天堂va视频va在线| 亚洲男人的天堂一区二区| 精品一区二区三区在线视频| 91福利精品视频| 国产亚洲污的网站| 蜜桃av噜噜一区二区三区小说| 91高清在线观看| 国产精品美女久久久久久久| 捆绑调教美女网站视频一区| 在线观看日产精品| 中文字幕一区二区在线播放 | 国产性做久久久久久| 青草av.久久免费一区| 在线观看国产精品网站| 亚洲欧洲三级电影| 国产69精品久久久久777| 精品国产乱码久久久久久久| 日产欧产美韩系列久久99| 欧美综合欧美视频| 一区二区在线观看av| 99久久免费视频.com| 久久理论电影网| 久久99蜜桃精品| 精品噜噜噜噜久久久久久久久试看| 亚洲一区二区欧美日韩| 欧美日韩在线播放三区| 亚洲黄色小说网站| 精品视频免费看| 亚洲国产精品尤物yw在线观看| 色综合久久中文综合久久97| 亚洲色图制服诱惑| 日本久久电影网| 一区二区欧美在线观看| 欧美在线观看视频一区二区三区 | 午夜伦欧美伦电影理论片| 欧洲精品视频在线观看| 性欧美疯狂xxxxbbbb| 欧美人牲a欧美精品| 日本aⅴ亚洲精品中文乱码| 日韩精品一区国产麻豆| 精品一区二区综合| 国产欧美视频在线观看| 成人黄色网址在线观看| 亚洲人成在线播放网站岛国| 91福利小视频| 日韩精品久久理论片| 欧美一区二区三区在线观看| 美国av一区二区| 国产肉丝袜一区二区| 91在线观看下载| 亚洲电影一级黄| 亚洲精品一线二线三线无人区| 国产激情一区二区三区| 综合久久久久久| 3atv一区二区三区| 国产美女精品在线| 亚洲日本在线看| 日韩一区二区三区视频| 国产91精品欧美| 一区二区三区在线高清| 欧美成人video| 99v久久综合狠狠综合久久| 香蕉久久一区二区不卡无毒影院 | av中文字幕亚洲| 亚洲国产精品综合小说图片区| 精品国产乱子伦一区| av中文一区二区三区| 美女脱光内衣内裤视频久久影院| 国产人成亚洲第一网站在线播放 | 综合欧美一区二区三区| 欧美一区中文字幕| 97久久超碰国产精品| 玖玖九九国产精品| 亚洲一区二三区| 久久久久国产精品麻豆ai换脸| 精品污污网站免费看| 高清视频一区二区| 经典三级在线一区| 婷婷久久综合九色综合绿巨人 | 日韩精品一区二区在线| 91国偷自产一区二区三区观看 | 国产精品视频麻豆| 欧美成人一级视频| 精品视频色一区| 91黄色在线观看| 色先锋aa成人| bt欧美亚洲午夜电影天堂| 国产一区二区视频在线播放| 亚洲成av人**亚洲成av**| 国产日韩成人精品| 久久久蜜桃精品| 日韩欧美一级在线播放| 在线不卡免费欧美| 欧美主播一区二区三区美女| 91原创在线视频| 成人成人成人在线视频| 国产精品一区二区视频| 美女在线一区二区| 捆绑紧缚一区二区三区视频| 男女性色大片免费观看一区二区| 亚洲午夜av在线| 亚洲一区二区三区四区的| 一区二区三区精密机械公司| 亚洲欧洲精品一区二区三区不卡| 国产精品乱码一区二三区小蝌蚪| 久久精品一区蜜桃臀影院| 久久久精品tv| 国产网站一区二区| 中文字幕精品一区二区精品绿巨人 | 免费观看30秒视频久久| 秋霞影院一区二区| 久久精品国产亚洲一区二区三区| 日韩高清在线不卡| 毛片不卡一区二区| 国产精品456露脸| 成人app下载| 色偷偷成人一区二区三区91| 91国产丝袜在线播放| 欧美性大战久久久久久久蜜臀| 欧洲国产伦久久久久久久| 欧美三级三级三级| 欧美一区二区精品久久911| 欧美一区二区三级| 国产日产精品一区| 亚洲欧美激情在线| 视频一区视频二区中文字幕| 久久精品999| 处破女av一区二区| 欧洲一区二区三区在线| 日韩一区二区三区视频在线| 国产日产欧美一区| 一区二区在线观看视频| 免费看欧美女人艹b| 风流少妇一区二区| 欧美日韩三级一区| 国产欧美日韩三区| 亚洲自拍偷拍av| 国产麻豆91精品| 欧美亚洲综合另类| 久久久久久免费网| 亚洲最新在线观看| 国产一区二区免费在线| 色噜噜狠狠成人网p站| 欧美电影免费观看高清完整版在| 中文字幕亚洲电影| 久久激情五月激情| 91久久精品国产91性色tv| 欧美xxxxxxxx| 亚洲一区二区三区自拍| 国产伦精品一区二区三区免费 | 一区二区欧美精品| 国内偷窥港台综合视频在线播放| 欧美性感一区二区三区| 国产人成亚洲第一网站在线播放 |