亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
午夜久久久久久| 亚洲日本成人在线观看| 欧美一区二区福利视频| 欧美色图免费看| 欧美写真视频网站| 在线观看欧美日本| 欧美三级电影精品| 欧美日韩亚洲综合在线| 欧美图区在线视频| 在线观看一区日韩| 欧美专区日韩专区| 日本精品免费观看高清观看| 成人教育av在线| 国产在线视频精品一区| 日韩成人dvd| 一个色在线综合| 亚洲色图一区二区| 国产精品女主播av| 中文字幕欧美日韩一区| 亚洲精品在线一区二区| 日韩欧美专区在线| 777a∨成人精品桃花网| 久久精品在线观看| 欧美一级免费观看| 亚洲影视资源网| 久久久国产一区二区三区四区小说 | 尤物视频一区二区| 亚洲欧美色图小说| 亚洲国产va精品久久久不卡综合| 午夜久久久影院| 精品一区二区三区在线观看 | 欧美一区二区三区影视| 久久影音资源网| 中文字幕中文乱码欧美一区二区| 中文字幕欧美一| 亚州成人在线电影| 久久国产精品99久久人人澡| 成人午夜视频在线观看| 欧美午夜电影网| 日韩精品一区二区在线| 中文字幕欧美日韩一区| 26uuu亚洲| 久久久欧美精品sm网站| 欧美三级在线看| 欧美电影免费提供在线观看| 国产女主播一区| 激情五月播播久久久精品| 成人网在线播放| 欧美区一区二区三区| 久久在线免费观看| 一级特黄大欧美久久久| 狠狠狠色丁香婷婷综合久久五月| 99久久综合99久久综合网站| 欧美一区欧美二区| 国产精品丝袜一区| 日韩国产欧美视频| thepron国产精品| 欧美一区二区精美| ...xxx性欧美| 精品一区二区影视| 欧美午夜片在线看| 国产欧美一区二区三区沐欲| 视频一区二区三区入口| 99久久精品免费精品国产| 欧美一区二区三区四区在线观看| 中文成人综合网| 日韩高清在线不卡| 91一区二区在线| 91精品久久久久久蜜臀| 五月天激情小说综合| 成人自拍视频在线观看| 国产精品一卡二| 欧美久久久久久久久中文字幕| 欧美国产一区在线| 免费成人在线播放| 色999日韩国产欧美一区二区| 国产亚洲欧美日韩俺去了| 午夜精品免费在线| 91蝌蚪porny九色| 久久精品日韩一区二区三区| 日本欧美一区二区三区乱码| 91女厕偷拍女厕偷拍高清| 2017欧美狠狠色| 日本美女一区二区| 91国产丝袜在线播放| 国产精品麻豆欧美日韩ww| 九九热在线视频观看这里只有精品| 欧美性大战xxxxx久久久| 中文字幕亚洲一区二区av在线 | 亚洲欧洲性图库| 久久91精品国产91久久小草| 欧美日韩一区精品| 亚洲一区二区三区激情| 92国产精品观看| 人人狠狠综合久久亚洲| 欧美日韩国产综合一区二区| 蜜臀av性久久久久av蜜臀妖精 | 91高清在线观看| 久久久五月婷婷| 丝袜亚洲另类欧美综合| www.av亚洲| 国产亚洲精品aa午夜观看| 日韩欧美色综合网站| 亚洲一区二区三区中文字幕| 成人福利视频在线看| 久久精品在这里| 成人性生交大合| 国产精品亲子乱子伦xxxx裸| 成人免费视频视频在线观看免费| 久久久www成人免费无遮挡大片| 美女国产一区二区三区| 日韩欧美国产小视频| 久久99精品久久久久久动态图| 欧美一级xxx| 麻豆国产精品一区二区三区| 欧美精品一区二区三区视频| 国产一区二区久久| 国产欧美日韩在线视频| av在线这里只有精品| 国产精品理伦片| 色偷偷久久一区二区三区| 夜夜精品视频一区二区| 色婷婷久久一区二区三区麻豆| 国内精品久久久久影院一蜜桃| 国产一区二区三区免费播放| 色婷婷精品大视频在线蜜桃视频| 亚洲色图第一区| 欧美最新大片在线看| 日本不卡1234视频| 精品国产一区二区在线观看| 国产激情一区二区三区四区| 国产精品初高中害羞小美女文| 色综合天天综合给合国产| 亚洲成人www| 精品免费视频.| 成人性色生活片| 一区二区三区欧美在线观看| 欧美一区二区在线观看| 国产盗摄精品一区二区三区在线| 国产精品伦理在线| 欧美日韩一级二级| 亚洲综合清纯丝袜自拍| 国产一区二区三区在线观看免费 | 午夜精品久久久久久久久久| 91麻豆精品国产无毒不卡在线观看 | 午夜精品成人在线| 欧美一区二区三区电影| 蜜臀久久99精品久久久久宅男| 亚洲国产精品视频| 亚洲欧美日韩人成在线播放| 欧美久久久久久久久久| 国产毛片一区二区| 亚洲综合激情网| 欧美成人乱码一区二区三区| k8久久久一区二区三区| 日韩高清电影一区| 国产精品成人午夜| 3atv在线一区二区三区| 成人丝袜高跟foot| 天堂va蜜桃一区二区三区漫画版| 精品国产青草久久久久福利| 91同城在线观看| 久久99精品久久久久久久久久久久| 亚洲免费在线观看| xnxx国产精品| 欧美日韩精品系列| 成人午夜激情视频| 蜜臀久久99精品久久久久久9| 亚洲视频一区二区免费在线观看| 日韩精品一区二区三区在线| 91极品美女在线| 国内成人精品2018免费看| 亚洲一区二区偷拍精品| 久久精品欧美一区二区三区麻豆| 欧美日韩国产另类不卡| 99久久精品国产精品久久| 久久爱www久久做| 一区二区日韩av| 日本一区二区成人| 精品久久久久久久人人人人传媒| 欧美性生活久久| 亚洲二区视频在线| 欧美亚洲一区二区三区四区| 国产日韩欧美亚洲| 成人高清免费观看| 欧美一区二区三区在线观看视频| 91麻豆福利精品推荐| 国产精品亚洲一区二区三区在线| 视频在线在亚洲| 亚洲精品视频免费看| 欧美国产精品一区二区| 久久综合视频网| 91精品国产高清一区二区三区| 91国偷自产一区二区使用方法| 丁香五精品蜜臀久久久久99网站| 久久国产成人午夜av影院| 日产国产高清一区二区三区| 亚洲成a人片在线不卡一二三区| 亚洲日本一区二区| 国产精品成人一区二区三区夜夜夜|