mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-12 01:08:32 +03:00
ReignEngine: Fix BackCG issues
- Enable both alpha map and alpha mod, using the new drawing function gfx_copy_stretch_blend_amap_alpha(). - Do not draw if `bcg->show` flag is false. - Do not WARNING() for SetBackCGNum(0) as it's used to unload the CG.
This commit is contained in:
@@ -888,6 +888,9 @@ bool RE_back_cg_set(struct RE_back_cg *bcg, int no)
|
||||
bcg->no = no;
|
||||
gfx_delete_texture(&bcg->texture);
|
||||
|
||||
if (!no) // unload only.
|
||||
return true;
|
||||
|
||||
struct cg *cg = asset_cg_load(no);
|
||||
if (!cg) {
|
||||
WARNING("cannot load back CG: %d", no);
|
||||
|
||||
+2
-2
@@ -505,11 +505,11 @@ static void render_shadow_map(struct RE_plugin *plugin, mat4 light_space_transfo
|
||||
|
||||
static void render_back_cg(struct texture *dst, struct RE_back_cg *bcg, struct RE_renderer *r)
|
||||
{
|
||||
if (!bcg->texture.handle)
|
||||
if (!bcg->show || !bcg->texture.handle)
|
||||
return;
|
||||
int sw = bcg->texture.w;
|
||||
int sh = bcg->texture.h;
|
||||
gfx_copy_stretch_blend(dst, bcg->x, bcg->y, sw * bcg->mag, sh * bcg->mag, &bcg->texture, 0, 0, sw, sh, bcg->blend_rate * 255);
|
||||
gfx_copy_stretch_blend_amap_alpha(dst, bcg->x, bcg->y, sw * bcg->mag, sh * bcg->mag, &bcg->texture, 0, 0, sw, sh, bcg->blend_rate * 255);
|
||||
}
|
||||
|
||||
static void setup_lights(struct RE_plugin *plugin)
|
||||
|
||||
Reference in New Issue
Block a user