Subversion Repositories eduke32

Rev

Rev 885 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 885 Rev 886
Line 52... Line 52...
52
#ifdef _WIN32
52
#ifdef _WIN32
53
#define WIN32_LEAN_AND_MEAN
53
#define WIN32_LEAN_AND_MEAN
54
#include <windows.h>
54
#include <windows.h>
55
#include <shellapi.h>
55
#include <shellapi.h>
56
extern int getversionfromwebsite(char *buffer);
56
extern int getversionfromwebsite(char *buffer);
57
#define BUILDDATE 20080720 // this is checked against http://eduke32.com/VERSION
57
#define BUILDDATE 20080722 // this is checked against http://eduke32.com/VERSION
58
#define UPDATEINTERVAL 604800 // 1w
58
#define UPDATEINTERVAL 604800 // 1w
59
#endif
59
#endif
60
60
61
#define IDFSIZE 479985668
61
#define IDFSIZE 479985668
62
#define IDFILENAME "DUKE3D.IDF"
62
#define IDFILENAME "DUKE3D.IDF"
Line 112... Line 112...
112
static int g_NoLogo = 0;
112
static int g_NoLogo = 0;
113
static int sendmessagecommand = -1;
113
static int sendmessagecommand = -1;
114
114
115
char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
115
char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp";
116
char *duke3dgrp = defaultduke3dgrp;
116
char *duke3dgrp = defaultduke3dgrp;
-
 
117
char *duke3dgrpstring = NULL;
117
static char defaultconfilename[BMAX_PATH] = {"EDUKE.CON"};
118
static char defaultconfilename[BMAX_PATH] = {"EDUKE.CON"};
118
static char *confilename = defaultconfilename;
119
static char *confilename = defaultconfilename;
119
static char *duke3ddef = "duke3d.def";
120
static char *duke3ddef = "duke3d.def";
120
121
121
extern int lastvisinc;
122
extern int lastvisinc;
Line 6473... Line 6474...
6473
                t->xrepeat = t->yrepeat = 0;
6474
                t->xrepeat = t->yrepeat = 0;
6474
                continue;
6475
                continue;
6475
            }
6476
            }
6476
        }
6477
        }
6477
6478
6478
        if (t->statnum == 99) continue;
6479
        if (t->statnum == STAT_NOCULL) continue;
6479
        if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps->newowner == -1 && s->owner >= 0)
6480
        if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps->newowner == -1 && s->owner >= 0)
6480
        {
6481
        {
6481
            t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posx-g_player[s->yvel].ps->oposx);
6482
            t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posx-g_player[s->yvel].ps->oposx);
6482
            t->y -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posy-g_player[s->yvel].ps->oposy);
6483
            t->y -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posy-g_player[s->yvel].ps->oposy);
6483
            t->z = g_player[s->yvel].ps->oposz + mulscale16(smoothratio,g_player[s->yvel].ps->posz-g_player[s->yvel].ps->oposz);
6484
            t->z = g_player[s->yvel].ps->oposz + mulscale16(smoothratio,g_player[s->yvel].ps->posz-g_player[s->yvel].ps->oposz);
Line 6664... Line 6665...
6664
            {
6665
            {
6665
                if (ud.showweapons && sprite[g_player[p].ps->i].extra > 0 && g_player[p].ps->curr_weapon > 0)
6666
                if (ud.showweapons && sprite[g_player[p].ps->i].extra > 0 && g_player[p].ps->curr_weapon > 0)
6666
                {
6667
                {
6667
                    memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
6668
                    memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
6668
6669
6669
                    tsprite[spritesortcnt].statnum = 99;
6670
                    tsprite[spritesortcnt].statnum = STAT_NOCULL;
6670
6671
6671
                    /*                    tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
6672
                    /*                    tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
6672
                                        if (t->yrepeat < 4) t->yrepeat = 4; */
6673
                                        if (t->yrepeat < 4) t->yrepeat = 4; */
6673
6674
6674
                    tsprite[spritesortcnt].shade = t->shade;
6675
                    tsprite[spritesortcnt].shade = t->shade;
Line 6696... Line 6697...
6696
6697
6697
                if (g_player[p].sync->extbits & (1<<7) && !ud.pause_on)
6698
                if (g_player[p].sync->extbits & (1<<7) && !ud.pause_on)
6698
                {
6699
                {
6699
                    memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
6700
                    memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
6700
6701
6701
                    tsprite[spritesortcnt].statnum = 99;
6702
                    tsprite[spritesortcnt].statnum = STAT_NOCULL;
6702
6703
6703
                    tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
6704
                    tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
6704
                    if (t->yrepeat < 4) t->yrepeat = 4;
6705
                    if (t->yrepeat < 4) t->yrepeat = 4;
6705
6706
6706
                    tsprite[spritesortcnt].cstat = 0;
6707
                    tsprite[spritesortcnt].cstat = 0;
Line 6937... Line 6938...
6937
                        if ((s->z-daz) < (8<<8))
6938
                        if ((s->z-daz) < (8<<8))
6938
                            if (g_player[screenpeek].ps->posz < daz)
6939
                            if (g_player[screenpeek].ps->posz < daz)
6939
                            {
6940
                            {
6940
                                memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
6941
                                memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
6941
6942
6942
                                tsprite[spritesortcnt].statnum = 99;
6943
                                tsprite[spritesortcnt].statnum = STAT_NOCULL;
6943
6944
6944
                                tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
6945
                                tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
6945
                                if (t->yrepeat < 4) t->yrepeat = 4;
6946
                                if (t->yrepeat < 4) t->yrepeat = 4;
6946
6947
6947
                                tsprite[spritesortcnt].shade = 127;
6948
                                tsprite[spritesortcnt].shade = 127;
Line 7105... Line 7106...
7105
        if (sector[t->sectnum].floorpicnum == MIRROR)
7106
        if (sector[t->sectnum].floorpicnum == MIRROR)
7106
            t->xrepeat = t->yrepeat = 0;
7107
            t->xrepeat = t->yrepeat = 0;
7107
    }
7108
    }
7108
    for (j=0;j < spritesortcnt; j++)
7109
    for (j=0;j < spritesortcnt; j++)
7109
    {
7110
    {
7110
        if (display_mirror) tsprite[j].statnum = 99;
7111
        if (display_mirror) tsprite[j].statnum = STAT_NOCULL;
7111
        if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
7112
        if (tsprite[j].owner > 0 && tsprite[j].owner < MAXSPRITES && spriteext[tsprite[j].owner].flags & SPREXT_TSPRACCESS)
7112
        {
7113
        {
7113
            OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
7114
            OnEvent(EVENT_ANIMATESPRITES,tsprite[j].owner, myconnectindex, -1);
7114
            spriteext[tsprite[j].owner].tspr = NULL;
7115
            spriteext[tsprite[j].owner].tspr = NULL;
7115
        }
7116
        }
Line 9392... Line 9393...
9392
    IFISSOFTMODE palto(0,0,0,63);
9393
    IFISSOFTMODE palto(0,0,0,63);
9393
9394
9394
    flushperms();
9395
    flushperms();
9395
    nextpage();
9396
    nextpage();
9396
9397
9397
    if (VOLUMEALL) wm_setapptitle(HEAD2);
9398
    Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
9398
    else wm_setapptitle(HEAD);
9399
    wm_setapptitle(tempbuf);
9399
9400
9400
    MUSIC_StopSong();
9401
    MUSIC_StopSong();
9401
    FX_StopAllSounds(); // JBF 20031228
9402
    FX_StopAllSounds(); // JBF 20031228
9402
    clearsoundlocks();  // JBF 20031228
9403
    clearsoundlocks();  // JBF 20031228
9403
    if (ud.multimode < 2 && (logoflags & LOGO_FLAG_ENABLED) && !g_NoLogo)
9404
    if (ud.multimode < 2 && (logoflags & LOGO_FLAG_ENABLED) && !g_NoLogo)
Line 10137... Line 10138...
10137
    if (ud.recstat == 1) closedemowrite();
10138
    if (ud.recstat == 1) closedemowrite();
10138
    ud.warp_on = 0;
10139
    ud.warp_on = 0;
10139
    g_player[myconnectindex].ps->gm = MODE_MENU;
10140
    g_player[myconnectindex].ps->gm = MODE_MENU;
10140
    cmenu(0);
10141
    cmenu(0);
10141
    KB_FlushKeyboardQueue();
10142
    KB_FlushKeyboardQueue();
10142
    if (VOLUMEALL) wm_setapptitle(HEAD2);
10143
    Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
10143
    else wm_setapptitle(HEAD);
10144
    wm_setapptitle(tempbuf);
10144
}
10145
}
10145
10146
10146
#ifdef RENDERTYPEWIN
10147
#ifdef RENDERTYPEWIN
10147
void app_crashhandler(void)
10148
void app_crashhandler(void)
10148
{
10149
{
Line 10339... Line 10340...
10339
            fg->game = grpfiles[i].game;
10340
            fg->game = grpfiles[i].game;
10340
            if (!first) first = fg;
10341
            if (!first) first = fg;
10341
            if (!Bstrcasecmp(fg->name, defaultduke3dgrp))
10342
            if (!Bstrcasecmp(fg->name, defaultduke3dgrp))
10342
            {
10343
            {
10343
                g_GameType = grpfiles[i].game;
10344
                g_GameType = grpfiles[i].game;
-
 
10345
                duke3dgrpstring = (char *)grpfiles[i].name;
10344
                break;
10346
                break;
10345
            }
10347
            }
10346
        }
10348
        }
10347
        if (!fg && first)
10349
        if (!fg && first)
10348
        {
10350
        {
10349
            Bstrcpy(defaultduke3dgrp, first->name);
10351
            Bstrcpy(defaultduke3dgrp, first->name);
10350
            g_GameType = first->game;
10352
            g_GameType = first->game;
-
 
10353
            duke3dgrpstring = (char *)grpfiles[0].name;
10351
        }
10354
        }
10352
    }
10355
    }
10353
10356
10354
#if (defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2))
10357
#if (defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2))
10355
    if (i < 0 || (!g_NoSetup && ud.config.ForceSetup) || g_CommandSetup)
10358
    if (i < 0 || (!g_NoSetup && ud.config.ForceSetup) || g_CommandSetup)
Line 10443... Line 10446...
10443
10446
10444
    if (netparamcount > 0) _buildargc = (argc -= netparamcount+1);  // crop off the net parameters
10447
    if (netparamcount > 0) _buildargc = (argc -= netparamcount+1);  // crop off the net parameters
10445
10448
10446
    // gotta set the proper title after we compile the CONs if this is the full version
10449
    // gotta set the proper title after we compile the CONs if this is the full version
10447
10450
10448
    if (VOLUMEALL) wm_setapptitle(HEAD2);
10451
    Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
10449
    else wm_setapptitle(HEAD);
10452
    wm_setapptitle(tempbuf);
-
 
10453
10450
10454
10451
//    initprintf("\n");
10455
//    initprintf("\n");
10452
10456
10453
    if (g_ScriptDebug)
10457
    if (g_ScriptDebug)
10454
        initprintf("CON debugging activated (level %d).\n",g_ScriptDebug);
10458
        initprintf("CON debugging activated (level %d).\n",g_ScriptDebug);
Line 11972... Line 11976...
11972
        290, 320,VICTORY1+6,86,59,
11976
        290, 320,VICTORY1+6,86,59,
11973
        320, 350,VICTORY1+7,86,59,
11977
        320, 350,VICTORY1+7,86,59,
11974
        350, 380,VICTORY1+8,86,59
11978
        350, 380,VICTORY1+8,86,59
11975
    };
11979
    };
11976
11980
11977
    if (VOLUMEALL) wm_setapptitle(HEAD2);
11981
    Bsprintf(tempbuf,HEAD2 " - %s",duke3dgrpstring);
11978
    else wm_setapptitle(HEAD);
11982
    wm_setapptitle(tempbuf);
11979
11983
11980
    if (ud.volume_number == 0 && ud.last_level == 8 && boardfilename[0])
11984
    if (ud.volume_number == 0 && ud.last_level == 8 && boardfilename[0])
11981
    {
11985
    {
11982
        lastmapname = Bstrrchr(boardfilename,'\\');
11986
        lastmapname = Bstrrchr(boardfilename,'\\');
11983
        if (!lastmapname) lastmapname = Bstrrchr(boardfilename,'/');
11987
        if (!lastmapname) lastmapname = Bstrrchr(boardfilename,'/');