Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: gummikana/poro
base: 17f06f7fa5
...
head fork: gummikana/poro
compare: fb99b6224e
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
2  source/game_utils/actionscript/sprite.h
@@ -279,7 +279,7 @@ struct Transform
//-----------------------------------------------------------------------------
-void DrawSprite( Sprite* sprite, poro::IGraphics* graphics, types::camera* camera, Transform& transform );
+void DrawSprite( Sprite* sprite, poro::IGraphics* graphics, types::camera* camera = NULL, Transform& transform = Transform() );
///////////////////////////////////////////////////////////////////////////////
View
11 source/poro/desktop/graphics_opengl.cpp
@@ -1121,7 +1121,8 @@ void GraphicsOpenGL::DrawFill( const std::vector< poro::types::vec2 >& vertices,
#endif
}
-void GraphicsOpenGL::DrawTexturedRect( const poro::types::vec2& position, const poro::types::vec2& size, ITexture* itexture )
+
+void GraphicsOpenGL::DrawTexturedRect( const poro::types::vec2& position, const poro::types::vec2& size, ITexture* itexture, const poro::types::fcolor& color, types::vec2* tex_coords, int count )
{
if( itexture == NULL )
return;
@@ -1148,13 +1149,17 @@ void GraphicsOpenGL::DrawTexturedRect( const poro::types::vec2& position, const
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
- glColor4f(1, 1, 1, 1);
+ glColor4f( color[ 0 ], color[ 1 ], color[ 2 ], color[ 3 ] );
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBegin( GL_TRIANGLE_STRIP );
for( int i = 0; i < 4; i++)
{
- glTexCoord2f(vertices[ i ].x / texture->GetWidth(), vertices[ i ].y / texture->GetHeight() );
+ if( tex_coords == NULL || i >= count )
+ glTexCoord2f( vertices[ i ].x / texture->GetWidth(), vertices[ i ].y / texture->GetHeight() );
+ else
+ glTexCoord2f( tex_coords[ i ].x / texture->GetWidth(), tex_coords[ i ].y / texture->GetHeight() );
+
glVertex2f(vertices[ i ].x, vertices[ i ].y );
}
View
2  source/poro/desktop/graphics_opengl.h
@@ -89,7 +89,7 @@ class GraphicsOpenGL : public IGraphics
virtual void DrawLines( const std::vector< poro::types::vec2 >& vertices, const types::fcolor& color, bool smooth, float width, bool loop );
virtual void DrawFill( const std::vector< poro::types::vec2 >& vertices, const types::fcolor& color );
- virtual void DrawTexturedRect( const poro::types::vec2& position, const poro::types::vec2& size, ITexture* itexture );
+ virtual void DrawTexturedRect( const poro::types::vec2& position, const poro::types::vec2& size, ITexture* itexture, const types::fcolor& color = poro::GetFColor( 1, 1, 1, 1 ), types::vec2* tex_coords = NULL, int count = 0 );
virtual IGraphicsBuffer* CreateGraphicsBuffer(int width, int height);
virtual void DestroyGraphicsBuffer(IGraphicsBuffer* buffer);
View
36 source/poro/igraphics.h
@@ -154,20 +154,44 @@ class IGraphics
//-------------------------------------------------------------------------
virtual void DrawTexture( ITexture* texture,
- types::Float32 x, types::Float32 y, types::Float32 w, types::Float32 h,
- const types::fcolor& color = poro::GetFColor( 1, 1, 1, 1 ), types::Float32 rotation = 0 ) = 0;
+ types::Float32 x,
+ types::Float32 y,
+ types::Float32 w,
+ types::Float32 h,
+ const types::fcolor& color = poro::GetFColor( 1, 1, 1, 1 ),
+ types::Float32 rotation = 0 ) = 0;
- virtual void DrawTexture( ITexture* texture, types::vec2* vertices, types::vec2* tex_coords, int count, const types::fcolor& color ) = 0;
+
+ virtual void DrawTexture( ITexture* texture,
+ types::vec2* vertices,
+ types::vec2* tex_coords,
+ int count,
+ const types::fcolor& color ) = 0;
- virtual void DrawTextureWithAlpha( ITexture* texture, types::vec2* vertices, types::vec2* tex_coords, int count, const types::fcolor& color,
- ITexture* alpha_texture, types::vec2* alpha_vertices, types::vec2* alpha_tex_coords, const types::fcolor& alpha_color ) { poro_assert( false && "Needs to be implemented" ); }
+
+ virtual void DrawTextureWithAlpha( ITexture* texture,
+ types::vec2* vertices,
+ types::vec2* tex_coords,
+ int count,
+ const types::fcolor& color,
+ ITexture* alpha_texture,
+ types::vec2* alpha_vertices,
+ types::vec2* alpha_tex_coords,
+ const types::fcolor& alpha_color ) { poro_assert( false && "Needs to be implemented" ); }
+
+
+ virtual void DrawTexturedRect( const poro::types::vec2& position,
+ const poro::types::vec2& size,
+ ITexture* itexture,
+ const types::fcolor& color = poro::GetFColor( 1, 1, 1, 1 ),
+ types::vec2* tex_coords = NULL,
+ int count = 0 ) { poro_assert( false && "Needs to be implemented" ); }
//-------------------------------------------------------------------------
virtual void DrawLines( const std::vector< poro::types::vec2 >& vertices, const types::fcolor& color, bool smooth, float width, bool loop = false ) { }
virtual void DrawLines( const std::vector< poro::types::vec2 >& vertices, const types::fcolor& color ) { DrawLines( vertices, color, false, 1.f, true ); }
virtual void DrawFill( const std::vector< poro::types::vec2 >& vertices, const types::fcolor& color ) { }
- virtual void DrawTexturedRect( const poro::types::vec2& position, const poro::types::vec2& size, ITexture* itexture ) { }
//-------------------------------------------------------------------------
View
3  source/poro/run_poro.h
@@ -26,6 +26,7 @@ struct AppConfig
internal_size_w( 1024 ),
internal_size_h( 768 ),
framerate( 60 ),
+ sounds( true ),
graphics_settings()
{
}
@@ -42,6 +43,8 @@ struct AppConfig
int internal_size_h;
int framerate;
+ bool sounds;
+
GraphicsSettings graphics_settings;
};

No commit comments for this range

Something went wrong with that request. Please try again.