Explorar el Código

scene: change sprite tile angles to radians.

undefined
Sam Hocevar hace 8 años
padre
commit
cfaa27df47
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  1. +2
    -2
      src/scene.cpp
  2. +1
    -1
      src/scene.h

+ 2
- 2
src/scene.cpp Ver fichero

@@ -457,7 +457,7 @@ void Scene::ReleaseAllPrimitiveRenderers(uintptr_t key)
}

//-----------------------------------------------------------------------------
void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float degrees)
void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float radians)
{
ASSERT(id < tileset->GetTileCount());

@@ -465,7 +465,7 @@ void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float
mat4 model = mat4::translate(pos)
* mat4::scale(scale.x, scale.y, 1.f)
* mat4::translate(size.x * 0.5f, size.y * 0.5f, 0.f)
* mat4::rotate(radians(scale.x * scale.y < 0 ? degrees : -degrees),
* mat4::rotate(scale.x * scale.y < 0 ? radians : -radians,
vec3::axis_z);

AddTile(tileset, id, model);


+ 1
- 1
src/scene.h Ver fichero

@@ -229,7 +229,7 @@ public:

/* FIXME: this should be deprecated -- it doesn't really match
* the architecture we want to build */
void AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float angle);
void AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale, float radians);
void AddTile(TileSet *tileset, int id, mat4 model);

public:


Cargando…
Cancelar
Guardar