Subversion Repositories eduke32

Rev

Rev 8473 | Rev 8475 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5327 hendricks2 1
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
2
// Ken Silverman's official web site: "http://www.advsys.net/ken"
3
// See the included license file "BUILDLIC.TXT" for license info.
4
//
5
// This file has been modified from Ken Silverman's original release
6
// by Jonathon Fowler (jf@jonof.id.au)
7
 
8
#include "compat.h"
9
#include "build.h"
10
#include "editor.h"
11
#include "pragmas.h"
12
#include "baselayer.h"
13
#include "names.h"
14
#include "osd.h"
15
#include "cache1d.h"
16
#include "common.h"
17
#include "m32script.h"
18
 
19
#include "common_game.h"
20
 
8456 hendricks2 21
const char *AppProperName = "EKenBuild Editor";
7537 hendricks2 22
const char *AppTechnicalName = "ekenbuild-editor";
5327 hendricks2 23
 
24
#if defined(_WIN32)
7537 hendricks2 25
#define DEFAULT_GAME_EXEC "ekenbuild.exe"
26
#define DEFAULT_GAME_LOCAL_EXEC "ekenbuild.exe"
5327 hendricks2 27
#else
7537 hendricks2 28
#define DEFAULT_GAME_EXEC "ekenbuild"
29
#define DEFAULT_GAME_LOCAL_EXEC "./ekenbuild"
5327 hendricks2 30
#endif
31
 
32
const char *DefaultGameExec = DEFAULT_GAME_EXEC;
33
const char *DefaultGameLocalExec = DEFAULT_GAME_LOCAL_EXEC;
34
 
7537 hendricks2 35
#define SETUPFILENAME "ekenbuild-editor.cfg"
5327 hendricks2 36
const char *defaultsetupfilename = SETUPFILENAME;
37
char setupfilename[BMAX_PATH] = SETUPFILENAME;
38
 
39
static char tempbuf[256];
40
 
41
#define NUMOPTIONS 9
42
char option[NUMOPTIONS] = {0,0,0,0,0,0,1,0,0};
43
unsigned char default_buildkeys[NUMBUILDKEYS] =
44
{
45
    0xc8,0xd0,0xcb,0xcd,0x2a,0x9d,0x1d,0x39,
46
    0x1e,0x2c,0xd1,0xc9,0x33,0x34,
8460 hendricks2 47
    0x9c,0x1c,0xd,0xc,0xf,0x29
5327 hendricks2 48
};
49
 
50
 
51
 
52
 
53
 
54
//static int hang = 0;
55
//static int rollangle = 0;
56
 
57
//Detecting 2D / 3D mode:
58
//   qsetmode is 200 in 3D mode
59
//   qsetmode is 350/480 in 2D mode
60
//
61
//You can read these variables when F5-F8 is pressed in 3D mode only:
62
//
63
//   If (searchstat == 0)  WALL        searchsector=sector, searchwall=wall
64
//   If (searchstat == 1)  CEILING     searchsector=sector
65
//   If (searchstat == 2)  FLOOR       searchsector=sector
66
//   If (searchstat == 3)  SPRITE      searchsector=sector, searchwall=sprite
67
//   If (searchstat == 4)  MASKED WALL searchsector=sector, searchwall=wall
68
//
69
//   searchsector is the sector of the selected item for all 5 searchstat's
70
//
71
//   searchwall is undefined if searchstat is 1 or 2
72
//   searchwall is the wall if searchstat = 0 or 4
73
//   searchwall is the sprite if searchstat = 3 (Yeah, I know - it says wall,
74
//                                      but trust me, it's the sprite number)
75
 
76
int averagefps;
77
#define AVERAGEFRAMES 32
78
static unsigned int frameval[AVERAGEFRAMES];
79
static int framecnt = 0;
80
 
81
 
82
const char *ExtGetVer(void)
83
{
84
    return s_buildRev;
85
}
86
 
5552 hendricks2 87
int32_t ExtPreInit(int32_t argc,char const * const * argv)
5327 hendricks2 88
{
89
    UNREFERENCED_PARAMETER(argc);
90
    UNREFERENCED_PARAMETER(argv);
91
 
7537 hendricks2 92
    OSD_SetLogFile("ekenbuild-editor.log");
8333 hendricks2 93
    char tempbuf[256];
94
    snprintf(tempbuf, ARRAY_SIZE(tempbuf), "%s %s", AppProperName, s_buildRev);
95
    OSD_SetVersion(tempbuf, 10,0);
8457 hendricks2 96
    buildprintf("%s\n", tempbuf);
6142 hendricks2 97
    PrintBuildInfo();
5327 hendricks2 98
 
99
    return 0;
100
}
101
 
102
int32_t ExtInit(void)
103
{
104
    int rv = 0;
105
 
106
    /*printf("------------------------------------------------------------------------------\n");
107
    printf("   BUILD.EXE copyright(c) 1996 by Ken Silverman.  You are granted the\n");
108
    printf("   right to use this software for your personal use only.  This is a\n");
109
    printf("   special version to be used with \"Happy Fun KenBuild\" and may not work\n");
110
    printf("   properly with other Build engine games.  Please refer to license.doc\n");
111
    printf("   for distribution rights\n");
112
    printf("------------------------------------------------------------------------------\n");
113
    getch();
114
    */
115
 
8333 hendricks2 116
    OSD_SetParameters(0,2, 0,0, 4,0, 0, 0, 0); // TODO
117
 
5327 hendricks2 118
    bpp = 8;
119
    if (loadsetup(setupfilename) < 0) buildputs("Configuration file not found, using defaults.\n"), rv = 1;
120
    Bmemcpy(buildkeys, default_buildkeys, NUMBUILDKEYS);   //Trick to make build use setup.dat keys
121
    if (option[4] > 0) option[4] = 0;
122
 
123
    kensplayerheight = 32;
124
    zmode = 0;
125
 
8458 hendricks2 126
    wm_msgbox("Pre-Release Software Warning", "%s is not ready for public use. Proceed with caution!", AppProperName);
127
 
5327 hendricks2 128
#ifdef _WIN32
129
//  allowtaskswitching(0);
130
#endif
131
    return rv;
132
}
133
 
134
int32_t ExtPostStartupWindow(void)
135
{
136
    initgroupfile(G_GrpFile());
137
 
7540 hendricks2 138
    if (engineInit())
5327 hendricks2 139
    {
140
        initprintf("There was a problem initializing the engine.\n");
141
        return -1;
142
    }
143
 
8473 hendricks2 144
    Ken_PostStartupWindow();
5327 hendricks2 145
 
146
    return 0;
147
}
148
 
5345 hendricks2 149
void ExtPostInit(void)
150
{
8474 hendricks2 151
    Ken_LoadVoxels();
7540 hendricks2 152
    palettePostLoadLookups();
5345 hendricks2 153
}
154
 
5327 hendricks2 155
void ExtUnInit(void)
156
{
157
    uninitgroupfile();
158
    writesetup(setupfilename);
159
}
160
 
161
//static int daviewingrange, daaspect, horizval1, horizval2;
162
void ExtPreCheckKeys(void)
163
{
164
    int /*cosang, sinang, dx, dy, mindx,*/ i, j, k;
165
 
166
    if (keystatus[0x3e])  //F4 - screen re-size
167
    {
168
        keystatus[0x3e] = 0;
169
 
170
        //cycle through all vesa modes, then screen-buffer mode
171
        if (keystatus[0x2a]|keystatus[0x36])
172
        {
7540 hendricks2 173
            videoSetGameMode(!fullscreen, xdim, ydim, bpp, upscalefactor);
5327 hendricks2 174
        }
175
        else
176
        {
177
 
178
            //cycle through all modes
179
            j=-1;
180
 
181
            // work out a mask to select the mode
182
            for (i=0; i<validmodecnt; i++)
183
                if ((validmode[i].xdim == xdim) &&
184
                    (validmode[i].ydim == ydim) &&
185
                    (validmode[i].fs == fullscreen) &&
186
                    (validmode[i].bpp == bpp))
187
                { j=i; break; }
188
 
189
            for (k=0; k<validmodecnt; k++)
190
                if (validmode[k].fs == fullscreen && validmode[k].bpp == bpp) break;
191
 
192
            if (j==-1) j=k;
193
            else
194
            {
195
                j++;
196
                if (j==validmodecnt) j=k;
197
            }
7540 hendricks2 198
            videoSetGameMode(fullscreen, validmode[j].xdim, validmode[j].ydim, bpp, upscalefactor);
5327 hendricks2 199
        }
200
    }
201
 
202
    if (keystatus[buildkeys[BK_MODE2D_3D]])  // Enter
203
    {
204
        getmessageleng = 0;
205
        getmessagetimeoff = 0;
206
    }
207
 
208
    if (getmessageleng > 0)
209
    {
210
        if (!in3dmode())
211
            printmessage16("%s", getmessage);
212
        if (totalclock > getmessagetimeoff)
213
            getmessageleng = 0;
214
    }
215
 
216
#if 0
217
    if (keystatus[0x2a]|keystatus[0x36])
218
    {
219
        if (keystatus[0xcf]) hang = max(hang-1,-182);
220
        if (keystatus[0xc7]) hang = min(hang+1,182);
221
    }
222
    else
223
    {
224
        if (keystatus[0xcf]) hang = max(hang-8,-182);
225
        if (keystatus[0xc7]) hang = min(hang+8,182);
226
    }
227
    if (keystatus[0x4c]) { hang = 0; horiz = 100; }
228
    if (hang != 0)
229
    {
230
        walock[4094] = 255;
231
 
232
        // JBF 20031117: scale each dimension by a factor of 1.2, and work out
233
        // the aspect of the screen. Anywhere you see 'i' below was the value
234
        // '200' before I changed it. NOTE: This whole trick crashes in resolutions
235
        // above 800x600. I'm not sure why, and fixing it is not something I intend
236
        // to do in a real big hurry.
237
        dx = (xdim + (xdim >> 3) + (xdim >> 4) + (xdim >> 6)) & (~7);
238
        dy = (ydim + (ydim >> 3) + (ydim >> 4) + (ydim >> 6)) & (~7);
239
        i = scale(320,ydim,xdim);
240
 
8250 hendricks2 241
        if (waloff[4094] == 0) g_cache.allocateBlock(&waloff[4094],/*240L*384L*/ dx*dy,&walock[4094]);
7540 hendricks2 242
        renderSetTarget(4094,/*240L,384L*/ dy,dx);
5327 hendricks2 243
 
244
        cosang = sintable[(hang+512)&2047];
245
        sinang = sintable[hang&2047];
246
 
247
        dx = dmulscale1(320,cosang,i,sinang); mindx = dx;
248
        dy = dmulscale1(-i,cosang,320,sinang);
249
        horizval1 = dy*(320>>1)/dx-1;
250
 
251
        dx = dmulscale1(320,cosang,-i,sinang); mindx = min(dx,mindx);
252
        dy = dmulscale1(i,cosang,320,sinang);
253
        horizval2 = dy*(320>>1)/dx+1;
254
 
6256 hendricks2 255
        daviewingrange = divscale30(xdim>>1, mindx-16);
5327 hendricks2 256
        daaspect = scale(daviewingrange,scale(320,tilesiz[4094].x,tilesiz[4094].y),horizval2+6-horizval1);
7540 hendricks2 257
        renderSetAspect(daviewingrange,scale(daaspect,ydim*320,xdim*i));
5327 hendricks2 258
        horiz = 100-divscale15(horizval1+horizval2,daviewingrange);
259
    }
260
#endif
261
}
262
 
263
#define MAXVOXMIPS 5
264
extern intptr_t voxoff[][MAXVOXMIPS];
8455 hendricks2 265
void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura, int32_t smoothr)
5327 hendricks2 266
{
267
    int i, *longptr;
6001 hendricks2 268
    uspritetype *tspr;
5327 hendricks2 269
 
270
    UNREFERENCED_PARAMETER(ourx);
271
    UNREFERENCED_PARAMETER(oury);
8455 hendricks2 272
    UNREFERENCED_PARAMETER(ourz);
5327 hendricks2 273
    UNREFERENCED_PARAMETER(oura);
274
    UNREFERENCED_PARAMETER(smoothr);
275
 
276
    for (i=0,tspr=&tsprite[0]; i<spritesortcnt; i++,tspr++)
277
    {
278
        if (usevoxels && tiletovox[tspr->picnum] >= 0)
279
        {
280
            switch (tspr->picnum)
281
            {
282
            case PLAYER:
283
                //tspr->cstat |= 48; tspr->picnum = tiletovox[tspr->picnum];
284
                longptr = (int *)voxoff[tiletovox[PLAYER]][0];
285
                tspr->xrepeat = scale(tspr->xrepeat,56,longptr[2]);
286
                tspr->yrepeat = scale(tspr->yrepeat,56,longptr[2]);
287
                tspr->shade -= 6;
288
                break;
289
            case BROWNMONSTER:
290
                //tspr->cstat |= 48; tspr->picnum = tiletovox[tspr->picnum];
291
                break;
292
            }
293
        }
294
 
295
        tspr->shade += 6;
296
        if (sector[tspr->sectnum].ceilingstat&1)
297
            tspr->shade += sector[tspr->sectnum].ceilingshade;
298
        else
299
            tspr->shade += sector[tspr->sectnum].floorshade;
300
    }
301
}
302
 
303
void ExtCheckKeys(void)
304
{
305
    int i; //, p, y, dx, dy, cosang, sinang, bufplc, tsizy, tsizyup15;
306
    int j;
307
 
308
    if (qsetmode == 200)    //In 3D mode
309
    {
310
#if 0
311
        if (hang != 0)
312
        {
313
            bufplc = waloff[4094]+(mulscale16(horiz-100,xdimenscale)+(tilesiz[4094].x>>1))*tilesiz[4094].y;
7540 hendricks2 314
            renderRestoreTarget();
5327 hendricks2 315
            cosang = sintable[(hang+512)&2047];
316
            sinang = sintable[hang&2047];
317
            dx = dmulscale1(xdim,cosang,ydim,sinang);
318
            dy = dmulscale1(-ydim,cosang,xdim,sinang);
319
 
7540 hendricks2 320
            videoBeginDrawing();
5327 hendricks2 321
            tsizy = tilesiz[4094].y;
322
            tsizyup15 = (tsizy<<15);
323
            dx = mulscale14(dx,daviewingrange);
324
            dy = mulscale14(dy,daaspect);
325
            sinang = mulscale14(sinang,daviewingrange);
326
            cosang = mulscale14(cosang,daaspect);
5984 hendricks2 327
            p = ylookup[windowxy1.y]+frameplace+windowxy2.x+1;
328
            for (y=windowxy1.y; y<=windowxy2.y; y++)
5327 hendricks2 329
            {
330
                i = divscale16(tsizyup15,dx);
331
                stretchhline(0,(xdim>>1)*i+tsizyup15,xdim>>2,i,mulscale32(i,dy)*tsizy+bufplc,p);
332
                dx -= sinang; dy += cosang; p += ylookup[1];
333
            }
334
            walock[4094] = 1;
335
 
336
            Bsprintf(tempbuf,"%d",(hang*180)>>10);
337
            printext256(0L,8L,31,-1,tempbuf,1);
7540 hendricks2 338
            videoEndDrawing();
5327 hendricks2 339
        }
340
#endif
7540 hendricks2 341
        if (keystatus[0xa]) renderSetAspect(viewingrange+(viewingrange>>8),yxaspect+(yxaspect>>8));
342
        if (keystatus[0xb]) renderSetAspect(viewingrange-(viewingrange>>8),yxaspect-(yxaspect>>8));
343
        if (keystatus[0xc]) renderSetAspect(viewingrange,yxaspect-(yxaspect>>8));
344
        if (keystatus[0xd]) renderSetAspect(viewingrange,yxaspect+(yxaspect>>8));
345
        //if (keystatus[0x38]) renderSetRollAngle(rollangle+=((keystatus[0x2a]|keystatus[0x36])*6+2));
346
        //if (keystatus[0xb8]) renderSetRollAngle(rollangle-=((keystatus[0x2a]|keystatus[0x36])*6+2));
347
        //if (keystatus[0x1d]|keystatus[0x9d]) renderSetRollAngle(rollangle=0);
5327 hendricks2 348
 
7540 hendricks2 349
        videoBeginDrawing();
5327 hendricks2 350
 
351
        i = frameval[framecnt&(AVERAGEFRAMES-1)];
7540 hendricks2 352
        j = frameval[framecnt&(AVERAGEFRAMES-1)] = timerGetTicks(); framecnt++;
5735 hendricks2 353
        if (i != j) averagefps = (averagefps*3 + (AVERAGEFRAMES*1000)/(j-i))>>2;
5327 hendricks2 354
        Bsprintf((char *)tempbuf,"%d",averagefps);
355
        printext256(0L,0L,31,-1,(char *)tempbuf,1);
356
 
7540 hendricks2 357
        videoEndDrawing();
5327 hendricks2 358
        editinput();
359
    }
360
    else
361
    {
362
    }
363
}
364
 
365
void ExtCleanUp(void)
366
{
367
}
368
 
369
void ExtPreLoadMap(void)
370
{
371
}
372
 
373
 
374
void ExtSetupMapFilename(const char *mapname)
375
{
376
    UNREFERENCED_PARAMETER(mapname);
377
}
378
 
379
void ExtLoadMap(const char *mapname)
380
{
381
    UNREFERENCED_PARAMETER(mapname);
382
}
383
 
384
int32_t ExtPreSaveMap(void)
385
{
386
    return 0;
387
}
388
 
389
void ExtSaveMap(const char *mapname)
390
{
391
    UNREFERENCED_PARAMETER(mapname);
392
}
393
 
394
const char *ExtGetSectorCaption(short sectnum)
395
{
396
    if ((sector[sectnum].lotag|sector[sectnum].hitag) == 0)
397
    {
398
        tempbuf[0] = 0;
399
    }
400
    else
401
    {
402
        Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)sector[sectnum].hitag,
403
                 (unsigned short)sector[sectnum].lotag);
404
    }
405
    return (char *)tempbuf;
406
}
407
 
408
const char *ExtGetWallCaption(short wallnum)
409
{
410
    if ((wall[wallnum].lotag|wall[wallnum].hitag) == 0)
411
    {
412
        tempbuf[0] = 0;
413
    }
414
    else
415
    {
416
        Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)wall[wallnum].hitag,
417
                 (unsigned short)wall[wallnum].lotag);
418
    }
419
    return (char *)tempbuf;
420
}
421
 
422
const char *ExtGetSpriteCaption(short spritenum)
423
{
424
    if ((sprite[spritenum].lotag|sprite[spritenum].hitag) == 0)
425
    {
426
        tempbuf[0] = 0;
427
    }
428
    else
429
    {
430
        Bsprintf((char *)tempbuf,"%hu,%hu",(unsigned short)sprite[spritenum].hitag,
431
                 (unsigned short)sprite[spritenum].lotag);
432
    }
433
    return (char *)tempbuf;
434
}
435
 
436
//printext16 parameters:
437
//printext16(int xpos, int ypos, short col, short backcol,
438
//           char name[82], char fontsize)
439
//  xpos 0-639   (top left)
440
//  ypos 0-479   (top left)
441
//  col 0-15
442
//  backcol 0-15, -1 is transparent background
443
//  name
444
//  fontsize 0=8*8, 1=3*5
445
 
7540 hendricks2 446
//editorDraw2dLine parameters:
447
// editorDraw2dLine(int x1, int y1, int x2, int y2, char col)
5327 hendricks2 448
//  x1, x2  0-639
449
//  y1, y2  0-143  (status bar is 144 high, origin is top-left of STATUS BAR)
450
//  col     0-15
451
 
452
void ExtShowSectorData(short sectnum)   //F5
453
{
454
    int i;
455
    if (qsetmode == 200)    //In 3D mode
456
    {
457
    }
458
    else
459
    {
7540 hendricks2 460
        videoBeginDrawing();
5327 hendricks2 461
        clearmidstatbar16();             //Clear middle of status bar
462
 
463
        Bsprintf((char *)tempbuf,"Sector %d",sectnum);
464
        printext16(8,ydim16+32,11,-1,(char *)tempbuf,0);
465
 
466
        printext16(8,ydim16+48,11,-1,"8*8 font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789",0);
467
        printext16(8,ydim16+56,11,-1,"3*5 font: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789",1);
468
 
469
        i=ydim16; ydim16=ydim;
7540 hendricks2 470
        editorDraw2dLine(320,i+68,344,i+80,4);       //Draw house
471
        editorDraw2dLine(344,i+80,344,i+116,4);
472
        editorDraw2dLine(344,i+116,296,i+116,4);
473
        editorDraw2dLine(296,i+116,296,i+80,4);
474
        editorDraw2dLine(296,i+80,320,i+68,4);
5327 hendricks2 475
        ydim16=i;
7540 hendricks2 476
        videoEndDrawing();
5327 hendricks2 477
    }
478
}
479
 
480
void ExtShowWallData(short wallnum)       //F6
481
{
482
    if (qsetmode == 200)    //In 3D mode
483
    {
484
    }
485
    else
486
    {
7540 hendricks2 487
        videoBeginDrawing();
5327 hendricks2 488
        clearmidstatbar16();             //Clear middle of status bar
489
 
490
        Bsprintf((char *)tempbuf,"Wall %d",wallnum);
491
        printext16(8,ydim16+32,11,-1,(char *)tempbuf,0);
7540 hendricks2 492
        videoEndDrawing();
5327 hendricks2 493
    }
494
}
495
 
496
void ExtShowSpriteData(short spritenum)   //F6
497
{
498
    if (qsetmode == 200)    //In 3D mode
499
    {
500
    }
501
    else
502
    {
7540 hendricks2 503
        videoBeginDrawing();
5327 hendricks2 504
        clearmidstatbar16();             //Clear middle of status bar
505
 
506
        Bsprintf((char *)tempbuf,"Sprite %d",spritenum);
507
        printext16(8,ydim16+32,11,-1,(char *)tempbuf,0);
7540 hendricks2 508
        videoEndDrawing();
5327 hendricks2 509
    }
510
}
511
 
512
void ExtEditSectorData(short sectnum)    //F7
513
{
514
    short nickdata;
515
 
516
    if (qsetmode == 200)    //In 3D mode
517
    {
518
        //Ceiling
519
        if (searchstat == 1)
520
            sector[searchsector].ceilingpicnum++;   //Just a stupid example
521
 
522
        //Floor
523
        if (searchstat == 2)
524
            sector[searchsector].floorshade++;      //Just a stupid example
525
    }
526
    else                    //In 2D mode
527
    {
528
        Bsprintf((char *)tempbuf,"Sector (%d) Nick's variable: ",sectnum);
529
        nickdata = 0;
530
        nickdata = getnumber16((char *)tempbuf,nickdata,65536L,0);
531
 
532
        printmessage16(" ");              //Clear message box (top right of status bar)
533
        ExtShowSectorData(sectnum);
534
    }
535
}
536
 
537
void ExtEditWallData(short wallnum)       //F8
538
{
539
    short nickdata;
540
 
541
    if (qsetmode == 200)    //In 3D mode
542
    {
543
    }
544
    else
545
    {
546
        Bsprintf((char *)tempbuf,"Wall (%d) Nick's variable: ",wallnum);
547
        nickdata = 0;
548
        nickdata = getnumber16((char *)tempbuf,nickdata,65536L,0);
549
 
550
        printmessage16(" ");              //Clear message box (top right of status bar)
551
        ExtShowWallData(wallnum);
552
    }
553
}
554
 
555
void ExtEditSpriteData(short spritenum)   //F8
556
{
557
    short nickdata;
558
 
559
    if (qsetmode == 200)    //In 3D mode
560
    {
561
    }
562
    else
563
    {
564
        Bsprintf((char *)tempbuf,"Sprite (%d) Nick's variable: ",spritenum);
565
        nickdata = 0;
566
        nickdata = getnumber16((char *)tempbuf,nickdata,65536L,0);
567
        printmessage16(" ");
568
 
569
        printmessage16(" ");              //Clear message box (top right of status bar)
570
        ExtShowSpriteData(spritenum);
571
    }
572
}
573
 
574
void faketimerhandler(void)
575
{
8250 hendricks2 576
    timerUpdateClock();
5327 hendricks2 577
}
578
 
579
void M32RunScript(const char *s) { UNREFERENCED_PARAMETER(s); }
580
void G_Polymer_UnInit(void) { }
581
void SetGamePalette(int32_t j) { UNREFERENCED_PARAMETER(j); }
582
 
583
int32_t AmbienceToggle, MixRate, ParentalLock;
584
 
585
int32_t taglab_linktags(int32_t spritep, int32_t num)
586
{
587
    int32_t link = 0;
588
 
589
    g_iReturnVar = link;
590
    VM_OnEvent(EVENT_LINKTAGS, spritep ? num : -1);
591
    link = g_iReturnVar;
592
 
593
    return link;
594
}
595
 
596
int32_t taglab_getnextfreetag(int32_t *duetoptr)
597
{
598
    int32_t i, nextfreetag=1;
599
    int32_t obj = -1;
600
 
601
    for (i=0; i<MAXSPRITES; i++)
602
    {
603
        int32_t tag;
604
 
605
        if (sprite[i].statnum == MAXSTATUS)
606
            continue;
607
 
608
        tag = select_sprite_tag(i);
609
 
610
        if (tag != INT32_MIN && nextfreetag <= tag)
611
        {
612
            nextfreetag = tag+1;
613
            obj = 32768 + i;
614
        }
615
    }
616
 
617
    for (i=0; i<numwalls; i++)
618
    {
619
        int32_t lt = taglab_linktags(0, i);
620
 
621
        if ((lt&1) && nextfreetag <= wall[i].lotag)
622
            nextfreetag = wall[i].lotag+1, obj = i;
623
        if ((lt&2) && nextfreetag <= wall[i].hitag)
624
            nextfreetag = wall[i].hitag+1, obj = i;
625
    }
626
 
627
    if (duetoptr != NULL)
628
        *duetoptr = obj;
629
 
630
    if (nextfreetag < 32768)
631
        return nextfreetag;
632
 
633
    return 0;
634
}
635
 
636
int32_t S_InvalidSound(int32_t num) {
637
    UNREFERENCED_PARAMETER(num); return 1;
638
};
639
int32_t S_CheckSoundPlaying(int32_t i, int32_t num) {
640
    UNREFERENCED_PARAMETER(i); UNREFERENCED_PARAMETER(num); return 0;
641
};
642
int32_t S_SoundsPlaying(int32_t i) {
643
    UNREFERENCED_PARAMETER(i); return -1;
644
}
645
int32_t S_SoundFlags(int32_t num) {
646
    UNREFERENCED_PARAMETER(num); return 0;
647
};
648
int32_t A_PlaySound(uint32_t num, int32_t i) {
649
    UNREFERENCED_PARAMETER(num); UNREFERENCED_PARAMETER(i); return 0;
650
};
651
void S_StopSound(int32_t num) {
652
    UNREFERENCED_PARAMETER(num);
653
};
5989 hendricks2 654
void S_StopAllSounds(void) { }
5327 hendricks2 655
 
656
//Just thought you might want my getnumber16 code
657
/*
658
getnumber16(char namestart[80], short num, int maxnumber)
659
{
660
    char buffer[80];
661
    int j, k, n, danum, oldnum;
662
 
663
    danum = (int)num;
664
    oldnum = danum;
665
    while ((keystatus[0x1c] != 2) && (keystatus[0x1] == 0))  //Enter, ESC
666
    {
667
        sprintf(&buffer,"%s%ld_ ",namestart,danum);
668
        printmessage16(buffer);
669
 
670
        for(j=2;j<=11;j++)                //Scan numbers 0-9
671
            if (keystatus[j] > 0)
672
            {
673
                keystatus[j] = 0;
674
                k = j-1;
675
                if (k == 10) k = 0;
676
                n = (danum*10)+k;
677
                if (n < maxnumber) danum = n;
678
            }
679
        if (keystatus[0xe] > 0)    // backspace
680
        {
681
            danum /= 10;
682
            keystatus[0xe] = 0;
683
        }
684
        if (keystatus[0x1c] == 1)   //L. enter
685
        {
686
            oldnum = danum;
687
            keystatus[0x1c] = 2;
688
            asksave = 1;
689
        }
690
    }
691
    keystatus[0x1c] = 0;
692
    keystatus[0x1] = 0;
693
    return((short)oldnum);
694
}
695
*/
696
 
697
/*
698
 * vim:ts=4:
699
 */