Changeset 69


Ignore:
Timestamp:
Feb 9, 2003, 12:17:40 PM (20 years ago)
Author:
Sam Hocevar
Message:
  • support for boxes
  • application: pause box
Location:
libcaca/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/TODO

    r67 r69  
    4141 * the nuke should break the tunnel
    4242
    43  * the laser stays alive when the ship exploded
     43 * the laser stays alive when the ship explodes
    4444
  • libcaca/trunk/src/Makefile.am

    r61 r69  
    2222        aliens.c \
    2323        bonus.c \
     24        box.c \
    2425        ceo.c \
    2526        collide.c \
  • libcaca/trunk/src/common.h

    r63 r69  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: common.h,v 1.15 2002/12/23 16:21:38 sam Exp $
     6 *   $Id: common.h,v 1.16 2003/02/09 11:17:40 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    144144{
    145145    int w, h;
     146    int x, y;
     147    int frame;
     148
     149} box;
     150
     151typedef struct
     152{
     153    int w, h;
    146154
    147155    starfield *sf;
     
    183191
    184192/*
     193 * From box.c
     194 */
     195box * create_box( game *g, int x, int y, int w, int h );
     196void draw_box( game *g, box *b );
     197void free_box( box *b );
     198
     199/*
    185200 * From ceo.c
    186201 */
     
    221236 * From overlay.c
    222237 */
    223 void draw_overlay( game *g );
     238void draw_status( game *g );
    224239
    225240/*
  • libcaca/trunk/src/main.c

    r63 r69  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: main.c,v 1.16 2002/12/23 16:21:38 sam Exp $
     6 *   $Id: main.c,v 1.17 2003/02/09 11:17:40 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    6161    int skip = 0;
    6262    int purcompteur = 0;
     63
     64    box *pausebox = NULL;
    6365
    6466    g->sf = create_starfield( g );
     
    9193            case 'p':
    9294                poz = !poz;
     95                if( poz )
     96                {
     97                    pausebox = create_box( g, g->w / 2, g->h / 2,
     98                                              g->w - 16, 8 );
     99                }
     100                else
     101                {
     102                    free_box( pausebox );
     103                }
    93104                break;
    94105            case '\t':
     
    216227        draw_weapons( g, g->wp );
    217228        draw_player( g, g->p );
    218         draw_overlay( g );
     229        draw_status( g );
     230
     231        /* Print pause box if needed */
     232        if( poz )
     233        {
     234            pausebox->frame++;
     235            draw_box( g, pausebox );
     236        }
    219237
    220238        /* Refresh */
     
    222240
    223241        purcompteur++;
     242    }
     243
     244    if( pausebox )
     245    {
     246        free_box( pausebox );
    224247    }
    225248
  • libcaca/trunk/src/overlay.c

    r63 r69  
    44 *                 All Rights Reserved
    55 *
    6  *   $Id: overlay.c,v 1.2 2002/12/23 16:21:38 sam Exp $
     6 *   $Id: overlay.c,v 1.3 2003/02/09 11:17:40 sam Exp $
    77 *
    88 *   This program is free software; you can redistribute it and/or modify
     
    2525#include "common.h"
    2626
    27 void draw_overlay( game *g )
     27void draw_status( game *g )
    2828{
    2929    static char dots30[] = "------------------------------";
Note: See TracChangeset for help on using the changeset viewer.