stead fixes + gfx mouse fix

This commit is contained in:
p.kosyh 2009-09-07 09:03:03 +00:00
parent 32f0978e7c
commit 046d0197b3
4 changed files with 11 additions and 6 deletions

View file

@ -8,7 +8,7 @@ char *curgame_dir = NULL;
int game_own_theme = 0;
static void game_cursor(int on);
void game_cursor(int on);
static void mouse_reset(void);
static void menu_toggle(void);
@ -1096,6 +1096,7 @@ int game_cmd(char *cmd)
/* draw title and ways */
if (new_pict || new_place) {
game_cursor(-1);
img_t offscreen = gfx_new(game_theme.w, game_theme.h);
oldscreen = gfx_screen(offscreen);
gfx_draw(oldscreen, 0, 0);
@ -1138,6 +1139,7 @@ int game_cmd(char *cmd)
// scene_scrollbar();
if (new_pict || new_place) {
img_t offscreen;
game_cursor(-1);
offscreen = gfx_screen(oldscreen);
gfx_change_screen(offscreen);
gfx_free_image(offscreen);
@ -1453,7 +1455,7 @@ int game_click(int x, int y, int action)
return 0;
}
static void game_cursor(int on)
void game_cursor(int on)
{
static img_t grab = NULL;
static img_t cur;

View file

@ -52,6 +52,7 @@ extern char *game_cfg_path(void);
extern char *game_save_path(int rc, int nr);
extern char *game_locale(void);
extern void game_cursor(int on); /* must be called with -1 before gfx change and 1 after */
struct game {
char *path;

View file

@ -2097,8 +2097,10 @@ static void update_gfx(void *aux)
img_t img = (img_t) aux;
if (step_nr == -1)
return;
game_cursor(-1);
gfx_set_alpha(img, (255 * (step_nr + 1)) / ALPHA_STEPS);
gfx_draw(img, 0, 0);
game_cursor(1);
gfx_flip();
step_nr ++;
if (step_nr == ALPHA_STEPS) {

View file

@ -351,7 +351,7 @@ function list_add(self, name, pos)
-- error "No string adding to list."
-- end
nam = deref(name);
if list_find(self, nam) then
if self:look(nam) then
return nil
end
self.__modifyed__ = true;
@ -425,12 +425,12 @@ end
function list_search(self, n)
local i;
i = list_find(self, n);
i = self:look(n);
if not i then
i = list_name(self, n);
i = self:name(n);
end
if not i and tonumber(n) then
i = list_id(self, tonumber(n));
i = self:byid(tonumber(n));
if not i then
return nil
end