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

Pixellight #559

Closed
wants to merge 103 commits into from
Closed

Pixellight #559

wants to merge 103 commits into from

Conversation

qndel
Copy link
Member

@qndel qndel commented Jan 28, 2020

image

lighttest2

image

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 : P
add light in town
To do:
color explosion of missiles properly
optimize performance Impossible till we rewrite all graphics to 32bit

@qndel qndel added the enhancement New feature or request label Jan 28, 2020
Source/scrollrt.cpp Outdated Show resolved Hide resolved
int lightyellow = 0xfff27a;

//others
lightColorMap["PLAYERLIGHT"] = white;
Copy link
Collaborator

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;

Copy link
Member Author

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

@diasurgical diasurgical deleted a comment from codecov bot Apr 11, 2020
@julealgon
Copy link
Contributor

Tried to run this branch and got a bunch of issues:

  • scaling is off. 480p window appears at top center of my screen, unscaled
  • in town, I get a red game screen with UI below
  • in the dungeon (yeah... I got to the dungeon on a fully red screen :D) I get a fully cian game frame

What could it be?

@Lundar
Copy link

Lundar commented Sep 6, 2020

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
Copy link
Member Author

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

@gaben1488
Copy link

gaben1488 commented Dec 28, 2022

Please tell me how can I add this enhancement in 1.4.1 actual version of devilutionx

@qndel
Copy link
Member Author

qndel commented Dec 28, 2022

Please tell me how can I add this enhancement in 1.4.1 actual version of devilutionx

you can't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants