From 3c4f0b7b1d80af547618cf91ee25b2c2794beeb5 Mon Sep 17 00:00:00 2001 From: Raydelto Hernandez Date: Sat, 6 Jun 2020 17:36:04 -0300 Subject: [PATCH] Making the source build on linux --- .gitignore | 2 + Makefile | 185 ++++++++++++++++-------------------- src/ball.cpp | 2 +- src/ball.h | 2 +- src/block.cpp | 2 +- src/block.h | 2 +- src/escalator.cpp | 2 +- src/escalator.h | 2 +- src/fan.cpp | 2 +- src/fan.h | 2 +- src/lighting.cpp | 2 +- src/lighting.h | 4 +- src/main.cpp | 15 +-- src/material.cpp | 4 +- src/material.h | 2 +- src/model.cpp | 6 +- src/model.h | 4 +- src/physics/constraint.cpp | 2 +- src/physics/constraint.h | 2 +- src/physics/force.cpp | 2 +- src/physics/force.h | 2 +- src/physics/particle.cpp | 2 +- src/physics/particle.h | 2 +- src/physics/rotation.cpp | 2 +- src/physics/rotation.h | 2 +- src/physics/shape.cpp | 2 +- src/physics/shape.h | 2 +- src/physics/shape_test.cpp | 2 +- src/physics/transform.cpp | 2 +- src/physics/transform.h | 2 +- src/physics/translation.cpp | 2 +- src/physics/translation.h | 2 +- src/physics/vector.cpp | 2 +- src/physics/vector.h | 2 +- src/physics/vector_test.cpp | 2 +- src/player.cpp | 8 +- src/player.h | 2 +- src/portal.cpp | 2 +- src/portal.h | 2 +- src/ramp.cpp | 2 +- src/ramp.h | 2 +- src/resource.cpp | 4 +- src/resource.h | 2 +- src/room.cpp | 2 +- src/room.h | 2 +- src/room_force.cpp | 2 +- src/room_force.h | 2 +- src/room_object.cpp | 2 +- src/room_object.h | 2 +- src/rotating.cpp | 2 +- src/rotating.h | 2 +- src/seesaw.cpp | 4 +- src/seesaw.h | 2 +- src/shader.cpp | 5 +- src/shader.h | 4 +- src/simulation.cpp | 4 +- src/simulation.h | 2 +- src/sound.cpp | 4 +- src/sound.h | 2 +- src/switch.cpp | 2 +- src/switch.h | 2 +- src/texture.cpp | 10 +- src/texture.h | 4 +- src/trail.cpp | 2 +- src/trail.h | 2 +- src/transforming.cpp | 2 +- src/transforming.h | 2 +- src/translating.cpp | 2 +- src/translating.h | 2 +- src/tube.cpp | 2 +- src/tube.h | 2 +- src/wall.cpp | 2 +- src/wall.h | 2 +- src/world.cpp | 4 +- src/world.h | 2 +- src/worlds.cpp | 4 +- src/worlds.h | 2 +- 77 files changed, 181 insertions(+), 212 deletions(-) diff --git a/.gitignore b/.gitignore index b672fde..477299a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ obj +bin +.vscode diff --git a/Makefile b/Makefile index 5ff2ae9..f91c824 100644 --- a/Makefile +++ b/Makefile @@ -1,107 +1,88 @@ -CXXFLAGS = \ - -O2 \ - -I/System/Library/Frameworks/GLUT.framework/Headers \ - -I/System/Library/Frameworks/OpenGL.framework/Headers \ - -I/System/Library/Frameworks/SDL.framework/Headers \ - -I/System/Library/Frameworks/SDL_image.framework/Headers \ - -I/System/Library/Frameworks/SDL_mixer.framework/Headers \ - -I/System/Library/Frameworks/TinyXML.framework/Headers +LIBS = -lGL -lGLEW -lGLU -lglut -ltinyxml -lSDL -lSDL_mixer -lSDL_image +INCLUDES=-I /usr/include -LDFLAGS = \ - -framework Cocoa \ - -framework GLUT \ - -framework OpenGL \ - -framework SDL \ - -framework SDL_image \ - -framework SDL_mixer \ - -framework TinyXML +SRC = ./src/portal.cpp \ +./src/fan.cpp \ +./src/physics/constraint.cpp \ +./src/physics/shape.cpp \ +./src/physics/vector.cpp \ +./src/physics/transform.cpp \ +./src/physics/force.cpp \ +./src/physics/particle.cpp \ +./src/physics/translation.cpp \ +./src/physics/rotation.cpp \ +./src/switch.cpp \ +./src/main.cpp \ +./src/room_force.cpp \ +./src/model.cpp \ +./src/resource.cpp \ +./src/wall.cpp \ +./src/world.cpp \ +./src/lighting.cpp \ +./src/ball.cpp \ +./src/worlds.cpp \ +./src/translating.cpp \ +./src/material.cpp \ +./src/transforming.cpp \ +./src/sound.cpp \ +./src/trail.cpp \ +./src/rotating.cpp \ +./src/player.cpp \ +./src/simulation.cpp \ +./src/tube.cpp \ +./src/shader.cpp \ +./src/ramp.cpp \ +./src/seesaw.cpp \ +./src/escalator.cpp \ +./src/room.cpp \ +./src/block.cpp \ +./src/texture.cpp \ +./src/room_object.cpp -RESOURCES = \ - resources/Polly.icns \ - resources/*.frag \ - resources/*.jpg \ - resources/*.ogg \ - resources/*.png \ - resources/*.vert \ - resources/world.xml +OBJ = ./bin/portal.o \ +./bin/fan.o \ +./bin/constraint.o \ +./bin/shape.o \ +./bin/vector.o \ +./bin/transform.o \ +./bin/force.o \ +./bin/particle.o \ +./bin/translation.o \ +./bin/rotation.o \ +./bin/switch.o \ +./bin/main.o \ +./bin/room_force.o \ +./bin/model.o \ +./bin/resource.o \ +./bin/wall.o \ +./bin/world.o \ +./bin/lighting.o \ +./bin/ball.o \ +./bin/worlds.o \ +./bin/translating.o \ +./bin/material.o \ +./bin/transforming.o \ +./bin/sound.o \ +./bin/trail.o \ +./bin/rotating.o \ +./bin/player.o \ +./bin/simulation.o \ +./bin/tube.o \ +./bin/shader.o \ +./bin/ramp.o \ +./bin/seesaw.o \ +./bin/escalator.o \ +./bin/room.o \ +./bin/block.o \ +./bin/texture.o \ +./bin/room_object.o -all : obj/Polly-B-Gone.app +WARNINGS=-w -obj/main.out : \ - obj/ball.o \ - obj/block.o \ - obj/escalator.o \ - obj/fan.o \ - obj/lighting.o \ - obj/material.o \ - obj/model.o \ - obj/physics/constraint.o \ - obj/physics/force.o \ - obj/physics/particle.o \ - obj/physics/rotation.o \ - obj/physics/shape.o \ - obj/physics/transform.o \ - obj/physics/translation.o \ - obj/physics/vector.o \ - obj/player.o \ - obj/portal.o \ - obj/ramp.o \ - obj/resource.o \ - obj/room.o \ - obj/room_force.o \ - obj/room_object.o \ - obj/rotating.o \ - obj/seesaw.o \ - obj/shader.o \ - obj/simulation.o \ - obj/sound.o \ - obj/switch.o \ - obj/texture.o \ - obj/trail.o \ - obj/transforming.o \ - obj/translating.o \ - obj/tube.o \ - obj/wall.o \ - obj/world.o \ - obj/worlds.o \ - src/SDLMain.m +FLAGS=-std=c++11 -obj/physics/particle_test.out : \ - obj/physics/force.o \ - obj/physics/particle.o \ - obj/physics/vector.o \ - obj/simulation.o - -obj/physics/shape_test.out : \ - obj/physics/shape.o \ - obj/physics/vector.o - -obj/physics/vector_test.out : \ - obj/physics/vector.o - -obj/Polly-B-Gone.app : obj/main.out $(RESOURCES) resources/Info.plist Makefile - rm -rf $@ - mkdir -p $@/Contents/MacOS - cp $< $@/Contents/MacOS/Polly-B-Gone - mkdir -p $@/Contents/Resources - cp resources/Info.plist $@/Contents - cp $(RESOURCES) $@/Contents/Resources - mkdir -p $@/Contents/Frameworks - cp -R /System/Library/Frameworks/SDL.framework $@/Contents/Frameworks - cp -R /System/Library/Frameworks/SDL_image.framework $@/Contents/Frameworks - cp -R /System/Library/Frameworks/SDL_mixer.framework $@/Contents/Frameworks - cp -R /System/Library/Frameworks/TinyXML.framework $@/Contents/Frameworks - find $@/Contents/Frameworks -name Headers | xargs rm -r -# ln -sf ../../../../resources/world.xml $@/Contents/Resources/world.xml - -obj/%.out : obj/%.o - $(CXX) $(LDFLAGS) -o $@ $^ - -obj/%.o : src/%.cpp - mkdir -p $(@D) - $(CXX) -c $(CXXFLAGS) -o $@ $< - -.PRECIOUS : obj/%.o obj/physics/%.o - -clean: - rm -rf obj +all: + g++ -c -g $(SRC) $(INCLUDES) $(WARNINGS) $(FLAGS) + ls bin>/dev/null||mkdir bin + mv *.o ./bin + g++ -g $(OBJ) $(LIBS) $(INCLUDES) -o bin/main $(WARNINGS) $(FLAGS) diff --git a/src/ball.cpp b/src/ball.cpp index 6c77623..7ffb913 100644 --- a/src/ball.cpp +++ b/src/ball.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "ball.h" #include "material.h" diff --git a/src/ball.h b/src/ball.h index 6b2b7ac..40f437b 100644 --- a/src/ball.h +++ b/src/ball.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_BALL_H #define MBOSTOCK_BALL_H diff --git a/src/block.cpp b/src/block.cpp index 0855dda..90686fe 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "block.h" #include "material.h" diff --git a/src/block.h b/src/block.h index b28f83a..e94aec9 100644 --- a/src/block.h +++ b/src/block.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_BLOCK_H #define MBOSTOCK_BLOCK_H diff --git a/src/escalator.cpp b/src/escalator.cpp index 862c53d..4e4d77d 100644 --- a/src/escalator.cpp +++ b/src/escalator.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "escalator.h" #include "material.h" diff --git a/src/escalator.h b/src/escalator.h index 28069a0..3f0708f 100644 --- a/src/escalator.h +++ b/src/escalator.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_ESCALATOR_H #define MBOSTOCK_ESCALATOR_H diff --git a/src/fan.cpp b/src/fan.cpp index 442bf63..a4eced9 100644 --- a/src/fan.cpp +++ b/src/fan.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/fan.h b/src/fan.h index 8a845db..bb75b36 100644 --- a/src/fan.h +++ b/src/fan.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_FAN_H #define MBOSTOCK_FAN_H diff --git a/src/lighting.cpp b/src/lighting.cpp index ad07a67..abbfc36 100644 --- a/src/lighting.cpp +++ b/src/lighting.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include diff --git a/src/lighting.h b/src/lighting.h index ef254a6..0b0f2c9 100644 --- a/src/lighting.h +++ b/src/lighting.h @@ -1,9 +1,7 @@ -// -*- C++ -*- - #ifndef MBOSTOCK_LIGHTING_H #define MBOSTOCK_LIGHTING_H -#include +#include namespace mbostock { diff --git a/src/main.cpp b/src/main.cpp index ef4966a..a693d75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,11 +1,10 @@ -// -*- C++ -*- - -#include -#include +#include +#include +#include #include #include #include -#include +#include #include "room.h" #include "shader.h" @@ -98,8 +97,10 @@ static void handleDisplay() { } static void toggleShader() { - shaderi = (shaderi + 1) % shadern; + static int increment = 1; + shaderi = shaderi + increment; shader()->initialize(); + increment *= -1; } static void toggleFullScreen() { @@ -194,6 +195,8 @@ static void eventLoop() { int main(int argc, char** argv) { SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO); + glutInit(&argc, argv); + SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); diff --git a/src/material.cpp b/src/material.cpp index 4ef263d..e5e978f 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -1,6 +1,4 @@ -// -*- C++ -*- - -#include +#include #include #include #include diff --git a/src/material.h b/src/material.h index 4d80bb0..67a5f0b 100644 --- a/src/material.h +++ b/src/material.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_MATERIAL_H #define MBOSTOCK_MATERIAL_H diff --git a/src/model.cpp b/src/model.cpp index cf165bc..ad1f9c3 100644 --- a/src/model.cpp +++ b/src/model.cpp @@ -1,7 +1,5 @@ -// -*- C++ -*- - -#include -#include +#include +#include #include #include #include diff --git a/src/model.h b/src/model.h index e8f4384..64ef340 100644 --- a/src/model.h +++ b/src/model.h @@ -1,9 +1,7 @@ -// -*- C++ -*- - #ifndef MBOSTOCK_MODEL_H #define MBOSTOCK_MODEL_H -#include +#include #include "physics/shape.h" #include "physics/vector.h" diff --git a/src/physics/constraint.cpp b/src/physics/constraint.cpp index fda5910..1b670fc 100644 --- a/src/physics/constraint.cpp +++ b/src/physics/constraint.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include diff --git a/src/physics/constraint.h b/src/physics/constraint.h index 4be49c3..0ae84b0 100644 --- a/src/physics/constraint.h +++ b/src/physics/constraint.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_CONSTRAINT_H #define MBOSTOCK_CONSTRAINT_H diff --git a/src/physics/force.cpp b/src/physics/force.cpp index 5a3dfa7..2307e97 100644 --- a/src/physics/force.cpp +++ b/src/physics/force.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/physics/force.h b/src/physics/force.h index 6111243..65fb674 100644 --- a/src/physics/force.h +++ b/src/physics/force.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_FORCE_H #define MBOSTOCK_FORCE_H diff --git a/src/physics/particle.cpp b/src/physics/particle.cpp index 1795b14..cfb6b82 100644 --- a/src/physics/particle.cpp +++ b/src/physics/particle.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/physics/particle.h b/src/physics/particle.h index 6d341ae..4b980e9 100644 --- a/src/physics/particle.h +++ b/src/physics/particle.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_PARTICLE_H #define MBOSTOCK_PARTICLE_H diff --git a/src/physics/rotation.cpp b/src/physics/rotation.cpp index a07130d..197e8ad 100644 --- a/src/physics/rotation.cpp +++ b/src/physics/rotation.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include diff --git a/src/physics/rotation.h b/src/physics/rotation.h index 293689d..44b77b3 100644 --- a/src/physics/rotation.h +++ b/src/physics/rotation.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_ROTATION_H #define MBOSTOCK_ROTATION_H diff --git a/src/physics/shape.cpp b/src/physics/shape.cpp index dfe0322..c9e8869 100644 --- a/src/physics/shape.cpp +++ b/src/physics/shape.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/physics/shape.h b/src/physics/shape.h index a5f9695..7e9a7f5 100644 --- a/src/physics/shape.h +++ b/src/physics/shape.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_SHAPE_H #define MBOSTOCK_SHAPE_H diff --git a/src/physics/shape_test.cpp b/src/physics/shape_test.cpp index 595d9df..372212f 100644 --- a/src/physics/shape_test.cpp +++ b/src/physics/shape_test.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/physics/transform.cpp b/src/physics/transform.cpp index 6c0d863..7c99421 100644 --- a/src/physics/transform.cpp +++ b/src/physics/transform.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "transform.h" diff --git a/src/physics/transform.h b/src/physics/transform.h index 060e14f..e563005 100644 --- a/src/physics/transform.h +++ b/src/physics/transform.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_TRANSFORM_H #define MBOSTOCK_TRANSFORM_H diff --git a/src/physics/translation.cpp b/src/physics/translation.cpp index 93f2087..c3448d0 100644 --- a/src/physics/translation.cpp +++ b/src/physics/translation.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "particle.h" #include "translation.h" diff --git a/src/physics/translation.h b/src/physics/translation.h index eb2362d..9f830fb 100644 --- a/src/physics/translation.h +++ b/src/physics/translation.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_TRANSLATION_H #define MBOSTOCK_TRANSLATION_H diff --git a/src/physics/vector.cpp b/src/physics/vector.cpp index c848142..3394668 100644 --- a/src/physics/vector.cpp +++ b/src/physics/vector.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/physics/vector.h b/src/physics/vector.h index 6427d65..0a02068 100644 --- a/src/physics/vector.h +++ b/src/physics/vector.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_VECTOR_H #define MBOSTOCK_VECTOR_H diff --git a/src/physics/vector_test.cpp b/src/physics/vector_test.cpp index ae1ad80..0dd49a6 100644 --- a/src/physics/vector_test.cpp +++ b/src/physics/vector_test.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/player.cpp b/src/player.cpp index 4fb5c1b..291e623 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -1,8 +1,6 @@ -// -*- C++ -*- - -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/player.h b/src/player.h index 7fef991..2bd32cb 100644 --- a/src/player.h +++ b/src/player.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_PLAYER_H #define MBOSTOCK_PLAYER_H diff --git a/src/portal.cpp b/src/portal.cpp index 351edb4..c3e3437 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "physics/vector.h" #include "portal.h" diff --git a/src/portal.h b/src/portal.h index adbcf03..083088a 100644 --- a/src/portal.h +++ b/src/portal.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_PORTAL_H #define MBOSTOCK_PORTAL_H diff --git a/src/ramp.cpp b/src/ramp.cpp index 051f576..3375205 100644 --- a/src/ramp.cpp +++ b/src/ramp.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "material.h" #include "model.h" diff --git a/src/ramp.h b/src/ramp.h index ce360f6..a194469 100644 --- a/src/ramp.h +++ b/src/ramp.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_RAMP_H #define MBOSTOCK_RAMP_H diff --git a/src/resource.cpp b/src/resource.cpp index 25b3c49..05f7a49 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -1,5 +1,3 @@ -// -*- C++ -*- - #include #include #include @@ -9,7 +7,7 @@ using namespace mbostock; const char* Resources::path() { - return "Contents/Resources/"; + return "resources/"; } const char* Resources::readFile(const char* p) { diff --git a/src/resource.h b/src/resource.h index 61a6308..08b6172 100644 --- a/src/resource.h +++ b/src/resource.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_RESOURCE_H #define MBOSTOCK_RESOURCE_H diff --git a/src/room.cpp b/src/room.cpp index 7a13fbc..671b791 100644 --- a/src/room.cpp +++ b/src/room.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include #include diff --git a/src/room.h b/src/room.h index 27ce4b3..22bb834 100644 --- a/src/room.h +++ b/src/room.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_ROOM_H #define MBOSTOCK_ROOM_H diff --git a/src/room_force.cpp b/src/room_force.cpp index fc26f98..93bc514 100644 --- a/src/room_force.cpp +++ b/src/room_force.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "room_force.h" #include "physics/particle.h" diff --git a/src/room_force.h b/src/room_force.h index fd9de2b..8c18548 100644 --- a/src/room_force.h +++ b/src/room_force.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_ROOM_FORCE_H #define MBOSTOCK_ROOM_FORCE_H diff --git a/src/room_object.cpp b/src/room_object.cpp index 4422c1d..c3f3269 100644 --- a/src/room_object.cpp +++ b/src/room_object.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "physics/vector.h" #include "room_object.h" diff --git a/src/room_object.h b/src/room_object.h index 0bcdc73..9ab7394 100644 --- a/src/room_object.h +++ b/src/room_object.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_ROOM_OBJECT_H #define MBOSTOCK_ROOM_OBJECT_H diff --git a/src/rotating.cpp b/src/rotating.cpp index ab173cb..23db87f 100644 --- a/src/rotating.cpp +++ b/src/rotating.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include diff --git a/src/rotating.h b/src/rotating.h index 0fdf136..b208ade 100644 --- a/src/rotating.h +++ b/src/rotating.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_ROTATING_H #define MBOSTOCK_ROTATING_H diff --git a/src/seesaw.cpp b/src/seesaw.cpp index 6a52643..2e2a685 100644 --- a/src/seesaw.cpp +++ b/src/seesaw.cpp @@ -1,6 +1,4 @@ -// -*- C++ -*- - -#include +#include #include "material.h" #include "physics/constraint.h" diff --git a/src/seesaw.h b/src/seesaw.h index b7803f5..05fe363 100644 --- a/src/seesaw.h +++ b/src/seesaw.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_SEESAW_H #define MBOSTOCK_SEESAW_H diff --git a/src/shader.cpp b/src/shader.cpp index f0cd2ce..8e713c8 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -1,7 +1,6 @@ -// -*- C++ -*- - #include - +#include +#include #include "model.h" #include "resource.h" #include "shader.h" diff --git a/src/shader.h b/src/shader.h index a473c8c..2285d63 100644 --- a/src/shader.h +++ b/src/shader.h @@ -1,9 +1,9 @@ -// -*- C++ -*- + #ifndef _SHADER_H #define _SHADER_H -#include +#include namespace mbostock { diff --git a/src/simulation.cpp b/src/simulation.cpp index 7c416ab..373c2a8 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -1,6 +1,4 @@ -// -*- C++ -*- - -#include +#include #include "simulation.h" diff --git a/src/simulation.h b/src/simulation.h index e53b8fb..ea04098 100644 --- a/src/simulation.h +++ b/src/simulation.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_SIMULATION_H #define MBOSTOCK_SIMULATION_H diff --git a/src/sound.cpp b/src/sound.cpp index 1ebf1fe..0eb5ecf 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -1,7 +1,7 @@ -// -*- C++ -*- + #include -#include +#include #include #include #include diff --git a/src/sound.h b/src/sound.h index c8be522..3df0466 100644 --- a/src/sound.h +++ b/src/sound.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_SOUND_H #define MBOSTOCK_SOUND_H diff --git a/src/switch.cpp b/src/switch.cpp index bd9412d..3150fa7 100644 --- a/src/switch.cpp +++ b/src/switch.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "material.h" #include "physics/transform.h" diff --git a/src/switch.h b/src/switch.h index 4e5c0bf..f80b018 100644 --- a/src/switch.h +++ b/src/switch.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_SWITCH_H #define MBOSTOCK_SWITCH_H diff --git a/src/texture.cpp b/src/texture.cpp index 4331f32..0a70f8b 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -1,9 +1,9 @@ -// -*- C++ -*- -#include -#include -#include -#include + +#include +#include +#include +#include #include #include #include diff --git a/src/texture.h b/src/texture.h index 54c339e..dbdae1d 100644 --- a/src/texture.h +++ b/src/texture.h @@ -1,9 +1,9 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_TEXTURE_H #define MBOSTOCK_TEXTURE_H -#include +#include namespace mbostock { diff --git a/src/trail.cpp b/src/trail.cpp index f1977ce..8d3c96e 100644 --- a/src/trail.cpp +++ b/src/trail.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "trail.h" diff --git a/src/trail.h b/src/trail.h index 875d280..88ecb5a 100644 --- a/src/trail.h +++ b/src/trail.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_TRAIL_H #define MBOSTOCK_TRAIL_H diff --git a/src/transforming.cpp b/src/transforming.cpp index ff0d26f..fef9f68 100644 --- a/src/transforming.cpp +++ b/src/transforming.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "transforming.h" diff --git a/src/transforming.h b/src/transforming.h index cdff84b..d3e960b 100644 --- a/src/transforming.h +++ b/src/transforming.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_TRANSFORMING_H #define MBOSTOCK_TRANSFORMING_H diff --git a/src/translating.cpp b/src/translating.cpp index ff389d7..c4b88c0 100644 --- a/src/translating.cpp +++ b/src/translating.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "physics/particle.h" #include "physics/vector.h" diff --git a/src/translating.h b/src/translating.h index 8f090b8..4dba7b8 100644 --- a/src/translating.h +++ b/src/translating.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_TRANSLATING_H #define MBOSTOCK_TRANSLATING_H diff --git a/src/tube.cpp b/src/tube.cpp index 907c7ab..ade0469 100644 --- a/src/tube.cpp +++ b/src/tube.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "material.h" #include "model.h" diff --git a/src/tube.h b/src/tube.h index decc6f9..3da43d4 100644 --- a/src/tube.h +++ b/src/tube.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_TUBE_H #define MBOSTOCK_TUBE_H diff --git a/src/wall.cpp b/src/wall.cpp index 6831ec2..4e5f3f4 100644 --- a/src/wall.cpp +++ b/src/wall.cpp @@ -1,4 +1,4 @@ -// -*- C++ -*- + #include "material.h" #include "model.h" diff --git a/src/wall.h b/src/wall.h index 715ec6e..6d308e5 100644 --- a/src/wall.h +++ b/src/wall.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_WALL_H #define MBOSTOCK_WALL_H diff --git a/src/world.cpp b/src/world.cpp index cbc4550..568329b 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -1,6 +1,6 @@ -// -*- C++ -*- -#include + +#include #include "material.h" #include "portal.h" diff --git a/src/world.h b/src/world.h index fad2b77..93caf48 100644 --- a/src/world.h +++ b/src/world.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_WORLD_H #define MBOSTOCK_WORLD_H diff --git a/src/worlds.cpp b/src/worlds.cpp index e10443e..0a45521 100644 --- a/src/worlds.cpp +++ b/src/worlds.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -144,7 +144,7 @@ World* XmlWorldBuilder::parseWorld(const char* path) { std::string fullPath(Resources::path()); fullPath.append(path); if (!document_.LoadFile(fullPath.c_str())) { - std::cerr << "Error loading world \"" << path << "\": "; + std::cerr << "Error loading world \"" << fullPath.c_str() << "\": "; std::cerr << document_.ErrorDesc() << "\n"; return NULL; } diff --git a/src/worlds.h b/src/worlds.h index e9bc81f..44b229c 100644 --- a/src/worlds.h +++ b/src/worlds.h @@ -1,4 +1,4 @@ -// -*- C++ -*- + #ifndef MBOSTOCK_WORLDS_H #define MBOSTOCK_WORLDS_H