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

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

?? same.c

?? minigui 1.6.10 游戲例子 能對編程有很大啟發(fā)
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** $Id: same.c,v 1.7 2006-03-02 05:28:28 xgwang Exp $**** Same: the Same game.** (C) 1997 the Free Software Foundation**** Author: Miguel de Icaza.**         Federico Mena.**         Horacio Pe?a.**** The idea is originally from KDE's same game program.**** Ported to MiniGUI by Wei Yongming***//***  This source is free software; you can redistribute it and/or**  modify it under the terms of the GNU General Public**  License as published by the Free Software Foundation; either**  version 2 of the License, or (at your option) any later version.****  This software is distributed in the hope that it will be useful,**  but WITHOUT ANY WARRANTY; without even the implied warranty of**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU**  General Public License for more details.****  You should have received a copy of the GNU General Public**  License along with this library; if not, write to the Free**  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,**  MA 02111-1307, USA*/#include <sys/types.h>#include <string.h>#include <stdlib.h>#include <time.h>#include <dirent.h>#include <minigui/common.h>#include <minigui/minigui.h>#include <minigui/gdi.h>#include <minigui/window.h>#include <minigui/control.h>#define IDM_NEW         100#define IDM_SCORES        110#define IDM_EXIT        120#define IDM_PREF        200#define IDM_ABOUT        300#define STONE_SIZE        40#define STONE_COLS        15#define STONE_LINES        10#define ID_TIMER        100#define _(x) (x)static RECT rcBoard;static HWND hwnd_score = HWND_INVALID, hwnd_menu;static BITMAP stones;static int tagged_count = 0;static int ball_timeout_id = -1;static int old_x = -1, old_y = -1;static int score;static const char* lang= "en";static const char**pmain_menu =NULL;static const char**pgame_menu =NULL;static const char**pabout_menu =NULL;static const char**pmessagebox =NULL;static const char**phelpmessage = NULL;static const char* messagebox_cn[] ={    "你確定要退出嗎?",    "同色球",    "得分:%.5d",    "游戲結束!\n你的分數(shù)是:%.5d",    "同色球游戲",    "場景",    "分數(shù)",    "同色球--1.0\n\nCopyright (C) 2003 ~ 2008 北京飛漫軟件技術有限公司\n\n 保留所有權利"};static const char* messagebox_tw[] ={    "你確定要退出嗎?",    "同色球",    "得分:%.5d",    "游戲結束!\n你的分數(shù)是:%.5d",    "同色球游戲",    "場景",    "分數(shù)",    "同色球--1.0\n\nCopyright (C) 2003 ~ 2008 北京飛漫軟件技術有限公司\n\n 保留所有權利"};static const char* messagebox_en[] ={    "Are you sure to quit?",    "Same",    "Score: %.5d",               //2    "End of Game! \nYour Score: %.5d",      //3    "The Same Game",              //4    "Scenario: ",                //5    "Score:",                    //6    "Same -- Version 1.0\n\nCopyright (C) 2003 ~ 2008 Beijing Feynman Software Technology Co., Ltd.\nAll rights reserved."          //7};static const char* about_menu_cn[] ={    "關于",    "關于同色球游戲"};static const char* about_menu_tw[] ={    "關於",    "關於同色球游戲"};static const char* about_menu_en[] ={    "About",    "About same game"};static const char* game_menu_cn[] ={    "游戲",    "新游戲",    "退出"};static const char* game_menu_tw[] ={    "游戲",    "新游戲",    "退出"};static const char* game_menu_en[] ={    "Game",    "New game",    "Exit"};static const char* main_menu_cn[] ={    "游戲",    "關于"};static const char* main_menu_tw[] ={    "游戲",    "關於"};static const char* main_menu_en[] ={    "Game",    "About"};static const char* main_help_cn[] ={" 同色球 -- 1.0 \n\n Copyright (C) 2003 ~ 2008 北京飛漫軟件技術有限公司\n\n 保留所有權利."};static const char* main_help_tw[] ={" 同色球 -- 1.0 \n\n Copyright (C) 2003 ~ 2008 北京飛漫軟件技術有限公司\n\n 保留所有權利."};static const char* main_help_en[] ={" Same -- Version 1.0 \n\n Copyright (C) 2003 ~ 2008 Beijing Feynman Software Technology Co., Ltd.\nAll rights reserved."};static int cur_sel_scen = 0;static PLOGFONT cap_font = NULL;static PLOGFONT ctrl_font = NULL;static PLOGFONT menu_font = NULL;static PLOGFONT utf8_font = NULL;static void init_same(){    cap_font = g_SysLogFont[SYSLOGFONT_CAPTION];    ctrl_font = g_SysLogFont[SYSLOGFONT_CONTROL];    menu_font = g_SysLogFont[SYSLOGFONT_MENU];    utf8_font = CreateLogFontByName("*-Arial-rrncnn-*-12-UTF-8");    g_SysLogFont[SYSLOGFONT_CAPTION] = utf8_font;    g_SysLogFont[SYSLOGFONT_CONTROL] = utf8_font;    g_SysLogFont[SYSLOGFONT_MENU] = utf8_font;    if(strcasecmp(lang,"zh_cn")==0){        local_SysText = GetSysTextInUTF8("zh_CN");    }    else if(strcasecmp(lang,"zh_tw")==0){        local_SysText = GetSysTextInUTF8("zh_TW");    }    else       local_SysText = GetSysTextInUTF8("EN");}static void release_same(){    g_SysLogFont[SYSLOGFONT_CAPTION] = cap_font;    g_SysLogFont[SYSLOGFONT_CONTROL] = ctrl_font;    g_SysLogFont[SYSLOGFONT_MENU] = menu_font;    DestroyLogFont(utf8_font);}static struct ball {    int color;    int tag;    int frame;} field [STONE_COLS][STONE_LINES];static int nstones;static int ncolors;static int sync_stones = 0;#define mapx(x) (x)#define mapy(y) (STONE_LINES-1-(y))static voiddraw_ball (HDC hdc, int x, int y){    int bx, by;    if (field [x][y].color){        by = STONE_SIZE * (field [x][y].color - 1);        bx = STONE_SIZE * (field [x][y].frame);                FillBoxWithBitmapPart (hdc, x * STONE_SIZE, y * STONE_SIZE,                  STONE_SIZE, STONE_SIZE, 0, 0, &stones,                 bx, by);    } else {        SetBrushColor (hdc, PIXEL_black);        FillBox (hdc, x * STONE_SIZE, y * STONE_SIZE,                       STONE_SIZE, STONE_SIZE);    }}static void paint (HWND hwnd, HDC hdc){    RECT rc;    int x1, y1, x2, y2, x, y;        GetClientRect (hdc, &rc);    x1 = rc.left / STONE_SIZE;    y1 = rc.top / STONE_SIZE;    x2 = rc.right / STONE_SIZE;    y2 = rc.bottom / STONE_SIZE;    for (x = 0; x < STONE_COLS; x++){        for (y = 0; y < STONE_LINES; y++){            draw_ball (hdc, x, y);        }    }}static void untag_all (HWND hwnd){    int x, y;    HDC hdc = GetClientDC (hwnd);    for (x = 0; x < STONE_COLS; x++)        for (y = 0; y < STONE_LINES; y++){            field [x][y].tag   = 0;            if (sync_stones && field [x][y].frame != 0) {                field [x][y].frame = 0;                draw_ball (hdc, x, y);            }        }    ReleaseDC (hdc);}static int flood_fill (int x, int y, int color){    int c = 0;        if (field [x][y].color != color)        return c;        if (field [x][y].tag)        return c;    c = 1;    field [x][y].tag = 1;        if (x+1 < STONE_COLS)        c += flood_fill (x+1, y, color);    if (x)        c += flood_fill (x-1, y, color);    if (y+1 < STONE_LINES)        c += flood_fill (x, y+1, color);    if (y)        c += flood_fill (x, y-1, color);    return c;}static int move_tagged_balls (HDC hdc){    int x, y;        for (x = 0; x < STONE_COLS; x++)        for (y = 0; y < STONE_LINES; y++){            if (!field [x][y].tag)                continue;            field [x][y].frame = (field [x][y].frame + 1) % nstones;            draw_ball (hdc, x, y);        }    return 1;}static void disable_timeout (HWND hwnd){    if (ball_timeout_id != -1){        KillTimer (hwnd, ball_timeout_id);        ball_timeout_id = -1;    }}static void mark_balls (HWND hwnd, int x, int y){    if (x == old_x && y == old_y)        return;    old_x = x;    old_y = y;    untag_all (hwnd);    disable_timeout (hwnd);    if (!field [x][y].color)        return;        tagged_count = flood_fill (x, y, field [x][y].color);        if (tagged_count > 1) {        SetTimer (hwnd, ID_TIMER, 10);         ball_timeout_id = ID_TIMER;    }}static void unmark_balls (HWND hWnd){    old_x = -1;    old_y = -1;    disable_timeout (hWnd);    untag_all (hWnd);}static void compress_column (int x){    int y, ym;        for (y = STONE_LINES - 1; y >= 0; y--){        if (!field [mapx(x)][mapy(y)].tag)            continue;        for (ym = y; ym < STONE_LINES - 1; ym++)            field [mapx(x)][mapy(ym)] = field [mapx(x)][mapy(ym+1)];        field [mapx(x)][mapy(ym)].color = 0;        field [mapx(x)][mapy(ym)].tag   = 0;    }}static void compress_y (void){    int x;    for (x = 0; x < STONE_COLS; x++)        compress_column (x);}static void copy_col (int dest, int src){    int y;        for (y = 0; y < STONE_LINES; y++)        field [mapx(dest)][mapy(y)] = field [mapx(src)][mapy(y)];}static void clean_last_col (void){    int y;    for (y = 0; y < STONE_LINES; y++){        field [mapx(STONE_COLS-1)][mapy(y)].color = 0;        field [mapx(STONE_COLS-1)][mapy(y)].tag   = 0;    }}static void compress_x (void){    int x, xm, l;    for (x = 0; x < STONE_COLS; x++){        for (l = STONE_COLS; field [mapx(x)][mapy(0)].color == 0 && l; l--){            for (xm = x; xm < STONE_COLS-1; xm++)                copy_col (xm, xm+1);            clean_last_col ();        }     }}static void set_score (int new_score){    char b [40];        score = new_score;    sprintf (b, pmessagebox[2], score);    if (hwnd_score != HWND_INVALID)        SetWindowText (hwnd_score, b);}static void end_of_game (HWND hWnd, char *title){        char b [256];    sprintf (b, pmessagebox[3], score);    MessageBox (hWnd, b, title,             MB_OK | MB_ICONINFORMATION | MB_BASEDONPARENT);}static void check_game_over (HWND hwnd){    int cleared=1;    int x,y;        for(x = 0; x < STONE_COLS; x++)        for(y = 0 ; y < STONE_LINES; y++) {            if (!field [x][y].color)                continue;            cleared = 0;            if(x+1 < STONE_COLS)                 if(field[x][y].color == field[x+1][y].color)                    return;            if(y+1 < STONE_LINES)                 if(field[x][y].color == field[x][y+1].color)                    return;        }    if (cleared){        set_score (score+1000);        end_of_game (hwnd, _(pmessagebox[4]));    }    else        end_of_game(hwnd, _(pmessagebox[4]));}static void kill_balls (HWND hwnd, int x, int y){    if (!field [x][y].color)        return;        if (tagged_count < 2)        return;    set_score (score + (tagged_count - 2) * (tagged_count - 2));    compress_y ();    compress_x ();    InvalidateRect (hwnd, &rcBoard, FALSE);    check_game_over (hwnd);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97精品久久久久中文字幕| 日韩一级在线观看| 成人免费高清在线观看| 激情六月婷婷久久| 九九精品视频在线看| 麻豆免费精品视频| 久久99日本精品| 久久er99精品| 国产精品伊人色| 国产伦精品一区二区三区免费迷| 紧缚捆绑精品一区二区| 精品亚洲成av人在线观看| 精品影视av免费| 国产一区高清在线| 国产99久久久精品| 99精品久久久久久| 91九色02白丝porn| 91麻豆精品国产综合久久久久久| 9191成人精品久久| 精品国产成人在线影院| 国产亚洲污的网站| 亚洲欧美综合色| 亚洲一区二区五区| 免费在线观看不卡| 国产精品 日产精品 欧美精品| 国产精品91xxx| 91免费国产在线观看| 在线观看网站黄不卡| 欧美另类久久久品| www亚洲一区| 亚洲已满18点击进入久久| 亚洲国产欧美在线| 美腿丝袜一区二区三区| 懂色av一区二区三区蜜臀| 99久久精品费精品国产一区二区| 在线免费视频一区二区| 欧美一级精品大片| 国产日韩精品一区| 一区二区三区四区五区视频在线观看 | 午夜电影网一区| 美国十次综合导航| 成人免费av资源| 欧美日韩和欧美的一区二区| 欧美本精品男人aⅴ天堂| 国产精品麻豆视频| 午夜精品123| 粉嫩av一区二区三区粉嫩| 欧洲另类一二三四区| 欧美tickling网站挠脚心| 欧美国产日本视频| 爽好久久久欧美精品| 国产精品羞羞答答xxdd| 91福利在线播放| 久久这里只有精品首页| 一区二区三区四区在线播放| 精品一区二区成人精品| 在线免费观看不卡av| 久久这里只有精品首页| 亚洲成人免费观看| 国产成人免费视| 欧美精品视频www在线观看| 国产精品午夜在线观看| 日本美女一区二区三区| 91在线你懂得| www亚洲一区| 视频一区二区欧美| 色综合久久88色综合天天免费| 日韩一区二区三区在线观看| 亚洲人成精品久久久久| 精品一区二区三区免费视频| 欧美日免费三级在线| 亚洲国产精品黑人久久久| 七七婷婷婷婷精品国产| 欧美亚洲一区二区在线| 中文幕一区二区三区久久蜜桃| 另类小说图片综合网| 欧美亚洲动漫精品| 国产精品福利影院| 国产乱码字幕精品高清av| 欧美精品久久天天躁| 亚洲精品欧美在线| 成人网页在线观看| 日韩女优制服丝袜电影| 午夜伊人狠狠久久| 91国偷自产一区二区三区观看| 欧美国产精品中文字幕| 国内外成人在线| 日韩一区二区三区免费看| 亚洲午夜激情av| 一本大道久久a久久综合婷婷| 日本一区二区免费在线观看视频| 麻豆91精品91久久久的内涵| 欧美日本一区二区三区四区| 一区二区三区在线观看动漫| 99免费精品在线| 国产片一区二区| 国产一区二区三区免费在线观看| 777午夜精品视频在线播放| 亚洲一区二区黄色| 欧美亚洲禁片免费| 亚洲乱码一区二区三区在线观看| a4yy欧美一区二区三区| 国产精品网站一区| 成人激情图片网| 国产精品国产三级国产aⅴ入口| 国产成人日日夜夜| 国产清纯美女被跳蛋高潮一区二区久久w | 免费看黄色91| 精品久久久久久久人人人人传媒 | 国产99久久久精品| 国产欧美一区二区精品性| 国产高清一区日本| 久久午夜色播影院免费高清| 国产自产2019最新不卡| www激情久久| 高清不卡一区二区| 国产免费久久精品| caoporm超碰国产精品| 中文字幕一区二区三区四区| 99九九99九九九视频精品| 一区二区中文字幕在线| 色婷婷精品久久二区二区蜜臀av | 精品成人在线观看| 国产成人在线影院 | 韩国av一区二区三区四区| 国产欧美一区二区精品婷婷| 成人国产精品免费观看| 亚洲精品高清视频在线观看| 欧美日韩日日摸| 紧缚奴在线一区二区三区| 国产婷婷精品av在线| 91麻豆精东视频| 同产精品九九九| 久久久久青草大香线综合精品| 成人在线视频一区| 亚洲夂夂婷婷色拍ww47| 日韩欧美国产系列| 成人sese在线| 五月开心婷婷久久| 国产日韩成人精品| 欧洲人成人精品| 久久99久久久久| 亚洲欧美综合另类在线卡通| 69堂国产成人免费视频| 国产91在线|亚洲| 亚洲一区二区三区精品在线| 精品成人在线观看| 在线亚洲+欧美+日本专区| 美女一区二区三区在线观看| 国产精品亲子伦对白| 欧美日韩另类一区| 国产精品一级在线| 亚洲一区二区三区三| 久久久久国产精品麻豆| 欧美做爰猛烈大尺度电影无法无天| 美腿丝袜亚洲综合| 亚洲视频一二三区| 精品久久久久久久久久久久久久久久久| eeuss鲁一区二区三区| 三级久久三级久久| 中文字幕一区二区在线播放| 8x福利精品第一导航| 99久久精品国产麻豆演员表| 免费黄网站欧美| 悠悠色在线精品| 久久精品这里都是精品| 欧美精品色综合| 99精品一区二区三区| 国精产品一区一区三区mba桃花| 亚洲精品国产a| 欧美精彩视频一区二区三区| 欧美日韩成人综合| 91丨porny丨国产入口| 国产精品一区二区在线播放 | 99精品久久久久久| 国产一区二区三区综合| 亚洲电影一区二区| 亚洲视频每日更新| 欧美国产日韩亚洲一区| 日韩女优毛片在线| 欧美日本在线看| 色婷婷av一区| 本田岬高潮一区二区三区| 精品亚洲成av人在线观看| 天堂一区二区在线| 一区二区三区在线看| 国产精品乱码妇女bbbb| 亚洲精品在线免费观看视频| 91精品国产综合久久精品图片| 欧美在线视频不卡| 一本色道亚洲精品aⅴ| av电影天堂一区二区在线观看| 国产精品伊人色| 久久99在线观看| 麻豆高清免费国产一区| 日本午夜一区二区| 日韩成人午夜电影| 视频一区欧美日韩| 日韩不卡一区二区三区| 午夜电影一区二区三区|