Ignore:
Timestamp:
Sep 18, 2011, 11:01:26 PM (9 years ago)
Author:
sam
Message:

osx: automake does not support .mm files yet, so rename ios-image.mm back
to ios-image.cpp, but disable it on OS X because UIKit isn't available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/dict.cpp

    r789 r958  
    7474int Dict::MakeSlot(char const *name)
    7575{
    76     int id, empty = -1;
     76    int slotid, empty = -1;
    7777
    7878    /* If the entry is already registered, remember its ID. Look for an
    7979     * empty slot at the same time. */
    80     for (id = 0; id < data->maxid; id++)
     80    for (slotid = 0; slotid < data->maxid; slotid++)
    8181    {
    82         Entity *e = data->entities[id];
     82        Entity *e = data->entities[slotid];
    8383        if (!e)
    8484        {
    85             empty = id;
     85            empty = slotid;
    8686            break;
    8787        }
     
    105105
    106106    /* If this is a new entry, create a new slot for it. */
    107     if (id == data->maxid || !data->entities[id])
     107    if (slotid == data->maxid || !data->entities[slotid])
    108108    {
    109         if (id == data->maxid)
     109        if (slotid == data->maxid)
    110110        {
    111111            empty = data->maxid++;
     
    115115
    116116        data->entities[empty] = NULL;
    117         id = empty;
     117        slotid = empty;
    118118        data->nentities++;
    119119    }
    120120    else
    121121    {
    122         Ticker::Ref(data->entities[id]);
     122        Ticker::Ref(data->entities[slotid]);
    123123    }
    124124
    125     return id;
     125    return slotid;
    126126}
    127127
    128 void Dict::RemoveSlot(int id)
     128void Dict::RemoveSlot(int slotid)
    129129{
    130     if (Ticker::Unref(data->entities[id]) == 0)
     130    if (Ticker::Unref(data->entities[slotid]) == 0)
    131131    {
    132         data->entities[id] = NULL;
     132        data->entities[slotid] = NULL;
    133133        data->nentities--;
    134134    }
     
    137137void Dict::RemoveSlot(Entity *entity)
    138138{
    139     for (int id = 0; id < data->maxid; id++)
    140         if (data->entities[id] == entity)
     139    for (int slotid = 0; slotid < data->maxid; slotid++)
     140        if (data->entities[slotid] == entity)
    141141        {
    142             RemoveSlot(id);
     142            RemoveSlot(slotid);
    143143            return;
    144144        }
     
    149149}
    150150
    151 void Dict::SetEntity(int id, Entity *entity)
     151void Dict::SetEntity(int slotid, Entity *entity)
    152152{
    153153    Ticker::Ref(entity);
    154     data->entities[id] = entity;
     154    data->entities[slotid] = entity;
    155155}
    156156
    157 Entity *Dict::GetEntity(int id)
     157Entity *Dict::GetEntity(int slotid)
    158158{
    159     return data->entities[id];
     159    return data->entities[slotid];
    160160}
    161161
Note: See TracChangeset for help on using the changeset viewer.