Minor vehicle fixes #436
Minor vehicle fixes #436
Conversation
This fixes a bug where, when a vehicle which was not on the map when the spritset was created is moved to the map, the vehicle is invisible.
|
I agree this is the simplest solution, I was thinking of refreshing the sprites of vehicles when SetVehicleLocation is used, like ChangeMapTileset does with tileset changes. But that would mean to have another vector of sprites just for the vehicles, not a pretty solution. By the way, this is not the issue commented in the PR description.
That means to board a vehicle that it's in the current map, but outside the range of valid positions. For example, if the player is in (1,1) facing left and a ship is in (0,1) (not a valid position), the player should be able to get on the vehicle. This is how RPG_RT behaves. |
|
I don't think such optimizations are worth the effort for 3 sprites. They won't induce a huge cpu penalty. Another question is if the Draw-code of off-screen Sprites draws anything or just skips. That would be a general optimization that all sprites (including vehicles) profit from. No idea if we already do this. |
Redo e7880d8 correctly this time :)
|
Thanks Zegeri. Can I take out these lines too? @Ghabry looks like a visibility test is the first thing out the door for sprite drawing, but they still participate in z-ordering and stuff. One more thing is the airship shadow is basically one or two more sprites in the spriteset too, and they'll have the same issue. |
Also, miscellaneous whitespace fix.
|
About airship shadow: there is a blend of two semitransparent sprites from system.png. I've prepared two red and blue squares there for testing: You can compare them with these Cairo (pixman) operations pictures to check which blend operation is closer. If you swap the colors, the colour blend result will be different: There are some PIXMAN_OP_* operator examples in source code (bitmap.cpp). |
|
@scurest Yeah, we won't need those lines. |
|
Alright, if everyone's good, that's all the stuff I had for this branch. I have code for the airship shadow too but I'll do it in another PR. |
|
Looks good to me, thanks |
|
so this is rdy? |
|
Yeah. |

Some very minor fixes on the heels of #434.
2dfa0d5 adds a "stepping speed" to decouple the rate that characters do their left-middle-right-middle animation from their movement speed, but since it's actually the player's movement speed that's faster when riding a vehicle, an alternative would be to set all the vehicle's move speeds to 1/8 and move the switch to choose higher move speeds when riding vehicles to the line changed by e7880d8. I don't think the vehicles' move speed actually affect anything but their stepping animation does it?
Was everyone ok with 10455da?