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

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

?? ascscrn.cpp

?? 使用BorlandC++4.5編譯的一個MUD客戶端程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
        if (0 == _CallScrollFunc(top,bottom,amount))
            _Invalidate(Pos(0,top), Size(Width(),bottom-top+1));
    };
}

// _IsOnScreen - returns 0 if pos is off the screen!
int AsciiScreen::IsOnScreen(const Pos & pos) const
{
    return ((pos.X() >= 0)
            && (pos.X() < Width())
            && (pos.Y() >= 0)
            && (pos.Y() < Height()));
}


// ------------------------------------------------------------------------
// _AnsiColor - Modify the text attributes
//
void AsciiScreen::_AnsiColor(const EscapeSequence & esc)
{
    int update_color = 0; // Set to 1 if color changes
    
    if (esc.ParameterCount() == 0)  // Clear attributes?
    {
        _useAnsiColor = 0;
        _cursorIsBold = 0;
        update_color = 1;
    }
    else
    {
        for (int i=0; i < esc.ParameterCount(); i++)
        {
            int attr = esc.Parameter(i);
            if (EscapeSequence::CLEAR_ATTR == attr)
            {
                _cursorIsBold = 0;
                update_color = 1;
            }
            else if (EscapeSequence::BOLD == attr)
            {
                _cursorIsBold = 1;
                update_color = 1;
            }
            else if (attr >= 30 && attr <= 37) // Foreground color!
            {
                _useAnsiColor = 1;
                _cursorAnsiColor = attr - 30;
                update_color = 1;
            }
            else if (attr >= 40 && attr <= 47) // Background color!
            {
                ; // Not implemented yet!
            };
            // Other attributes not implemented
        };
    };

    // If color has changed, update the current color
    if (update_color)
    {
        if (_useAnsiColor)
        {
            _cursorForeground = _LookupAnsiColor(_cursorIsBold,
                                                 _cursorAnsiColor);;
        }
        else if (_cursorIsBold)
            _cursorForeground = _boldForeground;
        else
            _cursorForeground = _normalForeground;
    };
}

// _BackSpace - move backwards a space, but not beyond the beginning of
//   the line
void AsciiScreen::_BackSpace()
{
    if (_cursor.X() > 0)
    {
        _cursor.X() -= 1;
        _Invalidate(_cursor, Size(2,1));
    };
}

// _CopyRow - copies row from source to target
//
// This is mainly a Scroll helper function
//
void AsciiScreen::_CopyRow(int target_row, int source_row)
{
    ASSERT(target_row >= 0 && target_row < Height(), "Row off screen?");
    ASSERT(source_row >= 0 && source_row < Height(), "Row off screen?");

    if (source_row == target_row)
        return;
    
    void * target = &_TextElement(Pos(0,target_row));
    const void * source = &_TextElement(Pos(0,source_row));
    memcpy(target, source, Width() * sizeof(char));

    // Move color info now (cross your fingers!)
    Pos source_pos(0,source_row);
    Pos target_pos(0,target_row);
    for (int i = 0; i < Width(); i++)
    {
        _ForegroundElement(target_pos) = _ForegroundElement(source_pos);
        source_pos.X() += 1;
        target_pos.X() += 1;
    };

}

// _ClearRows - quick and dirty
//
void AsciiScreen::_ClearRows(int top, int bottom)
{
    for (int i=top; i <= bottom; i++)
        _ClearRow(i);
}

// ClearRow - clears row to spaces and sets it to the current color!
void AsciiScreen::_ClearRow(int row)
{
    ASSERT(row >= 0 && row < Height(), "Row must be on screen");

    _Invalidate(Pos(0,row), Size(Width(),1));
    
    // Just set the row to all spaces
    memset(&_TextElement(Pos(0,row)), ' ', (Width() * sizeof(char)));

    int start = (row * Width());
    int end = start + Width();
    for (int i = start; i < end; i++)
    {
        ASSERT(i < (Width() * Height()), "Index past end of array?");
        ASSERT(i >= 0, "Negative array index not allowed");
        
        _foreground[i] = _cursorForeground;
    };
}

void AsciiScreen::_ClearScreen()
{
    // Initialize screen memory
    memset(_text, (int)' ', (Width() * Height() * sizeof(char)));

    // Initialize all screen colors
    for (int i=0; i < (Width() * Height()); i++)
        _foreground[i] = _cursorForeground;

    _Invalidate(Pos(0,0), Size(Width(),Height()));
}

void AsciiScreen::_ClearToEOL()
{
    int width = Width() - _cursor.X();
    memset(&_TextElement(_cursor), ' ', width * sizeof(char));

    _Invalidate(_cursor, Size(width,1));

    // Set Color
    int start = ((_cursor.Y() * Width()) + _cursor.X()) - 1;
    int end = ((_cursor.Y() + 1) * Width()) - 1;
    ASSERT(end < (Width() * Height()), "Index past end of array?");
    ASSERT(end >= 0, "Negative array index?");
    
    for (int i = start; i < end; i++)
        _foreground[i] = _cursorForeground;

}

void AsciiScreen::_EscapeSequence(EscapeSequence & esc)
{
    // We are assuming that the sequence is comeplete, etc.
    //
    // Note that screen locations are 1-indexed in the escape sequences,
    // so there's lots of "subtract one" here.
    switch (esc.Type())
    {
      case EscapeSequence::CMOVE:
        {
            Pos new_pos(esc.Parameter(1) - 1,  // Column
                        esc.Parameter(0) - 1); // Row

            if (IsOnScreen(new_pos)) // Ignore if off screen
            {
                _Invalidate(_cursor, Size(1,1));
                _cursor = new_pos;
                _Invalidate(_cursor, Size(1,1));
            };
        };
        break;
        
      case EscapeSequence::SCROLL: // Set scroll region
        _scrollRegionTop = esc.Parameter(0) - 1;
        _scrollRegionBottom = esc.Parameter(1) - 1;

        // Make sure the scroll region is on screen
        if (_scrollRegionTop < 0)
            _scrollRegionTop = 0;
        else if (_scrollRegionTop >= Height())
            _scrollRegionTop = Height() - 1;

        if (_scrollRegionBottom < 0)
            _scrollRegionBottom = 0;
        else if (_scrollRegionBottom >= Height())
            _scrollRegionBottom = Height() - 1;

        if (_scrollRegionBottom < _scrollRegionTop)
            _scrollRegionBottom = _scrollRegionTop;
        
        break;
        
      case EscapeSequence::REV_NEWLINE: // Scroll current region back one
        _ReverseNewLine();
        break;    
  
      case EscapeSequence::CLRSCR:
        _ClearScreen();
        _cursor.X() = 0;
        _cursor.Y() = 0;
        break;
        
      case EscapeSequence::CLREOL:
        _ClearToEOL();
        break;
        
      case EscapeSequence::ANSI_COLOR:
        _AnsiColor(esc);
        break;
        
      case EscapeSequence::UNKNOWN: // Unrecoginzed by parser
      case EscapeSequence::NONE:   // Error, not parsed correctly
      default:
        ASSERT(0, "Unexpected escape sequence");
        break; // Not reached
    };
}

// _IncrementPos - move cursor one space
//
// This automatically wraps the cursor if at eol, and scrolls the screen
// if it is the last point on the screen
void AsciiScreen::_IncrementPos()
{
    if ((_cursor.X() + 1) >= Width())
    {
        _Invalidate(_cursor, Size(1,1));
        _NewLine();
        _Invalidate(_cursor, Size(1,1)); 
    }
    else
    {
        _Invalidate(_cursor, Size(2,1)); // Invalidate two spaces
        _cursor.X() += 1;
    };
}

void AsciiScreen::_ReverseNewLine()
{
    _cursor.X() = 0;      // Wrap X of cursor

    // Either wrap Y or scroll
    if ((_cursor.Y() - 1) < _scrollRegionTop) // Need to scroll?
        _ScrollCurrentRegion(-1);
    else
        _cursor.Y() -= 1;
    
    ASSERT(IsOnScreen(_cursor), "Logic error moved cursor off screen");
}

// ------------------------------------------------------------------
// _CarriageReturn - cursor to column 0, no line feed.
//
void AsciiScreen::_CarriageReturn()
{
    if (0 != _cursor.X()) // Don't bother if already at col 0
    {
        _Invalidate(_cursor, Size(1,1)); // Invalidate old pos
        _cursor.X() = 0;
        _Invalidate(_cursor, Size(1,1)); // Invalidate new pos
    };
}

// ------------------------------------------------------------------
// _NewLine - wrap cursor
//
void AsciiScreen::_NewLine(int count)
{
    _cursor.X() = 0;      // Wrap X of cursor
    int scroll_count = 0; // Amount to scroll current screen

    while (count)
    {
        -- count;
        // Either wrap Y or scroll
        if (_cursor.Y() >= _scrollRegionBottom) // Need to scroll?
            ++ scroll_count;
        else
            _cursor.Y() += 1;
    };
    if (0 < scroll_count)
        _ScrollCurrentRegion(scroll_count);
    
    ASSERT(IsOnScreen(_cursor), "Cursor moved past bottom of screen");
}

// EOF //

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看亚洲a| 色94色欧美sute亚洲线路一久 | 久久久精品日韩欧美| 欧美一区二区三区白人| 91精品国产91久久久久久最新毛片 | 欧美日韩五月天| 色欧美片视频在线观看在线视频| av不卡在线播放| 一本色道久久综合亚洲精品按摩| 91社区在线播放| 欧美久久久久久蜜桃| 欧美一区二区三区人| 26uuu久久综合| 成人免费在线播放视频| 亚洲乱码中文字幕| 五月婷婷久久丁香| 蜜桃久久av一区| 国产电影一区二区三区| a级精品国产片在线观看| 色噜噜久久综合| 欧美一区二区三区四区视频| 日韩欧美国产综合一区| 国产片一区二区| 亚洲午夜日本在线观看| 国产一区二区三区黄视频 | 国产亚洲一本大道中文在线| 国产午夜精品理论片a级大结局| 国产精品色噜噜| 亚洲国产va精品久久久不卡综合| 伦理电影国产精品| 色综合夜色一区| 日韩女优视频免费观看| 国产精品国模大尺度视频| 樱花草国产18久久久久| 久久成人羞羞网站| 91麻豆蜜桃一区二区三区| 欧美一级高清片在线观看| 国产午夜精品久久| 日日嗨av一区二区三区四区| 丁香婷婷综合激情五月色| 欧美午夜精品一区二区三区| 26uuuu精品一区二区| 亚洲精品成人少妇| 国产精品456| 91精品国产综合久久久久久| 欧美国产1区2区| 免费看日韩精品| 91女人视频在线观看| 久久九九久久九九| 日本成人超碰在线观看| 91成人国产精品| 国产人久久人人人人爽| 免费观看在线色综合| 色欧美片视频在线观看在线视频| 国产亚洲精品bt天堂精选| 视频一区欧美日韩| 色噜噜夜夜夜综合网| 国产精品萝li| 国产一区二区三区综合| 日韩视频一区二区三区| 亚洲国产精品久久艾草纯爱| 成人免费视频视频在线观看免费 | 高清不卡在线观看av| 91麻豆精品国产无毒不卡在线观看 | 成人免费在线播放视频| 国产东北露脸精品视频| 精品国产sm最大网站| 青青草国产精品97视觉盛宴| 欧美午夜精品一区二区蜜桃| 亚洲情趣在线观看| 色综合一区二区三区| 国产精品电影一区二区| 成人黄色片在线观看| 国产亚洲精品资源在线26u| 国产酒店精品激情| 国产亚洲制服色| 丁香亚洲综合激情啪啪综合| 欧美成人vr18sexvr| 久久99精品国产麻豆婷婷| 欧美一区二区美女| 蓝色福利精品导航| 欧美精品一区二区久久婷婷| 国产在线播精品第三| 国产欧美日韩激情| 风间由美性色一区二区三区| 亚洲国产成人自拍| 色哟哟一区二区三区| 亚洲免费三区一区二区| 欧美日韩激情一区| 国产中文一区二区三区| 欧美极品xxx| 色乱码一区二区三区88| 午夜欧美2019年伦理| 欧美一区二区三区在线| 久久99热狠狠色一区二区| 国产蜜臀av在线一区二区三区| 7878成人国产在线观看| 蜜臀av一区二区在线观看| 精品88久久久久88久久久| 国产91色综合久久免费分享| 亚洲女女做受ⅹxx高潮| 91精品免费在线| 国产成a人亚洲| 一区二区三区四区在线播放| 日韩一级完整毛片| 成人激情免费电影网址| 亚洲大片一区二区三区| 久久亚洲二区三区| 在线观看一区日韩| 国产精品性做久久久久久| 亚洲视频香蕉人妖| 日韩欧美中文一区| 91蜜桃网址入口| 免费欧美在线视频| 亚洲欧美日韩国产手机在线| 91精品国产综合久久精品| 成人一区二区三区视频 | 狠狠色综合色综合网络| 亚洲图片激情小说| www久久精品| 欧美色图在线观看| 成人午夜视频网站| 麻豆传媒一区二区三区| 亚洲一区二区av在线| 久久看人人爽人人| 日韩欧美综合一区| 欧美四级电影在线观看| av中文字幕不卡| 国产麻豆成人传媒免费观看| 天堂va蜜桃一区二区三区漫画版| 国产精品国产三级国产专播品爱网 | 午夜久久久久久| 综合自拍亚洲综合图不卡区| 欧美tickling挠脚心丨vk| 色狠狠综合天天综合综合| 国产一区二区三区免费看| 亚洲国产日韩a在线播放| 亚洲欧洲精品一区二区三区| 2024国产精品| 精品欧美久久久| 91麻豆精品国产91久久久久久| 91麻豆国产在线观看| 成人激情av网| 成人app网站| 成人av电影在线| 成人免费观看男女羞羞视频| 国产一区欧美日韩| 国产制服丝袜一区| 国产精品综合二区| 国产精品一区二区x88av| 国产一区二区h| 国产精品主播直播| 国产精品12区| 懂色av噜噜一区二区三区av| 国产成人亚洲综合色影视| 激情五月婷婷综合| 国产精品伊人色| aaa亚洲精品一二三区| 91热门视频在线观看| 96av麻豆蜜桃一区二区| 91蝌蚪porny九色| 欧美最猛黑人xxxxx猛交| 欧美色偷偷大香| 欧美一区欧美二区| 日韩免费电影网站| 国产亚洲一区二区三区在线观看| 国产欧美精品一区| 亚洲人成人一区二区在线观看 | 久久se这里有精品| 成人精品国产免费网站| av动漫一区二区| 欧美性淫爽ww久久久久无| 欧美男男青年gay1069videost| 日韩欧美一区二区久久婷婷| 国产午夜三级一区二区三| 亚洲精品免费在线| 喷水一区二区三区| 国产69精品久久777的优势| 99视频一区二区| 欧美精品在线观看一区二区| 欧美大片在线观看一区二区| 亚洲国产成人在线| 日韩一区精品视频| 成人高清伦理免费影院在线观看| 91极品视觉盛宴| 久久蜜桃av一区二区天堂 | 欧美va在线播放| 国产精品国产馆在线真实露脸| 亚洲高清在线精品| 成人中文字幕电影| 欧美精品日韩精品| 国产精品久久久久久久久动漫| 午夜精彩视频在线观看不卡| 国产一区不卡精品| 欧美群妇大交群的观看方式| 欧美国产激情二区三区| 日本中文字幕一区二区视频| av一区二区三区黑人| 2023国产精华国产精品| 亚洲成人一二三|