亚洲欧美第一页_禁久久精品乱码_粉嫩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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区精品性色超碰 | 久久色成人在线| 亚洲人成网站色在线观看| 精品欧美久久久| 91影视在线播放| 亚洲国产另类av| 精品99久久久久久| 97久久精品人人做人人爽| 欧美va亚洲va香蕉在线| 狠狠狠色丁香婷婷综合激情 | 国内欧美视频一区二区| 亚洲柠檬福利资源导航| 亚洲精品在线三区| 欧美美女网站色| 91影院在线免费观看| 久久精品国产**网站演员| 欧美激情艳妇裸体舞| 色综合一区二区| 国产一区 二区| 五月婷婷色综合| 国产精品成人网| 成人国产精品免费网站| 天天操天天干天天综合网| 成人欧美一区二区三区| 色综合天天综合狠狠| 国产麻豆9l精品三级站| 亚洲国产日韩a在线播放| 久久久99久久| 欧美成人精品福利| 91麻豆精品国产无毒不卡在线观看 | 亚洲国产一区二区视频| 亚洲日本在线视频观看| 精品成人a区在线观看| 在线不卡一区二区| 日韩一级免费一区| 91精品欧美综合在线观看最新| 色婷婷亚洲综合| 91欧美一区二区| 国产91精品一区二区麻豆亚洲| 日韩电影一区二区三区四区| 国产欧美日韩在线视频| 中文字幕在线观看一区二区| 中文字幕日韩一区| 三级欧美在线一区| 国产成人自拍网| 欧美偷拍一区二区| 中文字幕av一区二区三区免费看| 欧美mv和日韩mv的网站| 日韩理论片中文av| 免费高清视频精品| 成人午夜伦理影院| 日韩免费观看高清完整版 | 欧美日韩在线综合| 国产视频一区在线播放| 国产精品美女久久久久久久久 | 91久久国产综合久久| 日韩三级在线免费观看| 自拍偷自拍亚洲精品播放| 青娱乐精品在线视频| av爱爱亚洲一区| 精品区一区二区| 亚洲成人免费视频| 99久久久久久99| 国产亚洲制服色| 男女视频一区二区| 欧美日韩国产大片| 亚洲综合久久久| www.日韩精品| 国产欧美日韩在线观看| 国产一区二区成人久久免费影院| 欧美一区二区三区四区高清| 亚洲成人av在线电影| 91在线视频免费观看| 久久久一区二区| 国产自产v一区二区三区c| 在线成人高清不卡| 日韩电影在线一区二区三区| 欧美人牲a欧美精品| 一区二区三区在线观看欧美| www.综合网.com| 久久久久97国产精华液好用吗| 麻豆一区二区三区| 亚洲精品国产无天堂网2021| 99久久国产综合色|国产精品| 欧美精品tushy高清| 亚洲高清免费观看高清完整版在线观看| 国产另类ts人妖一区二区| 精品国产乱码久久久久久久久| 亚洲成人激情自拍| 欧美亚洲日本国产| 精品美女在线观看| 亚洲成人免费在线| 男人的j进女人的j一区| 亚洲天堂a在线| 日本亚洲三级在线| 国产一区二区三区四| 国产欧美日韩不卡| 亚洲欧美成人一区二区三区| 99re8在线精品视频免费播放| 亚洲男人的天堂av| 91精品国产免费久久综合| 久久国产精品72免费观看| 久久综合色播五月| 成人午夜在线播放| 亚洲一区二区黄色| 欧美男女性生活在线直播观看| 亚洲欧美日韩久久精品| 91精品国产综合久久精品麻豆| 免费观看成人av| 久久久精品免费免费| 国产综合色在线| 亚洲欧美乱综合| 精品免费99久久| 国产mv日韩mv欧美| 亚洲高清免费在线| 欧美一区二区三区视频免费播放 | 激情五月婷婷综合| 国产精品久久午夜| 8x福利精品第一导航| 国产精品自产自拍| 亚洲国产精品久久久久婷婷884| 欧美日韩精品是欧美日韩精品| 久久成人免费网| 一区二区成人在线观看| 久久亚洲私人国产精品va媚药| 97精品国产露脸对白| 蜜桃视频一区二区三区 | 欧美在线制服丝袜| 国产精品国产三级国产普通话三级| 精品国产乱码久久久久久蜜臀| 久久超碰97中文字幕| 日韩视频免费直播| 不卡电影一区二区三区| 欧美精品国产精品| 国内精品国产三级国产a久久| 亚洲一区国产视频| 最新成人av在线| 欧美国产成人精品| 国产性天天综合网| 日韩视频免费观看高清在线视频| 在线精品视频一区二区| 成人动漫一区二区在线| 国产美女精品在线| 精品写真视频在线观看| 五月婷婷综合激情| 一区二区三区在线视频观看58| 欧美电影精品一区二区| 日韩一区二区视频| 日韩三级视频在线看| 91精品国产一区二区三区蜜臀| 欧美色图天堂网| 欧美日韩一级片在线观看| 在线观看亚洲精品| 91在线视频官网| 91在线porny国产在线看| 国产精品18久久久久久久网站| 精品一二三四在线| 国产精品综合一区二区| 久久精品国产澳门| 国产人成亚洲第一网站在线播放| 麻豆国产精品一区二区三区| 久久―日本道色综合久久| 日韩精品免费专区| 欧美韩日一区二区三区| 国产精品一级黄| 亚洲精品视频免费看| 欧美一区二区人人喊爽| 精品国产乱码久久久久久老虎| 久久看人人爽人人| 国产精品久久久一区麻豆最新章节| 久久色在线视频| 欧美日韩国产精品成人| 国产清纯在线一区二区www| 另类小说色综合网站| 日韩黄色免费电影| 一区二区三区中文免费| 中文字幕一区二区三中文字幕| 麻豆精品新av中文字幕| 国产在线精品一区二区| 懂色av一区二区三区蜜臀| 色综合久久88色综合天天6 | 亚洲成av人片www| 美美哒免费高清在线观看视频一区二区| 日韩国产精品久久久| 国产在线一区二区| av电影在线不卡| 91精品国产高清一区二区三区 | 91久久国产综合久久| 欧美久久久久久久久久| 久久久久国色av免费看影院| 亚洲国产精品成人综合色在线婷婷 | 亚洲mv在线观看| 日本欧美肥老太交大片| 国产精品系列在线观看| 91在线丨porny丨国产| 51精品秘密在线观看| 国产精品久久久久影院色老大| 亚洲成av人综合在线观看| 高清不卡在线观看| 欧美四级电影网|