Subversion Repositories eduke32

Rev

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

Rev 3702 Rev 3708
Line 9664... Line 9664...
9664
    S_MusicShutdown();
9664
    S_MusicShutdown();
9665
    CONTROL_Shutdown();
9665
    CONTROL_Shutdown();
9666
    KB_Shutdown();
9666
    KB_Shutdown();
9667
    uninitengine();
9667
    uninitengine();
9668
    G_Cleanup();
9668
    G_Cleanup();
-
 
9669
    FreeGroups();
9669
    Bfflush(NULL);
9670
    Bfflush(NULL);
9670
}
9671
}
9671
9672
9672
/*
9673
/*
9673
===================
9674
===================
Line 10168... Line 10169...
10168
    grp = FindGroup(crc);
10169
    grp = FindGroup(crc);
10169
10170
10170
    if (grp && FindGroup(DUKE15_CRC))
10171
    if (grp && FindGroup(DUKE15_CRC))
10171
    {
10172
    {
10172
        int32_t i;
10173
        int32_t i;
-
 
10174
        struct grpfile *grp;
10173
10175
10174
        clearGrpNamePtr();
10176
        clearGrpNamePtr();
10175
        g_grpNamePtr = dup_filename(FindGroup(DUKE15_CRC)->name);
10177
        g_grpNamePtr = dup_filename(FindGroup(DUKE15_CRC)->name);
10176
10178
10177
        G_AddGroup(grp->name);
10179
        G_AddGroup(grp->name);
10178
10180
-
 
10181
        for (grp = listgrps; grp; grp=grp->next)
10179
        for (i = 0; i<NUMGRPFILES; i++) if (crc == grpfiles[i].crcval) break;
10182
            if (crc == grp->crcval) break;
-
 
10183
10180
        if (i != NUMGRPFILES && grpfiles[i].scriptname)
10184
        if (grp != NULL && grp->scriptname)
10181
        {
10185
        {
10182
            clearScriptNamePtr();
10186
            clearScriptNamePtr();
10183
            g_scriptNamePtr = dup_filename(grpfiles[i].scriptname);
10187
            g_scriptNamePtr = dup_filename(grp->scriptname);
-
 
10188
        }
-
 
10189
-
 
10190
        if (grp != NULL && grp->defname)
-
 
10191
        {
-
 
10192
            clearDefNamePtr();
-
 
10193
            g_defNamePtr = dup_filename(grp->defname);
10184
        }
10194
        }
10185
    }
10195
    }
10186
}
10196
}
10187
10197
10188
EDUKE32_STATIC_ASSERT(sizeof(actor_t)==128);
10198
EDUKE32_STATIC_ASSERT(sizeof(actor_t)==128);
Line 10451... Line 10461...
10451
    {
10461
    {
10452
        // try and identify the 'defaultgamegrp' in the set of GRPs.
10462
        // try and identify the 'defaultgamegrp' in the set of GRPs.
10453
        // if it is found, set up the environment accordingly for the game it represents.
10463
        // if it is found, set up the environment accordingly for the game it represents.
10454
        // if it is not found, choose the first GRP from the list
10464
        // if it is not found, choose the first GRP from the list
10455
        struct grpfile *fg, *first = NULL;
10465
        struct grpfile *fg, *first = NULL;
10456
        int32_t i;
-
 
-
 
10466
10457
        for (fg = foundgrps; fg; fg=fg->next)
10467
        for (fg = foundgrps; fg; fg=fg->next)
10458
        {
10468
        {
-
 
10469
            struct grpfile *grp;
-
 
10470
            for (grp = listgrps; grp; grp=grp->next)
10459
            for (i = 0; i<NUMGRPFILES; i++) if (fg->crcval == grpfiles[i].crcval) break;
10471
                if (fg->crcval == grp->crcval) break;
-
 
10472
-
 
10473
            if (grp == NULL)
10460
            if (i == NUMGRPFILES) continue; // unrecognised grp file
10474
                continue;
-
 
10475
10461
            fg->game = grpfiles[i].game;
10476
            fg->game = grp->game;
10462
            if (!first) first = fg;
10477
            if (!first) first = fg;
10463
            if (!Bstrcasecmp(fg->name, G_DefaultGrpFile()))
10478
            if (!Bstrcasecmp(fg->name, G_DefaultGrpFile()))
10464
            {
10479
            {
10465
                g_gameType = grpfiles[i].game;
10480
                g_gameType = grp->game;
10466
                g_gameNamePtr = grpfiles[i].name;
10481
                g_gameNamePtr = grp->name;
10467
                break;
10482
                break;
10468
            }
10483
            }
10469
        }
10484
        }
10470
        if (!fg && first)
10485
        if (!fg && first)
10471
        {
10486
        {
Line 10473... Line 10488...
10473
            {
10488
            {
10474
                clearGrpNamePtr();
10489
                clearGrpNamePtr();
10475
                g_grpNamePtr = dup_filename(first->name);
10490
                g_grpNamePtr = dup_filename(first->name);
10476
            }
10491
            }
10477
            g_gameType = first->game;
10492
            g_gameType = first->game;
10478
            g_gameNamePtr = grpfiles[0].name;
10493
            g_gameNamePtr = listgrps->name;
10479
        }
10494
        }
10480
        else if (!fg) g_gameNamePtr = "Unknown GRP";
10495
        else if (!fg) g_gameNamePtr = "Unknown GRP";
10481
    }
10496
    }
10482
10497
10483
#if (defined _WIN32 || (defined RENDERTYPESDL && ((defined __APPLE__ && defined OSX_STARTUPWINDOW) || defined HAVE_GTK2)))
10498
#if (defined _WIN32 || (defined RENDERTYPESDL && ((defined __APPLE__ && defined OSX_STARTUPWINDOW) || defined HAVE_GTK2)))
Line 10551... Line 10566...
10551
            if (i != -1)
10566
            if (i != -1)
10552
                G_DoAutoload(grpfile);
10567
                G_DoAutoload(grpfile);
10553
        }
10568
        }
10554
    }
10569
    }
10555
10570
10556
    FreeGroups();
-
 
10557
-
 
10558
    if (g_modDir[0] != '/')
10571
    if (g_modDir[0] != '/')
10559
        G_LoadGroupsInDir(g_modDir);
10572
        G_LoadGroupsInDir(g_modDir);
10560
10573
10561
    // CODEDUP astub.c
10574
    // CODEDUP astub.c
10562
    if (g_defNamePtr == NULL)
10575
    if (g_defNamePtr == NULL)