Removed to make way for the new adaptive/irregular terrain system.
This commit is contained in:
parent
9d660dfdf0
commit
8d23c3f29b
4 changed files with 0 additions and 366 deletions
|
@ -1,53 +0,0 @@
|
||||||
/**************************************************************************
|
|
||||||
* chunkmgr.c -- top level scenery chunk management system.
|
|
||||||
*
|
|
||||||
* Written by Curtis Olson, started July 1997.
|
|
||||||
*
|
|
||||||
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* (Log is kept at end of this file)
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#include "chunkmgr.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* we'll use a fixed sized chunk list for now */
|
|
||||||
static struct chunk chunk_list[MAX_CHUNK_LIST];
|
|
||||||
|
|
||||||
/* ... and a fixed sized chunk cache */
|
|
||||||
static struct chunk chunk_cache[MAX_CHUNK_CACHE];
|
|
||||||
|
|
||||||
|
|
||||||
/* initialize the chunk management system */
|
|
||||||
void chunk_init() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* load all chunks within radius distance of the specified point if
|
|
||||||
* they are not already loaded or cached. Remove or cache any chunks that are
|
|
||||||
* out of range. */
|
|
||||||
void chunk_update(double lat, double lon, double radius) {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
|
||||||
/* Revision 1.1 1997/07/31 23:19:33 curt
|
|
||||||
/* Initial revision.
|
|
||||||
/*
|
|
||||||
*/
|
|
|
@ -1,73 +0,0 @@
|
||||||
/**************************************************************************
|
|
||||||
* chunkmgr.h -- top level scenery chunk management system.
|
|
||||||
*
|
|
||||||
* Written by Curtis Olson, started July 1997.
|
|
||||||
*
|
|
||||||
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* (Log is kept at end of this file)
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CHUNKMGR_H
|
|
||||||
#define CHUNKMGR_H
|
|
||||||
|
|
||||||
|
|
||||||
#include "mesh.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_CHUNK_LIST 1000
|
|
||||||
#define MAX_CHUNK_CACHE 100
|
|
||||||
|
|
||||||
|
|
||||||
struct chunk {
|
|
||||||
/* path name to the data file for this chunk */
|
|
||||||
char path[1024];
|
|
||||||
|
|
||||||
/* coordinates (in arc seconds) */
|
|
||||||
double lon, lat;
|
|
||||||
|
|
||||||
/* coordinates (cartesian, units = km) */
|
|
||||||
double x, y, z;
|
|
||||||
|
|
||||||
/* last calculated distance from current viewpoint */
|
|
||||||
double dist;
|
|
||||||
|
|
||||||
/* pointer to elevation grid array for this chunk*/
|
|
||||||
struct mesh *terrain_ptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/* initialize the chunk management system */
|
|
||||||
void chunk_init();
|
|
||||||
|
|
||||||
|
|
||||||
/* load all chunks within radius distance of the specified point if
|
|
||||||
* they are not already loaded or cached. Remove or cache any chunks that are
|
|
||||||
* out of range. */
|
|
||||||
void chunk_update(double lat, double lon, double radius);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CHUNKMGR_H */
|
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
|
||||||
/* Revision 1.1 1997/07/31 23:19:34 curt
|
|
||||||
/* Initial revision.
|
|
||||||
/*
|
|
||||||
*/
|
|
192
Scenery/parser.y
192
Scenery/parser.y
|
@ -1,192 +0,0 @@
|
||||||
/**************************************************************************
|
|
||||||
* parser.y -- scenery file parser
|
|
||||||
*
|
|
||||||
* Written by Curtis Olson, started June 1997.
|
|
||||||
*
|
|
||||||
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/* C pass through */
|
|
||||||
%{
|
|
||||||
#ifndef __CYGWIN32__
|
|
||||||
# include <malloc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "parsevrml.h"
|
|
||||||
#include "geometry.h"
|
|
||||||
#include "common.h"
|
|
||||||
#include "mesh.h"
|
|
||||||
#include "scenery.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*#DEFINE YYDEBUG 1 */
|
|
||||||
|
|
||||||
/* interfacing with scanner.l (lex) */
|
|
||||||
extern int line_num;
|
|
||||||
extern char *yytext;
|
|
||||||
int push_input_stream ( char *input );
|
|
||||||
|
|
||||||
/* we must define this ourselves */
|
|
||||||
int yyerror(char *s);
|
|
||||||
|
|
||||||
/* handle for a mesh structure */
|
|
||||||
struct mesh *mesh_ptr;
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
/* top level reserved words */
|
|
||||||
%token IncludeSym ShapeSym GeometrySym
|
|
||||||
|
|
||||||
/* basic tokens */
|
|
||||||
%token Identifier Number StringLiteral
|
|
||||||
|
|
||||||
/* symbol tokens */
|
|
||||||
%token EqualSym LBraceSym RBraceSym LParenSym RParenSym
|
|
||||||
%token LSqBracketSym RSqBracketSym CommaSym
|
|
||||||
|
|
||||||
/* error tokens */
|
|
||||||
%token BadStringLiteral ErrorMisc
|
|
||||||
|
|
||||||
|
|
||||||
/* Start Symbol */
|
|
||||||
%start vrml
|
|
||||||
|
|
||||||
|
|
||||||
/* Rules Section */
|
|
||||||
%%
|
|
||||||
|
|
||||||
vrml :
|
|
||||||
node_list
|
|
||||||
;
|
|
||||||
|
|
||||||
node_list :
|
|
||||||
node
|
|
||||||
| node_list node
|
|
||||||
;
|
|
||||||
|
|
||||||
node :
|
|
||||||
include
|
|
||||||
| shape
|
|
||||||
;
|
|
||||||
|
|
||||||
/* includes */
|
|
||||||
include :
|
|
||||||
IncludeSym StringLiteral
|
|
||||||
{
|
|
||||||
yytext = strip_quotes(yytext);
|
|
||||||
printf("Need to include %s\n", yytext);
|
|
||||||
push_input_stream(yytext);
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
/* Shape rules */
|
|
||||||
|
|
||||||
shape :
|
|
||||||
ShapeSym LBraceSym shape_body RBraceSym
|
|
||||||
;
|
|
||||||
|
|
||||||
shape_body :
|
|
||||||
/* appearance */ geometry
|
|
||||||
;
|
|
||||||
|
|
||||||
/* appearance : */
|
|
||||||
/* Empty OK */
|
|
||||||
/* ; */
|
|
||||||
|
|
||||||
geometry :
|
|
||||||
GeometrySym
|
|
||||||
Identifier
|
|
||||||
{
|
|
||||||
vrmlInitGeometry(yytext);
|
|
||||||
}
|
|
||||||
LBraceSym geom_item_list RBraceSym
|
|
||||||
{
|
|
||||||
vrmlHandleGeometry();
|
|
||||||
vrmlFreeGeometry();
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
geom_item_list :
|
|
||||||
geom_item
|
|
||||||
| geom_item_list geom_item
|
|
||||||
;
|
|
||||||
|
|
||||||
geom_item :
|
|
||||||
Identifier { vrmlGeomOptionName(yytext); }
|
|
||||||
geom_rvalue
|
|
||||||
;
|
|
||||||
|
|
||||||
geom_rvalue :
|
|
||||||
value
|
|
||||||
| LSqBracketSym value_list RSqBracketSym
|
|
||||||
;
|
|
||||||
|
|
||||||
value_list :
|
|
||||||
value
|
|
||||||
| value_list value
|
|
||||||
;
|
|
||||||
|
|
||||||
value :
|
|
||||||
Number { vrmlGeomOptionsValue(yytext); }
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/* C Function Section */
|
|
||||||
%%
|
|
||||||
|
|
||||||
|
|
||||||
int yyerror(char *s) {
|
|
||||||
printf("Error: %s at line %d.\n", s, line_num);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* this is a simple main for testing the parser */
|
|
||||||
|
|
||||||
/*
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
#ifdef YYDEBUG
|
|
||||||
yydebug = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printf(" input file = %s\n", argv[1]);
|
|
||||||
push_input_stream(argv[1]);
|
|
||||||
yyparse();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* parse a VRML scenery file */
|
|
||||||
int fgParseVRML(char *file) {
|
|
||||||
int result;
|
|
||||||
|
|
||||||
printf(" input file = %s\n", file);
|
|
||||||
push_input_stream(file);
|
|
||||||
result = yyparse();
|
|
||||||
|
|
||||||
/* return(result) */
|
|
||||||
return(result);
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
/**************************************************************************
|
|
||||||
* parsevrml.h -- top level include file for accessing the vrml parser
|
|
||||||
*
|
|
||||||
* Written by Curtis Olson, started June 1997.
|
|
||||||
*
|
|
||||||
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* (Log is kept at end of this file)
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef PARSEVRML_H
|
|
||||||
#define PARSEVRML_H
|
|
||||||
|
|
||||||
|
|
||||||
/* parse a VRML scenery file */
|
|
||||||
int fgParseVRML(char *file);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* PARSEVRML_H */
|
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
|
||||||
/* Revision 1.2 1997/07/23 21:52:26 curt
|
|
||||||
/* Put comments around the text after an #endif for increased portability.
|
|
||||||
/*
|
|
||||||
* Revision 1.1 1997/06/29 21:16:49 curt
|
|
||||||
* More twiddling with the Scenery Management system.
|
|
||||||
*
|
|
||||||
* Revision 1.1 1997/06/27 02:25:13 curt
|
|
||||||
* Initial revision.
|
|
||||||
*
|
|
||||||
*/
|
|
Loading…
Add table
Reference in a new issue