projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug with extremely slow envelopes when using "request.step_delay: 0"
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 209c4e23681915bd412b2d1f3a209538a2a4e25c..21f062b41cdc21fb2bfc3c257f08ffbefc87d9f7 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-1444,13
+1444,6
@@
void getSizedGraphicSourceExt(int graphic, int frame, int tilesize,
*y = *y * tilesize / g->tile_size;
}
*y = *y * tilesize / g->tile_size;
}
-void getFixedGraphicSourceExt(int graphic, int frame, Bitmap **bitmap,
- int *x, int *y, boolean get_backside)
-{
- getSizedGraphicSourceExt(graphic, frame, TILESIZE, bitmap, x, y,
- get_backside);
-}
-
void getSizedGraphicSource(int graphic, int frame, int tilesize,
Bitmap **bitmap, int *x, int *y)
{
void getSizedGraphicSource(int graphic, int frame, int tilesize,
Bitmap **bitmap, int *x, int *y)
{
@@
-2518,7
+2511,7
@@
void AnimateEnvelope(int envelope_nr, int anim_mode, int action)
boolean no_delay = (tape.warp_forward);
unsigned int anim_delay = 0;
int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay);
boolean no_delay = (tape.warp_forward);
unsigned int anim_delay = 0;
int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay);
- int anim_delay_value =
(no_delay ? 0 : frame_delay_value) / 2
;
+ int anim_delay_value =
MAX(1, (no_delay ? 0 : frame_delay_value) / 2)
;
int font_nr = FONT_ENVELOPE_1 + envelope_nr;
int font_width = getFontWidth(font_nr);
int font_height = getFontHeight(font_nr);
int font_nr = FONT_ENVELOPE_1 + envelope_nr;
int font_width = getFontWidth(font_nr);
int font_height = getFontHeight(font_nr);
@@
-2775,7
+2768,7
@@
void AnimateEnvelopeRequest(int anim_mode, int action)
boolean ffwd_delay = (tape.playing && tape.fast_forward);
boolean no_delay = (tape.warp_forward);
int delay_value = (ffwd_delay ? delay_value_fast : delay_value_normal);
boolean ffwd_delay = (tape.playing && tape.fast_forward);
boolean no_delay = (tape.warp_forward);
int delay_value = (ffwd_delay ? delay_value_fast : delay_value_normal);
- int anim_delay_value =
(no_delay ? 0 : delay_value + 500 * 0) / 2
;
+ int anim_delay_value =
MAX(1, (no_delay ? 0 : delay_value + 500 * 0) / 2)
;
unsigned int anim_delay = 0;
int tile_size = MAX(request.step_offset, 1);
unsigned int anim_delay = 0;
int tile_size = MAX(request.step_offset, 1);
@@
-3777,12
+3770,10
@@
void WaitForEventToContinue()
while (still_wait)
{
while (still_wait)
{
- if (PendingEvent())
- {
- Event event;
-
- NextEvent(&event);
+ Event event;
+ if (NextValidEvent(&event))
+ {
switch (event.type)
{
case EVENT_BUTTONPRESS:
switch (event.type)
{
case EVENT_BUTTONPRESS:
@@
-8500,7
+8491,7
@@
void PlayMenuMusicExt(int music)
void PlayMenuMusic()
{
char *curr_music = getCurrentlyPlayingMusicFilename();
void PlayMenuMusic()
{
char *curr_music = getCurrentlyPlayingMusicFilename();
- char *next_music = getMusic
ListEntry(menu.music[game_status])->filename
;
+ char *next_music = getMusic
InfoEntryFilename(menu.music[game_status])
;
if (!strEqual(curr_music, next_music))
PlayMenuMusicExt(menu.music[game_status]);
if (!strEqual(curr_music, next_music))
PlayMenuMusicExt(menu.music[game_status]);
@@
-8520,7
+8511,7
@@
static void FadeMenuSounds()
static void FadeMenuMusic()
{
char *curr_music = getCurrentlyPlayingMusicFilename();
static void FadeMenuMusic()
{
char *curr_music = getCurrentlyPlayingMusicFilename();
- char *next_music = getMusic
ListEntry(menu.music[game_status])->filename
;
+ char *next_music = getMusic
InfoEntryFilename(menu.music[game_status])
;
if (!strEqual(curr_music, next_music))
FadeMusic();
if (!strEqual(curr_music, next_music))
FadeMusic();