resurrection of diagonal level and clear patch
Moderator: OpenTTD Developers
Re: resurrection of diagonal level and clear patch
Can you remind me what tieliter is?
Re: resurrection of diagonal level and clear patch
I'm not entierly sure. I just remember that reading the flyspray task for it, it said one had to be applied on top of the other in one of the comments further down.
If you search for 'diagonal' on Flyspray, you should find it, have a read. It's one of the last comments to the task.
If you search for 'diagonal' on Flyspray, you should find it, have a read. It's one of the last comments to the task.
Re: resurrection of diagonal level and clear patch
I get a crash when trying to use the diagonal level at the corner of the map.
Steps used to reproduce:
Steps used to reproduce:
- Start OpenTTD
- Start a new game with following settings:
- Cheat yourself about $300,000,000
- Go to the very bottom of the map
- Lower some land so that the very bottom corner is sea
- Try to use Diagonal Level to go from the corner up
- Crash
- Attachments
-
- OpenTTD_Crash.zip
- (572.39 KiB) Downloaded 133 times
-
- diaglvl_win32_r18577_CRASH.rar
- (3.27 MiB) Downloaded 134 times
Re: resurrection of diagonal level and clear patch
Can I ask, does this happen only on the bottom corner, or does it affect all four? (Can't test. Accidentally killed computer. Am on the Internet channel on my Wii)
Re: resurrection of diagonal level and clear patch
Strangely enough, it happens on the most northern corner (top), most southern corner (bottom), and most eastern corner (right), but it has yet to happen on the most western corner (left).
Re: resurrection of diagonal level and clear patch
I have tested this crash setting all edges to water. The crash is not related to map corners; trying any diagonal terraform at the upper left border or at the lower right border will trigger the following assertion:
Code: Select all
src/tile_map.h: tile < MapSize()
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: resurrection of diagonal level and clear patch
I'm compiled with the latest patch and I still get the same crash, this time I've uploaded the PDB debugging file.
- Attachments
-
- cargodist_win32_r18625.rar
- (3.37 MiB) Downloaded 131 times
-
- cargodist_PDB_win32_r18625.rar
- (2.79 MiB) Downloaded 132 times
Re: resurrection of diagonal level and clear patch
I'm aware of the bug but I don't have a lot of time at the moment.
The guy on the picture is not me, it's Alonso.
Re: resurrection of diagonal level and clear patch
I managed to solve the crash. At the SetSelectionTilesDirty() function (viewport.cpp), the following line was missing a check.
Edit: Patch removed. An updated version can be found at http://fickzoo.com/fonsinchen/patches/against_trunk/
Code: Select all
- MarkTileDirtyByTile(TileXY(x / TILE_SIZE, y / TILE_SIZE));
+ if (TileXY(x / TILE_SIZE, y / TILE_SIZE) < MapSize()) MarkTileDirtyByTile(TileXY(x / TILE_SIZE, y / TILE_SIZE));
Last edited by Terkhen on 28 Dec 2009 23:54, edited 1 time in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: resurrection of diagonal level and clear patch
Do you have a clean hotfix so I can apply that over new patches?
Re: resurrection of diagonal level and clear patch
I don't. From what I know about how git works I think that it would be easy to create a diff against diagonal level and clear instead of against trunk, but learning git is still one of my pending subjects. I prefer to work with complete diff files anyways.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: resurrection of diagonal level and clear patch
the problem is fixed in today's version. And I'll send some cookies to anyone who posts a useful patch preventing the first tiles outside the map on the lower borders to be marked as selected when demolishing diagonally.
The guy on the picture is not me, it's Alonso.
Re: resurrection of diagonal level and clear patch
I love cookies 
At DrawTileSelection(const TileInfo *ti) in viewport.cpp, add the following line.
Edit: Patch removed.

At DrawTileSelection(const TileInfo *ti) in viewport.cpp, add the following line.
Code: Select all
if (_thd.diagonal) { // We're drawing a 45 degrees rotated (diagonal) rectangle
if (IsInsideRotatedRectangle((int)ti->x, (int)ti->y)) {
if (_thd.drawstyle & HT_RECT) { // highlighting a square (clear land)
+ if (TileX(ti->tile) == MapMaxX() || TileY(ti->tile) == MapMaxY()) return;
SpriteID image = SPR_SELECT_TILE + _tileh_to_sprite[ti->tileh];
DrawSelectionSprite(image, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE, ti, 7, FOUNDATION_PART_NORMAL);
} else { // highlighting a dot (level land)
Last edited by Terkhen on 02 Jan 2010 12:19, edited 1 time in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: resurrection of diagonal level and clear patch
Thanks for the patch and Congratulations! the cookies are yours. You may now choose between:Terkhen wrote:I love cookies
a, a fine selection of HTML cookies scraped from a bot-infested windows zombie
b, (fake space) cake
c, fake (space cake)
d, the christmas present I got from my grandmother
And you might want to tell me where to send them.
The guy on the picture is not me, it's Alonso.
Re: resurrection of diagonal level and clear patch
It seems that the cake is a lie... In that case the fixed version updated to trunk will do 

Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: resurrection of diagonal level and clear patch
Hello,
Here is an updated build using Terkhen's new patch. It was built with MSVC against r18683.
Disclaimer:
If diaglvl crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png (only available as of r18184, so if you are using a build older than that, don't bother). These files are vital to finding what happened during the crash. Also note that the PDB file attached is not needed when testing diaglvl, it is mainly for developers.
Peter
Here is an updated build using Terkhen's new patch. It was built with MSVC against r18683.
Disclaimer:
If diaglvl crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png (only available as of r18184, so if you are using a build older than that, don't bother). These files are vital to finding what happened during the crash. Also note that the PDB file attached is not needed when testing diaglvl, it is mainly for developers.
Peter
- Attachments
-
- diaglvl_win32_r18683.rar
- (3.24 MiB) Downloaded 127 times
-
- diaglvl_PDB_win32_r18683.rar
- (2.56 MiB) Downloaded 124 times
Re: resurrection of diagonal level and clear patch
The current version (and the previous one ...) contains the fix. And how can you tell if the cake is a lie? I'm fairly sure you don't know my grandmother.Terkhen wrote:It seems that the cake is a lie... In that case the fixed version updated to trunk will do

The guy on the picture is not me, it's Alonso.
Re: resurrection of diagonal level and clear patch
Sorry, I couldn't avoid the Portal reference 
I have updated the patch to current trunk, solving a reject at terraform_cmd. There was also a change caused by r18702: when using diagonal raise / lower / level land, the points showing the selected terrain did not appear anymore. What was DrawGroundSpriteAt is now AddTileSpriteToDraw. At viewport.cpp:

I have updated the patch to current trunk, solving a reject at terraform_cmd. There was also a change caused by r18702: when using diagonal raise / lower / level land, the points showing the selected terrain did not appear anymore. What was DrawGroundSpriteAt is now AddTileSpriteToDraw. At viewport.cpp:
Code: Select all
} else { // highlighting a dot (level land)
/* Figure out the Z coordinate for the single dot. */
byte z = ti->z;
if (ti->tileh & SLOPE_N) {
z += TILE_HEIGHT;
if (!(ti->tileh & SLOPE_S) && (ti->tileh & SLOPE_STEEP)) {
z += TILE_HEIGHT;
}
}
- DrawGroundSpriteAt(_cur_dpi->zoom != 2 ? SPR_DOT : SPR_DOT_SMALL, PAL_NONE, ti->x, ti->y, z);
+ AddTileSpriteToDraw(_cur_dpi->zoom != 2 ? SPR_DOT : SPR_DOT_SMALL, PAL_NONE, ti->x, ti->y, z);
}
- Attachments
-
- diaglvl_r18730.diff
- (27.63 KiB) Downloaded 137 times
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: resurrection of diagonal level and clear patch
Here's another build, r18715, MSVC. Sorry Terkhen, I used fonso's patch from his repo. I will use yours when he implements it into the git repo.
Disclaimer:
If diaglvl crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png (only available as of r18184, so if you are using a build older than that, don't bother). These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/
Peter
Disclaimer:
If diaglvl crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png (only available as of r18184, so if you are using a build older than that, don't bother). These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/
Peter
- Attachments
-
- diaglvl_win32_r18715.rar
- (2.99 MiB) Downloaded 129 times
Re: resurrection of diagonal level and clear patch
Hey again,
I've done another compile, but this time with git. I'm not sure if I did this correctly, because I used the following commands:
Disclaimer:
If diaglvl crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png (only available as of r18184, so if you are using a build older than that, don't bother). These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/
Peter
I've done another compile, but this time with git. I'm not sure if I did this correctly, because I used the following commands:
Code: Select all
git clone http://fickzoo.com/fonsinchen/openttd.git/
git checkout origin/diaglvl
git checkout -b diaglvl
If diaglvl crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png (only available as of r18184, so if you are using a build older than that, don't bother). These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/
Peter
- Attachments
-
- gf6ae587a-diaglvl_win32.rar
- (2.99 MiB) Downloaded 126 times
Who is online
Users browsing this forum: No registered users and 28 guests