summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f8f6911)
* added recognition of "trigger element" for "change digged element to"
(this is not really what the "trigger element" was made for, but its
use may seem obvious for leaving back digged elements unchanged)
* fixed multiple warnings about failed joystick device initialization
+2005-07-24
+ * added recognition of "trigger element" for "change digged element to"
+ (this is not really what the "trigger element" was made for, but its
+ use may seem obvious for leaving back digged elements unchanged)
+
+2005-07-23
+ * fixed multiple warnings about failed joystick device initialization
+
2005-06-27
* fixed bug with dynamite dropped on top of just dropped custom element
(collect dynamite, collect CE, drop CE => dynamite was also dropped);
2005-06-27
* fixed bug with dynamite dropped on top of just dropped custom element
(collect dynamite, collect CE, drop CE => dynamite was also dropped);
-#define COMPILE_DATE_STRING "[2005-06-30 00:18]"
+#define COMPILE_DATE_STRING "[2005-07-24 14:45]"
#define USE_DROP_BUGFIX (TRUE * USE_NEW_STUFF * 1)
#define USE_DROP_BUGFIX (TRUE * USE_NEW_STUFF * 1)
+#define USE_CHANGE_TO_TRIGGERED (TRUE * USE_NEW_STUFF * 1)
+
/* for DigField() */
#define DF_NO_PUSH 0
/* for DigField() */
#define DF_NO_PUSH 0
#if 1
Store[newx][newy] = EL_EMPTY;
if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)))
#if 1
Store[newx][newy] = EL_EMPTY;
if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)))
+ {
+#if USE_CHANGE_TO_TRIGGERED
+ int move_leave_element = element_info[element].move_leave_element;
+
+ Store[newx][newy] = (move_leave_element == EL_TRIGGER_ELEMENT ?
+ new_element : move_leave_element);
+#else
Store[newx][newy] = element_info[element].move_leave_element;
Store[newx][newy] = element_info[element].move_leave_element;
#else
Store[newx][newy] = EL_EMPTY;
if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)) ||
#else
Store[newx][newy] = EL_EMPTY;
if (IS_EQUAL_OR_IN_GROUP(new_element, MOVE_ENTER_EL(element)) ||
{
int move_leave_element = ei->move_leave_element;
{
int move_leave_element = ei->move_leave_element;
+#if USE_CHANGE_TO_TRIGGERED
+ if (ei->move_leave_type == LEAVE_TYPE_LIMITED &&
+ ei->move_leave_element == EL_TRIGGER_ELEMENT)
+ move_leave_element = stored;
+#endif
+
Feld[x][y] = move_leave_element;
#if USE_PREVIOUS_MOVE_DIR
Feld[x][y] = move_leave_element;
#if USE_PREVIOUS_MOVE_DIR
#if defined(PLATFORM_UNIX) && !defined(TARGET_SDL)
void UnixInitJoysticks()
{
#if defined(PLATFORM_UNIX) && !defined(TARGET_SDL)
void UnixInitJoysticks()
{
+ static boolean unix_joystick_subsystem_initialized = FALSE;
+ boolean print_warning = !unix_joystick_subsystem_initialized;
int i;
for (i = 0; i < MAX_PLAYERS; i++)
int i;
for (i = 0; i < MAX_PLAYERS; i++)
if (access(device_name, R_OK) != 0)
{
if (access(device_name, R_OK) != 0)
{
- Error(ERR_WARN, "cannot access joystick device '%s'", device_name);
+ if (print_warning)
+ Error(ERR_WARN, "cannot access joystick device '%s'", device_name);
+
continue;
}
if ((joystick.fd[i] = open(device_name, O_RDONLY)) < 0)
{
continue;
}
if ((joystick.fd[i] = open(device_name, O_RDONLY)) < 0)
{
- Error(ERR_WARN, "cannot open joystick device '%s'", device_name);
+ if (print_warning)
+ Error(ERR_WARN, "cannot open joystick device '%s'", device_name);
+
continue;
}
joystick.status = JOYSTICK_ACTIVATED;
}
continue;
}
joystick.status = JOYSTICK_ACTIVATED;
}
+
+ unix_joystick_subsystem_initialized = TRUE;
}
boolean UnixReadJoystick(int fd, int *x, int *y, boolean *b1, boolean *b2)
}
boolean UnixReadJoystick(int fd, int *x, int *y, boolean *b1, boolean *b2)
void SDLInitJoysticks()
{
static boolean sdl_joystick_subsystem_initialized = FALSE;
void SDLInitJoysticks()
{
static boolean sdl_joystick_subsystem_initialized = FALSE;
+ boolean print_warning = !sdl_joystick_subsystem_initialized;
int i;
if (!sdl_joystick_subsystem_initialized)
int i;
if (!sdl_joystick_subsystem_initialized)
int joystick_nr = getJoystickNrFromDeviceName(device_name);
if (joystick_nr >= SDL_NumJoysticks())
int joystick_nr = getJoystickNrFromDeviceName(device_name);
if (joystick_nr >= SDL_NumJoysticks())
+ {
+ if (setup.input[i].use_joystick && print_warning)
+ Error(ERR_WARN, "cannot find joystick %d", joystick_nr);
+
/* misuse joystick file descriptor variable to store joystick number */
joystick.fd[i] = joystick_nr;
/* misuse joystick file descriptor variable to store joystick number */
joystick.fd[i] = joystick_nr;
+ if (joystick_nr == -1)
+ continue;
+
/* this allows subsequent calls to 'InitJoysticks' for re-initialization */
if (SDLCheckJoystickOpened(joystick_nr))
SDLCloseJoystick(joystick_nr);
/* this allows subsequent calls to 'InitJoysticks' for re-initialization */
if (SDLCheckJoystickOpened(joystick_nr))
SDLCloseJoystick(joystick_nr);
if (!SDLOpenJoystick(joystick_nr))
{
if (!SDLOpenJoystick(joystick_nr))
{
- Error(ERR_WARN, "cannot open joystick %d", joystick_nr);
+ if (print_warning)
+ Error(ERR_WARN, "cannot open joystick %d", joystick_nr);
+