summaryrefslogtreecommitdiff
path: root/src/worldmapdata.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-13 00:19:13 +0100
committerTreeki <treeki@gmail.com>2011-03-13 00:19:13 +0100
commitb0e0d63eab1e11d1a7f841afdc7eb18e7a9de3ba (patch)
tree82802511dfa1f34b27c2b6ea708c4a5d94f40717 /src/worldmapdata.h
parent7d4e4c0b34a613dd3c0220475ae4e448197522c1 (diff)
downloadkamek-b0e0d63eab1e11d1a7f841afdc7eb18e7a9de3ba.tar.gz
kamek-b0e0d63eab1e11d1a7f841afdc7eb18e7a9de3ba.zip
this branch now features only the level select stuff
Diffstat (limited to 'src/worldmapdata.h')
-rw-r--r--src/worldmapdata.h149
1 files changed, 0 insertions, 149 deletions
diff --git a/src/worldmapdata.h b/src/worldmapdata.h
deleted file mode 100644
index 1d6a305..0000000
--- a/src/worldmapdata.h
+++ /dev/null
@@ -1,149 +0,0 @@
-#ifndef __NEWER_WORLDMAPDATA_H
-#define __NEWER_WORLDMAPDATA_H
-
-#include "fileload.h"
-#include <rvl/mtx.h>
-
-// Forward declarations
-struct WMPathPoint;
-struct WMPathAction;
-struct WMPathSegment;
-struct WMPathDef;
-
-// here's a note: while most of these structs contain pointers to other structs,
-// in the data file these fields actually contain an index into the lists
-// (defined in WMDataHeader)
-// WorldMapData::load() fixes these offsets.
-
-/******************************************************************************/
-// Definition for an entrance onto one side of a path
-// (TODO: Maybe rename this struct?)
-
-// Note: a null WMPathEntrance has no path defined
-// since the path pointer is stored as an index in the data file, the index for
-// a null path becomes -1
-
-struct WMPathEntrance {
- WMPathDef *path;
- bool isEndSide;
-
- bool isValid() { return (this->path != 0); }
-};
-
-
-/******************************************************************************/
-// Definition for one point on the map
-
-struct WMPathPoint {
- enum PointType {
- NONE_TYPE,
- LEVEL_TYPE
- };
-
- // Paths you arrive on when you press a direction when at this point
- union {
- struct {
- WMPathEntrance left;
- WMPathEntrance right;
- WMPathEntrance up;
- WMPathEntrance down;
- } asDirection;
- WMPathEntrance asArray[4];
- } exits;
-
- // Point metadata
- PointType type;
- int params[4];
-
- Vec position;
-};
-
-
-/******************************************************************************/
-// Definition for an action that can be triggered when the player reaches a
-// specific point
-
-struct WMPathAction {
- enum ActionType {
- TELEPORT_TYPE // teleports to another submap
- };
-
- // Action metadata
- ActionType type;
- int params[4];
-};
-
-
-/******************************************************************************/
-// Definition for one part of a path
-
-struct WMPathSegment {
- // Segment metadata
- Vec start;
- Vec end;
- float stepsPerFrame;
- int animationType;
- float animationSpeed;
- short direction;
- bool useLastDir;
- bool alwaysSameDir;
-
- // Optional Action that's triggered when the player touches this segment
- WMPathAction *action;
-};
-
-
-/******************************************************************************/
-// Definition for one path
-
-struct WMPathDef {
- // Path metadata
- WMPathPoint *startPoint;
- WMPathPoint *endPoint;
-
- int segCount;
- WMPathSegment *segments[1]; // variable-length array
-};
-
-
-
-
-struct WMDataHeader {
- u32 magic;
-
- WMPathDef **pathList;
- int pathCount;
-
- WMPathPoint **pointList;
- int pointCount;
-
- WMPathSegment **segmentList;
- int segmentCount;
-
- // todo: remove action list?
- WMPathAction **actionList;
- int actionCount;
-};
-
-
-class WorldMapData {
-public:
- WorldMapData();
- ~WorldMapData();
-
- bool load(const char *filename);
-
- FileHandle fh;
-
- int getPathCount() {
- return ((WMDataHeader*)fh.filePtr)->pathCount;
- }
-
- WMPathDef *getPath(int idx) {
- return ((WMDataHeader*)fh.filePtr)->pathList[idx];
- }
-
- int getPointID(WMPathPoint *point);
-};
-
-#endif // __NEWER_WORLDMAPDATA_H