-
Notifications
You must be signed in to change notification settings - Fork 796
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
Pixellight #559
Pixellight #559
Conversation
int lightyellow = 0xfff27a; | ||
|
||
//others | ||
lightColorMap["PLAYERLIGHT"] = white; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be a struct or a series of variables, then there won't be any look-ups and you won't need a prepareLightColors function.
// light_color.h
extern const int LIGHT_FIREARROW;
// light_colors.cpp
namespace {
constexpr int kBlue = 0x0000ff;
}
const int LIGHT_FIREARROW = kBlue;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I'd need an extern for each variable :P
Tried to run this branch and got a bunch of issues:
What could it be? |
Spent most of a day looking into this. It appears that SDL_SetColorKey and SDL_ConvertSurface do not always work together. Found that the Surface tmp was not being created with transparent regions as expected. The SDL wiki here suggests that Convert surface is best used to optimize repeated blits, since we discard the converted surface every frame, we are probably safe to skip this step, and create ui_texture directly from ui_surface. (At least that is the fix that resolved this problem for me). |
@@ -962,6 +996,53 @@ void SaveGame() | |||
dwLen = codec_get_encoded_len(tbuff - SaveBuff); | |||
pfile_write_save_file(szName, SaveBuff, tbuff - SaveBuff, dwLen); | |||
mem_free_dbg(SaveBuff); | |||
#ifdef PIXEL_LIGHT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems this could use restoring tbuff to previous value after custom saving/loading ends, it didn't corrupt saves in this case but when moved to a different place, it would
Please tell me how can I add this enhancement in 1.4.1 actual version of devilutionx |
you can't |
Fully working now :)
Done:
support multiple colors
player light
missiles
static lights
fix static lights jumping around
deal with light being cut off on lower resolutions
fix first load have no static lights
stop the light system from affecting main menu etc.
make the fadein/fadeout when loading/going to/from main menu work properly
create a global table for missile color (and radius?)
add custom colors to missiles
deal with cursor having opaque rectangle around during fades
rewrite red on death/pause to work with pixel light
make light work during lag
stop quest area and normal level lights from interfering
save static lights with character
reset static light table between games
fix unique monster light jump around
fix light staying after unique monster teleports
(vanilla bug) - kind of fixed, even if broken, will try to follow the monster : Padd light in town
To do:
color explosion of missiles properly
Impossible till we rewrite all graphics to 32bitoptimize performance