void
dmz::RenderModuleCoreOgreBasic::_init (Config &local, Config &global) {

   Definitions defs (get_plugin_runtime_context (), &_log);

   _defaultAttributeHandle = defs.create_named_handle (ObjectAttributeDefaultName);

   Config pluginList;

   if (local.lookup_all_config ("plugins.plugin", pluginList)) {

      RuntimeContext *context (get_plugin_runtime_context ());
      dmz::load_plugins (context, pluginList, local, global, _extensions, &_log);
   }
   else {

   }

   Config ogreLocal;

   if (local.lookup_config ("ogre", ogreLocal)) {

      try {

         _init_root (ogreLocal);
         _init_resources (ogreLocal);
         _init_render_system (ogreLocal);
         _init_render_windows ();

         Ogre::ResourceGroupManager::getSingleton ().initialiseAllResourceGroups ();

         _init_scene_manager (ogreLocal);
      }
      catch (Ogre::Exception e) {

         if (_root) {

            if (_sceneManager) {

               _root->destroySceneManager (_sceneManager);
               _sceneManager = 0;
            }

            delete _root;
            _root = 0;
         }

         _log.error << e.getFullDescription ().c_str () << endl;
      }
   }
   else {

   }

   _extensions.discover_plugins ();
}
void ProjectManager::load_new_game()
{
    _init_resources();
    
    debug("loading the debug map\n");
    import(Action, am);
    import(Branch, bm);
    import(Event, em);
    import(Image, im);
    import(Position, pm);
    import(Sound, sm);
    import(Text, tm);
    import(Variable, vm);

    {
        Image* new_elem(new Image());

        new_elem->res_data.size = 775;
        im[0] = new_elem;
    }

    {
        Image* new_elem(new Image());

        new_elem->res_data.size = 871;
        im[1] = new_elem;
    }

    set_name("debug game project");
    set_author("benoit guina");
    m_meta.player.x = 0;
    m_meta.player.y = 0;
    m_meta.player.image.id = 1;
    m_meta.player.image.at_x = 0;
    m_meta.player.image.at_y = 0;

    int map_height((int)ProjectManagerBase::map_height);
    int map_width((int)ProjectManagerBase::map_width);
    //int map_height(1);
    //int map_width(1);
    for (int y = 0; y < map_height; ++y)
    {
        for (int x = 0; x < map_width; ++x)
        {
            Position* new_elem(new Position());

            new_elem->res_data.x = x;
            new_elem->res_data.y = y;
            //new_elem->res_data.id_event = 0;
            new_elem->res_data.id_event = -1;
            new_elem->res_data.id_image = 0;
            new_elem->res_data.image_tile_at[0] = 0;
            new_elem->res_data.image_tile_at[1] = 0;
            pm[y * ProjectManagerBase::map_width + x] = new_elem;
        }
    }

    {
        //Event* e = new Event;
        //em[0] = new ;
    }

    debug("debug map created\n");

    load();
}