
32bit Graphics Extra Zoom Patch
Moderator: Graphics Moderators
-
- Transport Coordinator
- Posts: 282
- Joined: 02 Apr 2009 21:57
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Ok ok I understand..you have all the reasons of th world... 

Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Sign problem (town name, station name, ...) not working in other zoom than normal:
I've duplicate some of the code you have put in comment in viewport.cpp but not in the same function and it works so I'm wondering if maybe there something I'm missing.
I've duplicate some of the code you have put in comment in viewport.cpp but not in the same function and it works so I'm wondering if maybe there something I'm missing.
Code: Select all
static bool CheckClickOnViewportSign(const ViewPort *vp, int x, int y, const ViewportSign *sign)
{
bool small = (vp->zoom >= ZOOM_LVL_OUT_4X);
int sign_half_width = ScaleByZoom((small ? sign->width_small : sign->width_normal) / 2, vp->zoom);
int sign_height = ScaleByZoom(VPSM_TOP + (small ? FONT_HEIGHT_SMALL : FONT_HEIGHT_NORMAL) + VPSM_BOTTOM, vp->zoom);
// x = ScaleByZoom(x - vp->left, vp->zoom) + vp->virtual_left;
// y = ScaleByZoom(y - vp->top, vp->zoom) + vp->virtual_top;
x = ScaleByZoom(x - vp->left + vp->virtual_left, vp->zoom);
y = ScaleByZoom(y - vp->top + vp->virtual_top, vp->zoom);
return
y >= sign->top &&
y < sign->top + sign_height &&
x >= sign->center - sign_half_width &&
x < sign->center + sign_half_width;
}
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Update with the patches of Szvengar.
Seems to work ok, clicking the signs did work ok in the past, but got messed up in one of the syncs, thanks for the fix.
Seems to work ok, clicking the signs did work ok in the past, but got messed up in one of the syncs, thanks for the fix.
- Attachments
-
- 32bpp_19519_v13.diff
- (86.3 KiB) Downloaded 145 times
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
You forgot to remove from spriteloader.hpp:
And you remove a little too much from png.cpp:
I will have to work a little more on PNG in palette color 1, 2 and 4 bits because I have doubts about the tRNS.
Code: Select all
+ uint8 mr; ///< Remap-red-channel
+ uint8 mg; ///< Remap-green-channel
+ uint8 mb; ///< Remap-blue-channel
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Very possible, because it was a diff against trunk, I did have several chunks failing. I think this one is a little better.
- Attachments
-
- 32bpp_19519_v13b.diff
- (86.49 KiB) Downloaded 172 times
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
I think I may I've found the solution for the sound problem:
Your last diff is good for me.Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Sorry, I forgot a little thing:
Might be helpful for the location of the sound!!!Re: [32bpp] Extra zoom levels, experimental new CC algorithm
I think that would be very healthy for the feature itself and a step that has to be taken before there's hope of the feature getting included in official builds.GeekToo wrote: Speaking of that, how would you (and everybody else) feel about the idea of taking this patch to an openttdcoop project? Now multiple people are contributing patches, I think it's time to end this being a one man project, and making it a true open project, with the added benefits of having an issue tracker. Then we also have the possibility to compile the windows bins on the compile farm regularly.
#################
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
OK, I've added a project and filled the code repository up to the latest version:
http://dev.openttdcoop.org/projects/32bpp-ez
http://dev.openttdcoop.org/projects/32bpp-ez
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Nice! So, are there now going to be regularly built binaries?
#################
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Not yet, I still have to figure out how to let it run on the compile farm regularly.
But we can use the issue tracker, and the project is open now, i.e. other coders like Szvengar or Maquinista could join the project.
Btw, I've added a new feature: follow vehicles in extra zoom levels too, gives a real nice effect.
You can follow the changelogs of the project here:
http://mz.openttdcoop.org/hg/32bpp-ez/
But we can use the issue tracker, and the project is open now, i.e. other coders like Szvengar or Maquinista could join the project.
Btw, I've added a new feature: follow vehicles in extra zoom levels too, gives a real nice effect.
You can follow the changelogs of the project here:
http://mz.openttdcoop.org/hg/32bpp-ez/
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
I was thinking of posting some bug reports but thought I'd hold off till there's a new build to see if they've been fixed. Like the town names unclickable bug, and map screen marker bug.
#################
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
On the subject of bugs... has anyone else noticed that dragging the view at high view levels don't work correctly when you are only trying to move a very short distance? It seems like you have to move the mouse at least 4 pixels or so between each mouse movement step for it to register...
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
The "town names unclickable bug" should be solve in the last binary I made.Jupix wrote:I was thinking of posting some bug reports but thought I'd hold off till there's a new build to see if they've been fixed. Like the town names unclickable bug, and map screen marker bug.
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
are there actually any binaries on the site yet?GeekToo wrote:You can follow the changelogs of the project here:
http://mz.openttdcoop.org/hg/32bpp-ez/
a (very) quick check and i couldn't find any

AroAI - A really feeble attempt at an AI
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Not yet unless there have been changes since this post.Lord Aro wrote:are there actually any binaries on the site yet?GeekToo wrote:You can follow the changelogs of the project here:
http://mz.openttdcoop.org/hg/32bpp-ez/
a (very) quick check and i couldn't find any
#################
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
Can someone compile a 1.0-EZ binary? (Diffs would also be nice I guess)
#################
-
- Tycoon
- Posts: 1829
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
I have tried to modify the monorail bridge, but I have found a problem. The far pillar are not drawn in the two upper levels. This is useful in most of briges, but It is a problem in simple bridges, because the column is not continuous. I think that the problem will be fixed drawing a pillar more. The bridge surface could be used to finish the bridge.
I have modified the code to do this:
This is the change:
I have replaced the "<" and now is a "<=".
Maybe this change could be suggested to include It in trunk.
I have modified the code to do this:
Code: Select all
static void DrawBridgePillars(const PalSpriteID *psid, const TileInfo *ti, Axis axis, bool drawfarpillar, int x, int y, int z_bridge)
{
/* Do not draw bridge pillars if they are invisible */
if (IsInvisibilitySet(TO_BRIDGES)) return;
SpriteID image = psid->sprite;
if (image != 0) {
/* "side" specifies the side the pillars stand on.
* The length of the pillars is then set to the height of the bridge over the corners of this edge.
*
* axis==AXIS_X axis==AXIS_Y
* side==false SW NW
* side==true NE SE
*
* I have no clue, why this was done this way.
*/
bool side = HasBit(image, 0);
/* "dir" means the edge the pillars stand on */
DiagDirection dir = AxisToDiagDir(axis);
if (side != (axis == AXIS_Y)) dir = ReverseDiagDir(dir);
/* Determine ground height under pillars */
int front_height = ti->z;
int back_height = ti->z;
GetSlopeZOnEdge(ti->tileh, dir, &front_height, &back_height);
/* x and y size of bounding-box of pillars */
int w = (axis == AXIS_X ? 16 : 2);
int h = (axis == AXIS_X ? 2 : 16);
/* sprite position of back facing pillar */
int x_back = x - (axis == AXIS_X ? 0 : 9);
int y_back = y - (axis == AXIS_X ? 9 : 0);
for (int cur_z = z_bridge; cur_z >= front_height || cur_z >= back_height; cur_z -= TILE_HEIGHT) {
/* Draw front facing pillar */
if (cur_z >= front_height) {
AddSortableSpriteToDraw(image, psid->pal, x, y, w, h, BB_HEIGHT_UNDER_BRIDGE - 5, cur_z, IsTransparencySet(TO_BRIDGES), 0, 0, -5);
}
/* Draw back facing pillar, but not the highest part directly under the bridge-floor */
if (drawfarpillar && cur_z >= back_height && cur_z <= z_bridge - TILE_HEIGHT) {
AddSortableSpriteToDraw(image, psid->pal, x_back, y_back, w, h, BB_HEIGHT_UNDER_BRIDGE - 5, cur_z, IsTransparencySet(TO_BRIDGES), 0, 0, -5);
}
}
}
}
Code: Select all
if (drawfarpillar && cur_z >= back_height && cur_z <= z_bridge - TILE_HEIGHT)
Maybe this change could be suggested to include It in trunk.
- Attachments
-
- Current problem with this bridge. I want to add some pillar to this bridge because It looks very strange without them.
- suggestion_monorail.JPEG (66.28 KiB) Viewed 3503 times
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
-
- Engineer
- Posts: 4
- Joined: 03 Apr 2010 16:58
Re: [32bpp] Extra zoom levels, experimental new CC algorithm
I should mention that your site currently seems to time out, don't know if its on my end or one the other end.....GeekToo wrote:OK, I've added a project and filled the code repository up to the latest version:
http://dev.openttdcoop.org/projects/32bpp-ez
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 15 guests