Changeset 2613


Ignore:
Timestamp:
Mar 28, 2013, 6:01:12 PM (7 years ago)
Author:
sam
Message:

mrpigeon: try the new tile definition system… which doesn’t work.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/tile.lolfx

    r2566 r2613  
    3333{
    3434    vec4 col = texture2D(in_Texture, pass_TexCoord);
    35     gl_FragColor = col;
     35    gl_FragColor = mix(col, vec4(1.0, 1.0, 0.0, 1.0), 0.5);
    3636}
    3737
  • trunk/src/scene.cpp

    r2609 r2613  
    161161void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o, vec2 scale)
    162162{
     163    ASSERT(id < tileset->GetTileCount());
     164
    163165    Tile t;
    164166    /* FIXME: this sorting only works for a 45-degree camera */
  • trunk/src/tiler.cpp

    r2216 r2613  
    5555}
    5656
     57TileSet *Tiler::Register(char const *path)
     58{
     59    int id = data->tilesets.MakeSlot(path);
     60    TileSet *tileset = (TileSet *)data->tilesets.GetEntity(id);
     61
     62    if (!tileset)
     63    {
     64        tileset = new TileSet(path);
     65        data->tilesets.SetEntity(id, tileset);
     66    }
     67
     68    return tileset;
     69}
     70
    5771void Tiler::Deregister(TileSet *tileset)
    5872{
  • trunk/src/tiler.h

    r2437 r2613  
    2929public:
    3030    static TileSet *Register(char const *path, ivec2 size, ivec2 count);
     31    static TileSet *Register(char const *path);
    3132    static void Deregister(TileSet *);
    3233
  • trunk/src/tileset.h

    r2609 r2613  
    4545public:
    4646    /* New methods */
     47    int AddTile(ibox2 rect);
    4748    int GetTileCount() const;
    4849    ivec2 GetTileSize(int tileid) const;
     50
    4951    ivec2 GetTextureSize() const;
    5052    ShaderTexture GetTexture() const;
     
    5658private:
    5759    void Init(char const *path);
    58     int AddTile(ibox2 rect);
    5960
    6061    TileSetData *m_data;
Note: See TracChangeset for help on using the changeset viewer.