File: map.c

package info (click to toggle)
lgeneral 1.4.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,384 kB
  • sloc: ansic: 30,441; sh: 3,574; makefile: 375; sed: 93
file content (52 lines) | stat: -rw-r--r-- 1,887 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/***************************************************************************
                          map.c  -  description
                             -------------------
    begin                : Mon Jan 22 2001
    copyright            : (C) 2001 by Michael Speck
                           (C) 2005 by Leo Savernik
    email                : kulkanie@gmx.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "map.h"

#include "list.h"
#include "parser.h"
#include "util.h"

int map_detect( struct PData *pd ) {
    int dummy; char *str;
    if ( !parser_get_int( pd, "width", &dummy ) ) return 0;
    if ( !parser_get_int( pd, "height", &dummy ) ) return 0;
    if ( !parser_get_value( pd, "terrain_db", &str, 0 ) ) return 0;
    if ( !parser_get_value( pd, "tiles", &str, 0 ) ) return 0;
    return 1;
}

int map_extract( struct PData *pd, struct Translateables *xl )
{
    PData *sub;
    /* map size */
    /* load terrains */
    /* allocate map memory */
    /* map itself */
    /* map names */
    if ( parser_get_pdata( pd, "names", &sub ) ) {
        translateables_add_pdata(xl, sub);
    }
    return 1;
#ifdef __NOTUSED
parser_failure:
    fprintf( stderr, "%s\n", parser_get_error() );
    return 0;
#endif
}