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

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

?? array2d.h

?? 模擬游戲中人的行走
?? 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一区二区三区免费野_久草精品视频
午夜视频一区二区| 成人国产精品免费观看动漫| 69精品人人人人| 久久精品国产一区二区| 国产精品久久免费看| 欧美影视一区在线| 久久99久久99| 一区二区三区在线播放| 久久女同精品一区二区| 91在线视频播放地址| 麻豆精品视频在线观看视频| 国产精品色婷婷久久58| 欧美日韩日日夜夜| av不卡免费电影| 极品美女销魂一区二区三区| 亚洲mv在线观看| 亚洲人成网站精品片在线观看 | 亚洲男女一区二区三区| 精品久久人人做人人爰| 欧美日韩一区二区不卡| 在线视频一区二区免费| 国产毛片精品国产一区二区三区| 亚洲激情自拍偷拍| 亚洲国产高清aⅴ视频| 久久久久久久久久美女| 日韩欧美一区二区三区在线| 在线不卡的av| 在线播放日韩导航| 51精品久久久久久久蜜臀| 欧美日韩在线播放三区| 欧美日韩一区二区三区四区五区 | 免费成人小视频| 另类人妖一区二区av| 男女性色大片免费观看一区二区| 日韩精品1区2区3区| 婷婷中文字幕综合| 免费高清成人在线| 国产在线视频一区二区三区| 国产精品资源在线| 99re8在线精品视频免费播放| 91精品福利视频| 7777精品伊人久久久大香线蕉| 欧美一级二级三级蜜桃| 久久综合色之久久综合| 日韩毛片精品高清免费| 亚洲国产精品欧美一二99| 日韩成人av影视| 国产成人精品免费一区二区| 日本精品视频一区二区三区| 欧美三级在线视频| 中文字幕乱码久久午夜不卡 | 在线观看日韩电影| 精品卡一卡二卡三卡四在线| 亚洲欧美日韩中文播放| 久久爱www久久做| 欧美午夜在线观看| 欧美国产综合一区二区| 日韩av电影免费观看高清完整版| 国产白丝精品91爽爽久久| 欧美一区二区三区思思人| 国产精品卡一卡二| 国产精品99久久久久久久vr| 911精品国产一区二区在线| 国产精品国产三级国产三级人妇 | 99国内精品久久| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 国产亚洲欧美日韩在线一区| 五月激情六月综合| 欧美中文字幕亚洲一区二区va在线 | 午夜电影网亚洲视频| 91精品办公室少妇高潮对白| 国产精品进线69影院| 国产成人aaa| 国产精品免费免费| 成人av网在线| 亚洲一区二区精品3399| 欧美日韩精品久久久| 免费的国产精品| 久久综合久久久久88| 国产精品白丝av| 成人免费在线视频| 91免费版pro下载短视频| 亚洲激情图片qvod| 欧美日韩国产一级| 精品一区二区三区免费播放| 久久女同精品一区二区| 91官网在线观看| 久久99久久99小草精品免视看| 国产v日产∨综合v精品视频| 无码av免费一区二区三区试看| 成人免费视频视频在线观看免费| 日韩精品一区二区三区蜜臀 | 国v精品久久久网| 一区二区在线观看av| 日韩欧美在线网站| 成人性色生活片| 免费黄网站欧美| 亚洲精品成人在线| 久久精品在线免费观看| 精品视频在线免费观看| hitomi一区二区三区精品| 男男视频亚洲欧美| 亚洲综合色婷婷| 国产精品久久久久aaaa| 久久久亚洲精品一区二区三区| 欧洲精品一区二区三区在线观看| 久久99九九99精品| 性做久久久久久久免费看| 国产精品久久精品日日| 精品三级在线观看| 国产精品欧美一区二区三区| 日韩一二三区不卡| 日韩欧美国产一区二区三区| 欧美视频在线一区| 欧美天堂亚洲电影院在线播放| 91蜜桃传媒精品久久久一区二区| 懂色av一区二区三区免费看| 国产91精品欧美| 99久久综合色| 欧美影院午夜播放| 欧美中文字幕久久| 欧美精品亚洲一区二区在线播放| 欧美性感一区二区三区| 欧美日韩国产免费| 日韩欧美第一区| 国产欧美日韩综合| 1区2区3区国产精品| 亚洲成人综合视频| 激情综合色播五月| 成人免费福利片| 欧美精品少妇一区二区三区 | 在线播放中文字幕一区| 久久亚洲二区三区| 一区二区三区欧美亚洲| 韩国三级电影一区二区| 99久久伊人精品| 精品人在线二区三区| 亚洲欧洲日产国码二区| 精品在线一区二区三区| 91激情在线视频| 欧美国产激情一区二区三区蜜月| 亚洲乱码国产乱码精品精的特点 | 亚洲最新视频在线播放| 久久精品男人天堂av| 日韩国产在线观看| 五月天激情小说综合| 久久99国产精品麻豆| 国产69精品久久777的优势| 顶级嫩模精品视频在线看| 91免费观看视频| 日韩一区二区影院| √…a在线天堂一区| 天天操天天干天天综合网| 极品少妇一区二区三区精品视频| 成人一区二区三区视频在线观看| 色噜噜狠狠色综合中国| 日韩精品中文字幕一区二区三区| 中文字幕一区二区在线观看| 日韩影视精彩在线| 99精品一区二区三区| 日韩免费福利电影在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 久久久综合网站| 亚洲综合另类小说| 成人在线一区二区三区| 欧美美女喷水视频| 国产欧美日韩精品一区| 日韩福利电影在线| 91久久精品一区二区三区| 久久亚洲综合色| 午夜久久久久久电影| av高清久久久| 欧美mv日韩mv国产网站| 午夜一区二区三区视频| 成人精品一区二区三区中文字幕| 欧美一区二区精品在线| 一区二区三区在线观看国产| 不卡的av网站| 久久精品一区二区| 麻豆视频一区二区| 欧美亚洲综合色| ...av二区三区久久精品| 国产综合一区二区| 日韩一区二区在线看| 亚洲第一av色| 欧美色手机在线观看| 日韩美女视频一区| av高清久久久| 国产精品妹子av| 国产1区2区3区精品美女| 精品国产污网站| 免费视频一区二区| 91精品一区二区三区久久久久久| 亚洲精品精品亚洲| 91麻豆国产精品久久| 中文字幕日韩精品一区| 国产成人av电影在线| 国产丝袜在线精品| 国产伦精一区二区三区| 久久久久久一级片|