Subversion Repositories eduke32

Rev

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