Помогите побороть ошибку
От: EXL Россия  
Дата: 17.09.10 12:36
Оценка:
Пытаюсь собрать кое-какую игру на телефон, но совершенно не знаю языка.
Помогите пожалуйста разобраться, насколько я понял ошибка синтаксическая.
Лог компилятора:

exl@exl-desktop /home/z6/cooldown-game-read-only $ make
arm-linux-gnueabi-g++ -o cooldown src/*.cpp  `sdl-config --libs` -lm -lz -lpng -lSDL_image -lfreetype -lSDL_mixer -lSDL_ttf `sdl-config --cflags`
src/PlayGame.cpp: In constructor `PlayGame::PlayGame()':
src/PlayGame.cpp:45: warning: passing `double' for converting 2 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/PlayGame.cpp:45: warning: passing `double' for converting 3 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/PlayGame.cpp:53: warning: passing `double' for converting 2 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/PlayGame.cpp:53: warning: passing `double' for converting 3 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/PlayGame.cpp: In member function `bool PlayGame::moveCursorTo(int, int)':
src/PlayGame.cpp:226: warning: passing `double' for converting 1 of `void Sprite::centerTo(int, int)'
src/PlayGame.cpp:226: warning: passing `double' for converting 2 of `void Sprite::centerTo(int, int)'
src/PlayGame.cpp:227: warning: passing `double' for converting 1 of `void Sprite::centerTo(int, int)'
src/PlayGame.cpp:227: warning: passing `double' for converting 2 of `void Sprite::centerTo(int, int)'
src/PlayGame.cpp: In member function `void PlayGame::placeCurrent()':
src/PlayGame.cpp:281: warning: passing `double' for converting 2 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/PlayGame.cpp:281: warning: passing `double' for converting 3 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/PlayGame.cpp: In member function `void PlayGame::penalty()':
src/PlayGame.cpp:470: warning: converting to `int' from `float'
src/PlayGame.cpp: In member function `bool PlayGame::playLevel(Level*)':
src/PlayGame.cpp:560: warning: passing `double' for converting 2 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/PlayGame.cpp:560: warning: passing `double' for converting 3 of `static SDL_Surface* Sprite::ScaleSurface(SDL_Surface*, Uint16, Uint16)'
src/Queue.cpp: In member function `void Queue::update()':
src/Queue.cpp:50: error: no match for 'operator!=' in 'it != std::list<_Tp, _Alloc>::rend() [with _Tp = Tile*, _Alloc = std::allocator<Tile*>]()'
src/Queue.cpp:51: error: no match for 'operator==' in 'it == std::list<_Tp, _Alloc>::rbegin() [with _Tp = Tile*, _Alloc = std::allocator<Tile*>]()'
src/Queue.cpp: In member function `virtual void Queue::redraw()':
src/Queue.cpp:61: error: no match for 'operator!=' in 'it != std::list<_Tp, _Alloc>::rend() [with _Tp = Tile*, _Alloc = std::allocator<Tile*>]()'
src/TileFactory.cpp: In static member function `static Tile* TileFactory::alter(Tile*, std::string)':
src/TileFactory.cpp:46: warning: converting to `int' from `double'
make: *** [build] Error 1


Queue.cpp:

#include    <typeinfo>
#include    "main.h"
#include    "Queue.h"
#include    "ResourceManager.h"
#include    "Logger.h"

Queue::Queue(Level *nlevel)
    : Sprite(),
      level(nlevel)
{
    moveTo(PLAY_QUEUE_X, PLAY_QUEUE_Y);
    setImage(ResourceManager::instance()->getImage("images/queue.png"));
    for (int i=0; i<QUEUE_SIZE; ++i)
        addNew()->moveTo(pos.x + width()/2 - tiles.front()->width()/2, pos.y + height() - (i+1) * tiles.front()->height());
}

bool Queue::isOK(Tile *t)
{
    if (tiles.empty())
        return true;
    if (t->getType() == tiles.back()->getType())
        return false;
    return true;
}

Tile* Queue::addNew()
{
    Tile* next = level->randomTile();
    while (!isOK(next))
    {
        delete next;
        next = level->randomTile();
    }
    tiles.push_back(next);
    return next;
}

Queue::~Queue()
{
#ifndef    NOLOG
    Logger::log(EXTRADEBUG) << "~Queue";
#endif
    for (list<Tile*>::const_iterator it = tiles.begin(); it != tiles.end(); ++it)
        delete *it;
}

void Queue::update()
{
    Sprite::update();
    for (list<Tile*>::const_reverse_iterator it = tiles.rbegin(); it != tiles.rend(); ++it)
        if (it == tiles.rbegin())
            (*it)->redraw();
        else
            (*it)->update();
    return;
}

void Queue::redraw()
{
    Sprite::redraw();
    for (list<Tile*>::const_reverse_iterator it = tiles.rbegin(); it != tiles.rend(); ++it)
        (*it)->redraw();
}

Tile *Queue::shift()
{
    if (tiles.empty())
        return 0;
    Tile *first = tiles.front();
    tiles.pop_front();
    addNew()->moveTo(tiles.front()->x(), pos.y+height() - 5*tiles.front()->height());
    int i=0;
    for (list<Tile*>::const_iterator it = tiles.begin(); it != tiles.end() && (*it)!=tiles.back(); ++it, ++i)
        (*it)->animateTo(pos.x + width()/2 - (*it)->width()/2, pos.y + height() - (i+1) * (*it)->height(), QUEUESHIFTTIME);
    first->animateTo(pos.x + width()/2 - first->width()/2, pos.y + height(), QUEUESHIFTTIME);
    return first;
}


Queue.h:

#ifndef        QUEUE_H
#define        QUEUE_H

#include    <list>
#include    "Level.h"
#include    "Sprite.h"
#include    "Tile.h"

using namespace std;

/**
  *    \class    Queue
  *    \brief    Waiting queue during gameplay
  */
class Queue : public Sprite
{
    public:
        /**
          *    \brief    Queue constructor
          *    \param    nlevel    Pointer to the Level where Queue will be used
          *
          *    The Level is needed, because it knows allowed Tile types.
          */
        Queue(Level *nlevel);

        ///    \brief    Destructor
        ~Queue();

        /**
          *    \brief    Remove and return Tile at the bottom,
          *    shift queue (add a new one at the end)
          */
        Tile *shift();

        void update();
        void redraw();

    protected:
        /**
          *    \brief    Generates a random tile which is different from the last one and adds to queue
          *    \return    New tile
          */
        Tile* addNew();

        ///    \brief    Returns TRUE if the tile can be added to the queue (to avoid repetitions)
        bool isOK(Tile* t);

        list<Tile*>  tiles;  ///< List of Tiles in the queue
        Level        *level; ///< Level where this Queue is used
};

#endif
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.