News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Make world limits not forced to water level

Started by Markohs, November 16, 2012, 01:39:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

There is this bug report:

http://forum.simutrans.com/index.php?topic=12135.0

The reason is: loadingscreen_t does not set the world's background dirty. It cannot as it does not know of any world.

How to fix?

Move the background-dirty stuff to simgraph? Add karte_t* static member to loadingscreen_t?
Parsley, sage, rosemary, and maggikraut.

Ters

A loadingscreen_t doesn't appear on its own. Something is causing it to appear. I think it might be better to mark the world as dirty further down the stack, though that might be quite some way away in the network code.

This is something that would have benfited from a global world, although loadingscreen_t would have to be a bit careful, because I don't think there is any world at all when it is first used.

Markohs

mmm... well, yes, setting world dirty makes sense, and it's what should be done. Ofc the world *might* not exist on a loadingscreen_t destroy.

If we are going to turn the world a global variable or a singleton (I don't know if there is a consensus in that issue), just mark the world dirty. I'd go this way, static karte_t::singleton->set_dirty()

*but* if this are not the plan, I'd just add karte_t * to the loadingscreen_t::loadingscreen_t(karte_t * world) constructor allowing it to be NULL, and just marking dirty if the world exists.

I don't like loadingscreen being a class, forcing a creation/destruction leads to issues similar to this one, but well, we have it like is now, and the only two options are those I exposed.

I can implement it, ofc, wich one do you prefer? ;)

Markohs

Seeing noone wants to give his opppinion, I'll implement this adding the function to simwin.h, we have the world accesible in that file. it's the easiest solution and makes enough sense, until we decide if we want to make the world a global variable (I'd take this option), a singleton or keep having the possibility of having multiple simulated worlds in-game.

Markohs


Ters

Using the world the window manager already knew about was a good idea.

Markohs

Thx Ters, I think it's the simplest solution and less intrusive one. Let's see if someone has something alse to say about it and I'll commit.

prissi

Do it, such a function may be handy also for other occasions.

Markohs


Max-Max

how did this end? Are there new ground images for this?
- My code doesn't have bugs. It develops random features...

Markohs

nope, I paused development on it. It was a complex addition, not only required implenting in game image creating,rle compression and register  (I see you implemented that in your code) but drawing that slope with diagonal clipping, and modifying the world drawing algorithm in a way that didn't affect performance,  wich I was unable to realize.  It also required deep water altering tools. The thing is having prissi's simple and good looking world slopes implementation I'm not so sure if this is a good idea. I was also quite exhausted of this, so decided to look elsewhere for a while and look back to it later. Why do you ask?  wanna have it a look yourself?  I can post the WIP patch, iirc it segfaulted a lot and needed a lot of extra work, but the slopes were cool looking.

Max-Max

I have not gone beyond the GUI stuff yet, I'm still 100% on themes and GUI. There is still a looot of things to do. It goes kind'a slow because I have to wait for the trunk merge after each submitted patch.

Well, your project looked so nice and I was only wondering what happened to it. usually it is a good thing to focus on something else for a while, then suddenly out of the blue the solution pops up!
- My code doesn't have bugs. It develops random features...

prissi

One could still use a texture which is blending a color depending on the depth. On a black background it does not alter color, so one would only need slopes. (One may even blend slopes for the moment.

Markohs

Yep, that's what I implemented so far, prissi, but it's incomplete.