~ubuntu-branches/ubuntu/raring/bumprace/raring

« back to all changes in this revision

Viewing changes to src/menu.c

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess, Joey Hess, root
  • Date: 2006-10-14 23:00:39 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20061014230039-navrufb60e95o381
Tags: 1.5.1.dfsg-2.1
[ Joey Hess ]
* NMU with patch from tbm to fix FTBFS with current gcc. Closes: #392318

[ root ]
* GNU config automated update: config.sub     (20060223 to 20060920),
  config.guess     (20060223 to 20060702)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "bumprace.h"
 
2
#include <math.h>
2
3
 
3
4
void clear_screen()
4
5
{
159
160
 
160
161
void Menu()
161
162
{
162
 
  int v,y=599,update;
163
 
  float time;
 
163
  int y=599,update;
 
164
  float startTime;
164
165
  SDL_Rect oldrect[4];
165
166
 
166
167
//  blit(0,0,title_pic);
168
169
  {
169
170
    oldrect[i].x=0;oldrect[i].y=0;oldrect[i].w=1;oldrect[i].h=1;
170
171
  }
171
 
  v=555;
172
 
  now=SDL_GetTicks();
173
 
  while (v>0)
 
172
  startTime = now = SDL_GetTicks();
 
173
  while (startTime + 1000 > now)
174
174
  {
175
175
    for (i=0;i<4;i++) {
176
176
      SDL_FillRect(Screen,&oldrect[i],0);
180
180
    oldrect[1]=DrawMode(1, y, oldrect);
181
181
    oldrect[2]=DrawMode(2, y, oldrect);
182
182
    oldrect[3]=DrawMode(3, y+120, oldrect);
183
 
    time=((float)(SDL_GetTicks()-now))/1000;
184
 
    now=SDL_GetTicks();
185
 
    y-=v*time;
186
 
    v-=599*time;
 
183
    now = SDL_GetTicks();
 
184
    y = 599 - (int)( sin((now - startTime) * M_PI / 2000) * 310);
187
185
    Update();
188
186
  }
189
187
  mode=0;update=1;
254
252
void SelectRacer()  //menu for racer selection
255
253
{  
256
254
  SDL_Rect fillrect;
257
 
  int i;
258
255
  
259
256
  fillrect.x=50;
260
257
  fillrect.y=140;