C++ (Qt)void ExplosionOfProjectile::genTextures(){ QImage image( ":/Texture/TankSpriteSheet.png" ); image = image.mirrored( false, true ); QImage frame; frame = image.copy( 257, 112, 15, 15 ); m_textures.push_back( new QOpenGLTexture( frame ) ); frame = image.copy( 272, 112, 16, 16 ); m_textures.push_back( new QOpenGLTexture( frame ) ); frame = image.copy( 287, 111, 18, 18 ); m_textures.push_back( new QOpenGLTexture( frame ) );}
C++ (Qt)m_textures.push_back( new QOpenGLTexture( frame ) );
C++ (Qt)void Scene::keyPressEvent( QKeyEvent *event )
C++ (Qt)void Scene::addProjectileExplosion( float x0, float y0 ){ ExplosionOfProjectile *explosion = new ExplosionOfProjectile( &m_program, m_vertexAttr, m_textureAttr, m_textureUniform ); explosion->setX0( x0 ); explosion->setY0( y0 ); connect( explosion, SIGNAL( signalShowProjectileExplosion( int, bool ) ), this, SLOT( slotShowProjectileExplosion( int, bool ) ) ); m_projectileExplosions[explosion->id()] = explosion; explosion->start(); update();}
C++ (Qt)qDebug() << image << frame;
C++ (Qt)QImage image( ":/Textures/TankSpriteSheet.png" );
C++ (Qt)QImage(QSize(400, 256),format=5,depth=32,devicePixelRatio=1,bytesPerLine=1600,byteCount=409600) QImage(QSize(15, 15),format=5,depth=32,devicePixelRatio=1,bytesPerLine=60,byteCount=900)
C++ (Qt)void Scene::addProjectileExplosion( float x0, float y0 ){ makeCurrent(); ExplosionOfProjectile *explosion = new ExplosionOfProjectile( &m_program, m_vertexAttr, m_textureAttr, m_textureUniform ); explosion->setX0( x0 ); explosion->setY0( y0 ); connect( explosion, SIGNAL( signalShowProjectileExplosion( int, bool ) ), this, SLOT( slotShowProjectileExplosion( int, bool ) ) ); m_projectileExplosions[explosion->id()] = explosion; explosion->start(); doneCurrent(); update();}
C++ (Qt) std::vector<QOpenGLTexture*> m_textures; ... frame = image.copy( 257, 112, 15, 15 ); m_textures.push_back( new QOpenGLTexture( frame ) ); frame = image.copy( 272, 112, 16, 16 ); m_textures.push_back( new QOpenGLTexture( frame ) ); frame = image.copy( 287, 111, 18, 18 ); m_textures.push_back( new QOpenGLTexture( frame ) );