Skip to content

Commit

Permalink
vita: fix textures for latest cross2d changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste committed Oct 25, 2018
1 parent b6269ad commit 7497e08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions include/cross2d/platforms/psp2/psp2_texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ namespace c2d {

public:

PSP2Texture(const std::string &path);
explicit PSP2Texture(const std::string &path);

PSP2Texture(const Vector2f &size = Vector2f(0, 0),
explicit PSP2Texture(const Vector2f &size = Vector2f(0, 0),
Format format = Format::RGBA8);

~PSP2Texture();
~PSP2Texture() override;

int resize(const Vector2f &size, bool copyPixels = true);
int resize(const Vector2f &size, bool copyPixels = true) override;

int lock(FloatRect *rect, void **pixels, int *pitch);
int lock(FloatRect *rect, void **pixels, int *pitch) override;

void setFilter(Filter filter);
void setFilter(Filter filter) override;

void setShader(int shader);
void setShader(int shader) override;

void applyShader();
void applyShader() override;

//private:
vita2d_texture *tex = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions source/platforms/psp2/psp2_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PSP2Texture::PSP2Texture(const std::string &p) : Texture(p) {
return;
}

m_vertices.setPrimitiveType(TriangleStrip);
setSize(vita2d_texture_get_width(tex), vita2d_texture_get_height(tex));
setTexture(this, true);
pitch = vita2d_texture_get_stride(tex);
Expand All @@ -36,8 +37,6 @@ PSP2Texture::PSP2Texture(const std::string &p) : Texture(p) {

PSP2Texture::PSP2Texture(const Vector2f &size, Format fmt) : Texture(size, fmt) {

printf("PSP2Texture(%p): %i x %i\n", this, (int) size.x, (int) size.y);

vita2d_texture_set_alloc_memblock_type(SCE_KERNEL_MEMBLOCK_TYPE_USER_RW);
tex = vita2d_create_empty_texture_format(
(unsigned int) size.x, (unsigned int) size.y,
Expand All @@ -49,6 +48,7 @@ PSP2Texture::PSP2Texture(const Vector2f &size, Format fmt) : Texture(size, fmt)
return;
}

m_vertices.setPrimitiveType(TriangleStrip);
setSize(size.x, size.y);
setTexture(this, true);
pitch = vita2d_texture_get_stride(tex);
Expand Down

0 comments on commit 7497e08

Please sign in to comment.