예제 #1
0
void TileSprite::onEnter()
{
    Node::onEnter();
    
    drawBackGround();
    addLable();
}
예제 #2
0
/*!

 */
void
FieldPainter::draw( QPainter & painter )
{
    if ( Options::instance().minimumMode() )
    {
        painter.fillRect( painter.window(),
                          Qt::black );
        return;
    }

    if ( Options::instance().antiAliasing() )
    {
        painter.setRenderHint( QPainter::Antialiasing, false );
    }

    drawBackGround( painter );
    drawLines( painter );
    drawPenaltyAreaLines( painter );
    drawGoalAreaLines( painter );
    drawGoals( painter );
    if ( Options::instance().showFlag() )
    {
        drawFlags( painter );
    }
    if ( Options::instance().gridStep() > 0.0 )
    {
        drawGrid( painter );
    }

    if ( Options::instance().antiAliasing() )
    {
        painter.setRenderHint( QPainter::Antialiasing );
    }
}
예제 #3
0
 void Render::drawDebugPrimitives(float avgFPS)
 {
     clearScreen();
     drawBackGround();
     drawPhysicWorld();
     drawDebugText(avgFPS);
     step();
 }
예제 #4
0
 void Render::draw(void)
 {
     clearScreen();
     drawBackGround();
     drawCharacters();
     drawFurnitures();
     step();
 }
예제 #5
0
 void Render::drawDebug(float avgFPS)
 {
     clearScreen();
     drawBackGround();
     drawCharacters();
     drawFurnitures();
     drawPhysicWorld();
     drawDebugText(avgFPS);
     step();
 }     
예제 #6
0
파일: pathfinder.cpp 프로젝트: ej2xu/cs106b
string loadGraphFile(Graph &graph, Map<coordT> &m) {
	ifstream in;
	promptUserForFile(in);
	InitGraphics();
	string image = drawBackGround(in);
	string token;
	in >> token;
	if (token == "NODES") readNodes(in, graph, m);
	else Error("File format error."); 
	readArcs(in, graph);
	in.close();
	return image;
}
예제 #7
0
void GameMain::draw()
{
	drawBackGround();//背景(昼)描画

	drawMarioLove();//水道描画

	drawGround();//背景(地面)描画
	
	drawPlayer();//プレイヤー描画
	
	drawUI();//UI描画

	//DrawFormatString(0, 0, RGB(0, 0, 0), "playtime : %d", m_playtime);
	//DrawFormatString(0, 0, RGB(0, 0, 0), "P : %d", m_playerPoint);
}
예제 #8
0
ScreenCapture::ScreenCapture(QWidget *parent) :
    QDialog(parent)
{

    setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint );
    setWindowState(Qt::WindowFullScreen);
    setCursor(Qt::CrossCursor);

    sizeDesktop = QApplication::desktop()->size();
    resize(sizeDesktop);

    desktopPixmapBkg = QPixmap::grabWindow(QApplication::desktop()->winId());
    desktopPixmapClr = desktopPixmapBkg;

    move(0, 0);
    drawBackGround();
}
예제 #9
0
	//----------------------------------------------------------------------------
	void GameRadar::update(Flt delta)
	{
		if ( !mMapLoaded )
			return;

		Bool updateDirty = ( mTimeElapse > mUpdateInterval ) ? true: false;

		if ( !updateDirty )
			mTimeElapse += delta;
		else
			mTimeElapse = 0.0f;

		if ( updateDirty )
		{
			drawBackGround();
			drawAllUnit();
		}
	}
예제 #10
0
	//----------------------------------------------------------------------------
	Bool GameRadar::loadMap(Str name, Str path, Vec2 visibleWorldSize, Vec2 worldCenter)
	{
		if ( mWorldMapName == name && 
			mWorldMapGroup == path )
		{
			return true;
		}

		mWorldMapName = name;
		mWorldMapGroup = path;
		mVisibleWorldSize = visibleWorldSize;
		mVisibleWorldCenter = worldCenter;
		mMapLoaded = false;

		IEngineUtil* engUtil = ClientMain::getInstance().getEngine()->engineUtil();
		if ( engUtil )
		{
			if ( engUtil->load2DTexture( mWorldMapName, mWorldMapGroup, mWorldMapGroup ) )
			{
				if ( engUtil->isTextureExist( mapName, mapGroup ) )
				{
					engUtil->unload2DTexture( mapName, mapGroup );
				}

				mMiniMapSize = engUtil->getTextureSize( mWorldMapName, mWorldMapGroup );

				if ( engUtil->create2DTexture( mapName, mapGroup, mMiniMapSize.x, mMiniMapSize.y ) )
				{
					mMapLoaded = true;
				}
			}
		}

		if ( mMapLoaded )
		{
			if ( mListener )
				mListener->onMiniMapLoaded(this);

			//先画一下背景,将UI填满
			drawBackGround();
		}

		return mMapLoaded;
	}
예제 #11
0
RegionSelect::RegionSelect(Config *mainconf, QWidget *parent)
    :QDialog(parent)
{    
    conf = mainconf;

    setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint );
    setWindowState(Qt::WindowFullScreen);
    setCursor(Qt::CrossCursor);

    sizeDesktop = QApplication::desktop()->size();
    resize(sizeDesktop);

    desktopPixmapBkg = QPixmap::grabWindow(QApplication::desktop()->winId());
    desktopPixmapClr = desktopPixmapBkg;

    move(0, 0);
    drawBackGround();

    mainconf = NULL;
    delete mainconf;

}
예제 #12
0
파일: light.cpp 프로젝트: kampone/Sharik
void light::paintGL()
{

   glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);


   stereo cam(  2000.0f,5005.0f,1.3333f, 45.0f,-10*R,200.0f);   // Far Clipping Distance

   cam.ApplyLeftFrustum();
   glColorMask(true, false, false, false);
   glLoadIdentity();
   glBindTexture(GL_TEXTURE_2D, textureID[0]);
   drawBackGround();

   glPopMatrix();
   GLfloat tempMatrix[16];
   glGetFloatv(GL_MODELVIEW_MATRIX,tempMatrix);
   glLoadIdentity();
   GLfloat angle=(sqrt(m_dy*m_dy+m_dx*m_dx)*180.0)/(pi*R);
   glRotatef(angle,m_dy,-m_dx,0.0f);
   glMultMatrixf(tempMatrix);
   glGetFloatv(GL_MODELVIEW_MATRIX,tempMatrix);
   glPushMatrix();
   glLoadIdentity();
   m_x+=m_dx;
   m_y+=m_dy;
   glTranslatef(m_x,m_y,0.0f);
   glMultMatrixf(tempMatrix);
   glBindTexture(GL_TEXTURE_2D, textureID[1]);
   gluQuadricTexture(m_qObj,1);
   gluSphere(m_qObj,R,100,100);

   glClear(GL_DEPTH_BUFFER_BIT) ;

   cam.ApplyRightFrustum();
   glColorMask(false, true, true, false);

   glLoadIdentity();

   glBindTexture(GL_TEXTURE_2D, textureID[0]);
   drawBackGround();
   glPopMatrix();
   glGetFloatv(GL_MODELVIEW_MATRIX,tempMatrix);
   glLoadIdentity();
   glRotatef(angle,m_dy,-m_dx,0.0f);
   glMultMatrixf(tempMatrix);
   glGetFloatv(GL_MODELVIEW_MATRIX,tempMatrix);
   glPushMatrix();
   glLoadIdentity();
   glTranslatef(m_x,m_y,0.0f);
   glMultMatrixf(tempMatrix);
   glBindTexture(GL_TEXTURE_2D, textureID[1]);
   gluQuadricTexture(m_qObj,1);
   gluSphere(m_qObj,R,100,100);
   //drawAxis();

   glColorMask(true, true, true, true);


 //  drawAxis();
   glFlush();
}