What do you mean?
ExplosionOfProjectile.h
class ExplosionOfProjectile
: public QObject,
public Plane
{
//...
private:
std::vector<QOpenGLTexture*> m_textures;
}
class ExplosionOfProjectile : public QObject, public Plane
{
//...
private:
std::vector<QOpenGLTexture*> m_textures;
}
To copy to clipboard, switch view to plain text mode
ExplosionOfProjectile.cpp
void ExplosionOfProjectile::genTextures()
{
QImage image
( ":/Textures/TankSpriteSheet.png" );
image = image.mirrored( false, true );
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 ) );
}
void ExplosionOfProjectile::genTextures()
{
QImage image( ":/Textures/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 ) );
}
To copy to clipboard, switch view to plain text mode
The error on the line: m_textures.push_back( new QOpenGLTexture( frame ) );
Added after 34 minutes:
It was bacause I had mistake. I replace "Texture" on "Textures". But now there is a new crash
I set breakpoing on "update()" method but after "continue" I have crash:
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();
}
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();
}
To copy to clipboard, switch view to plain text mode
https://github.com/8Observer8/Tanks
Bookmarks