Fadeout not working on latest source. #121

Closed
opened 2015-07-07 12:47:18 +00:00 by sorlok · 2 comments
sorlok commented 2015-07-07 12:47:18 +00:00 (Migrated from github.com)

At some point, fade-outs stopped working in MKXP for RPG Maker VX. Sample game:
https://drive.google.com/file/d/0B1P7NepPcOslVmhCcFBhc05BS0U/view?usp=sharing

Talking to the NPC fades the screen correctly in the downloadable binary (Win32) but fails to fade it on the latest source (Linux). Tracking this a bit further, I've found the following:

  1. Game_Interpreter sets Game_Screen's "brightness" variable during a fade.
  2. Game_Screen uses "brightness" to set viewport3's "color"
  3. Viewport3's "color" is used in Viewport::composite() like so:
    scene->requestViewportRender(p->color->norm, flashColor, p->tone->norm);
  4. In Graphics::requestViewportRender(), we have the following:
        bool toneEffect = t.xyzHasEffect();
        bool colorEffect = c.xyzHasEffect();
        bool flashEffect = f.xyzHasEffect();
        if (!toneEffect && !colorEffect && !flashEffect)
            return;

The problem here is that a black "color effect" will register as NO color effect. The following fixes the problem:

        bool colorEffect = c.xyzHasEffect() || c.w>0;

I am not sure if the toneEffect and flashEffect suffer from the same problem for translucent black effects.

At some point, fade-outs stopped working in MKXP for RPG Maker VX. Sample game: https://drive.google.com/file/d/0B1P7NepPcOslVmhCcFBhc05BS0U/view?usp=sharing Talking to the NPC fades the screen correctly in the downloadable binary (Win32) but fails to fade it on the latest source (Linux). Tracking this a bit further, I've found the following: 1. Game_Interpreter sets Game_Screen's "brightness" variable during a fade. 2. Game_Screen uses "brightness" to set viewport3's "color" 3. Viewport3's "color" is used in Viewport::composite() like so: scene->requestViewportRender(p->color->norm, flashColor, p->tone->norm); 4. In Graphics::requestViewportRender(), we have the following: ``` bool toneEffect = t.xyzHasEffect(); bool colorEffect = c.xyzHasEffect(); bool flashEffect = f.xyzHasEffect(); if (!toneEffect && !colorEffect && !flashEffect) return; ``` The problem here is that a black "color effect" will register as NO color effect. The following fixes the problem: ``` bool colorEffect = c.xyzHasEffect() || c.w>0; ``` I am not sure if the toneEffect and flashEffect suffer from the same problem for translucent black effects.
Ancurio commented 2015-07-07 13:23:53 +00:00 (Migrated from github.com)

I suspect it's 373b90af00 that broke it. Edit: Indeed. Not sure what I was thinking.

I suspect it's 373b90af003fe5f9b765f2a1ec8c0f803bd808e2 that broke it. Edit: Indeed. Not sure what I was thinking.
sorlok commented 2015-07-07 14:14:59 +00:00 (Migrated from github.com)

I'll try it out after work, but looks like it should do the trick. Thanks!

I'll try it out after work, but looks like it should do the trick. Thanks!
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: MapleShrine/mkxp#121
No description provided.