Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* file.c (g_score_mode): renamed to g_score_mask.
[vor.git]
/
main.c
diff --git
a/main.c
b/main.c
index
c2e6601
..
a2bdcbc
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-19,11
+19,23
@@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <argp.h>
+#include <math.h>
+#include <SDL/SDL.h>
+#include <SDL/SDL_image.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SFont.h"
+
#ifdef DEBUG
#include "debug.h"
#endif
#include "args.h"
#ifdef DEBUG
#include "debug.h"
#endif
#include "args.h"
+#include "common.h"
#include "config.h"
#include "file.h"
#include "globals.h"
#include "config.h"
#include "file.h"
#include "globals.h"
@@
-32,17
+44,6
@@
#include "shape.h"
#include "sound.h"
#include "shape.h"
#include "sound.h"
-#include <argp.h>
-#include <math.h>
-#include <SDL/SDL.h>
-#include <SDL/SDL_image.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "SFont.h"
-
// ************************************* VARS
// SDL_Surface global variables
SDL_Surface
// ************************************* VARS
// SDL_Surface global variables
SDL_Surface
@@
-116,6
+117,8
@@
char *data_dir;
extern char *optarg;
extern int optind, opterr, optopt;
extern char *optarg;
extern int optind, opterr, optopt;
+#define TO_TICKS(seconds) ((seconds)*20*opt_gamespeed)
+
// ************************************* FUNCS
float
// ************************************* FUNCS
float
@@
-714,13
+717,14
@@
gameloop() {
screendx = -tmp;
// taper off if we would hit the barrier in under 2 seconds.
screendx = -tmp;
// taper off if we would hit the barrier in under 2 seconds.
- if(back_dist + (screendx - SCREENDXMIN)*2*20*opt_gamespeed < 0) {
- screendx = SCREENDXMIN - (back_dist/(2*20*opt_gamespeed));
+ if(back_dist + (screendx - SCREENDXMIN)*TO_TICKS(2) < 0) {
+ screendx = SCREENDXMIN - (back_dist/TO_TICKS(2));
}
xscroll = screendx * framelen;
yscroll = screendy * framelen;
back_dist += (screendx - SCREENDXMIN)*framelen;
}
xscroll = screendx * framelen;
yscroll = screendy * framelen;
back_dist += (screendx - SCREENDXMIN)*framelen;
+ if(opt_max_lead >= 0) back_dist = min(back_dist, opt_max_lead);
shipx -= xscroll;
shipy -= yscroll;
shipx -= xscroll;
shipy -= yscroll;