Skip to content

Commit

Permalink
Whoops, pushed a conflict that last time. Fixing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Shea committed Oct 19, 2010
1 parent d3ff724 commit bb2d8c3
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 381 deletions.
89 changes: 12 additions & 77 deletions Elevation.pde
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@ import java.util.Date;
import java.text.SimpleDateFormat;
import processing.opengl.*;

<<<<<<< HEAD
// for config data
ArrayList configFilenames;
int numConfigFiles;
=======
// for file data
ArrayList filenames;
>>>>>>> parent of bbb3e10... Fixed speed data (aside from anomalies), started refactoring XML parsing to work with config files
ArrayList trackFilenames;

// for track data
ArrayList trackFilenames;
Scene scene;
Tracks[] tracklist;
int numTracks;
Expand Down Expand Up @@ -135,44 +128,15 @@ void setup() {
// create the crosshairs object
crosshair = new uiCrosshairs();

<<<<<<< HEAD
// get the config data
String[] configFileExtensions = {
"cfg"
};
configFilenames = fileCount(dataPath("") + "/config/", configFileExtensions);
numConfigFiles = configFilenames.size();
getConfiguration(configFilenames);


// get the map data
String[] trackFileExtensions = {
// get the track data
String[] fileExtensions = {
"gpx",
"kml",
"tcx"
};
trackFilenames = fileCount(dataPath("") + "/xml/", trackFileExtensions);
trackFilenames = fileCount(dataPath("") + "/xml/", fileExtensions);
numTracks = trackFilenames.size();
getTrackXML(trackFilenames);

=======
// get the map data XML files
filenames = listFileNames(dataPath("") + "/xml/");
try {
numTracks = filenames.size();
}
catch (NullPointerException e) {
// likely suspect: no /xml/ directory
}

// turn the XML into something a little more usable
tracklist = new Tracks[numTracks];
for (int i = 0; i < numTracks; i++) {
tracklist[i] = parseXML((String) filenames.get(i));
// pull out the track dimensions
tracklist[i].getDimensions();
};
>>>>>>> parent of bbb3e10... Fixed speed data (aside from anomalies), started refactoring XML parsing to work with config files
getTrackXML(numTracks);

// create the map scale object once the map data is loaded
mapScale = new uiScale(scene.canvasWidth / 2, scene.canvasHeight - 106, scene.canvasWidth, 5);
Expand Down Expand Up @@ -241,36 +205,8 @@ void draw() {

// if we're going to redraw, let's go for it
if (scene.viewRedraw == true) {

// set default colours
background(#000000);
stroke(#FFFFFF);

// should be putting this in tracks.render, but when I do
// the app crashes my entire system. hmm. infinte loop perhaps?
switch(scene.viewMode) {
case 0:
background(scene.getColor("Mode 1 Background"));
stroke(scene.getColor("Mode 1 Foreground"));
break;
case 1:
background(scene.getColor("Mode 2 Background"));
stroke(scene.getColor("Mode 2 Foreground"));
break;
case 2:
background(scene.getColor("Mode 3 Background"));
stroke(scene.getColor("Mode 3 Foreground"));
break;
case 3:
background(scene.getColor("Mode 4 Background"));
stroke(scene.getColor("Mode 4 Foreground"));
break;
case 4:
background(scene.getColor("Mode 5 Background"));
stroke(scene.getColor("Mode 5 Foreground"));
break;
}; // end switch

background(scene.palette[0]);
stroke(scene.palette[1]);
noFill();

// move the sketch to the center of the canvas, accounting for height of the UI panel
Expand All @@ -280,7 +216,10 @@ void draw() {
rotateX(scene.rotationX);
rotateY(scene.rotationY);
rotateZ(scene.rotationZ);


// draw the crosshairs
crosshair.render(scene.palette[1]);

// adjust the scale based on user input
scale(scene.drawingScale);

Expand All @@ -292,9 +231,6 @@ void draw() {
tracklist[i].render();
}

// draw the crosshairs
crosshair.render(scene.palette[1].value);

// disable depth ordering for the sake of drawing 2D controls over top of the 3D scene
hint(DISABLE_DEPTH_TEST);
// reset the camera view for 2D drawing
Expand All @@ -313,11 +249,10 @@ void draw() {
}

// draw the map scale
mapScale.render(scene.palette[1].value);
mapScale.render(scene.palette[1]);

// draw mini-compass
compass.translateThenRender();

};

// reset the viewRedraw switch for each loop so we don't peg the CPU
Expand Down
Loading

0 comments on commit bb2d8c3

Please sign in to comment.