コード例 #1
0
ファイル: Game.cpp プロジェクト: SiliGuo/RCC
void Game::record() {
    winLose = getWin();
    Link *temp = p1.getBdFront();
    while (temp != NULL) {
        score.push_back(temp->data);
        temp = temp->LinkPtr;
    }
}
コード例 #2
0
// this uses strings and vectors heavily so it is OK to use 'using'
void WindowManager::setWinParams(TInt winId, const std::string &params) {
    TuringWindow* win = getWin(winId);
    
    std::vector<std::string> items;
    WindowManager::split(items, params, ",");
    
    std::vector<std::string>::const_iterator item = items.begin();
    for (; item != items.end(); ++item) {
        std::vector<std::string> parts;
        split(parts,*item, ":;"); // split by either
        if (parts.size() == 0) TuringCommon::runtimeError("Malformed window format specifier component.");
        
        std::string tagname = parts[0];
        
        if ((tagname.compare("graphics") == 0 || tagname.compare("screen") == 0) &&
            parts.size() == 3) { // graphics:x;y
            int x = atoi(parts[1].c_str());
            int y = atoi(parts[2].c_str());
            if (x < 1 || y < 1) {
                TuringCommon::runtimeError("Tried to create a window with negative or zero size");
            }
            win->Width  = x;
            win->Height = y;
            win->Win.SetSize(x,y);
        } else if (tagname.compare("title") == 0 && parts.size() == 2) { // title:name
            win->Title = parts[1];
        } else if (tagname.compare("offscreenonly") == 0) {
            win->OffScreenOnly = true;
        } else if (tagname.compare("nooffscreenonly") == 0) {
            win->OffScreenOnly = false;
        } else {
            TuringCommon::runtimeError("Don't recognize window option. Might just not be implemented.",true); // true = warn
        }
    }
    
    win->Win.Create(sf::VideoMode(win->Width,win->Height), win->Title,sf::Style::Close,Settings);
    
    //set up OpenGL
    setupOpenGL(win);
//    clearWin(winId);
}
コード例 #3
0
void WindowManager::setCurWin(TInt winId) {
    TuringWindow *win = getWin(winId);
    win->Win.SetActive(true);
    CurWin = winId;
}
コード例 #4
0
void WindowManager::clearWin(TInt winId) {
    TuringWindow *win = getWin(winId);
    win->Win.Clear(sf::Color(255,255,255));
    win->PutLine = 1;
}
コード例 #5
0
void WindowManager::updateWindow(TInt winId, bool force) {
    TuringWindow* win = getWin(winId);
    if (force || !win->OffScreenOnly) {
        doWinUpdate(win);
    }
}
コード例 #6
0
ファイル: reader.c プロジェクト: knusbaum/Wily
rdWin *
getBlankListWin(int user, void *userp)
{
	return getWin(user, userp, rdList);
}
コード例 #7
0
ファイル: reader.c プロジェクト: knusbaum/Wily
rdWin *
getBlankArtWin(int user, void *userp)
{
	return getWin(user, userp, rdArticle);
}