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

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

?? array2d.h

?? 游戲開發數據結構-Data.Structures.for.Game.Programmers
?? H
字號:
// ============================================================================
// Data Structures For Game Programmers
// Ron Penton
// Array2D.h
// This is the 2D Aray class
// ============================================================================

#ifndef ARRAY2D_H
#define ARRAY2D_H


template <class Datatype>
class Array2D
{
public:

// -------------------------------------------------------
// Name:        Array2D::Array2D
// Description: This creates the 2D array using a single
//              linear array.
// -------------------------------------------------------
    Array2D( int p_width, int p_height )
    {
        // create the new array
        m_array = new Datatype[ p_width * p_height ];

        // set the width and height
        m_width = p_width;
        m_height = p_height;
    }


// -------------------------------------------------------
// Name:        Array2D::~Array2D
// Description: This destructs the array.
// -------------------------------------------------------
    ~Array2D()
    {
        // if the array is valid, delete it.
        if( m_array != 0 )
            delete[] m_array;
        m_array = 0;
    }

 
// -------------------------------------------------------
// Name:        Array2D::Get
// Description: This retrieves the item at the given
//              index.
// -------------------------------------------------------
    Datatype& Get( int p_x, int p_y )
    {
        return m_array[ p_y * m_width + p_x ];
    }



// -------------------------------------------------------
// Name:        Array2D::Resize
// Description: This resizes the array.
// -------------------------------------------------------
    void Resize( int p_width, int p_height )
    {
        // create a new array.
        Datatype* newarray = new Datatype[ p_width * p_height ];

        if( newarray == 0 )
            return;

        // create the two coordinate variables and the two temp 
        // variables.
        int x, y, t1, t2;

        // determine the minimum of both dimensions.
        int minx = (p_width < m_width ? p_width : m_width);
        int miny = (p_height < m_height ? p_height : m_height);

        // loop through each cell and copy everything over.
        for( y = 0; y < miny; y++ )
        {
            // OPTIMISATION: pre-calculate t1 and t2
            // the standard algorithm to calculate the
            // position in a 2d array is [y * w + x].
            // however, since y * w doesn't change at all
            // in the innermost loop, we calculate it out
            // here instead.
            t1 = y * p_width;
            t2 = y * m_width;
            for( x = 0; x < minx; x++ )
            {
                // move the data to the new array.
                newarray[ t1 + x ] = m_array[ t2 + x ];
            }
        }

        // delete the old array.        
        if( m_array != 0 )
            delete[] m_array;

        // set the new array, and the width and height.
        m_array = newarray;
        m_width = p_width;
        m_height = p_height;
    }



// -------------------------------------------------------
//  Name:         Array2D::Size
//  Description:  gets the size of the array.
//  Return Value: the size of the array.
// -------------------------------------------------------
    int Size()
    {
        return m_width * m_height;
    }


// -------------------------------------------------------
//  Name:         Array2D::Width
//  Description:  gets the width of the array.
//  Return Value: the width of the array.
// -------------------------------------------------------
    int Width()
    {
        return m_width;
    }


// -------------------------------------------------------
//  Name:         Array2D::Height
//  Description:  gets the height of the array.
//  Return Value: the height of the array.
// -------------------------------------------------------
    int Height()
    {
        return m_height;
    }




// -------------------------------------------------------
// Name:        array2d::m_array
// Description: This is a pointer to the array.
// -------------------------------------------------------
 Datatype* m_array;

// -------------------------------------------------------
// Name:        array2d::m_width
// Description: the current width of the array.
// -------------------------------------------------------
 int m_width;

// -------------------------------------------------------
// Name:        array2d::m_height
// Description: the current height of the array.
// -------------------------------------------------------
 int m_height;
};




#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
视频在线观看91| 亚洲色图在线播放| 在线中文字幕一区二区| 97久久精品人人做人人爽 | 欧美日韩免费一区二区三区| 色综合久久综合网欧美综合网| 成年人国产精品| 成人性色生活片| 99久久精品国产毛片| 91老司机福利 在线| 欧美日韩一区二区欧美激情 | 无码av免费一区二区三区试看 | 一二三区精品福利视频| 亚洲一区二区三区国产| 日日骚欧美日韩| 九色综合狠狠综合久久| 国产精品白丝av| 99riav久久精品riav| 欧美色偷偷大香| 日韩精品一区二区在线| 日本一二三不卡| 亚洲自拍偷拍综合| 不卡一区中文字幕| 欧美日韩极品在线观看一区| 日韩一级二级三级精品视频| 国产日韩欧美精品综合| 亚洲精品免费在线观看| 美腿丝袜亚洲综合| gogo大胆日本视频一区| 欧美精品免费视频| 国产三级精品三级| 亚洲韩国精品一区| 国产一区二区中文字幕| 一本色道久久综合亚洲aⅴ蜜桃| 宅男在线国产精品| 国产精品国产三级国产a| 秋霞成人午夜伦在线观看| 国产不卡视频一区| 欧美疯狂做受xxxx富婆| 国产精品毛片高清在线完整版| 天堂一区二区在线| 91老司机福利 在线| 久久先锋资源网| 日韩激情视频网站| 一本久久a久久免费精品不卡| 欧美成人官网二区| 亚洲一本大道在线| 97se亚洲国产综合自在线 | 国产亚洲综合在线| 午夜天堂影视香蕉久久| 91香蕉视频污| 久久精品夜夜夜夜久久| 久久99国产精品久久99果冻传媒| 色久优优欧美色久优优| 国产精品超碰97尤物18| 国产乱子伦一区二区三区国色天香| 91国内精品野花午夜精品| 国产精品国产三级国产a| 国产馆精品极品| 26uuu国产电影一区二区| 一区二区三区鲁丝不卡| av电影天堂一区二区在线观看| 精品福利二区三区| 蜜桃视频在线一区| 91精品国产入口| 天堂蜜桃91精品| 在线电影国产精品| 樱花影视一区二区| 色婷婷av一区二区三区之一色屋| 国产精品色噜噜| 成人自拍视频在线| 亚洲欧洲日韩女同| 成人av网站大全| 中文字幕一区二区5566日韩| 成人av第一页| 亚洲精品写真福利| 色综合激情久久| 亚洲一区二区三区美女| 欧美日韩大陆一区二区| 日日夜夜精品视频天天综合网| 在线不卡的av| 美女视频黄 久久| 久久久精品2019中文字幕之3| 国产制服丝袜一区| 久久久久久久久免费| 国产sm精品调教视频网站| 国产精品乱人伦一区二区| 成人av免费网站| 韩国理伦片一区二区三区在线播放| 精品va天堂亚洲国产| 国产成人免费在线视频| 亚洲精品中文字幕乱码三区| 91啦中文在线观看| 日本网站在线观看一区二区三区 | 2023国产精品| 懂色av噜噜一区二区三区av| 中文字幕亚洲一区二区va在线| 一本色道久久综合精品竹菊| 日韩精品电影一区亚洲| 国产亚洲精品7777| 色哟哟一区二区在线观看| 日本成人中文字幕在线视频| 国产视频视频一区| 91官网在线免费观看| 蜜桃av噜噜一区| 亚洲欧美怡红院| 欧美一级高清片| 成人综合婷婷国产精品久久| 五月婷婷激情综合| 国产欧美日韩不卡免费| 欧美日韩国产一级| 成人一级片在线观看| 午夜成人在线视频| 国产精品欧美极品| 91精品国产aⅴ一区二区| www.成人网.com| 精品一区在线看| 亚洲影院在线观看| 国产精品美女www爽爽爽| 日韩一区二区三区在线| 97精品超碰一区二区三区| 久久66热re国产| 日韩激情视频在线观看| 18涩涩午夜精品.www| 久久先锋影音av鲁色资源网| 欧美日韩中文字幕精品| 高清av一区二区| 精品亚洲国内自在自线福利| 亚洲成年人网站在线观看| 国产精品久久久爽爽爽麻豆色哟哟| 欧美一区二区在线不卡| 色欧美片视频在线观看在线视频| 国产在线不卡视频| 日韩va亚洲va欧美va久久| 国产精品三级久久久久三级| 日韩午夜三级在线| 欧美性高清videossexo| 99久久综合国产精品| 国产一区二区在线电影| 蜜桃精品视频在线| 五月激情综合色| 五月婷婷欧美视频| 亚洲成人午夜电影| 亚洲综合在线第一页| 国产精品成人网| 国产精品久久久久久久蜜臀| 国产免费成人在线视频| 国产午夜精品在线观看| 久久网站热最新地址| 日韩免费电影一区| 宅男噜噜噜66一区二区66| 欧美精品自拍偷拍动漫精品| 欧美日韩一区二区欧美激情| 在线亚洲一区观看| 在线亚洲+欧美+日本专区| 色婷婷激情综合| 欧美午夜精品一区| 欧美美女直播网站| 5月丁香婷婷综合| 欧美一区二区三区视频免费播放| 欧美一区二区视频网站| 制服丝袜国产精品| 久久婷婷久久一区二区三区| 国产日韩欧美精品电影三级在线| 国产日韩精品一区二区三区| 国产精品国产三级国产aⅴ原创| 美日韩一区二区| 国产剧情一区在线| 国产成人午夜99999| 99麻豆久久久国产精品免费| 91麻豆免费在线观看| 欧美午夜影院一区| 日韩限制级电影在线观看| 国产亚洲精品免费| 亚洲欧洲日本在线| 日韩精品一级二级 | 国产日韩精品一区二区浪潮av| 国产精品免费观看视频| 亚洲精品精品亚洲| 蜜桃精品视频在线| 成人av片在线观看| 欧美日韩国产免费一区二区 | 欧美性受xxxx| 久久夜色精品国产噜噜av| 亚洲色图清纯唯美| 免费成人av资源网| 99热国产精品| 日韩免费一区二区| 中文字幕在线一区免费| 日本人妖一区二区| 成人av在线一区二区| 这里只有精品免费| 1000部国产精品成人观看| 久久精品国产免费看久久精品| 床上的激情91.| 日韩亚洲欧美中文三级| 国产精品免费观看视频| 日本vs亚洲vs韩国一区三区二区 | 久久久五月婷婷| 亚洲一区二区欧美日韩|