Skip to content

Commit

Permalink
Added updated source code with generated doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
Jipolie01 committed Jan 25, 2017
1 parent 68e5fb9 commit f964d32
Show file tree
Hide file tree
Showing 484 changed files with 21,121 additions and 1,002 deletions.
16 changes: 5 additions & 11 deletions Source/background.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#include "Background.hpp"
#include "background.hpp"
#include <string>

Background::Background(std::string filename):
drawable(sf::Vector2f(0,0), sf::Vector2f(0, 0),"Background"),
filename(filename)
{
background_texture.loadFromFile(filename);
background_sprite.setTexture(background_texture);
}

sf::FloatRect Background::getGlobalBounds() {
return background_sprite.getGlobalBounds();
background_image{
image_from_file(sf::Vector2f(0,0),filename)
}
{}

void Background::draw( sf::RenderWindow &window ) {
window.draw(background_sprite);
background_image.draw(window);
}
72 changes: 31 additions & 41 deletions Source/background.hpp
Original file line number Diff line number Diff line change
@@ -1,56 +1,46 @@
///@file

/*!
* \file Background.hpp
*
* \author Luke Roovers
* \date 23-1-2017
*
* Background class
*/


#ifndef _BACKGROUND_HPP
#define _BACKGROUND_HPP

#include "drawable.hpp"
#include <SFML\Graphics.hpp>

#include <SFML/Graphics.hpp>
#include "image.hpp"
#include <iostream>
#include <string>

/*!
* \class Background
*
* \brief Class that draws a background
*
* class with a position, size and name, that is inherited by all
* object that can be drawn on the screen.
*
* \date 23/01/17
*/
class Background:public drawable
///
/// \class Background
///
/// \brief Class that draws a background
///
/// class with a position, size and name, that is inherited by all
/// object that can be drawn on the screen.
///
/// \date 23/01/17

class Background
{
public:
/*! drawable(std::string str = "x")
* \brief constructor for background class
*
* constructor that initializes the file that the background class will use. Default is "x", if default a default picture will be loaded.
*
* \param[in] str name of the .png file that will be loaded as a background, this is a sf::Vector2f
*/
/// \brief constructor for background class
///
/// constructor that initializes the file that the background class will use. Default is "x", if default a default picture will be loaded.
///
/// \param[in] std::string name of the .png file that will be loaded as a background

Background(std::string filename);
/*!void draw(sf::RenderWindow & window) override
* \brief Draw function for background class
*
* defines draw function in super class. Draws the background.
*
* \param[in] window SFML window that is used to display the drawable
*/
void draw(sf::RenderWindow &window) override;

sf::FloatRect getGlobalBounds() override;
/// void draw(sf::RenderWindow & window) override
/// \brief Draw function for background class
///
/// defines draw function in super class. Draws the background.
///
/// \param[in] window SFML window that is used to display the drawable
///
void draw(sf::RenderWindow &window);
private:
sf::Texture background_texture;
sf::Sprite background_sprite;
std::string filename;
image_from_file background_image;

};
#endif
57 changes: 22 additions & 35 deletions Source/camera.hpp
Original file line number Diff line number Diff line change
@@ -1,47 +1,34 @@
///@file

/*!
* \file camera.hpp
*
* \author Luke Roovers
* \date 23-1-2017
*
* Camera class
*/
#ifndef _CAMERA_HPP
#define _CAMERA_HPP


#include <SFML\Graphics.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>
#include "drawable.hpp"
/*!
* \class camera
*
* \brief Class that creates a camera that follows the player around
*
* class with a unicorn tracking function.
*
*
* \date 23/01/17
*/

///\class camera
///
/// \brief Class that creates a camera that follows the player around
///
/// class with a unicorn tracking function.
///
class camera{
public:
/*! camera()
* \brief constructor for camera player
*
* constructor to make a camera.
*
* \param[in] player object that the camera will follow
*/

/// \brief constructor for camera player
///
/// constructor to make a camera.
///
/// \param[in] player object that the camera will follow
///
camera(object_ptr Unicorn);
/*!void follow(sf::RenderWindow &window)
* \brief playercam
*
* Follow the player
*
* \param[in] window SFML window that is used to display the camera.
*/

/// \brief playercam
///
/// Follow the player
///
/// \param[in] window SFML window that is used to display the camera.
///
void follow(sf::RenderWindow &window);

private:
Expand Down
2 changes: 1 addition & 1 deletion Source/drawable.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "drawable.hpp"
#include "math.h"


drawable::drawable(const sf::Vector2f & position, const sf::Vector2f & size, std::string type) :
position{ position },
Expand Down
Loading

0 comments on commit f964d32

Please sign in to comment.