Skip to content

Comments

Add mortar layer#738

Open
madebr wants to merge 2 commits intoisledecomp:masterfrom
madebr:add-mortar-layer
Open

Add mortar layer#738
madebr wants to merge 2 commits intoisledecomp:masterfrom
madebr:add-mortar-layer

Conversation

@madebr
Copy link
Contributor

@madebr madebr commented Nov 27, 2025

No description provided.

@madebr madebr marked this pull request as draft November 27, 2025 22:53
@madebr madebr force-pushed the add-mortar-layer branch 7 times, most recently from d8c80e9 to 380aaaf Compare December 19, 2025 23:08
@madebr
Copy link
Contributor Author

madebr commented Dec 19, 2025

This pr is ready for testing.
I only need to change one thing before this is ready for merging: limit the number of SDL3 symbols that are dynamically loaded.

@madebr madebr force-pushed the add-mortar-layer branch 3 times, most recently from ca345e7 to 623fe47 Compare December 20, 2025 19:34
@madebr madebr force-pushed the add-mortar-layer branch 4 times, most recently from b2d1fa4 to b501e3a Compare December 31, 2025 15:54
@madebr madebr marked this pull request as ready for review December 31, 2025 15:59
@madebr
Copy link
Contributor Author

madebr commented Dec 31, 2025

I'm marking this ready for review.
It needs a thorough review + testing before considered ready for merging.

@CompSciDude1

This comment was marked as resolved.

@leap0x7b

This comment was marked as resolved.

@leap0x7b

This comment was marked as off-topic.

@madebr

This comment was marked as off-topic.

@madebr madebr marked this pull request as draft January 7, 2026 16:35
@madebr madebr marked this pull request as ready for review January 8, 2026 00:44
@madebr madebr force-pushed the add-mortar-layer branch 2 times, most recently from ae1b71f to 2cb0571 Compare January 8, 2026 01:10
@leap0x7b

This comment was marked as off-topic.

@madebr

This comment was marked as off-topic.

@Rhlp-Engineering

This comment was marked as off-topic.

@Rhlp-Engineering
Copy link

What's mortar?

The motivation of an extra layer is platforms that do not (yet) have SDL3 support, or don't even have any SDL support. Please read the thread starting from #707 (review) This extra layer (with some, but minimal overhead) allows isle-portabl to be built on top of any platform.

we're using sdl3 as of right now (which is a bad idea imo should've used sdl2) though the mortar thing will allow you to use other backends

sdl2 is in maintenance mode and will never ever get additional features. Perhaps sdl2-compat provides too good compatibility.

oh sorry that i didnt see this.

@foxtacles
Copy link
Member

@madebr could you rebase this one more time? I'll do some testing this weekend

@madebr
Copy link
Contributor Author

madebr commented Jan 31, 2026

@madebr could you rebase this one more time? I'll do some testing this weekend

Done.

When testing and reviewing the code, make sure to pay attention to the mortar surfaces and palettes in sdl3_surface.cpp, palettes in particular as these depend on reference counting. I think I got it right but it's always good to have extra eyes on it.

Please make sure your texture loader extension still functions properly, as it was present in the traces of #775.

This mortar thing is missing proper testing that you intend to do coming weekend.

When loading BMP files via MORTAR_LoadBMP, SDL3 attaches a palette to
the surface internally. Previously, create_mortar_surface_from_sdl3
did not extract this palette, causing MORTAR_GetSurfacePalette to
return NULL for 8-bit palettized images.

Create an independent MORTAR palette and copy the colors from the
SDL3 surface's palette to make it accessible via MORTAR_GetSurfacePalette.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants