Changeset 958


Ignore:
Timestamp:
Sep 18, 2011, 11:01:26 PM (8 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.

Location:
trunk
Files:
13 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r954 r958  
    233233
    234234
     235dnl Use Cocoa?
     236ac_cv_my_have_cocoa="no"
     237LIBS_save="$LIBS"
     238LIBS="$LIBS -Wl,-framework -Wl,Cocoa"
     239AC_MSG_CHECKING(for -framework Cocoa)
     240AC_TRY_LINK([], [],
     241 [ac_cv_my_have_cocoa="yes"
     242  AC_MSG_RESULT(yes)
     243  CXXFLAGS="${CXXFLAGS} -ObjC++"],
     244 [AC_MSG_RESULT(no)])
     245LIBS="$LIBS_save"
     246AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" != "no")
     247
     248
    235249dnl Use EGL?
    236250ac_cv_my_have_egl="no"
  • trunk/deushax/deushax.cpp

    r865 r958  
    2121#include "platform/sdl/sdlinput.h"
    2222#include "debugsprite.h"
     23
     24#if USE_SDL
     25#   include <SDL_main.h>
     26#endif
    2327
    2428#if defined _WIN32
  • trunk/monsterz/monsterz.cpp

    r865 r958  
    3535#include "interface.h"
    3636
     37#if USE_SDL
     38#   include <SDL_main.h>
     39#endif
     40
    3741#if defined _WIN32
    3842#   undef main /* FIXME: still needed? */
  • trunk/monsterz/piece.cpp

    r866 r958  
    3939    Piece *above, *below;
    4040    ivec2 size, cell, pos, pos_src, pos_dst, off, off_src;
    41     int id;
     41    int pieceid;
    4242    float speed, timer;
    4343
     
    7474 */
    7575
    76 Piece::Piece(piece_t piece, Emitter *emitter, ivec2 cell, int id)
     76Piece::Piece(piece_t piece, Emitter *emitter, ivec2 cell, int pieceid)
    7777  : data(new PieceData())
    7878{
     
    9595        data->size = 48;
    9696        data->tileset = Tiler::Register(PNG_TILES, data->size, 0, 1.0f);
    97         data->id = 80 + 20 * id;
     97        data->pieceid = 80 + 20 * pieceid;
    9898        break;
    9999    }
     
    309309        {
    310310            vec3 pos(data->pos.x + 24, data->pos.y + 72, 5);
    311             int start = data->id + 12;
    312             int stop = data->id + 15;
    313             for (int id = start; id < stop; id++)
     311            int start = data->pieceid + 12;
     312            int stop = data->pieceid + 15;
     313            for (int pieceid = start; pieceid < stop; pieceid++)
    314314            {
    315315                float angle = RandF(-1.2f, 1.2f);
    316316                float speed = RandF(0.3f, 0.5f);
    317317                vec3 vel(speed * sinf(angle), speed * cosf(angle), 0.0f);
    318                 data->emitter->AddParticle(id, pos, vel);
     318                data->emitter->AddParticle(pieceid, pos, vel);
    319319            }
    320320
     
    333333    Entity::TickDraw(deltams);
    334334
    335     int id = data->id, off = 0;
     335    int pieceid = data->pieceid, off = 0;
    336336    int x = data->pos.x + data->off.x + 24;
    337337    int y = data->pos.y + data->off.y + 72;
     
    378378    {
    379379    case PIECE_HUNT:
    380         id += off;
     380        pieceid += off;
    381381        break;
    382382    }
    383383
    384384    if (data->state != PieceData::DEAD)
    385         Scene::GetDefault()->AddTile(data->tileset, id, ivec3(x, y, z), 0);
     385        Scene::GetDefault()->AddTile(data->tileset, pieceid, ivec3(x, y, z), 0);
    386386
    387387    if (data->state == PieceData::GRAB && Platform::GetMouseCount())
  • trunk/monsterz/title.cpp

    r866 r958  
    353353    /* Maybe an animation? */
    354354    TileSet *tiler = NULL;
    355     int id = 0;
     355    int tileid = 0;
    356356    ivec2 pos = 0;
    357357
     
    364364        pos = animpos[data->animid];
    365365        pos.y = 384 - animsize[data->animid].y - pos.y; // Hack
    366         id = (data->length - data->timer) * data->nframes / data->length;
    367         if (id < 0) id = 0;
    368         if (id > data->nframes - 1) id = data->nframes - 1;
     366        tileid = (data->length - data->timer) * data->nframes / data->length;
     367        if (tileid < 0) tileid = 0;
     368        if (tileid > data->nframes - 1) tileid = data->nframes - 1;
    369369        break;
    370370    case TitleData::EVENT:
     
    372372        pos = eventpos[data->animid];
    373373        pos.y = 384 - eventsize[data->animid].y - pos.y; // Hack
    374         id = (data->length - data->timer) * data->nframes / data->length;
    375         if (id < 0) id = 0;
    376         if (id > data->nframes - 1) id = data->nframes - 1;
     374        tileid = (data->length - data->timer) * data->nframes / data->length;
     375        if (tileid < 0) tileid = 0;
     376        if (tileid > data->nframes - 1) tileid = data->nframes - 1;
    377377        break;
    378378    }
    379379    if (tiler)
    380         Scene::GetDefault()->AddTile(tiler, id,
     380        Scene::GetDefault()->AddTile(tiler, tileid,
    381381                                     ivec3(data->ground_pos.x + pos.x,
    382382                                           data->ground_pos.y + pos.y, 1), 0);
  • trunk/src/Makefile.am

    r957 r958  
    2727    image/image.cpp image/image.h image/image-private.h \
    2828    image/codec/android-image.cpp \
    29     image/codec/ios-image.mm \
     29    image/codec/ios-image.cpp \
    3030    image/codec/sdl-image.cpp \
    3131    image/codec/ps3-image.cpp \
  • 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
  • trunk/src/dict.h

    r789 r958  
    3131
    3232    int MakeSlot(char const *name);
    33     void RemoveSlot(int id);
     33    void RemoveSlot(int slotid);
    3434    void RemoveSlot(Entity *entity);
    3535
    36     void SetEntity(int id, Entity *entity);
    37     Entity *GetEntity(int id);
     36    void SetEntity(int slotid, Entity *entity);
     37    Entity *GetEntity(int slotid);
    3838
    3939private:
  • trunk/src/image/codec/ios-image.cpp

    r957 r958  
    1313#endif
    1414
    15 #if defined __APPLE__ && defined __MACH__
     15#if defined __APPLE__ && defined __MACH__ && defined __arm__
    1616
    1717#include <cmath>
     
    9898} /* namespace lol */
    9999
    100 #endif /* defined __APPLE__ && defined __MACH__ */
     100#endif /* defined __APPLE__ && defined __MACH__ && defined __arm__ */
    101101
  • trunk/src/image/image.cpp

    r955 r958  
    2929#endif
    3030    REGISTER_IMAGE_LOADER(DummyImageData)
    31 #if defined __APPLE__ && defined __MACH__
     31#if defined __APPLE__ && defined __MACH__ && defined __arm__
    3232    REGISTER_IMAGE_LOADER(IosImageData)
    3333#endif
  • trunk/test/benchsuite.cpp

    r942 r958  
    1414
    1515#include <cstdio>
     16
     17#if USE_SDL
     18#   include <SDL_main.h>
     19#endif
    1620
    1721#include "core.h"
  • trunk/test/debug/quad.cpp

    r903 r958  
    2929#endif
    3030
     31#if USE_SDL
     32#   include <SDL_main.h>
     33#endif
     34
    3135#if defined _WIN32
    3236#   undef main /* FIXME: still needed? */
  • trunk/test/debug/sandbox.cpp

    r893 r958  
    1313#endif
    1414
     15#if USE_SDL
     16#   include <SDL_main.h>
     17#endif
     18
    1519#include "core.h"
    1620
  • trunk/test/testsuite.cpp

    r942 r958  
    1616#include <cstdlib>
    1717
     18#if USE_SDL
     19#   include <SDL_main.h>
     20#endif
     21
    1822#include <lol/unit.h>
    1923
    20 int main(void)
     24int main(int argc, char **argv)
    2125{
    2226    lol::TextTestRunner runner;
Note: See TracChangeset for help on using the changeset viewer.