Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 326961 | Differences between
and this patch

Collapse All | Expand All

(-)wl_act2.cpp.orig (-5 / +5 lines)
Lines 1468-1474 Link Here
1468
    if (CheckLine(ob))                                              // got a shot at player?
1468
    if (CheckLine(ob))                                              // got a shot at player?
1469
    {
1469
    {
1470
        ob->hidden = false;
1470
        ob->hidden = false;
1471
        if ( (unsigned) US_RndT() < (tics<<3) && objfreelist)
1471
        if ( (int) US_RndT() < (tics<<3) && objfreelist)
1472
        {
1472
        {
1473
            //
1473
            //
1474
            // go into attack frame
1474
            // go into attack frame
Lines 2389-2395 Link Here
2389
    if (CheckLine(ob))                                              // got a shot at player?
2389
    if (CheckLine(ob))                                              // got a shot at player?
2390
    {
2390
    {
2391
        ob->hidden = false;
2391
        ob->hidden = false;
2392
        if ( (unsigned) US_RndT() < (tics<<3) && objfreelist)
2392
        if ( (int) US_RndT() < (tics<<3) && objfreelist)
2393
        {
2393
        {
2394
            //
2394
            //
2395
            // go into attack frame
2395
            // go into attack frame
Lines 2481-2487 Link Here
2481
    if (CheckLine(ob))                                              // got a shot at player?
2481
    if (CheckLine(ob))                                              // got a shot at player?
2482
    {
2482
    {
2483
        ob->hidden = false;
2483
        ob->hidden = false;
2484
        if ( (unsigned) US_RndT() < (tics<<3) && objfreelist)
2484
        if ( (int) US_RndT() < (tics<<3) && objfreelist)
2485
        {
2485
        {
2486
            //
2486
            //
2487
            // go into attack frame
2487
            // go into attack frame
Lines 2573-2579 Link Here
2573
    if (CheckLine(ob))                                              // got a shot at player?
2573
    if (CheckLine(ob))                                              // got a shot at player?
2574
    {
2574
    {
2575
        ob->hidden = false;
2575
        ob->hidden = false;
2576
        if ( (unsigned) US_RndT() < (tics<<3) && objfreelist)
2576
        if ( (int) US_RndT() < (tics<<3) && objfreelist)
2577
        {
2577
        {
2578
            //
2578
            //
2579
            // go into attack frame
2579
            // go into attack frame
Lines 2976-2982 Link Here
2976
    if (CheckLine(ob))                      // got a shot at player?
2976
    if (CheckLine(ob))                      // got a shot at player?
2977
    {
2977
    {
2978
        ob->hidden = false;
2978
        ob->hidden = false;
2979
        if ( (unsigned) US_RndT() < (tics<<1) && objfreelist)
2979
        if ( (int) US_RndT() < (tics<<1) && objfreelist)
2980
        {
2980
        {
2981
            //
2981
            //
2982
            // go into attack frame
2982
            // go into attack frame
(-)wl_agent.cpp.orig (-61 / +29 lines)
Lines 151-157 Link Here
151
=
151
=
152
= ControlMovement
152
= ControlMovement
153
=
153
=
154
= Takes controlx,controly, and buttonstate[bt_strafe]
154
= Takes controlx,controly,controlh, and buttonstate[bt_strafe]
155
=
155
=
156
= Changes the player's angle and position
156
= Changes the player's angle and position
157
=
157
=
Lines 172-239 Link Here
172
    oldx = player->x;
172
    oldx = player->x;
173
    oldy = player->y;
173
    oldy = player->y;
174
174
175
    if(buttonstate[bt_strafeleft])
176
    {
177
        angle = ob->angle + ANGLES/4;
178
        if(angle >= ANGLES)
179
            angle -= ANGLES;
180
        if(buttonstate[bt_run])
181
            Thrust(angle, RUNMOVE * MOVESCALE * tics);
182
        else
183
            Thrust(angle, BASEMOVE * MOVESCALE * tics);
184
    }
185
186
    if(buttonstate[bt_straferight])
187
    {
188
        angle = ob->angle - ANGLES/4;
189
        if(angle < 0)
190
            angle += ANGLES;
191
        if(buttonstate[bt_run])
192
            Thrust(angle, RUNMOVE * MOVESCALE * tics );
193
        else
194
            Thrust(angle, BASEMOVE * MOVESCALE * tics);
195
    }
196
197
    //
175
    //
198
    // side to side move
176
    // turn
199
    //
177
    //
200
    if (buttonstate[bt_strafe])
178
    anglefrac += controlh;
201
    {
179
    angleunits = anglefrac/ANGLESCALE;
202
        //
180
    anglefrac -= angleunits*ANGLESCALE;
203
        // strafing
181
    ob->angle -= angleunits;
204
        //
182
205
        //
183
    if (ob->angle >= ANGLES)
206
        if (controlx > 0)
184
        ob->angle -= ANGLES;
207
        {
185
    if (ob->angle < 0)
208
            angle = ob->angle - ANGLES/4;
186
        ob->angle += ANGLES;
209
            if (angle < 0)
210
                angle += ANGLES;
211
            Thrust (angle,controlx*MOVESCALE);      // move to left
212
        }
213
        else if (controlx < 0)
214
        {
215
            angle = ob->angle + ANGLES/4;
216
            if (angle >= ANGLES)
217
                angle -= ANGLES;
218
            Thrust (angle,-controlx*MOVESCALE);     // move to right
219
        }
220
    }
221
    else
222
    {
223
        //
224
        // not strafing
225
        //
226
        anglefrac += controlx;
227
        angleunits = anglefrac/ANGLESCALE;
228
        anglefrac -= angleunits*ANGLESCALE;
229
        ob->angle -= angleunits;
230
231
        if (ob->angle >= ANGLES)
232
            ob->angle -= ANGLES;
233
        if (ob->angle < 0)
234
            ob->angle += ANGLES;
235
236
    }
237
187
238
    //
188
    //
239
    // forward/backwards move
189
    // forward/backwards move
Lines 252-257 Link Here
252
202
253
    if (gamestate.victoryflag)              // watching the BJ actor
203
    if (gamestate.victoryflag)              // watching the BJ actor
254
        return;
204
        return;
205
206
    //
207
    // strafing
208
    //
209
    if (controlx > 0)
210
    {
211
        angle = ob->angle - ANGLES/4;
212
        if (angle < 0)
213
            angle += ANGLES;
214
        Thrust (angle,controlx*MOVESCALE);      // move to left
215
    }
216
    else if (controlx < 0)
217
    {
218
        angle = ob->angle + ANGLES/4;
219
        if (angle >= ANGLES)
220
            angle -= ANGLES;
221
        Thrust (angle,-controlx*MOVESCALE);     // move to right
222
    }
255
}
223
}
256
224
257
/*
225
/*
(-)wl_def.h.orig (-2 / +4 lines)
Lines 995-1001 Link Here
995
*/
995
*/
996
996
997
#define BASEMOVE                35
997
#define BASEMOVE                35
998
#define BASEMOVEDIAG            24
998
#define RUNMOVE                 70
999
#define RUNMOVE                 70
1000
#define RUNMOVEDIAG             24
999
#define BASETURN                35
1001
#define BASETURN                35
1000
#define RUNTURN                 70
1002
#define RUNTURN                 70
1001
1003
Lines 1007-1013 Link Here
1007
1009
1008
extern  objtype         *player;
1010
extern  objtype         *player;
1009
1011
1010
extern  unsigned        tics;
1012
extern  int             tics;
1011
extern  int             viewsize;
1013
extern  int             viewsize;
1012
1014
1013
extern  int             lastgamemusicoffset;
1015
extern  int             lastgamemusicoffset;
Lines 1015-1021 Link Here
1015
//
1017
//
1016
// current user input
1018
// current user input
1017
//
1019
//
1018
extern  int         controlx,controly;              // range from -100 to 100
1020
extern  int         controlx,controly,controlh;    // range from -100 to 100
1019
extern  boolean     buttonstate[NUMBUTTONS];
1021
extern  boolean     buttonstate[NUMBUTTONS];
1020
extern  objtype     objlist[MAXACTORS];
1022
extern  objtype     objlist[MAXACTORS];
1021
extern  boolean     buttonheld[NUMBUTTONS];
1023
extern  boolean     buttonheld[NUMBUTTONS];
(-)wl_play.cpp.orig (-26 / +113 lines)
Lines 45-57 Link Here
45
//
45
//
46
// replacing refresh manager
46
// replacing refresh manager
47
//
47
//
48
unsigned tics;
48
int tics;
49
49
50
//
50
//
51
// control info
51
// control info
52
//
52
//
53
boolean mouseenabled, joystickenabled;
53
boolean mouseenabled, joystickenabled;
54
int dirscan[4] = { sc_UpArrow, sc_RightArrow, sc_DownArrow, sc_LeftArrow };
54
int dirscan[4] = { sc_W, sc_D, sc_S, sc_A }; 
55
int buttonscan[NUMBUTTONS] = { sc_Control, sc_Alt, sc_LShift, sc_Space, sc_1, sc_2, sc_3, sc_4 };
55
int buttonscan[NUMBUTTONS] = { sc_Control, sc_Alt, sc_LShift, sc_Space, sc_1, sc_2, sc_3, sc_4 };
56
int buttonmouse[4] = { bt_attack, bt_strafe, bt_use, bt_nobutton };
56
int buttonmouse[4] = { bt_attack, bt_strafe, bt_use, bt_nobutton };
57
int buttonjoy[32] = {
57
int buttonjoy[32] = {
Lines 77-83 Link Here
77
//
77
//
78
// current user input
78
// current user input
79
//
79
//
80
int controlx, controly;         // range from -100 to 100 per tic
80
int controlx, controly, controlh;         // range from -100 to 100 per tic
81
boolean buttonstate[NUMBUTTONS];
81
boolean buttonstate[NUMBUTTONS];
82
82
83
int lastgamemusicoffset = 0;
83
int lastgamemusicoffset = 0;
Lines 315-330 Link Here
315
315
316
void PollKeyboardMove (void)
316
void PollKeyboardMove (void)
317
{
317
{
318
    int delta = buttonstate[bt_run] ? RUNMOVE * tics : BASEMOVE * tics;
319
320
    if (Keyboard[dirscan[di_north]])
318
    if (Keyboard[dirscan[di_north]])
321
        controly -= delta;
319
        if (Keyboard[dirscan[di_south]])
322
    if (Keyboard[dirscan[di_south]])
320
            if (Keyboard[dirscan[di_west]])
323
        controly += delta;
321
            {
324
    if (Keyboard[dirscan[di_west]])
322
                if (!Keyboard[dirscan[di_east]])
325
        controlx -= delta;
323
                    controlx = -BASEMOVE * tics;
326
    if (Keyboard[dirscan[di_east]])
324
            }
327
        controlx += delta;
325
            else
326
            {
327
                if (Keyboard[dirscan[di_east]])
328
                    controlx = BASEMOVE * tics;
329
            }
330
        else
331
            if (Keyboard[dirscan[di_west]])
332
                if (Keyboard[dirscan[di_east]])
333
                    controly = (buttonstate[bt_run]) ? -RUNMOVE * tics : -BASEMOVE * tics;
334
                else
335
                {
336
                    controlx = (buttonstate[bt_run]) ? -RUNMOVEDIAG * tics : -BASEMOVEDIAG * tics;
337
                    controly = controlx;
338
                }
339
            else
340
                if (Keyboard[dirscan[di_east]])
341
                {
342
                    controlx = (buttonstate[bt_run]) ? RUNMOVEDIAG * tics : BASEMOVEDIAG * tics;
343
                    controly = -controlx;
344
                }
345
                else
346
                    controly = (buttonstate[bt_run]) ? -RUNMOVE * tics : -BASEMOVE * tics;
347
    else
348
        if (Keyboard[dirscan[di_south]])
349
            if (Keyboard[dirscan[di_west]])
350
                if (Keyboard[dirscan[di_east]])
351
                    controly = (buttonstate[bt_run]) ? RUNMOVE * tics : BASEMOVE * tics;
352
                else
353
                {
354
                    controly = (buttonstate[bt_run]) ? RUNMOVEDIAG * tics : BASEMOVEDIAG * tics;
355
                    controlx = -controly;
356
                }
357
            else
358
                if (Keyboard[dirscan[di_east]])
359
                {
360
                    controlx = (buttonstate[bt_run]) ? RUNMOVEDIAG * tics : BASEMOVEDIAG * tics;
361
                    controly = controlx;
362
                }
363
                else
364
                    controly = (buttonstate[bt_run]) ? RUNMOVE * tics : BASEMOVE * tics;
365
        else
366
            if (Keyboard[dirscan[di_west]])
367
            {
368
                if (!Keyboard[dirscan[di_east]])
369
                    controlx = -BASEMOVE * tics;
370
            }
371
            else
372
                if (Keyboard[dirscan[di_east]])
373
                    controlx = BASEMOVE * tics; 
328
}
374
}
329
375
330
376
Lines 345-354 Link Here
345
        IN_CenterMouse();
391
        IN_CenterMouse();
346
392
347
    mousexmove -= screenWidth / 2;
393
    mousexmove -= screenWidth / 2;
348
    mouseymove -= screenHeight / 2;
349
394
350
    controlx += mousexmove * 10 / (13 - mouseadjustment);
395
    controlh += (mousexmove << 4) / (13 - mouseadjustment); 
351
    controly += mouseymove * 20 / (13 - mouseadjustment);
352
}
396
}
353
397
354
398
Lines 366-381 Link Here
366
410
367
    IN_GetJoyDelta (&joyx, &joyy);
411
    IN_GetJoyDelta (&joyx, &joyy);
368
412
369
    int delta = buttonstate[bt_run] ? RUNMOVE * tics : BASEMOVE * tics;
413
    if (buttonstate[bt_strafe])
370
414
    {
371
    if (joyx > 64 || buttonstate[bt_turnright])
415
        if (joyy < -64)
372
        controlx += delta;
416
            if (joyx < -64)
373
    else if (joyx < -64  || buttonstate[bt_turnleft])
417
            {
374
        controlx -= delta;
418
                controlx = (buttonstate[bt_run]) ? BASEMOVEDIAG * tics : RUNMOVEDIAG * tics;
375
    if (joyy > 64 || buttonstate[bt_movebackward])
419
                controly = controlx;
376
        controly += delta;
420
            }
377
    else if (joyy < -64 || buttonstate[bt_moveforward])
421
            else if (joyx > 64)
378
        controly -= delta;
422
            {
423
                controlx = (buttonstate[bt_run]) ? BASEMOVEDIAG * tics : RUNMOVEDIAG * tics;
424
                controly = -controlx;
425
            }
426
            else
427
                controly = (buttonstate[bt_run]) ? -BASEMOVE * tics : -RUNMOVE * tics;
428
        else
429
            if (joyy > 64)
430
                if (joyx < -64)
431
                {
432
                    controly = (buttonstate[bt_run]) ? BASEMOVEDIAG * tics : RUNMOVEDIAG * tics;
433
                    controlx = -controly;
434
                }
435
                else if (joyx > 64)
436
                {
437
                    controlx = (buttonstate[bt_run]) ? BASEMOVEDIAG * tics : RUNMOVEDIAG * tics;
438
                    controly = controlx;
439
                }
440
                else
441
                    controly = (buttonstate[bt_run]) ? BASEMOVE * tics : RUNMOVE * tics;
442
    }
443
    else
444
    {
445
        if (joyx < -64)
446
            controlh = (buttonstate[bt_run]) ? -BASEMOVE * tics : -RUNMOVE * tics;
447
        else if (joyx > 64)
448
            controlh = (buttonstate[bt_run]) ? BASEMOVE * tics : RUNMOVE * tics;
449
        if (joyy < -64)
450
            controly = (buttonstate[bt_run]) ? -BASEMOVE * tics : -RUNMOVE * tics;
451
        else if (joyy > 64)
452
            controly = (buttonstate[bt_run]) ? BASEMOVE * tics : RUNMOVE * tics;
453
    }
379
}
454
}
380
455
381
/*
456
/*
Lines 395-401 Link Here
395
470
396
void PollControls (void)
471
void PollControls (void)
397
{
472
{
398
    int max, min, i;
473
    int max, min, rmax, rmin, i;
399
    byte buttonbits;
474
    byte buttonbits;
400
475
401
    IN_ProcessEvents();
476
    IN_ProcessEvents();
Lines 422-427 Link Here
422
497
423
    controlx = 0;
498
    controlx = 0;
424
    controly = 0;
499
    controly = 0;
500
    controlh = 0;
425
    memcpy (buttonheld, buttonstate, sizeof (buttonstate));
501
    memcpy (buttonheld, buttonstate, sizeof (buttonstate));
426
    memset (buttonstate, 0, sizeof (buttonstate));
502
    memset (buttonstate, 0, sizeof (buttonstate));
427
503
Lines 445-450 Link Here
445
521
446
        controlx *= (int) tics;
522
        controlx *= (int) tics;
447
        controly *= (int) tics;
523
        controly *= (int) tics;
524
        controlh *= (int) tics;
448
525
449
        return;
526
        return;
450
    }
527
    }
Lines 477-482 Link Here
477
//
554
//
478
    max = 100 * tics;
555
    max = 100 * tics;
479
    min = -max;
556
    min = -max;
557
    rmax = max << 4;
558
    rmin = -rmax;
480
    if (controlx > max)
559
    if (controlx > max)
481
        controlx = max;
560
        controlx = max;
482
    else if (controlx < min)
561
    else if (controlx < min)
Lines 487-492 Link Here
487
    else if (controly < min)
566
    else if (controly < min)
488
        controly = min;
567
        controly = min;
489
568
569
    if (controlh > rmax)
570
        controlh = rmax;
571
    else if (controlh < rmin)
572
        controlh = rmin;
573
490
    if (demorecord)
574
    if (demorecord)
491
    {
575
    {
492
        //
576
        //
Lines 494-499 Link Here
494
        //
578
        //
495
        controlx /= (int) tics;
579
        controlx /= (int) tics;
496
        controly /= (int) tics;
580
        controly /= (int) tics;
581
        controlh /= (int) tics;
497
582
498
        buttonbits = 0;
583
        buttonbits = 0;
499
584
Lines 508-513 Link Here
508
        *demoptr++ = buttonbits;
593
        *demoptr++ = buttonbits;
509
        *demoptr++ = controlx;
594
        *demoptr++ = controlx;
510
        *demoptr++ = controly;
595
        *demoptr++ = controly;
596
        *demoptr++ = controlh;
511
597
512
        if (demoptr >= lastdemoptr - 8)
598
        if (demoptr >= lastdemoptr - 8)
513
            playstate = ex_completed;
599
            playstate = ex_completed;
Lines 515-520 Link Here
515
        {
601
        {
516
            controlx *= (int) tics;
602
            controlx *= (int) tics;
517
            controly *= (int) tics;
603
            controly *= (int) tics;
604
            controlh *= (int) tics;
518
        }
605
        }
519
    }
606
    }
520
}
607
}

Return to bug 326961