Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
cannonball
Commits
1e9a5120
Commit
1e9a5120
authored
Nov 17, 2013
by
reassembler
Browse files
LayOut specific fix: Avoid bad memory writes on over populated scenery segments.
parent
1a7be5fc
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/engine/osprites.cpp
View file @
1e9a5120
...
...
@@ -370,6 +370,10 @@ void OSprites::map_palette(oentry* spr)
void
OSprites
::
do_spr_order_shadows
(
oentry
*
input
)
{
// LayOut specific fix to avoid memory crash on over populated scenery segments
if
(
spr_cnt_main
+
spr_cnt_shadow
>=
JUMP_ENTRIES_TOTAL
)
return
;
// Use priority as lookup into table. Assume we're on boundaries of 0x10
uint16_t
priority
=
(
input
->
priority
&
0x1FF
)
<<
4
;
uint8_t
bytes_to_copy
=
sprite_order
[
priority
];
...
...
@@ -387,6 +391,10 @@ void OSprites::do_spr_order_shadows(oentry* input)
// test_shadow:
if
(
!
(
input
->
control
&
SHADOW
))
return
;
// LayOut specific fix to avoid memory crash on over populated scenery segments
if
(
spr_cnt_main
+
spr_cnt_shadow
>=
JUMP_ENTRIES_TOTAL
)
return
;
input
->
dst_index
=
spr_cnt_shadow
;
spr_cnt_shadow
++
;
// Increment total shadow count
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment