Subversion Repositories eduke32

Rev

Rev 8660 | Rev 8671 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8660 Rev 8664
Line 189... Line 189...
189
// because stats 0-NUMSTATS required NUMSTATS+1 bytes.   -Andy
189
// because stats 0-NUMSTATS required NUMSTATS+1 bytes.   -Andy
190
#define NUMSTATS 13
190
#define NUMSTATS 13
191
static signed char statrate[NUMSTATS] = {-1,0,-1,0,0,0,1,3,0,3,15,-1,-1};
191
static signed char statrate[NUMSTATS] = {-1,0,-1,0,0,0,1,3,0,3,15,-1,-1};
192
192
193
//Input structures
193
//Input structures
194
static char networkmode;     //0 is 2(n-1) mode, 1 is n(n-1) mode
-
 
195
static int locselectedgun, locselectedgun2;
194
static int locselectedgun, locselectedgun2;
196
static input loc, oloc, loc2;
195
static input loc, oloc, loc2;
197
static input ffsync[MAXPLAYERS], osync[MAXPLAYERS], ssync[MAXPLAYERS];
196
static input ffsync[MAXPLAYERS], osync[MAXPLAYERS], ssync[MAXPLAYERS];
198
//Input faketimerhandler -> movethings fifo
197
//Input faketimerhandler -> movethings fifo
199
static int movefifoplc, movefifoend[MAXPLAYERS];
198
static int movefifoplc, movefifoend[MAXPLAYERS];
Line 455... Line 454...
455
int32_t app_main(int32_t argc, char const * const * argv)
454
int32_t app_main(int32_t argc, char const * const * argv)
456
{
455
{
457
#if defined STARTUP_SETUP_WINDOW
456
#if defined STARTUP_SETUP_WINDOW
458
    int cmdsetup = 0;
457
    int cmdsetup = 0;
459
#endif
458
#endif
460
    int i, j, k /*, l, fil, waitplayers, x1, y1, x2, y2*/;
459
    int i, j, k /*, l, fil*/, waitplayers, x1, y1, x2, y2;
461
    int /*other, packleng,*/ netparm;
460
    int other, /*packleng, */netparm;
462
461
463
    OSD_SetLogFile("ekenbuild.log");
462
    OSD_SetLogFile("ekenbuild.log");
464
463
465
    initprintf("%s %s\n", AppProperName, s_buildRev);
464
    initprintf("%s %s\n", AppProperName, s_buildRev);
466
    PrintBuildInfo();
465
    PrintBuildInfo();
Line 479... Line 478...
479
#endif
478
#endif
480
479
481
    wm_setapptitle(AppProperName);
480
    wm_setapptitle(AppProperName);
482
481
483
    Bstrcpy(boardfilename, "nukeland.map");
482
    Bstrcpy(boardfilename, "nukeland.map");
484
    j = 0; netparm = argc;
483
    netparm = argc;
485
    for (i=1; i<argc; i++)
484
    for (i=1; i<argc; i++)
486
    {
485
    {
487
        if ((!Bstrcasecmp("-net",argv[i])) || (!Bstrcasecmp("/net",argv[i]))) { j = 1; netparm = i; continue; }
486
        if ((!Bstrcasecmp("-net",argv[i])) || (!Bstrcasecmp("/net",argv[i]))) { netparm = i+1; break; }
488
        if (j)
-
 
489
        {
-
 
490
            if (argv[i][0] == '-' || argv[i][0] == '/')
-
 
491
            {
-
 
492
                if (((argv[i][1] == 'n') || (argv[i][1] == 'N')) && (argv[i][2] == '0')) { networkmode = 0; continue; }
-
 
493
                if (((argv[i][1] == 'n') || (argv[i][1] == 'N')) && (argv[i][2] == '1')) { networkmode = 1; continue; }
-
 
494
            }
-
 
495
            if (isvalidipaddress(argv[i])) continue;
-
 
496
        }
-
 
497
        else
-
 
498
        {
-
 
499
            if (!Bstrcasecmp(argv[i], "-setup"))
487
        if (!Bstrcasecmp(argv[i], "-setup"))
500
            {
488
        {
501
#if defined STARTUP_SETUP_WINDOW
489
#if defined STARTUP_SETUP_WINDOW
502
                cmdsetup = 1;
490
                cmdsetup = 1;
503
#endif
491
#endif
Line 506... Line 494...
506
            {
494
        {
507
                Bstrcpy(boardfilename, argv[i]);
495
            Bstrcpy(boardfilename, argv[i]);
508
                if (!Bstrrchr(boardfilename,'.')) Bstrcat(boardfilename,".map");
496
            if (!Bstrrchr(boardfilename,'.')) Bstrcat(boardfilename,".map");
509
            }
497
        }
510
        }
498
    }
511
    }
-
 
512
499
513
    if ((i = Ken_loadsetup(setupfilename)) < 0)
500
    if ((i = Ken_loadsetup(setupfilename)) < 0)
514
        buildputs("Configuration file not found, using defaults.\n");
501
        buildputs("Configuration file not found, using defaults.\n");
515
502
516
    wm_msgbox("Pre-Release Software Warning", "%s is not ready for public use. Proceed with caution!", AppProperName);
503
    wm_msgbox("Pre-Release Software Warning", "%s is not ready for public use. Proceed with caution!", AppProperName);
Line 603... Line 590...
603
    //   loadsong("klabsong.kdm");
590
    //   loadsong("klabsong.kdm");
604
    //else
591
    //else
605
    loadsong("neatsong.kdm");
592
    loadsong("neatsong.kdm");
606
    musicon();
593
    musicon();
607
594
608
#if 0
-
 
609
    if (option[4] > 0)
595
    if (option[4] > 0)
610
    {
596
    {
611
        x1 = ((xdim-screensize)>>1);
597
        x1 = ((xdim-screensize)>>1);
612
        x2 = x1+screensize-1;
598
        x2 = x1+screensize-1;
613
        y1 = (((ydim-32)-scale(screensize,ydim-32,xdim))>>1);
599
        y1 = (((ydim-32)-scale(screensize,ydim-32,xdim))>>1);
Line 663... Line 649...
663
            else Bstrcat(getmessage," (Slave)");
649
            else Bstrcat(getmessage," (Slave)");
664
        }
650
        }
665
        else
651
        else
666
            Bstrcat(getmessage," (Even)");
652
            Bstrcat(getmessage," (Even)");
667
        getmessageleng = Bstrlen(getmessage);
653
        getmessageleng = Bstrlen(getmessage);
668
        getmessagetimeoff = totalclock+120;
654
        getmessagetimeoff = (int32_t) totalclock+120;
669
    }
655
    }
670
#endif
-
 
671
    screenpeek = myconnectindex;
656
    screenpeek = myconnectindex;
672
    reccnt = 0;
657
    reccnt = 0;
673
    for (i=connecthead; i>=0; i=connectpoint2[i]) initplayersprite((short)i);
658
    for (i=connecthead; i>=0; i=connectpoint2[i]) initplayersprite((short)i);
674
659
675
    waitforeverybody();
660
    waitforeverybody();
Line 4509... Line 4494...
4509
        (horiz[myconnectindex] == myhorizbak[i]) &&
4494
        (horiz[myconnectindex] == myhorizbak[i]) &&
4510
        (ang[myconnectindex] == myangbak[i]))
4495
        (ang[myconnectindex] == myangbak[i]))
4511
        return;
4496
        return;
4512
4497
4513
    //Re-start fakedomovethings back to place of error
4498
    //Re-start fakedomovethings back to place of error
4514
    my = omy;
4499
    my = omy = pos[myconnectindex];
4515
    myzvel = hvel[myconnectindex];
4500
    myzvel = hvel[myconnectindex];
4516
    myang = omyang = ang[myconnectindex];
4501
    myang = omyang = ang[myconnectindex];
4517
    mycursectnum = cursectnum[myconnectindex];
4502
    mycursectnum = cursectnum[myconnectindex];
4518
    myhoriz = omyhoriz = horiz[myconnectindex];
4503
    myhoriz = omyhoriz = horiz[myconnectindex];
4519
4504
Line 4934... Line 4919...
4934
4919
4935
        startwall = sector[dasector].wallptr;
4920
        startwall = sector[dasector].wallptr;
4936
        endwall = startwall+sector[dasector].wallnum;
4921
        endwall = startwall+sector[dasector].wallnum;
4937
        if (endwall <= startwall) continue;
4922
        if (endwall <= startwall) continue;
4938
4923
-
 
4924
        da.x = da.y = 0;
4939
        minx = 0x7fffffff; maxx = 0x80000000;
4925
        minx = 0x7fffffff; maxx = 0x80000000;
4940
        miny = 0x7fffffff; maxy = 0x80000000;
4926
        miny = 0x7fffffff; maxy = 0x80000000;
4941
4927
4942
        for (s=startwall; s<endwall; s++)
4928
        for (s=startwall; s<endwall; s++)
4943
        {
4929
        {