Subversion Repositories eduke32

Rev

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