Skip to content

Commit

Permalink
fixed #include file extensions as well (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelrahim-hentabli authored Dec 30, 2023
1 parent ad05c2b commit bdac8ba
Show file tree
Hide file tree
Showing 30 changed files with 62 additions and 62 deletions.
6 changes: 3 additions & 3 deletions include/bounding_box.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
//#####################################################################
// Function #in
//#####################################################################
#include "object.h"
#include "ray.h"
#include "vec.h"
#include "object.hpp"
#include "ray.hpp"
#include "vec.hpp"

template<class T, int d>
vec<T,d> componentwise_max(const vec<T,d>& a, const vec<T,d>& b)
Expand Down
4 changes: 2 additions & 2 deletions include/box.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef __BOX_H__
#define __BOX_H__

#include "ray.h"
#include "misc.h"
#include "ray.hpp"
#include "misc.hpp"
#include <limits>

class Box
Expand Down
4 changes: 2 additions & 2 deletions include/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define __CAMERA_H__

#include <algorithm>
#include "vec.h"
#include "misc.h"
#include "vec.hpp"
#include "misc.hpp"

typedef unsigned int Pixel;

Expand Down
4 changes: 2 additions & 2 deletions include/direction_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <vector>
#include <iostream>
#include <limits>
#include "vec.h"
#include "light.h"
#include "vec.hpp"
#include "light.hpp"

class Direction_Light : public Light
{
Expand Down
2 changes: 1 addition & 1 deletion include/flat_shader.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __FLAT_SHADER_H__
#define __FLAT_SHADER_H__

#include "shader.h"
#include "shader.hpp"

class Flat_Shader : public Shader
{
Expand Down
2 changes: 1 addition & 1 deletion include/hierarchy.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __HIERARCHY_H__
#define __HIERARCHY_H__

#include "object.h"
#include "object.hpp"

/*
A hierarchy is a binary tree. We represent the hierarchy as a complete
Expand Down
2 changes: 1 addition & 1 deletion include/light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <vector>
#include <iostream>
#include <limits>
#include "vec.h"
#include "vec.hpp"

class Ray;

Expand Down
2 changes: 1 addition & 1 deletion include/mesh.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __MESH_H__
#define __MESH_H__

#include "object.h"
#include "object.hpp"

// Consider a hit to be inside a triange if all barycentric weights
// satisfy weight>=-weight_tol
Expand Down
4 changes: 2 additions & 2 deletions include/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define __OBJECT_H__

#include <vector>
#include "box.h"
#include "vec.h"
#include "box.hpp"
#include "vec.hpp"

// t has to be bigger than small_t to register an intersection with a ray. You
// may need to tweak this value.
Expand Down
2 changes: 1 addition & 1 deletion include/phong_shader.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __PHONG_SHADER_H__
#define __PHONG_SHADER_H__

#include "shader.h"
#include "shader.hpp"

class Phong_Shader : public Shader
{
Expand Down
2 changes: 1 addition & 1 deletion include/plane.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __PLANE_H__
#define __PLANE_H__

#include "object.h"
#include "object.hpp"

class Plane : public Object
{
Expand Down
4 changes: 2 additions & 2 deletions include/point_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <vector>
#include <iostream>
#include <limits>
#include "vec.h"
#include "light.h"
#include "vec.hpp"
#include "light.hpp"

class Point_Light : public Light
{
Expand Down
2 changes: 1 addition & 1 deletion include/ray.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __RAY_H__
#define __RAY_H__

#include "vec.h"
#include "vec.hpp"

class Object;
class Ray
Expand Down
2 changes: 1 addition & 1 deletion include/reflective_shader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __REFLECTIVE_SHADER_H__

#include <algorithm>
#include "shader.h"
#include "shader.hpp"

class Reflective_Shader : public Shader
{
Expand Down
6 changes: 3 additions & 3 deletions include/render_world.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define __RENDER_WORLD_H__

#include <vector>
#include "camera.h"
#include "hierarchy.h"
#include "object.h"
#include "camera.hpp"
#include "hierarchy.hpp"
#include "object.hpp"

class Light;
class Shader;
Expand Down
2 changes: 1 addition & 1 deletion include/shader.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __SHADER_H__
#define __SHADER_H__

#include "vec.h"
#include "vec.hpp"
class Render_World;
class Ray;

Expand Down
2 changes: 1 addition & 1 deletion include/sphere.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __SPHERE_H__
#define __SPHERE_H__

#include "object.h"
#include "object.hpp"
class Sphere : public Object
{
vec3 center;
Expand Down
4 changes: 2 additions & 2 deletions include/spot_light.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <vector>
#include <iostream>
#include <limits>
#include "vec.h"
#include "light.h"
#include "vec.hpp"
#include "light.hpp"

class Spot_Light : public Light
{
Expand Down
2 changes: 1 addition & 1 deletion src/box.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <limits>
#include "box.h"
#include "box.hpp"

// Return whether the ray intersects this box.
bool Box::Intersection(const Ray& ray) const
Expand Down
2 changes: 1 addition & 1 deletion src/camera.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "camera.h"
#include "camera.hpp"

Camera::Camera()
:colors(0)
Expand Down
2 changes: 1 addition & 1 deletion src/flat_shader.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "flat_shader.h"
#include "flat_shader.hpp"

vec3 Flat_Shader::
Shade_Surface(const Ray& ray,const vec3& intersection_point,
Expand Down
2 changes: 1 addition & 1 deletion src/hierarchy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <algorithm>
#include "hierarchy.h"
#include "hierarchy.hpp"

// Reorder the entries vector so that adjacent entries tend to be nearby.
// You may want to implement box.cpp first.
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "render_world.h"
#include "object.h"
#include "render_world.hpp"
#include "object.hpp"
#include <iostream>
#include <cstdio>
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/mesh.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "mesh.h"
#include "mesh.hpp"
#include <fstream>
#include <string>
#include <limits>
Expand Down
20 changes: 10 additions & 10 deletions src/parse.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include <map>
#include <sstream>
#include <string>
#include "direction_light.h"
#include "flat_shader.h"
#include "mesh.h"
#include "phong_shader.h"
#include "plane.h"
#include "point_light.h"
#include "reflective_shader.h"
#include "render_world.h"
#include "sphere.h"
#include "spot_light.h"
#include "direction_light.hpp"
#include "flat_shader.hpp"
#include "mesh.hpp"
#include "phong_shader.hpp"
#include "plane.hpp"
#include "point_light.hpp"
#include "reflective_shader.hpp"
#include "render_world.hpp"
#include "sphere.hpp"
#include "spot_light.hpp"

void Parse(Render_World& world,int& width,int& height,const char* test_file)
{
Expand Down
10 changes: 5 additions & 5 deletions src/phong_shader.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "light.h"
#include "phong_shader.h"
#include "ray.h"
#include "render_world.h"
#include "object.h"
#include "light.hpp"
#include "phong_shader.hpp"
#include "ray.hpp"
#include "render_world.hpp"
#include "object.hpp"

vec3 Phong_Shader::
Shade_Surface(const Ray& ray,const vec3& intersection_point,
Expand Down
4 changes: 2 additions & 2 deletions src/plane.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "plane.h"
#include "ray.h"
#include "plane.hpp"
#include "ray.hpp"
#include <cfloat>
#include <limits>

Expand Down
6 changes: 3 additions & 3 deletions src/reflective_shader.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "reflective_shader.h"
#include "ray.h"
#include "render_world.h"
#include "reflective_shader.hpp"
#include "ray.hpp"
#include "render_world.hpp"

vec3 Reflective_Shader::
Shade_Surface(const Ray& ray,const vec3& intersection_point,
Expand Down
10 changes: 5 additions & 5 deletions src/render_world.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "render_world.h"
#include "flat_shader.h"
#include "object.h"
#include "light.h"
#include "ray.h"
#include "render_world.hpp"
#include "flat_shader.hpp"
#include "object.hpp"
#include "light.hpp"
#include "ray.hpp"

extern bool disable_hierarchy;

Expand Down
4 changes: 2 additions & 2 deletions src/sphere.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "sphere.h"
#include "ray.h"
#include "sphere.hpp"
#include "ray.hpp"

// Determine if the ray intersects with the sphere
Hit Sphere::Intersection(const Ray& ray, int part) const
Expand Down

0 comments on commit bdac8ba

Please sign in to comment.