/**
 * This is the main paint routine. It must be called by the viewer holding the reference to this canvas (e.g. when a 
 * window must be redrawn).
 *
 * @param content The elements to render.
 */
void CGenericCanvas::render(TGCRenderContent content)
{
  // No display if the canvas is currently being updated.
  if (!updating())
  {
    beginUpdate();
    try
    {
      if ((FStates & GC_STATE_PENDING_ACTIVATION) != 0)
      {
        // A pending activation state always means there is a valid current view.
        FStates &= ~GC_STATE_PENDING_ACTIVATION;
        FCurrentView->activate();
      };

      if (FCurrentView != NULL)
      {
        FCurrentView->validate();
        clearBuffers();
        FCurrentView->render(content);
      };
      endUpdate();
    }
    catch(...)
    {
      endUpdate();
      throw;
    };

    checkError();
  };
}
Esempio n. 2
0
void AvatarManager::updateOtherAvatars(float deltaTime) {
    if (_avatarHash.size() < 2 && _avatarFades.isEmpty()) {
        return;
    }
    bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
    PerformanceWarning warn(showWarnings, "Application::updateAvatars()");

    PerformanceTimer perfTimer("otherAvatars");

    // simulate avatars
    AvatarHash::iterator avatarIterator = _avatarHash.begin();
    while (avatarIterator != _avatarHash.end()) {
        auto avatar = std::dynamic_pointer_cast<Avatar>(avatarIterator.value());

        if (avatar == _myAvatar || !avatar->isInitialized()) {
            // DO NOT update _myAvatar!  Its update has already been done earlier in the main loop.
            // DO NOT update or fade out uninitialized Avatars
            ++avatarIterator;
        } else if (avatar->shouldDie()) {
            removeAvatarMotionState(avatar);
            _avatarFades.push_back(avatarIterator.value());
            avatarIterator = _avatarHash.erase(avatarIterator);
        } else {
            avatar->startUpdate();
            avatar->simulate(deltaTime);
            avatar->endUpdate();
            ++avatarIterator;
        }
    }

    // simulate avatar fades
    simulateAvatarFades(deltaTime);
}
Esempio n. 3
0
void DetachedEntity::setFromMessage(const Atlas::Message::MapType& attrs)
{
	beginUpdate();

	Atlas::Message::MapType::const_iterator A;

	/*
	 attrs.erase("loc");
	 attrs.erase("id");
	 attrs.erase("contains");

	 if (!allowMove) filterMoveAttrs(attrs);
	 */

	for (A = attrs.begin(); A != attrs.end(); ++A) {
		if (A->first == "loc" || A->first == "id" || A->first == "contains")
			continue;

		// see if the value in the sight matches the exsiting value
		Eris::Entity::AttrMap::iterator I = m_attrs.find(A->first);
		if ((I != m_attrs.end()) && (I->second == A->second))
			continue;

		setAttr(A->first, A->second);
	}

	endUpdate();
}
Esempio n. 4
0
void AvatarManager::simulateAvatarFades(float deltaTime) {
    QVector<AvatarSharedPointer>::iterator fadingIterator = _avatarFades.begin();

    const float SHRINK_RATE = 0.9f;
    const float MIN_FADE_SCALE = MIN_AVATAR_SCALE;

    render::ScenePointer scene = qApp->getMain3DScene();
    render::PendingChanges pendingChanges;
    while (fadingIterator != _avatarFades.end()) {
        auto avatar = std::static_pointer_cast<Avatar>(*fadingIterator);
        avatar->startUpdate();
        avatar->setTargetScale(avatar->getUniformScale() * SHRINK_RATE);
        if (avatar->getTargetScale() <= MIN_FADE_SCALE) {
            avatar->removeFromScene(*fadingIterator, scene, pendingChanges);
            // only remove from _avatarFades if we're sure its motionState has been removed from PhysicsEngine
            if (_motionStatesToRemoveFromPhysics.empty()) {
                fadingIterator = _avatarFades.erase(fadingIterator);
            } else {
                ++fadingIterator;
            }
        } else {
            avatar->simulate(deltaTime);
            ++fadingIterator;
        }
        avatar->endUpdate();
    }
    scene->enqueuePendingChanges(pendingChanges);
}
CGenericCanvas::~CGenericCanvas(void)
{
  beginUpdate();
  disableEvents();

  // Release all managed data. Start with the visual parts to avoid frequent change events between model and other elements.
  for (CViews::iterator iterator = FViews.begin(); iterator != FViews.end(); ++iterator)
    delete *iterator;
  for (CLayers::iterator iterator = FLayers.begin(); iterator != FLayers.end(); ++iterator)
    delete *iterator;

  delete FModel;
  delete FAnimationManager;

  // Release the lock we placed in the constructor.
  // If this is the last GC instance then also the font manager can be released.
  unlockFontManager();
  endUpdate();

#ifdef _WINDOWS
  DeleteCriticalSection(&FLock);
#else
  g_static_rec_mutex_free(&FLock);
#endif
}
Esempio n. 6
0
void Label::setTheme( Theme & t, const string prefix )
{
	Widget::setTheme( t, prefix );
  beginUpdate();
  setBorder( t.getBorder( prefix+"label" ) );
  setFont( t.getFont( prefix+"label" ) );
  setFontColor( t.getColor( prefix+"label_font" ) );
  endUpdate();
}
/**
 * Causes the model to clear its style definitions.
 */
void CGenericCanvas::clearStyles(void)
{
  beginUpdate();
  FModel->clearStyles();
  endUpdate();

  change(this, GC_CHANGE_CANVAS_CLEAR_STYLES);
  refresh();
}
/**
 * Removes all layout info.
 */
void CGenericCanvas::clearLayouts(void)
{
  beginUpdate();
  FModel->clearLayouts();
  endUpdate();

  change(this, GC_CHANGE_CANVAS_CLEAR_LAYOUTS);
  refresh();
}
/**
 * Removes all GC content.
 */
void CGenericCanvas::clearContent(void)
{
  beginUpdate();
  FModel->clearFigures();
  endUpdate();

  change(this, GC_CHANGE_CANVAS_CLEAR_CONTENT);
  refresh();
}
Esempio n. 10
0
/**
 * Removes the given layer from the internal layer list. The layer itself will not be destroyed, just removed.
 *
 * @param layer The layer to be removed.
 */
void CGenericCanvas::removeLayer(CLayer* layer)
{
  beginUpdate();

  for (CLayers::iterator iterator = FLayers.begin(); iterator != FLayers.end(); ++iterator)
    if (*iterator == layer)
    {
      delete layer;
      FLayers.erase(iterator);
      break;
    };
  endUpdate();

  change(this, GC_CHANGE_CANVAS_REMOVE_LAYER);
}
Esempio n. 11
0
/**
 * Removes the given view from the internal list.
 *
 * @param View The view to be removed.
 */
void CGenericCanvas::removeView(CGCView* View)
{
  beginUpdate();

  if (FCurrentView == View)
    FCurrentView = NULL;
  for (CViews::iterator iterator = FViews.begin(); iterator != FViews.end(); ++iterator)
    if (*iterator == View)
    {
      (*iterator)->removeListener(&FListener);
      FViews.erase(iterator);
      change(View, GC_CHANGE_CANVAS_REMOVE_VIEW);
      break;
    };

  endUpdate();
}
Esempio n. 12
0
	void setFromMessage(const Atlas::Message::MapType& attrs)
	{
		beginUpdate();

		Atlas::Message::MapType::const_iterator A;

		for (A = attrs.begin(); A != attrs.end(); ++A) {
			if (A->first == "loc" || A->first == "id" || A->first == "contains")
				continue;

			Eris::Entity::AttrMap::iterator I = m_attrs.find(A->first);
			if ((I != m_attrs.end()) && (I->second == A->second))
				continue;

			setAttr(A->first, A->second);
		}

		endUpdate();
	}
Esempio n. 13
0
void AvatarManager::updateOtherAvatars(float deltaTime) {
    // lock the hash for read to check the size
    QReadLocker lock(&_hashLock);

    if (_avatarHash.size() < 2 && _avatarFades.isEmpty()) {
        return;
    }

    lock.unlock();

    bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
    PerformanceWarning warn(showWarnings, "Application::updateAvatars()");

    PerformanceTimer perfTimer("otherAvatars");

    // simulate avatars
    auto hashCopy = getHashCopy();

    AvatarHash::iterator avatarIterator = hashCopy.begin();
    while (avatarIterator != hashCopy.end()) {
        auto avatar = std::static_pointer_cast<Avatar>(avatarIterator.value());

        if (avatar == _myAvatar || !avatar->isInitialized()) {
            // DO NOT update _myAvatar!  Its update has already been done earlier in the main loop.
            // DO NOT update or fade out uninitialized Avatars
            ++avatarIterator;
        } else if (avatar->shouldDie()) {
            removeAvatar(avatarIterator.key());
            ++avatarIterator;
        } else {
            avatar->startUpdate();
            avatar->simulate(deltaTime);
            avatar->endUpdate();
            ++avatarIterator;
        }
    }

    // simulate avatar fades
    simulateAvatarFades(deltaTime);
}
Esempio n. 14
0
void AvatarManager::simulateAvatarFades(float deltaTime) {
    QVector<AvatarSharedPointer>::iterator fadingIterator = _avatarFades.begin();

    const float SHRINK_RATE = 0.9f;
    const float MIN_FADE_SCALE = 0.001f;

    render::ScenePointer scene = qApp->getMain3DScene();
    render::PendingChanges pendingChanges;
    while (fadingIterator != _avatarFades.end()) {
        auto avatar = std::static_pointer_cast<Avatar>(*fadingIterator);
        avatar->startUpdate();
        avatar->setTargetScale(avatar->getScale() * SHRINK_RATE, true);
        if (avatar->getTargetScale() < MIN_FADE_SCALE) {
            avatar->removeFromScene(*fadingIterator, scene, pendingChanges);
            fadingIterator = _avatarFades.erase(fadingIterator);
        } else {
            avatar->simulate(deltaTime);
            ++fadingIterator;
        }
        avatar->endUpdate();
    }
    scene->enqueuePendingChanges(pendingChanges);
}
Esempio n. 15
0
/**
 * Renders the current scene to a file in the format given.
 *
 * @param filename The name of the target file. It must already contain the correct extension and must be encoded in UTF-8.
 * @param format The format of the file to render. Supported are PNG, PDF, PS (postscript) and EPS (encapsulated postscript).
 * @param title The titel for the document. Must be ANSI encoded for now.
 * @param software A string describing the producer of the document. Must be ANSI encoded for now.
 * @param content A set of flags indicating what additional info to render.
 * @param zoom The zoom at which render the file.
 * @param bounds Position and size of the area to store in the file (currently only for PNG).
 * @return True if successful otherwise false.
 */
bool CGenericCanvas::renderToFile(const char* filename, TGCFileFormat format, const char* title, const char* software,
                                  TGCRenderContent content, float zoom, TGCViewport& bounds)
{
  bool result = false;

  if (!updating())
  {
    beginUpdate();
    try
    {
      if ((FStates & GC_STATE_PENDING_ACTIVATION) != 0)
      {
        // A pending activation state always means there is a valid current view.
        FStates &= ~GC_STATE_PENDING_ACTIVATION;
        FCurrentView->activate();
      };

      switch (format)
      {
        case GC_FILE_FORMAT_PDF:
        case GC_FILE_FORMAT_PS:
        case GC_FILE_FORMAT_EPS:
          {
            if (FCurrentView != NULL)
            {
              const int fileTypeMapper[4] = {GL2PS_PDF, GL2PS_PS, GL2PS_EPS, GL2PS_TEX};

              FILE *file = openFile(filename, "wb");

              GLint bufferSize = 0;
              GLint state = GL2PS_OVERFLOW;
              
              char *oldlocale = setlocale(LC_NUMERIC, "C");
              while (state == GL2PS_OVERFLOW)
              {
                bufferSize += 1024 * 1024;
                gl2psBeginPage(title, software, NULL, fileTypeMapper[format], GL2PS_NO_SORT, GL2PS_DRAW_BACKGROUND | GL2PS_USE_CURRENT_VIEWPORT |
                  GL2PS_COMPRESS, GL_RGBA, 0, NULL, 0, 0, 0, bufferSize, file, filename);
                gl2psEnable(GL2PS_BLEND);
                gl2psBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

                clearBuffers();
                FCurrentView->render(content);

                state = gl2psEndPage();
              };
              setlocale(LC_NUMERIC, oldlocale);
              fclose(file);

              result = true;
            };
            break;
          };
        case GC_FILE_FORMAT_PNG:
          {
            if (FCurrentView != NULL)
            {
              TImage image;

              float workspaceWidth;
              float workspaceHeight;
              FCurrentView->getWorkspace(&workspaceWidth, &workspaceHeight);
              image.width = bounds.width;
              if (image.width < 0)
                image.width = (int) workspaceWidth;
              image.height = bounds.height;
              if (image.height < 0)
                image.height = (int) workspaceHeight;

              // If the frame buffer extension is not supported then there is no sense
              // to allocate a buffer larger than the current viewport,
              // because we cannot render more than this area in this case.
              if (!supportsExtension(GC_OE_FRAME_BUFFER_OBJECTS))
              {
                if (image.height > FCurrentView->viewportGet().height)
                  image.height = FCurrentView->viewportGet().height;
                if (image.width > FCurrentView->viewportGet().width)
                  image.width = FCurrentView->viewportGet().width;
              };

              image.colorType = COLOR_TYPE_RGB_ALPHA;
              image.data = (unsigned char*) malloc(image.width * image.height * 4);
              if (image.data != NULL)
              {
                FCurrentView->renderToMemory(GC_COLOR_FORMAT_RGBA, content, zoom, bounds, image.data);
                image.width = bounds.width;
                image.height = bounds.height;
                result = savePNG(utf8ToUtf16(filename), &image, true, title, software);
                free(image.data);
              };
            };
            break;
          };
      };
      endUpdate();
    }
    catch(...)
    {
      endUpdate();
      throw;
    };

    checkError();
  };

  return result;
}
/**
 * Test for catching mapping errors with duplicate attachments.
 */
void TestKeePass2Format::testDuplicateAttachments()
{
    auto db = QSharedPointer<Database>::create();
    db->setKey(QSharedPointer<CompositeKey>::create());

    const QByteArray attachment1("abc");
    const QByteArray attachment2("def");
    const QByteArray attachment3("ghi");

    auto entry1 = new Entry();
    entry1->setGroup(db->rootGroup());
    entry1->setUuid(QUuid::fromRfc4122("aaaaaaaaaaaaaaaa"));
    entry1->attachments()->set("a", attachment1);

    auto entry2 = new Entry();
    entry2->setGroup(db->rootGroup());
    entry2->setUuid(QUuid::fromRfc4122("bbbbbbbbbbbbbbbb"));
    entry2->attachments()->set("b1", attachment1);
    entry2->beginUpdate();
    entry2->attachments()->set("b2", attachment1);
    entry2->endUpdate();
    entry2->beginUpdate();
    entry2->attachments()->set("b3", attachment2);
    entry2->endUpdate();
    entry2->beginUpdate();
    entry2->attachments()->set("b4", attachment2);
    entry2->endUpdate();

    auto entry3 = new Entry();
    entry3->setGroup(db->rootGroup());
    entry3->setUuid(QUuid::fromRfc4122("cccccccccccccccc"));
    entry3->attachments()->set("c1", attachment2);
    entry3->attachments()->set("c2", attachment2);
    entry3->attachments()->set("c3", attachment3);

    QBuffer buffer;
    buffer.open(QBuffer::ReadWrite);

    bool hasError = false;
    QString errorString;
    writeKdbx(&buffer, db.data(), hasError, errorString);
    if (hasError) {
        QFAIL(qPrintable(QString("Error while writing database: %1").arg(errorString)));
    }

    buffer.seek(0);
    readKdbx(&buffer, QSharedPointer<CompositeKey>::create(), db, hasError, errorString);
    if (hasError) {
        QFAIL(qPrintable(QString("Error while reading database: %1").arg(errorString)));
    }

    QCOMPARE(db->rootGroup()->entries()[0]->attachments()->value("a"), attachment1);

    QCOMPARE(db->rootGroup()->entries()[1]->attachments()->value("b1"), attachment1);
    QCOMPARE(db->rootGroup()->entries()[1]->attachments()->value("b2"), attachment1);
    QCOMPARE(db->rootGroup()->entries()[1]->attachments()->value("b3"), attachment2);
    QCOMPARE(db->rootGroup()->entries()[1]->attachments()->value("b4"), attachment2);
    QCOMPARE(db->rootGroup()->entries()[1]->historyItems()[0]->attachments()->value("b1"), attachment1);
    QCOMPARE(db->rootGroup()->entries()[1]->historyItems()[1]->attachments()->value("b1"), attachment1);
    QCOMPARE(db->rootGroup()->entries()[1]->historyItems()[1]->attachments()->value("b2"), attachment1);
    QCOMPARE(db->rootGroup()->entries()[1]->historyItems()[2]->attachments()->value("b1"), attachment1);
    QCOMPARE(db->rootGroup()->entries()[1]->historyItems()[2]->attachments()->value("b2"), attachment1);
    QCOMPARE(db->rootGroup()->entries()[1]->historyItems()[2]->attachments()->value("b3"), attachment2);

    QCOMPARE(db->rootGroup()->entries()[2]->attachments()->value("c1"), attachment2);
    QCOMPARE(db->rootGroup()->entries()[2]->attachments()->value("c2"), attachment2);
    QCOMPARE(db->rootGroup()->entries()[2]->attachments()->value("c3"), attachment3);
}
Esempio n. 17
0
NetwalkWindow::NetwalkWindow(Frame* parent, Font* f)
 : WindowFrame( parent )
{
  pSizeX = 6;
  pSizeY = 6;
  pNumCli = 8;

  beginUpdate();
  titleLabel.setParent( this );
  titleLabel.setTheme( Theme::defaultTheme() );

  scoreLabel.setParent( this );
  newButton.setParent( this );
  skillCombo.setParent( this );
  skillEasyItem.setText( L"Easy" );
  skillNormalItem.setText( L"Normal" );
  skillHardItem.setText( L"Hard" );
  skillDropdown.addItem( &skillEasyItem );
  skillDropdown.addItem( &skillNormalItem );
  skillDropdown.addItem( &skillHardItem );

  skillCombo.setDropdownList( &skillDropdown );

  skillDropdown.setTheme( Theme::defaultTheme() );

  skillCombo.setTheme( Theme::defaultTheme(), "readonly_" );
  skillCombo.setHeight( 20 );
  skillCombo.setName( "nw.skillCombo" );
  mapView.setParent( this );
  mapView.setTheme( Theme::defaultTheme() );
  mapView.setName( "nw.mapView" );

  titleLabel.setTop( 0 );
  titleLabel.setLeft( 0 );
  titleLabel.setWidth( 80 );
  titleLabel.setHeight( 20 );
//  titleLabel.setFont( f );
  titleLabel.setText( L"Netwalk" );
  titleLabel.setName( "nw.titleLabel" );

  scoreLabel.setTop( 20 );
  scoreLabel.setLeft( 0 );
  scoreLabel.setWidth( 40 );
  scoreLabel.setHeight( 20 );
  scoreLabel.setTheme( Theme::defaultTheme(), "score_" );
  scoreLabel.setText( L"0" );
  scoreLabel.setName( "nw.scoreLabel" );

  newButton.setTheme( Theme::defaultTheme() );
  newButton.setTop( 20 );
  newButton.setLeft( 42 );
  newButton.setWidth( 40 );
  newButton.setHeight( 20 );
  newButton.setText( L"New" );
  newButton.setName( "nw.newButton" );

  skillCombo.setTop( 20 );
  skillCombo.setLeft( 84 );
  skillCombo.setWidth( 78 );
  skillCombo.setText( L"Easy" );
  skillCombo.setReadOnly( true );

  mapView.setTop( 40 );
  mapView.setLeft( 0 );
  mapView.setTheme( Theme::defaultTheme() );

  string datadir;
  datadir = UIDATADIR;
  datadir += "/Images";

  Utils::setNotice( "Datadir is: " + datadir );

  SDLImageObject* imbg = new SDLImageObject();
  assert( imbg->loadImage( datadir+string("/net_bg.png") ) );
  mapView.tileImages().append( (ImageObject*&)imbg );

  SDLImageObject* imbg1 = new SDLImageObject();
  assert( imbg1->loadImage( datadir+"/net_flare1.png" ) );
  mapView.tileImages().append( (ImageObject*&)imbg1 );

  SDLImageObject* imbg2 = new SDLImageObject();
  assert( imbg2->loadImage( datadir+"/net_flare2.png" ) );
  mapView.tileImages().append( (ImageObject*&)imbg2 );

  SDLImageObject* imbg3 = new SDLImageObject();
  assert( imbg3->loadImage( datadir+"/net_flare3.png" ) );
  mapView.tileImages().append( (ImageObject*&)imbg3 );

  SDLImageObject* imo1 = new SDLImageObject();
  assert( imo1->loadImage( datadir+"/net_1u.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo1 );

  SDLImageObject* imo2 = new SDLImageObject();
  assert( imo2->loadImage( datadir+"/net_1r.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo2 );

  SDLImageObject* imo3 = new SDLImageObject();
  assert( imo3->loadImage( datadir+"/net_1d.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo3 );

  SDLImageObject* imo4 = new SDLImageObject();
  assert( imo4->loadImage( datadir+"/net_1l.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo4 );

  SDLImageObject* imo5 = new SDLImageObject();
  assert( imo5->loadImage( datadir+"/net_ph.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo5 );

  SDLImageObject* imo6 = new SDLImageObject();
  assert( imo6->loadImage( datadir+"/net_pv.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo6 );

  SDLImageObject* imo7 = new SDLImageObject();
  assert( imo7->loadImage( datadir+"/net_tur.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo7 );

  SDLImageObject* imo8 = new SDLImageObject();
  assert( imo8->loadImage( datadir+"/net_tul.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo8 );

  SDLImageObject* imo9 = new SDLImageObject();
  assert( imo9->loadImage( datadir+"/net_tdr.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo9 );

  SDLImageObject* imo10 = new SDLImageObject();
  assert( imo10->loadImage( datadir+"/net_tdl.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo10 );

  SDLImageObject* imo11 = new SDLImageObject();
  assert( imo11->loadImage( datadir+"/net_3u.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo11 );

  SDLImageObject* imo12 = new SDLImageObject();
  assert( imo12->loadImage( datadir+"/net_3r.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo12 );

  SDLImageObject* imo13 = new SDLImageObject();
  assert( imo13->loadImage( datadir+"/net_3d.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo13 );

  SDLImageObject* imo14 = new SDLImageObject();
  assert( imo14->loadImage( datadir+"/net_3l.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo14 );


  SDLImageObject* imo15 = new SDLImageObject();
  assert( imo15->loadImage( datadir+"/net_1u2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo15 );

  SDLImageObject* imo16 = new SDLImageObject();
  assert( imo16->loadImage( datadir+"/net_1r2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo16 );

  SDLImageObject* imo17 = new SDLImageObject();
  assert( imo17->loadImage( datadir+"/net_1d2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo17 );

  SDLImageObject* imo18 = new SDLImageObject();
  assert( imo18->loadImage( datadir+"/net_1l2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo18 );

  SDLImageObject* imo19 = new SDLImageObject();
  assert( imo19->loadImage( datadir+"/net_ph2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo19 );

  SDLImageObject* imo20 = new SDLImageObject();
  assert( imo20->loadImage( datadir+"/net_pv2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo20 );

  SDLImageObject* imo21 = new SDLImageObject();
  assert( imo21->loadImage( datadir+"/net_tur2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo21 );

  SDLImageObject* imo22 = new SDLImageObject();
  assert( imo22->loadImage( datadir+"/net_tul2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo22 );

  SDLImageObject* imo23 = new SDLImageObject();
  assert( imo23->loadImage( datadir+"/net_tdr2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo23 );

  SDLImageObject* imo24 = new SDLImageObject();
  assert( imo24->loadImage( datadir+"/net_tdl2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo24 );

  SDLImageObject* imo25 = new SDLImageObject();
  assert( imo25->loadImage( datadir+"/net_3u2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo25 );

  SDLImageObject* imo26 = new SDLImageObject();
  assert( imo26->loadImage( datadir+"/net_3r2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo26 );

  SDLImageObject* imo27 = new SDLImageObject();
  assert( imo27->loadImage( datadir+"/net_3d2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo27 );

  SDLImageObject* imo28 = new SDLImageObject();
  assert( imo28->loadImage( datadir+"/net_3l2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo28 );


  SDLImageObject* imo29 = new SDLImageObject();
  assert( imo29->loadImage( datadir+"/net_serv.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo29 );

  SDLImageObject* imo30 = new SDLImageObject();
  assert( imo30->loadImage( datadir+"/net_cli.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo30 );

  SDLImageObject* imo31 = new SDLImageObject();
  assert( imo31->loadImage( datadir+"/net_cli2.png" ) );
  mapView.objectImages().append( (ImageObject*&)imo31 );


  skillDropdown.onItemClicked.connect( this, &NetwalkWindow::skillDropdownClick );
  newButton.onMouseClick.connect( this, &NetwalkWindow::newButtonClick );
  mapView.onMouseMove.connect( this, &NetwalkWindow::mapViewMouseMove );
  mapView.onMousePressed.connect( this, &NetwalkWindow::mapViewMousePressed );
  mapView.onMouseClick.connect( this, &NetwalkWindow::mapViewMouseClick );
  mapView.onTileClicked.connect( this, &NetwalkWindow::mapViewTileClicked );

  titleLabel.setVisible( true );
  scoreLabel.setVisible( true );
  newButton.setVisible( true );
  skillCombo.setVisible( true );
  mapView.setVisible( true );

  endUpdate();
}