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

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

?? array2d.h

?? 游戲開發(fā)數(shù)據(jù)結(jié)構(gòu)-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黄色激情网站| 欧美国产精品一区二区| 久久久久久毛片| 玉足女爽爽91| 国产自产v一区二区三区c| 日本精品视频一区二区| 日韩精品一区二区三区swag| 亚洲女人****多毛耸耸8| 免费人成黄页网站在线一区二区| 91小视频在线| 2020国产精品自拍| 日本最新不卡在线| a美女胸又www黄视频久久| 日韩午夜小视频| 亚洲综合在线五月| 成人av一区二区三区| 精品国产不卡一区二区三区| 爽爽淫人综合网网站| 色悠悠久久综合| 国产精品免费丝袜| 国内精品久久久久影院薰衣草| 欧美日韩精品一区二区在线播放| 亚洲同性gay激情无套| 成人中文字幕在线| 26uuu精品一区二区| 久久精品久久精品| 欧美一区二区三区性视频| 亚洲小说欧美激情另类| 日本大香伊一区二区三区| 国产精品欧美久久久久无广告| 国产一区二区三区高清播放| 91精品国产麻豆| 日一区二区三区| 欧美喷水一区二区| 国产99久久久久久免费看农村| 亚洲成人你懂的| 亚洲黄色在线视频| 欧美人牲a欧美精品| 色综合天天综合给合国产| 亚洲人成亚洲人成在线观看图片 | 一二三四社区欧美黄| 成人黄色av电影| 欧美日韩国产不卡| 亚洲成av人片一区二区三区| 欧美日韩精品一区视频| 美女视频一区二区| 精品成人在线观看| 丰满亚洲少妇av| 亚洲裸体在线观看| 欧美日韩亚州综合| 麻豆精品蜜桃视频网站| 国产亚洲欧美激情| 色婷婷狠狠综合| 日本视频中文字幕一区二区三区| 日韩亚洲欧美一区| 成人丝袜18视频在线观看| 亚洲丝袜另类动漫二区| 欧美精品粉嫩高潮一区二区| 中文字幕中文在线不卡住| 亚洲国产成人av网| 另类的小说在线视频另类成人小视频在线| 自拍偷自拍亚洲精品播放| 久久激情综合网| 日本在线不卡一区| 日韩中文欧美在线| 久久久久久夜精品精品免费| 国产视频一区不卡| 亚洲制服丝袜在线| 精品一区二区久久| 欧美日韩中文国产| 国产网站一区二区| 午夜精品视频一区| av在线播放一区二区三区| 日韩亚洲国产中文字幕欧美| 中文字幕中文字幕一区二区| 成人激情免费电影网址| 在线观看亚洲a| 亚洲色图19p| 成人一区在线观看| 久久亚洲综合色一区二区三区| 日韩不卡一区二区三区| 在线这里只有精品| 一区二区三区小说| youjizz久久| 亚洲精品视频在线看| 91丨porny丨最新| 日韩在线一区二区三区| 91精品国产综合久久福利| 老司机精品视频一区二区三区| 欧美经典一区二区| 欧美日韩在线精品一区二区三区激情| 国产成人免费在线观看| 国产一级精品在线| 日本一区二区三区四区| 国产一区福利在线| 欧美午夜免费电影| 午夜视频在线观看一区二区| 日韩女优电影在线观看| 色94色欧美sute亚洲13| 欧美日韩高清一区二区不卡| 日本韩国一区二区| 中文字幕在线观看一区| 亚洲精品一区二区三区在线观看 | 欧美国产精品劲爆| 在线不卡欧美精品一区二区三区| 99久久er热在这里只有精品66| 韩国中文字幕2020精品| 久久99最新地址| 国产一区视频导航| 日本一区二区三区国色天香 | 亚洲免费电影在线| 日本韩国一区二区| 色哟哟亚洲精品| 韩日精品视频一区| 欧美影院一区二区三区| caoporn国产精品| 国产91精品欧美| 国产a精品视频| 成人激情免费网站| 成人丝袜18视频在线观看| 成人午夜私人影院| 国产.欧美.日韩| 成人黄色软件下载| 色婷婷av一区二区三区大白胸 | 久久久久久久久久久久电影 | 激情伊人五月天久久综合| 美洲天堂一区二卡三卡四卡视频 | 亚洲一区二区精品视频| 亚洲一区二区三区四区在线免费观看| 亚洲精品视频观看| 亚洲一区二区三区三| 天天影视网天天综合色在线播放 | 亚洲成人在线网站| 日韩黄色在线观看| 国产精品一区免费视频| 不卡一区二区在线| 欧美三级三级三级爽爽爽| 日韩午夜在线影院| 国产精品高潮呻吟久久| 亚洲国产综合91精品麻豆 | 午夜视频久久久久久| 青青草成人在线观看| 国产91高潮流白浆在线麻豆 | 国产精品小仙女| 99精品一区二区| 欧美一区二区三区四区久久| 国产欧美一区二区精品婷婷| 亚洲欧美日韩中文播放| 同产精品九九九| 国产宾馆实践打屁股91| 色丁香久综合在线久综合在线观看| 91精品蜜臀在线一区尤物| 久久精品人人爽人人爽| 亚洲午夜精品17c| 国产高清不卡一区二区| 欧美优质美女网站| 久久久无码精品亚洲日韩按摩| 一区二区三区中文字幕| 国产在线不卡一卡二卡三卡四卡| 99re这里只有精品首页| 欧美成人一区二区三区在线观看| 国产精品情趣视频| 久久国内精品视频| 欧美性生交片4| 国产精品美女久久久久久久久久久| 亚洲第一av色| 色偷偷一区二区三区| 2017欧美狠狠色| 蜜臀久久99精品久久久久宅男| av在线免费不卡| 国产三级精品视频| 免费人成黄页网站在线一区二区| 色综合天天综合网天天狠天天| 久久亚洲综合色| 男女男精品网站| 欧美日韩久久久久久| 亚洲视频综合在线| 国产91清纯白嫩初高中在线观看| 欧美一区二区三区在线电影| 亚洲国产综合人成综合网站| 91麻豆国产福利精品| 国产欧美精品一区二区色综合| 美女一区二区三区| 欧美精品粉嫩高潮一区二区| 一区二区三区欧美日韩| 99re这里都是精品| 国产欧美日本一区视频| 精品一区二区三区免费| 欧美精品久久久久久久多人混战| 亚洲日本va午夜在线影院| 成人午夜免费av| 亚洲国产精华液网站w| 国产乱码精品一区二区三区av| 日韩免费观看高清完整版在线观看| 亚洲一区二区三区视频在线播放 | 亚洲不卡一区二区三区| 91黄视频在线| 亚洲最大的成人av| 欧美日韩精品电影| 日韩国产在线一|