7 Commits

6 changed files with 51 additions and 40 deletions

View File

@@ -1,10 +0,0 @@
v0.1: First Release
- Basic simulation.
- Information printing.
v0.2: Menu Bar
- Added a menu bar.
- Can reset the simulation.
v0.3: Port to C
- Codebase ported to C for better performance.

21
CHANGELOG.md Normal file
View File

@@ -0,0 +1,21 @@
# Change Log
## v0.4: More functionality
- Fix acceleration.
- Add fullscreen support.
- Pause functionality.
## v0.3: Port to C
- Codebase ported to C for better performance.
## v0.2: Menu Bar
- Added a menu bar.
- Can reset the simulation.
## v1.0: First Release
- Basic simulation.
- Information printing.

View File

@@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 3.10)
project(SpaceShipSim C)
set(TARGET_NAME "spaceshipsim")
set(TARGET_VERSION "0.3")
set(TARGET_VERSION "0.4")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "release")
@@ -48,8 +48,7 @@ set(SRCS
add_definitions(-DVERSION="${TARGET_VERSION}")
if(${CMAKE_BUILD_TYPE} STREQUAL "debug" OR
${CMAKE_BUILD_TYPE} STREQUAL "relwithdebinfo")
if(${CMAKE_BUILD_TYPE} STREQUAL "debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "relwithdebinfo")
add_definitions(-DDEBUG)
else()
add_definitions(-DNDEBUG)

View File

@@ -1,39 +1,40 @@
====================
*** SpaceShipSim ***
====================
# SpaceShipSim
This is a small simulation program of a space ship (with infinite fuel) in a
frictionless environment (space). The idea is to use it for educational
purposes.
# Compiling
-----------
## Compiling
In order to build this program you will require the following dependencies:
- GNU GCC (https://gcc.gnu.org/)
- CMake (https://cmake.org/)
- Allegro 5 (http://liballeg.org/)
- A C compiler that supports C99 or higher
- CMake 3.10 or higher
- Allegro 5
You can then compile the program via the following commands:
```bash
cd build/
cmake ..
make
```
This will create a release build with compiler optimizations. If you would like
a debug build then pass the `-DCMAKE_BUILD_TYPE=debug' flag to the `cmake'
command. If you would like to install then run `cmake' with the additional flag
`-DCMAKE_INSTALL_PREFIX=<install_dir>'. If you are installing as a user then
you may want to set the installation prefix to `/usr/local/', and if you're
a debug build then pass the `-DCMAKE_BUILD_TYPE=debug` flag to the `cmake`
command. If you would like to install then run `cmake` with the additional flag
`-DCMAKE_INSTALL_PREFIX=<install_dir>`. If you are installing as a user then
you may want to set the installation prefix to `/usr/local/`, and if you're
packaging then please consult your distribution's policies. With this you
should be able to run the `make install' target and install the binary.
# Contributing
--------------
If you would like to contribute to the project, send a patch file to my e-mail
address: <nortega@themusicinnoise.net>.
## Contributing
If you would like to contribute to the project, send a patch file to my e-mail
address: [nicolas@ortegas.org](mailto:nicolas@ortegas.org).
## License
# License
---------
As educational software, unless otherwise noted, all files are licensed under
the terms & conditions of the GNU General Public License version 3 or greater
(see `LICENSE' file for more information).
(see the [license file](LICENSE) for more information).

1
TODO
View File

@@ -1,3 +1,2 @@
TODO:
- Add a fullscreen mode.
- Add presets with stellar masses (for gravity simulation).

View File

@@ -20,6 +20,11 @@
#include "event_manager.h"
#include "ship.h"
int run;
int redraw;
int show_help;
int show_info;
#include <stdio.h>
#include <allegro5/allegro.h>
#include <allegro5/allegro_primitives.h>
@@ -45,10 +50,6 @@ const char *info_format =
"velY: %f px/sec";
int main() {
int run;
int redraw;
int show_help;
int show_info;
char title[32];
sprintf(title, "SpaceShipSim v%s", VERSION);
puts(title);