Jump to content
The Dark Mod Forums

Namespace From Gtk Radiant


New Horizon

Recommended Posts

You wouldn't normally use structs as keys in a hashtable, only as values. What information do you need to store in this case?

 

I'd like to store both the filename and a GtkWidget* pointer (the one pointing to the according menu element).

Link to comment
Share on other sites

Couldn't you do that by using the std::string filename as the key, and the GtkWidget* as the value? Storing such as struct as a key would not be helpful, because you would have to have a copy of the data structure already in order to look it up.

 

I may be misunderstanding what you want to do.

Link to comment
Share on other sites

Oh, I see what you mean.

 

In that case, you probably don't need an associative lookup (hashing) because you will be populating the menu in order. You could store the structures in an ordered std::list, and each time one is selected, remove it from its position and stick it on the front of the list before repopulating the menu with the new ordering.

Link to comment
Share on other sites

There is even an example at boost.org for such an MRU list, but it is using std::strings as keys only, so I tried to change it to use structs instead of std::string. The hashing of these structs is obviously different to those of std::string and after several compiler errors I finally managed to get this

The container works for the common types like int/string etc out of box, but how should

it know how to access a custom struct? You have to tell it.

For a sorted container you must at least implement a compare-function, for hashing a

way to supply the keys.

 

Yes the errors are ugly, but STL template errors are quite the same.

The best I had so far was a gcc error that was 3 pages long...

Link to comment
Share on other sites

Ah, I found another item that would be suitable: GtkRecentManager.

 

- It's only available since GTK+ 2.10, I think we have GTK+ 2.0 for Win32 builds only. Don't know how much hassle it is to upgrade our Win32 libraries.

- It seems to save its data (i.e. the list of recently used files) into a separate file. I'd rather like it to store them into the XMLRegistry.

 

Opinions?

Link to comment
Share on other sites

I think that is more than we need; it looks like it is designed as a way for GNOME applications like Nautilus to load up different applications to open recently used files. There is a menu on the GNOME desktop which allows recent files to be opened, which I presume is using this.

 

Incidentally, I am pretty sure we are using GTK 2.6 not 2.0 on Windows. It started at 2.4 but I upgraded it last year.

Link to comment
Share on other sites

Namespace, what are your plans/ideas for DarkRadiant? Or have you and Orbweaver already talked about this?

 

Sorry for not responding the past days, I got burried in "happy" real life stuff. <_<

 

Well the first and most unexciting thing would be to port the numerous bugfixes we made

for gtkr to darkrd. :mellow: We recently fixed some very annoying stuff (not in trunk at

the time of writing).

 

One of my ideas for gtkr was to replace the giant entitypopup menu with 3 smaller popups

featuring "recently used", "custom", "the rest".

You guys already made a good replacement for the entitymenu, however it would be

cool if you could put a "custom"-popupmenu on the left side of the cursor.

This menu would show a short custom entitylist which every mapper could edit to get a better workflow.

Feel free to discard this idea, its just a "nice to have" feature in my opinion ;)

 

Rework the redraw mechanism a bit.

Radiant draws almost everything during "idle", idle is an event gtk triggers, when it thinks that there

is nothingelse to do. In most of the cases thats fine, but as soon as you work on a system under

cpuload things get very unresponsitive. I think the idle-redraw is fine for ui-dialogs, but the

3dview update should be able to do a forced redraw when needed, or to redraw with a mininmal

framerate when 3d-movement is activated.

 

Probaly the biggest thing I would like to change is the renderer.

I already taked to Orbweaver about it and we are both not very happy with the current state of it.

My idea is a 3 layered modular rendering system:

1. Culling

2. Frontend (sorting etc)

3. Backend (opengl wrapper)

 

You may wonder why culling is an extra module, it could easly be part of the frontend.

Having a modular renderer allows us to plugin different rendering systems (like the one from my engine ^_^ ). Depending on the actual rendering strategy the frontend may be completly different in structure.

The frontend for deferred rendering for example would have to do completly different things

comared to a more doom3-like renderingsystem.

Culling in contrast stays the same for whatever system we use. So instead if reimplementing it in

every frontend I would like to make it a standalone-module.

 

I can make a more detailed post about my ideas for the renderer in some days.

Maybe with some UML-diagrams when I get the time ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...