#include <sys/param.h>
#include <sys/types.h>
#include <stdarg.h>
+#include <ctype.h>
#include "misc.h"
#include "init.h"
#include "random.h"
#include "joystick.h"
+/* maximal allowed length of a command line option */
+#define MAX_OPTION_LEN 256
+
static unsigned long mainCounter(int mode)
{
static struct timeval base_time = { 0, 0 };
return (root % max);
}
+#ifdef DEBUG
+static unsigned int last_RND_value = 0;
+
+unsigned int last_RND()
+{
+ return last_RND_value;
+}
+#endif
+
unsigned int RND(unsigned int max)
{
+#ifdef DEBUG
+ return (last_RND_value = random_linux_libc() % max);
+#else
return (random_linux_libc() % max);
+#endif
}
unsigned int InitRND(long seed)
return s_copy;
}
+char *getStringToLower(char *s)
+{
+ char *s_copy = checked_malloc(strlen(s) + 1);
+ char *s_ptr = s_copy;
+
+ while (*s)
+ *s_ptr++ = tolower(*s++);
+
+ return s_copy;
+}
+
void MarkTileDirty(int x, int y)
{
int xx = redraw_x1 + x;