~bialix/fte-mirror/fte-utf8

« back to all changes in this revision

Viewing changes to src/con_slang.cpp

  • Committer: chaac
  • Date: 2003-07-22 09:29:38 UTC
  • Revision ID: chaac_chaac-20030722092938-i0qqf3pz0w5binue
Modified files to allow compilation under newer slang

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
int ConInit(int /*XSize */ , int /*YSize */ )
216
216
{
217
217
    unsigned i;
218
 
    unsigned short linebuf[sizeof(slang_dchs)];
 
218
    SLsmg_Char_Type linebuf[sizeof(slang_dchs)];
219
219
 
220
220
    SLtt_get_terminfo();
221
221
 
361
361
    return 0;
362
362
}
363
363
 
364
 
static int ConPutBoxRaw(int X, int Y, int W, int H, unsigned short *box)
 
364
static int ConPutBoxRaw(int X, int Y, int W, int H, SLsmg_Char_Type *box)
365
365
{
366
366
    int CurX, CurY;
367
367
 
382
382
{
383
383
    int CurX, CurY, i;
384
384
    char ch;
 
385
    SLsmg_Char_Type buffer[W];
385
386
 
386
387
    ConQueryCursorPos(&CurX, &CurY);
387
388
    while (H > 0) {
388
389
        SLsmg_gotorc(Y++, X);
389
 
        SLsmg_read_raw(Cell, W);
 
390
        SLsmg_read_raw(buffer, W);
390
391
        for (i = 0; i < W; i++)
 
392
        {
 
393
            Cell[i] = SLSMG_EXTRACT_CHAR(buffer[i]) | (SLSMG_EXTRACT_COLOR(buffer[i]) << 8);
 
394
 
391
395
            if (Cell[i] & 0x8000) {
392
396
                ch = Cell[i] & 0xff;
393
397
                Cell[i] &= 0x7f00;
394
398
                Cell[i] |= ftesl_get_dch(ch);
395
399
            }
 
400
        }
396
401
        Cell += W;
397
402
        H--;
398
403
    }
402
407
 
403
408
}
404
409
 
405
 
static int ConGetBoxRaw(int X, int Y, int W, int H, unsigned short *box)
 
410
static int ConGetBoxRaw(int X, int Y, int W, int H, SLsmg_Char_Type *box)
406
411
{
407
412
    int CurX, CurY;
408
413
 
437
442
 
438
443
int ConSetBox(int X, int Y, int W, int H, TCell Cell)
439
444
{
440
 
    PCell line = (PCell) malloc(sizeof(TCell) * W);
 
445
//    PCell line = (PCell) malloc(sizeof(TCell) * W);
 
446
    TCell line[W];
441
447
    int i;
442
448
 
443
449
    for (i = 0; i < W; i++)
444
450
        line[i] = Cell;
445
451
    ConPutLine(X, Y++, W, H, line);
446
 
    free(line);
 
452
//    free(line);
447
453
    return 0;
448
454
}
449
455
 
451
457
 
452
458
int ConScroll(int Way, int X, int Y, int W, int H, TAttr Fill, int Count)
453
459
{
454
 
    unsigned short *box;
 
460
    SLsmg_Char_Type box[W * H];
455
461
 
456
 
    box = new unsigned short [W * H];
 
462
//    box = new unsigned short [W * H];
457
463
 
458
464
    TCell fill = (((unsigned) Fill) << 8) | ' ';
459
465
 
467
473
        ConSetBox(X, Y, W, Count, fill);
468
474
    }
469
475
 
470
 
    delete [] (box);
 
476
  //  delete [] (box);
471
477
 
472
478
    return 0;
473
479
}