Page 2 of 2
Posted: 19 Oct 2005 05:10
by DaleStan
OK, how did I miss the fact that Patchman had posted?
EDITed out stuff to which Patchman had responded.
belugas wrote:I think I read somewhere that [OTTD] only uses WinPalette.
It seems that this is true. I tested with the DOS grf files and NightTTD. The Win version of NightTTD worked; the DOS version did not.
Posted: 19 Oct 2005 07:42
by Celestar
You needa run openttd with -i to force it to the DOS palette
Celestar
Posted: 19 Oct 2005 13:33
by belugas
belugas wrote:Patchman wrote:This should really be a new variable that's 0 for patch and 1 for OTTD.
belugas wrote:Indeed, it would be the best solution. BUt who am I to ask for the Patch to change?

Is it hard to implement a new one?
Not at all.
[5 seconds later.]
Done.
(Sorry, just a bit too late to make it into alpha 65

)
Thanks Patchman, you're very kind.
And as a bonus, you even updated the wiki Action 07/09 page ! That is nice!
So for everyone who might be interested :
Action 7/9 has a new variable :
Code: Select all
Var : 9D
Size : D
Value : TTD Platform, 0=TTDPatch, 1=OpenTTD
I think I have made myself a new patch opportunity!
Posted: 19 Oct 2005 15:55
by belugas
Celestar wrote:You needa run openttd with -i to force it to the DOS palette
Celestar
Question about that :
I have searched the code and found that this coomand line parameter sets thwe variable
_use_dos_palette (declared in gfx.h, as
VARDEF bool _use_dos_palette;)to true. But nowhere have I found an initialization of the variable (or so I think). In gfxinit.c, function CheckExternalFiles, I do see what could be seen as an init, but the first test is already checking for _use_dos_palette value...
Code: Select all
if (_use_dos_palette) {
return;
} else if (win == 5) {
_use_dos_palette = false;
} else if (dos == 5 || (win == 0 && dos > 0)) {
_use_dos_palette = true;
} else {
_use_dos_palette = false;
}
Am I right? Is it required?
If i'm right, what about putting it in openttd.c, function ttd_main, along with
Code: Select all
_game_mode = GM_MENU;
_switch_mode = SM_MENU;
_switch_mode_errorstr = INVALID_STRING_ID;
_dedicated_forks = false;
dedicated = false;
_config_file = NULL;
----> _use_dos_palette = false;
Posted: 19 Oct 2005 17:03
by belugas
Here the fun really kicks in!
What about a grf that enable ALL TYPES of churches in temperate climate?
Posted: 19 Oct 2005 20:14
by Born Acorn
I hope this can slowly expand to be able to support Zimmlocks TTRS

Posted: 19 Oct 2005 20:49
by belugas
That is the secondary goal. Ttrs(x) is so inspiring...
First one is a promise I made to dmh_mac. And i'm so far from fulfilling it...
In what kind of trouble have I stepped in.....
I like it so far, though....

Posted: 22 Oct 2005 16:28
by belugas
I have a bit of a problem understanding this piece of code, from town_cmd.c :
Code: Select all
static void MakeTownHouseBigger(TileIndex tile)
{
uint flags = _housetypeInfos[_m[tile].m4].more_flags;
if (flags & 8) MakeSingleHouseBigger(TILE_ADDXY(tile, 0, 0));
if (flags & 4) MakeSingleHouseBigger(TILE_ADDXY(tile, 0, 1));
if (flags & 2) MakeSingleHouseBigger(TILE_ADDXY(tile, 1, 0));
if (flags & 1) MakeSingleHouseBigger(TILE_ADDXY(tile, 1, 1));
}
I understand the flags & 8,4,2,1 thing (checkng for a bit) but i'm puzzled about the TILE_ADDXY macro.
The point is : I think it is about coordinates, but I don't know where the tiles will be added.
Code: Select all
/\
/ \
/\A /\
/ \/ \
\B /\C /
\/ \/
\D /
\/
So, first of all, am I in A,B,C or D?
If flag = 8, what will it do? I'm in B and it will add in C?
Or else

That is one of the last things I need to figure out before next release...
So please, any hint, pointer, suggestion, documentation will be more then welcome!
Posted: 29 Oct 2005 03:26
by belugas
I have just finished a new release of the patch.
This time, we are getting a bit more visual! We can now
specify random colors to
apply to buildings(or change current ones). Later this weekend, i will finish a little grf replacing a park into a full featured colored tall office, for all to see.
I would really appreciate if anyone could test it out.
The way houses are managed have somewhat been changed. Although I'm confident it works (after countless hours at watching towns growth), something might have eluded me.
With or without grfs, it is totally up to you.
Thanks in advance

Posted: 29 Oct 2005 07:53
by peter1138
Belugas, please use a text editor that doesn't mess with tabs and spacing, and also have a look at the content of the diff you make.
If you have a look through your 460KB (!!) patch you'll see a *lot* of totally irrelevent changes that are just replacing tabs with spaces.
Posted: 29 Oct 2005 16:46
by belugas
You are right peter1138. Sorry I have to admit I did not saw how big the patch was...
I had the feeling tabs are not welcome in source code, mainly because not everyone uses the same spacing, meaning strange looking code.
That is why I reformated the files.
Now : in using tabs, what would be the proper settings? Is there a consensus on it? If so, I have not seen it in the Coding Style document.
Either way, i'm restoring now the files in a less intrusive way.
But you have to understand that town_land.h is almost a new file, thus a big part of the size of the patch. Tonight, I'll send the updated-unformated patch, along with another one, consisting only of town_land.h That way, it would be easier to see the changes.
Does it suits you better? By "you", I mean Peter1138 as well as all the others who showed interest in this patch
Ho.. I'm using delphi as an editor, at the office at least. At home, it is MSCV6
Posted: 29 Oct 2005 18:44
by peter1138
The deal with using tabs is that it means you can in fact use your own prefered tab depth... With spaces you're stuck with what the original coder used.
However, do use spaces for lining up columns in tables, etc.
Posted: 30 Oct 2005 01:29
by belugas
peter1138 wrote:The deal with using tabs is that it means you can in fact use your own prefered tab depth... With spaces you're stuck with what the original coder used.
However, do use spaces for lining up columns in tables, etc.
It is done and delivered. What a job...
Thanks for pointing it out. I hope you can now fully evaluate the work. Hoping the note will be good enough
My collegues and I are always using space, leaving an homogeonous look both on prints and on screen, when we have to help one another. I though it makes more sens. Other places, other cultures...

Posted: 01 Nov 2005 18:31
by belugas
Here is the test grf I've spoken about.
Included is a zip file, with all that is needed in order to get the think working, with commentaries in the NFO file too...
If you want to play with this building, of course, you'll need OR my binary (top post of the topic) OR the Patch. Current OpenTTD cannot do it.
The only thing you migh see, is the building instead of the statue it is replacing.
But it won't indicate Tall Office Block, nor will it generate a LOT of passenger/mail, nor does it will cost a BUNDLE to demolish...
Random colours seem to be "broken" or maybe it was ot compiled. I'l see it as soon as I can
Posted: 11 Nov 2005 01:21
by belugas
I have just posted version 0.2.5
Nothing spectacular has changed.
The code is better written, as are the comments.
I removed unecessary changes and so on.
I do have some good ideas for next release. I think I will make it a try as to add new graphics other then by simply replacing them.
Also, I think it is time to post that patch, as it is, on SourceForge.
Posted: 11 Nov 2005 10:34
by dmh_mac
Will the shopping mall I made a while back have random colours with this?
Posted: 11 Nov 2005 11:21
by MeusH
Great job Belugas. There is one thing I'm wondering about: on the first picture attached, there is no amount of passengers, mail and goods. Does it mean it is 8/8 (full) or it is a bug?
Posted: 11 Nov 2005 11:42
by belugas
dmh_mac : Yes, now it can be.
I did not told you so, because I have to make a new grf for it. I have two things to do before...
MeusH: Ain't a bug. If yuo do not see digits, it means full (8/8) Good observation. By the way, this is standard behaviour, not a new feature from my patch.
Posted: 08 Feb 2006 15:50
by Jango
did this patch ever make it into the trunk?
Posted: 08 Feb 2006 17:01
by belugas
It is not up to me to say

Either way, i'm quite buzy with something much bigger right now

I will resume that work anyway, for sure !