示例#1
0
void CStarCrosshairs::fn2(CVideoSurface *surface, CStarField *starField, CStarMarkers *markers) {
	if (_matchIndex <= -1) {
		if (_entryIndex > -1) {
			drawEntry(_entryIndex, surface, starField, markers);
			--_entryIndex;
		}
	} else {
		--_matchIndex;
		if (_entryIndex - _matchIndex > 1) {
			drawEntry(_entryIndex, surface, starField, markers);
			--_entryIndex;
		}
	}
}
示例#2
0
void 
ShellContent::draw() { 

	if ( _console ) { 
		string s;
		_prompt = _console->prompt();
		while ( _console->has_output() ) { 
			_console->get_output(s);
			output( s );
		}
	}

    _fixCanvas();
    _fixView();

    bool blending = ( WindowManager::getRenderMode() == WINDOW_RENDER_BLEND );
             
    glPushMatrix();
       
    glPushMatrix();
    _viewport.setCols( UI_BASE, Color4D( 1.0,1.0,1.0, 0.8 ), Color4D(0.2, 0.5, 0.2, 0.8 ) );
    _viewport.viewTranslate();
    
    if ( blending ) _viewport.filledQuad();
    glPopMatrix();
    
    _viewport.scale();
    _viewport.viewTranslate();

    glColor4dv( _fontColor.data() );
    glLineWidth (2.0);

    glLineWidth ( _fontWeight );

    //translate to bottom to draw our input line
    glTranslated ( 0, - _viewport.vpH() + _leading * 0.333, 0 );

    //rogue colors!
    if ( blending ) { 
        glColor4d( 1.0,1.0,0.9,1.0);

        glBegin (GL_QUADS);
        glVertex2d (0.0, 0.0  );
        glVertex2d (0.0, _leading  );
        glVertex2d ( _viewport.vpW(), _leading  );
        glVertex2d ( _viewport.vpW(), 0.0  );
        glEnd();
    }
    //draw current entry
    
	drawEntry();

    if ( !_output->empty() ) { 
        int range = min ( _output->nlines(), 8 );
        glColor4dv( _fontColor.data() );
        glTranslated( 0, _leading * ( range ) , 0 );
        for ( t_CKUINT i = _output->nlines()-range ; i < _output->nlines() ; i++ ) { 
            glTranslated ( 0, -_leading, 0 );
            glPushMatrix();
            bufferFont->scale ( _fontScale, _fontAspect );
            bufferFont->draw_sub( _output->line(i).str() );
            glPopMatrix();
        }
    }

    glPopMatrix();

}