示例#1
0
文件: area.cpp 项目: farmboy0/xoreos
void Area::show() {
	if (_visible)
		return;

	loadModels();

	GfxMan.lockFrame();

	// Show area geometry model
	if (_model)
		_model->show();

	// Show objects
	for (ObjectList::iterator o = _objects.begin(); o != _objects.end(); ++o)
		(*o)->show();

	GfxMan.unlockFrame();

	playAmbientMusic();

	_visible = true;
}
示例#2
0
文件: area.cpp 项目: DeejStar/xoreos
void Area::show() {
	assert(_loaded);

	if (_visible)
		return;

	playAmbientSound();
	playAmbientMusic();

	GfxMan.lockFrame();

	// Show rooms
	for (std::vector<Room *>::iterator r = _rooms.begin(); r != _rooms.end(); ++r)
		(*r)->model->show();

	// Show objects
	for (ObjectList::iterator o = _objects.begin(); o != _objects.end(); ++o)
		(*o)->show();

	GfxMan.unlockFrame();

	_visible = true;
}
示例#3
0
文件: area.cpp 项目: clone2727/xoreos
void Area::show() {
	if (_visible)
		return;

	loadModels();

	GfxMan.lockFrame();

	// Show tiles
	for (std::vector<Tile>::iterator t = _tiles.begin(); t != _tiles.end(); ++t)
		t->model->show();

	// Show objects
	for (ObjectList::iterator o = _objects.begin(); o != _objects.end(); ++o)
		(*o)->show();

	GfxMan.unlockFrame();

	// Play music and sound
	playAmbientSound();
	playAmbientMusic();

	_visible = true;
}
示例#4
0
LevelEditor::LevelEditor(QMap<GLint,GLuint> &_iconsList, Alphabet *_alphabet, QObject *_parent, Level *_level, bool _audioEnabled, Skin *_asphaltSkin):
    parent(_parent),
    iconsList(_iconsList),
    audioEnabled(_audioEnabled),
    isMoving(false),
    level(_level),
    currentView(SET_NAME_VIEW),
    currentLength(LEVEL_LENGTH_DEFAULT),
    currentWidth(LEVEL_WIDTH_DEFAULT),
    currentGravity(LEVEL_GRAVITY_DEFAULT),
    alphabet(_alphabet),
    volumeSkin(NULL),
    asphaltSkin(_asphaltSkin),
    visible(true),
    visibleTime(0),
    currentName(""),
    currentError(""),
    movingObject(-1),
    positionValid(false),
    xCell(0),
    yCell(0),
    zCell(0),
    lastMouseX(0),
    lastMouseY(0)
{
    connect(this, SIGNAL(playAmbientMusic(QString)), parent, SIGNAL(playAmbientMusic(QString)));
    connect(this, SIGNAL(setMouseMovementTracking(int)), parent, SLOT(setMouseMovementTracking(int)));
    connect(this, SIGNAL(setSkybox(QString)), parent, SLOT(setSkybox(QString)));

    emit playAmbientMusic("editor.mp3");
    emit setSkybox("stars");

    currentActions = new ActionList(INITIAL_MOVEMENT);

    cameraOffset = new Vector3f(-30.0f, -30.0f, 0.0f);
    levelOffset  = new Vector3f(0.0f, -3.0f, 0.0f);

    if (level != NULL)
    {
        // Carica il livello
        level->load();
        currentGravity = level->getGravity();
        currentLength = level->getLength();
        currentWidth = level->getWidth();

        cameraOffset->x = 30.0f;
        currentView = SET_GRAVITY_VIEW;
    }

    angleRotVolumeCube = (audioEnabled ? 0.0f : 90.0f);

    lengthLabel = new CubeString(QString::number(currentLength / 3), 3.0f, alphabet, LENGTH_LABEL);
    widthLabel = new CubeString(QString::number(currentWidth / 3), 3.0f, alphabet, WIDTH_LABEL);
    gravityLabel = new CubeString(QString::number(currentGravity), 3.0f, alphabet, GRAVITY_LABEL);

    lengthString = new CubeString("length", 1.5f, alphabet, LENGTH_STRING);
    widthString = new CubeString("width", 1.5f, alphabet, WIDTH_STRING);
    gravityString = new CubeString("gravity", 1.5f, alphabet, GRAVITY_STRING);

    back = new CubeString("back", 1.0f, alphabet, BUTTON_BACK);
    menu = new CubeString("menu", 1.0f, alphabet, BUTTON_EXIT);
    create = new CubeString("create", 1.0f, alphabet, BUTTON_NEXT);
    next = new CubeString("next", 1.0f, alphabet, BUTTON_NEXT);
    save = new CubeString("save", 0.8f, alphabet, BUTTON_SAVE);
    cancel = new CubeString("cancel", 0.8f, alphabet, BUTTON_CANCEL);
    clear = new CubeString("clear", 0.8f, alphabet, BUTTON_CLEAR);
    exit = new CubeString("exit", 0.8f, alphabet, BUTTON_EXIT);

    labelSetLevelName = new CubeString("level name", 1.3f, alphabet, LABEL_SET_LEVEL_NAME);

    formSetLevelName = new CubeStringList("", 14.0f, 6.0f, alphabet, 2.0f, FORM_SET_LEVEL_NAME);
    GLuint volume_on = iconsList.value(VOLUME_ON);
    GLuint volume_off = iconsList.value(VOLUME_OFF);
    volumeSkin = new Skin(0, 0, volume_off, volume_off, volume_on, volume_on);

    toolbarObstacleCentres.append(new Vector3f(80.0f,  6.0f, 0.0f));
    toolbarObstacleCentres.append(new Vector3f(80.0f,  3.2f, 0.0f));
    toolbarObstacleCentres.append(new Vector3f(80.0f,  0.4f, 0.0f));
    toolbarObstacleCentres.append(new Vector3f(80.0f, -2.4f, 0.0f));
}