#3233 closed enhancement (fixed)
[PATCH] Show capture bars when hoovering, similar to health bars
Reported by: | sanderd17 | Owned by: | sanderd17 |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 19 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description
When something is capturable, you should be able to see its state easily.
But sadly, the Engine only supports overlay textures. And as the capture bar needs player colours to represent the capture state, having textures is not versatile enough.
Included is a patch that should add CColor support, but sadly, I'm stumbling over OpenGL, and can only get black rectangles. The sprite->m_Color logged at the OverlayRenderer line 657 contains the wanted color, so it probably fails at the OpenGL commands trying to render the colour.
Another issue is that the bar doesn't get removed when unselecting the building. But maybe that's related.
Attachments (3)
Change History (9)
by , 9 years ago
Attachment: | color_sprite.diff added |
---|
comment:1 by , 9 years ago
by , 9 years ago
Attachment: | sprite_with_color_mul.patch added |
---|
Add to function "AddSprite" color param, which multiply texture value
comment:2 by , 9 years ago
Hmm, it looks like the ARB shader doesn't work. When launching a game (or even an empty map), I get
ERROR: Failed to compile fragment program 'shaders/arb/foreground_overlay.fp' (line 4): line 4, char 19: error: syntax error, unexpected IDENTIFIER
So it appears that colorMul isn't defined there.
When I change the colorMul to fragment.color (and change the colorMul in the xml file to color), and add a TEMP variable (so it doesn't have to read the result), I don't get any errors anymore. But it appears that it's reading random memory (the textures flicker a bit like analog TV noise).
by , 9 years ago
Attachment: | sprite_with_color_mul.2.patch added |
---|
comment:4 by , 9 years ago
Milestone: | Backlog → Alpha 19 |
---|
comment:6 by , 8 years ago
Summary: | [Patch] Show capture bars when hoovering, similar to health bars → [PATCH] Show capture bars when hoovering, similar to health bars |
---|
To summarise some IRC comments from a week or two ago: It would be better to stick to one method, and require a texture and a colour. Then when displaying, the texture can be multiplied with the colour.
So when taking a more-or-less white texture, and the playercolour, it would result in a playercolour bar. While multiplying the existing textures with pure white, they wouldn't be altered.