Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adventure map fading #84

Merged
merged 9 commits into from Feb 18, 2015
Merged

Adventure map fading #84

merged 9 commits into from Feb 18, 2015

Conversation

@Fayth
Copy link
Contributor

Fayth commented Feb 9, 2015

Implemented screen crossfading in advmap (when using monoliths, gates and dimension doors).
Implemented fading of objects in advmap (e.g. taken resources, defeated monsters, built boats, (dis)embarking).
To test fading with extraResolutions mod enabled, you'll need to add a config similar to default resolutions.json to your chosen resolution (https://github.com/Fayth/vcmi/compare/test/advMapFading?expand=1#diff-ab59169ed44867cfe6ec50ab3eb1225cR7 ).

Hopefully there won't be any conflicts with spells refactoring branch, as I didn't touch drawTileOverlay() or blit() methods.
This probably doesn't fix mantis#2053, I'll try to fix that separately.

Fayth added 8 commits Jan 28, 2015
Smoother fade animations;
Added fading when recentering hero after switching levels;
Added more map object fading cases (teleports/(dis)embarking)
Disabled map movement requests during fade;
…apFading

Conflicts:
	client/CPlayerInterface.cpp
@DjWarmonger

This comment has been minimized.

Copy link
Member

DjWarmonger commented Feb 9, 2015

Why would we need fading in a config, anyway? Isn't this standard feature?

Either way, user options should be moved to settings.json. resolutions.json was meant for mods.

@Fayth

This comment has been minimized.

Copy link
Contributor Author

Fayth commented Feb 9, 2015

While it's not very important to put it in config, I think there's no harm. I can imagine having some low-end settings (android?) where additional redraws during animations would be unnecessary.

As for setting location -- you know better than me. ;) I placed them right by the smooth map scrolling and puzzle map sepia, which look like the same type of settings.

@DjWarmonger

This comment has been minimized.

Copy link
Member

DjWarmonger commented Feb 9, 2015

The issue is now we can't use resolutions mod and fading independently.

I suggest just adding default value for now, which turns the fading on by default (but can be disabled via config).

@ArseniyShestakov

This comment has been minimized.

Copy link
Member

ArseniyShestakov commented Feb 10, 2015

Tested this branch. So far it's doesn't cause any instability for me and work as expected.

DjWarmonger added a commit that referenced this pull request Feb 18, 2015
If no one objects, I will try to merge this.
@DjWarmonger DjWarmonger merged commit 2a082e6 into vcmi:develop Feb 18, 2015
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
return;
}

SDL_SetSurfaceAlphaMod(fadingSurface, fadingCounter * 255);

This comment has been minimized.

Copy link
@DjWarmonger

DjWarmonger Feb 18, 2015

Member

Where is this function defined? Can't find it.

This comment has been minimized.

Copy link
@ArseniyShestakov

ArseniyShestakov Feb 18, 2015

Member

Do you mean SDL_SetSurfaceAlphaMod? If yes then it's likely SDL2-only function.

This comment has been minimized.

Copy link
@alexvins

alexvins Feb 18, 2015

Member

See void CPicture::setAlpha for usage example and SDL1 equivalent and yes it is SDL2 only.

UPD. Also it may be a good idea to define it as a macro in SDL_Compat.h

This comment has been minimized.

Copy link
@Fayth

Fayth Feb 18, 2015

Author Contributor

Well, oops. I didn't check function version, that was the first thing that google suggested for sdl alpha manipulation. As an excuse, I haven't used sdl before vcmi. ;)
I can look into it later today if you want.

This comment has been minimized.

Copy link
@alexvins

alexvins Feb 18, 2015

Member

The only usage of this function in VCMI:

void CPicture::setAlpha(int value)
{
#ifdef VCMI_SDL1
SDL_SetAlpha(bg, SDL_SRCALPHA, value);
#else
SDL_SetSurfaceAlphaMod(bg,value);
#endif // 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.