diff --git a/doc/tutorial/06_sprite.cpp b/doc/tutorial/06_sprite.cpp index 45d3b5f6..695fcf5a 100644 --- a/doc/tutorial/06_sprite.cpp +++ b/doc/tutorial/06_sprite.cpp @@ -4,7 +4,7 @@ // Copyright © 2011—2015 Sam Hocevar // © 2012 Daniel Stephens (artwork) // -// This program is free software. It comes without any warranty, to +// Lol Engine is free software. It comes without any warranty, to // the extent permitted by applicable law. You can redistribute it // and/or modify it under the terms of the Do What the Fuck You Want // to Public License, Version 2, as published by the WTFPL Task Force. @@ -33,7 +33,7 @@ public: m_tileset = Tiler::Register("06_sprite.png"); for (int i = 0; i < FRAME_COUNT; ++i) - m_tileset->AddTile(ibox2(i * 24, 376, 24 + i * 24, 24 + 376)); + m_tileset->define_tile(ibox2(i * 24, 376, 24 + i * 24, 24 + 376)); for (int i = 0; i < SPRITE_COUNT; ++i) { diff --git a/src/tileset.cpp b/src/tileset.cpp index 1e872571..4273a5ad 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -1,11 +1,13 @@ // -// Lol Engine +// Lol Engine // -// Copyright: (c) 2010-2014 Sam Hocevar -// This program is free software; you can redistribute it and/or -// modify it under the terms of the Do What The Fuck You Want To -// Public License, Version 2, as published by Sam Hocevar. See -// http://www.wtfpl.net/ for more details. +// Copyright © 2010—2015 Sam Hocevar +// +// Lol Engine is free software. It comes without any warranty, to +// the extent permitted by applicable law. You can redistribute it +// and/or modify it under the terms of the Do What the Fuck You Want +// to Public License, Version 2, as published by the WTFPL Task Force. +// See http://www.wtfpl.net/ for more details. // #include @@ -55,7 +57,7 @@ TileSet::TileSet(char const *path) array tiles; if (m_data->m_image->RetrieveTiles(tiles)) for (int i = 0; i < tiles.count(); i++) - AddTile(ibox2(tiles[0].m1, tiles[0].m1 + tiles[0].m2)); + define_tile(ibox2(tiles[0].m1, tiles[0].m1 + tiles[0].m2)); } TileSet::TileSet(char const *path, Image* image) @@ -66,7 +68,7 @@ TileSet::TileSet(char const *path, Image* image) array tiles; if (m_data->m_image->RetrieveTiles(tiles)) for (int i = 0; i < tiles.count(); i++) - AddTile(ibox2(tiles[0].m1, tiles[0].m1 + tiles[0].m2)); + define_tile(ibox2(tiles[0].m1, tiles[0].m1 + tiles[0].m2)); } TileSet::TileSet(char const *path, ivec2 size, ivec2 count) @@ -87,8 +89,8 @@ TileSet::TileSet(char const *path, ivec2 size, ivec2 count) for (int j = 0; j < count.y; ++j) for (int i = 0; i < count.x; ++i) { - AddTile(ibox2(size * ivec2(i, j), - size * ivec2(i + 1, j + 1))); + define_tile(ibox2(size * ivec2(i, j), + size * ivec2(i + 1, j + 1))); } } @@ -110,8 +112,8 @@ TileSet::TileSet(char const *path, Image* image, ivec2 size, ivec2 count) for (int j = 0; j < count.y; ++j) for (int i = 0; i < count.x; ++i) { - AddTile(ibox2(size * ivec2(i, j), - size * ivec2(i + 1, j + 1))); + define_tile(ibox2(size * ivec2(i, j), + size * ivec2(i + 1, j + 1))); } } @@ -134,7 +136,7 @@ char const *TileSet::GetName() } //New methods ----------------------------------------------------------------- -int TileSet::AddTile(ibox2 rect) +int TileSet::define_tile(ibox2 rect) { m_tileset_data->m_tiles.push(rect, box2((vec2)rect.aa / (vec2)m_data->m_texture_size, @@ -142,15 +144,15 @@ int TileSet::AddTile(ibox2 rect) return m_tileset_data->m_tiles.count() - 1; } -void TileSet::AddTile(ivec2 count) +void TileSet::define_tile(ivec2 count) { ivec2 size = m_data->m_image_size / count; for (int j = 0; j < count.y; ++j) for (int i = 0; i < count.x; ++i) { - AddTile(ibox2(size * ivec2(i, j), - size * ivec2(i + 1, j + 1))); + define_tile(ibox2(size * ivec2(i, j), + size * ivec2(i + 1, j + 1))); } } diff --git a/src/tileset.h b/src/tileset.h index 227c7945..4e6b2e63 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -1,11 +1,13 @@ // -// Lol Engine +// Lol Engine // -// Copyright: (c) 2010-2013 Sam Hocevar -// This program is free software; you can redistribute it and/or -// modify it under the terms of the Do What The Fuck You Want To -// Public License, Version 2, as published by Sam Hocevar. See -// http://www.wtfpl.net/ for more details. +// Copyright © 2010—2015 Sam Hocevar +// +// Lol Engine is free software. It comes without any warranty, to +// the extent permitted by applicable law. You can redistribute it +// and/or modify it under the terms of the Do What the Fuck You Want +// to Public License, Version 2, as published by the WTFPL Task Force. +// See http://www.wtfpl.net/ for more details. // #pragma once @@ -56,8 +58,8 @@ public: virtual char const *GetName(); /* New methods */ - int AddTile(ibox2 rect); - void AddTile(ivec2 count); + int define_tile(ibox2 rect); + void define_tile(ivec2 count); int GetTileCount() const; ivec2 GetTileSize(int tileid) const;