93 Commits
Author SHA1 Message Date
Mauro Junior 1e3c78a470 Rewrite Map: Lock tiles against going OOB.
That solves some errors related out of bounds access.
Sometimes it happens when drawing a tile, others when checking passability.

It may differ from how maniacs deals with this (I suspect maniacs have an extra blank tile, with locked passability, just for OOB tiles).
2025-01-15 15:19:57 -03:00
Mauro Junior b983e207c6 Rewrite Map: Upper tiles - Bugfixes
- Fixed wrong IDs
- Fixed wrong Layer assertion
- Added a conditional branch to protect IDs from overflowing.
2025-01-06 16:10:01 -03:00
Primekick ca30cf711f Implement recalculating autotiles D 2024-11-27 12:58:50 +01:00
Primekick ad2557a684 Partially implement Maniacs RewriteMap (without autotile fixup) 2024-11-26 21:15:22 +01:00
Ghabry aed33e772c DynRPG: Refactor to use a Game_DynRpg instance 2024-11-03 22:28:57 +01:00
Ghabry dd068009bd Fix warnings 2024-05-27 11:09:31 +02:00
Ghabry c3382029c8 Redo the X/Y shifting (Sprite clones) on looping maps.
The change doubles the amount of sprites on looping maps but this fixes all the rendering issues, especially with big charsets ($).

Most of the sprites are culled because they are out of bounds on larger maps, so the performance implications are small.

Fix #3149
2024-04-15 14:58:04 +02:00
Ghabry 02f2a36784 Screen: Clear section that is drawn out-of-bounds
This happens when the map is smaller than the viewport on higher resolutions.
2023-06-06 00:26:12 +02:00
Ghabry 0de236cff0 Panorama resolution hack must be applied everytime when the Panorama is loaded 2023-06-05 23:41:44 +02:00
Ghabry 9121bfbafa Fake Resolution: Center the map if it is smaller than the screen size
For this a new render_ox and render_oy are introduced whose only purpose is storing this offset.

Could not use ox/oy as these are already used by the sprites for other purposes.
2023-06-05 22:38:49 +02:00
Ghabry a7d6c3ca03 Spriteset Map: Replace shared_ptr with unique_ptr as these sprites are not shared.
Should be slightly faster.

Modernize code.
2023-06-05 21:06:26 +02:00
Ghabry 97753d856a Rename Game_Map Width/Height to GetTilesX/Y 2023-05-26 11:09:33 +02:00
Ghabry f8bdfdaa45 Disable commands in RPG2k that only exist in RPG2k3
Opt-in is possible with RPG2k3Commands=1 in EasyRPG.ini

Related #2951
2023-04-12 21:18:08 +02:00
Ghabry 755bc6bbed Fake Panorama position in FakeResolution mode
Is not perfect especially on scrolling maps but is better than nothing.
2023-03-24 15:58:26 +01:00
Ghabry a48f3cf01f Set panorama coordinates correctly when the map has no panorama by default
Fix #2889
2023-03-08 10:00:17 +01:00
Ghabry b93dae249d Clear map background when res % 16 != 0 to prevent artifacts at the map borders 2023-03-09 00:13:38 +01:00
Ghabry e6867ff529 Fix vehicle being invisible after map change
Fix #2867
2022-11-23 20:48:48 +01:00
Ghabry 8b5467b0f8 Panorama: Fix bugs on map init
- Panorama is now set to 0 when no panorama is set (regression introduced in a recent commit)
- reset_panorama were already set to true in ChangeBG when clearing
- panorama_on_map_init was cleared too early
2022-01-13 15:48:56 +01:00
Ghabry ee104d0240 Panorama positioning depends on width and height of the panorama.
In some cases (not scrolling or looping) the position is reset after loading the panorama.
Here was the bug: Multiple ChangePanorama commands overwrote the reset indicator.

Added a async yield op to the event and made the panorama image important to ensure that the image is loaded.

Refactored Spriteset_Map to prevent deletion as the panorama change is otherwise a dangling reference.

Fix #2195
2022-01-05 22:17:24 +01:00
Matthew Fioravante 91ca3b5aaa Tilemap: remove Update() function 2020-10-13 22:21:38 -04:00
Matthew Fioravante 89beb17b1d Remove SpriteTimer::Update 2020-10-09 14:04:20 -04:00
Ghabry 6e486a4432 DynRPG: Use Plugin Api instead of global functions 2020-09-30 16:38:48 +02:00
Matthew Fioravante 28c990d364 Refactor Game_Picture to Game_Pictures 2020-02-04 18:06:04 -05:00
Matthew Fioravante 1ff2afb2c4 Rename RequireBackground -> RequireClear and optimize 2020-01-14 23:45:04 -05:00
Carsten Teibes 03088acf72 Merge pull request #2004 from fmatthew5876/weatheropt
Rain, Snow, Screen, Bitmap, and Animations improvements
2020-01-06 17:22:48 +01:00
Matthew Fioravante 28eb3dd6ec Update tile sprite events when chipset changes
Fix: #1060
2020-01-05 11:44:50 -05:00
Matthew Fioravante d0319264e6 Move Weather into Game_Screen 2019-12-27 10:09:29 -05:00
Matthew Fioravante d2aec72baf Add DrawableList
Make a special class for DrawableList. Encapsulate all sorting / dirty
logic within.
2019-12-21 12:27:42 -05:00
Ghabry 22f1b9ce13 Make the criteria for clearing the map screen (a single 320x240x4 memset) more strict: It is always cleared except when a panorama is active.
The reason for this is another edge case in the previous commit: The lower layer star tile can be partially transparent and the upper layer tile below, too.
In this case there will be a smear because the background is not drawn. This is not fixable without additional book-keeping but a screen clear solves it.
2019-09-21 11:59:29 +02:00
Matthew Fioravante 36dc4b2704 AsyncHandler: Add IsGraphicFile() concept
Any graphical asset gets this flag.
2019-04-07 10:44:19 -04:00
Ghabry b125931c54 Support "clones" for Airship Shadow 2018-12-08 14:37:39 +01:00
Ghabry a75c824e87 Correctly render sprites on looping maps by emitting "clones" which are duplicated a X, Y and XY depending on the map panning.
Fix #1216
2018-12-08 14:23:36 +01:00
Matthew Fioravante 35479cfa02 s/SCREEN_TILE_WIDTH/SCREEN_TILE_SIZE/ 2018-12-21 18:53:05 -05:00
Matthew Fioravante 55e3428f4a Refactor tilemap substitutions
Store a reference to map_info and just trigger OnSubstitution()
to regenerate cached values.

This allows loading saved games with tile changes to actually
render correctly.
2018-12-11 18:32:31 -05:00
Matthew Fioravante 9f42c3e016 Apply screen tint to airship shadow 2018-12-08 18:11:41 -05:00
Ghabry 4b56eb6848 RPG2k3E: Don't draw the tilemap opaque when there is any drawable (Picture) below it.
Fix #1417
2018-09-23 10:59:46 +02:00
Albeleon 7844332665 Implement "ToneBlit for individual elements", Fix sprite flash with tone.
ToneBlit is very heavy performance-wise, which forced us to use two different ways to implement tintscreen in our screen:
  - 1st method: "ToneBlit for individual elements (tiles, background, weather, sprites, etc.) when they're drawn": when tintscreen remains static it was more efficient, but slower when the tone screen gradually changes. This method allows us to fix a Sprite flash bug (a sprite flash shouldn't be tinted by the screen tone; i.e. a white flash with a dark tintscreen should stay white).
  - 2nd method: "After all the drawables are drawn, ToneBlit to the screen": it's used during battles and when a tintscreen gradually changes, in this last case to improve performance.

The ideal solution would be using the 1st method to fix the flash bug. To implement it:
 - Sprite: We invert the positions of ToneBlit and BlendBlit. This way the flash color will have priority and not be tinted in the 1st method.
 - Spriteset_Map: Now in all the cases it uses the 1st method, so the code that allows the 2nd method is deleted.
 - Spriteset_Battle: We change from the 2nd method to the 1st one. We set the tone for the background and the battler sprites.
 - Background: We include the option of setting and getting a tone, and then draw it.
 - Screen: We eliminate the tone functions since no other class uses them.
2018-07-02 12:09:09 +02:00
Ghabry bf7ae9e41c Reset Panorama when the name is empty instead of showing a "Panorama/ not found" warning. 2017-09-09 23:57:33 +02:00
Ghabry 9448f9e84b Add Priorities for Below/Same/Above Events and Below/Above Tiles. Rewording and cleanup. 2017-05-27 16:51:58 +02:00
Ghabry e8765f3e6b Categorize Z Priorities in groups. 2016-10-15 23:36:53 +02:00
scurest db6c485398 Refactor/change parallax BG handling
Refactor parallax handling into a dedicated namespace in Game_Map.

Treats SaveMapInfo::parallax_* info as an override and uses the
RPG::Map parallax fields as fallback when they are empty. This
fixes #1071.
2017-03-26 11:58:09 -05:00
Ghabry 712ba657cd Weather is below screen and needs tone change, too. 2016-08-29 01:34:57 +02:00
Ghabry 7cae50696d Move Map/Battle sprites to SpriteSet class. Use screen tone for gradient changes, use per-sprite tone for constant tone (faster for these situations). 2016-08-29 01:34:57 +02:00
Ghabry 58272cd606 Spriteset_Map: Switch from stack to heap allocation 2016-08-29 01:34:57 +02:00
Ghabry eecaca648c Improve performance of Tone effect by only rendernig the tone effect once per sprite instead of applying it to the screen. Respect x and y for the tone change. 2016-08-29 01:34:57 +02:00
Ghabry 188d567a6d Make blitting on the Map smarter. Draw bottom opaque when no panorama exists, otherwise with alpha. This saves an extra background graphic draw. 2016-04-03 23:15:31 +02:00
Zegeri 23b8701d91 Replace EASYRPG_* macros with std::* equivalents 2016-03-23 21:31:32 +01:00
Ghabry 7edb5d02e2 Delay load vehicles (when they appear first time on a map) 2016-02-19 02:08:20 +01:00
Ghabry e5a797581e AsyncHandler: Prevent race conditions via shared_ptr 2016-02-18 22:09:32 +01:00
Zegeri 79b56f5c91 Simplify storage of events and common events 2016-02-06 12:34:18 +01:00