Przeglądaj źródła

gpu: give access to the Texture behind a TileSet.

undefined
Sam Hocevar 10 lat temu
rodzic
commit
c29058ac87
3 zmienionych plików z 9 dodań i 3 usunięć
  1. +6
    -1
      src/tileset.cpp
  2. +2
    -1
      src/tileset.h
  3. +1
    -1
      test/btphystest.cpp

+ 6
- 1
src/tileset.cpp Wyświetl plik

@@ -180,11 +180,16 @@ ivec2 TileSet::GetTextureSize() const
return m_data->m_texture_size;
}

ShaderTexture TileSet::GetTexture() const
ShaderTexture TileSet::GetShaderTexture() const
{
return m_data->m_texture->GetTexture();
}

Texture const * TileSet::GetTexture() const
{
return m_data->m_texture;
}

void TileSet::Bind()
{
if (!m_data->m_image && m_data->m_texture)


+ 2
- 1
src/tileset.h Wyświetl plik

@@ -49,7 +49,8 @@ public:
ivec2 GetTileSize(int tileid) const;

ivec2 GetTextureSize() const;
ShaderTexture GetTexture() const;
ShaderTexture GetShaderTexture() const;
Texture const * GetTexture() const;
void Bind();
void Unbind();
void BlitTile(uint32_t id, vec3 pos, int o, vec2 scale, float angle,


+ 1
- 1
test/btphystest.cpp Wyświetl plik

@@ -585,7 +585,7 @@ void BtPhysTest::TickDraw(float seconds)
(1 << VertexUsage::TexCoord) |
(1 << VertexUsage::TexCoordExt)),
m_cat_shader);
m_cat_sdata->m_shader_texture = m_cat_texture->GetTexture();
m_cat_sdata->m_shader_texture = m_cat_texture->GetShaderTexture();
m_cat_sdata->m_sprite_flip = ((rand(2) == 1)?(1.f):(0.f)) / (float)(NB_SPRITE * PARTICLE_SIZE);
PhysObj->SetCustomShaderData(m_cat_sdata);
m_cat_sdata = NULL;


Ładowanie…
Anuluj
Zapisz