Beispiel #1
0
// object
bool Commands::getObject(int argc, char** argv) {
    Renderable* ren = Renderable::get(argv[1]);
    if (ren) {
        if (ren->getType() != OBJ) {
            fprintf(stderr, "Commands::getObject ERROR Renderable with name %s already exists and has type %s\n",
                argv[1], toCstr(ren->getType()));
            CommandLine::clearState();
            return false;
        }
    } else {
        Renderable::create(OBJ, argv[1]);
    }
    return true;
}
Beispiel #2
0
void SpacePage::render(const Renderable& r)
{
    if (m_PlayerRenderable) {
        if (r.getType() == "troll") {
            m_Closest.check(r, m_PlayerRenderable->getPosition());
        }
    }
	Gosu::Graphics& g = PageManager::Instance()->graphics();
    r.draw(m_matGlobalToLocal, g.width(), g.height());
}