Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
91 KB
Referenced Files
None
Subscribers
None
diff --git a/.gitignore b/.gitignore
index 5f4a465..142e4e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,24 +1,30 @@
+linuxdeploy-x86_64.AppImage
+build/
parts/
prime/
snap/
stage/
DeerPortal
*.snap
*.o
enfucraft
enfucraft.pro.user
Makefile
docs/
pagan_board.pro.user
*.swo
*.swp
*.Release
*.Debug
*.debhelper.log
debian/deerportal
MakeCache.txt
CMakeFiles/
CPackConfig.cmake
CPackSourceConfig.cmake
cmake_install.cmake
CMakeCache.txt
+.vs
+out
+install_manifest.txt
+DeerPortal-*.AppImage
diff --git a/AppRun b/AppRun
new file mode 100755
index 0000000..b4abfdb
--- /dev/null
+++ b/AppRun
@@ -0,0 +1,4 @@
+#!/bin/sh
+cd "$(dirname "$0")"
+export DP_DIR=.
+exec ./usr/bin/DeerPortal
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd6b72f..bff527b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,68 +1,85 @@
#Change this if you need to target a specific CMake version
cmake_minimum_required(VERSION 3.1)
set (CMAKE_CXX_STANDARD 11)
# To unify version handling
file (STRINGS "version.txt" DEERPORTAL_VERSION)
string(REGEX MATCH "^([0-9]+)" DEERPORTAL_VERSION_MAJOR ${DEERPORTAL_VERSION})
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\2" DEERPORTAL_VERSION_MINOR ${DEERPORTAL_VERSION})
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+.*)" "\\3" DEERPORTAL_VERSION_PATCH ${DEERPORTAL_VERSION})
MESSAGE( STATUS "DEERPORTAL_VERSION: " ${DEERPORTAL_VERSION} )
MESSAGE( STATUS "DEERPORTAL_VERSION_MAJOR: " ${DEERPORTAL_VERSION_MAJOR} )
MESSAGE( STATUS "DEERPORTAL_VERSION_MINOR: " ${DEERPORTAL_VERSION_MINOR} )
MESSAGE( STATUS "DEERPORTAL_VERSION_PATCH: " ${DEERPORTAL_VERSION_PATCH} )
# Enable debug symbols by default
# must be done before project() statement
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()
# (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Release)
project(myproject)
#target_compile_definitions(DeerPortal PRIVATE FOO=1 BAR=1)
add_definitions(-DDEERPORTAL_VERSION="${DEERPORTAL_VERSION}.${CMAKE_BUILD_TYPE}")
# Set version information in a config.h file
# configure_file(
# "${PROJECT_SOURCE_DIR}/config.h.in"
# "${PROJECT_BINARY_DIR}/config.h"
# )
include_directories("${PROJECT_BINARY_DIR}")
include_directories(${YOUR_DIRECTORY})
# Define sources and executable
set(EXECUTABLE_NAME "DeerPortal")
file( GLOB SRCS src/*.cpp src/*.h )
add_executable(${EXECUTABLE_NAME} ${SRCS})
# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
#Find any version 2.X of SFML
#See the FindSFML.cmake file for additional details and instructions
find_package(SFML 2 REQUIRED network audio graphics window system)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${EXECUTABLE_NAME} ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
endif()
set_target_properties(${EXECUTABLE_NAME} PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
RESOURCE "${RESOURCE_FILES}"
)
# Install target
-install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
-set (ASSETS_BASE_PATH share/games/deerportal)
+
+IF (WIN32)
+ set (ASSETS_BASE_PATH data)
+ install(TARGETS ${EXECUTABLE_NAME} DESTINATION .)
+ELSE()
+ set (ASSETS_BASE_PATH share/games/deerportal)
+ install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
+ENDIF()
+
add_definitions(-DBASE_PATH="${CMAKE_INSTALL_PREFIX}")
-add_definitions(-DASSETS_PATH="${CMAKE_INSTALL_PREFIX}/${ASSETS_BASE_PATH}/")
+IF (WIN32)
+ add_definitions(-DASSETS_PATH="${ASSETS_BASE_PATH}/")
+#install(DIRECTORY assets DESTINATION share/games/deerportal)
+install(DIRECTORY assets DESTINATION "${ASSETS_BASE_PATH}/")
+ELSE()
+ add_definitions(-DASSETS_PATH="${CMAKE_INSTALL_PREFIX}/${ASSETS_BASE_PATH}/")
+ # install(DIRECTORY assets DESTINATION share/games/deerportal)
+ install(DIRECTORY assets DESTINATION "${CMAKE_INSTALL_PREFIX}/${ASSETS_BASE_PATH}/")
+
+ENDIF()
+# install(DIRECTORY assets DESTINATION share/games/deerportal)
+
-install(DIRECTORY assets DESTINATION share/games/deerportal)
# CPack packaging
include(InstallRequiredSystemLibraries)
# set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR "${DEERPORTAL_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${DEERPORTAL_VERSION_MINOR}.${DEERPORTAL_VERSION_PATCH}")
include(CPack)
diff --git a/CMakeSettings.json b/CMakeSettings.json
new file mode 100644
index 0000000..f841f6c
--- /dev/null
+++ b/CMakeSettings.json
@@ -0,0 +1,28 @@
+{
+ "configurations": [
+ {
+ "name": "x64-Debug",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "inheritEnvironments": [ "msvc_x64_x64" ],
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "variables": []
+ },
+ {
+ "name": "x86-Debug",
+ "generator": "Ninja",
+ "configurationType": "Debug",
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "inheritEnvironments": [ "msvc_x86" ],
+ "variables": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..21c241a
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,12 @@
+pipeline {
+ agent {
+ docker { image 'node:7-alpine' }
+ }
+ stages {
+ stage('Test') {
+ steps {
+ sh 'node --version'
+ }
+ }
+ }
+}
diff --git a/README.md b/README.md
index 59f45c6..bc7f3ec 100644
--- a/README.md
+++ b/README.md
@@ -1,94 +1,100 @@
Devcarpet {#mainpage}
=========
presents
Deerportal
----------
[![devcarpet](https://devcarpet.net/images/dc_black.png)](https://devcarpet.net)[![Build Status](https://travis-ci.org/deerportal/deerportal.svg?branch=master)](https://travis-ci.org/deerportal/deerportal) [![Build Status](https://semaphoreci.com/api/v1/bluszcz/deerportal/branches/master/badge.svg)](https://semaphoreci.com/bluszcz/deerportal) [![Ebert](https://ebertapp.io/github/deerportal/deerportal.svg)](https://ebertapp.io/github/deerportal/deerportal)
![DeerPortal MultiPlayer Mode](https://bluszcz.net/projects/games/deerportal/deerportal-game-about-how-human-can-be-upgraded-to-the-deer_771.png/@@images/image.png)
Deerportal is a open source (free as a speech, free as a beer) hybrid game which utilize board and card games mechanisms. World of the game is driven by four classical elemets along with Almighty Deer God.
Homepage: https://devcarpet.net/deerportal/
Collect the diamonds, execute actions on cards and survive the chaos of nature! Compete against 3 other players.
Features
--------
* 0-4 players mode
* changing seasons
* open source (zlib / cc-by 4.0)
SFML, Linux, OSX, Windows.
![DeerPortal Game play](https://bluszcz.net/projects/games/deerportal/deerportal-game-about-how-human-can-be-upgraded-to-the-deer_772.png/@@images/image.png)
## Installation
### Compilation
#### Linux / OSX
```
$ git clone https://github.com/deerportal/deerportal.git
$ cd deerportal
$ cmake .
$ make
$ sudo make install
$ ./DeerPortal
```
##### Debian
If you would like to see Deer Portal in Debian repositories, there is an opened bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826612 - please help :)
To make deb package locally:
```
$ git clone https://github.com/deerportal/deerportal.git
$ cd deerportal
$ fakeroot debian/rules binary
```
### Binary download
In our [releases](https://github.com/deerportal/deerportal/releases) section we are providing compiled binaries for Ubuntu (Trusty, Xenial) and Windows.
+### Snap install
+
+```
+sudo snap install deerportal --classic
+```
+
#### Ubuntu apt repo
If you want to have an easy installation via system apt, add one of the folowing (depends on your distro) to your /etc/apt/sources.list, if you have Trusty 14.04
```
deb http://deb.devcarpet.net/ubuntu trusty main
```
or for Xenial 16.04
```
deb http://deb.devcarpet.net/ubuntu xenial main
```
and later:
```
sudo apt-get update
sudo apt-get install deerportal
```
#### Development windows builds
* https://devcarpet.net/deerportal/downloads/windows/
#### Developer documentation
Following doxygen api docs has been created using our Jenkins based Continous Integration:
* https://devcarpet.net/deerportal/downloads/docs/html/
**Developed with [Devcarpet](https://devcarpet.net) platform.**
![SFML GAME](https://bluszcz.net/projects/games/deerportal/sfml-logo-small.png/@@images/image.png)
diff --git a/build_packages.sh b/build_packages.sh
new file mode 100755
index 0000000..d385b91
--- /dev/null
+++ b/build_packages.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+snapcraft
+sh ./make_appimage.sh
diff --git a/make_appimage.sh b/make_appimage.sh
new file mode 100644
index 0000000..7f7df63
--- /dev/null
+++ b/make_appimage.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+[ -f "linuxdeploy-x86_64.AppImage" ] || wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
+chmod 755 linuxdeploy-x86_64.AppImage
+rm -rf CMakeCache.txt CMakeFiles
+
+mkdir build
+cd build
+rm -rf CMakeCache.txt CMakeFiles
+cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+make -j 4
+../linuxdeploy-x86_64.AppImage --appdir AppDir
+make install DESTDIR=AppDir
+cp ../AppRun AppDir/
+cp ../deerportal.desktop AppDir
+cp ../assets/img/deerportal.png AppDir
+sed -i '/Exec/d' AppDir/deerportal.desktop
+../linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage
+
diff --git a/snapcraft.yaml b/snapcraft.yaml
index 40c82c8..3fbca00 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -1,33 +1,104 @@
+base: core18
name: deerportal
-version: "0.7.5-more-plugs"
+version: "0.8"
summary: Deer Portal" snap
description: Board game where you need to transfer yourself into the Deer God
grade: stable
confinement: strict
apps:
deerportal:
- command: DeerPortal
+ command: desktop-launch DeerPortal
+ environment:
+ DP_DIR: "$SNAP"
plugs:
+# - alsa
+ - audio-playback
- desktop
- desktop-legacy
- - gsettings
- - home
+# - gsettings
+# - home
- opengl
- pulseaudio
- - unity7
+# - unity7
- wayland
- x11
+# - alsa
parts:
+ desktop-gtk3:
+ build-packages:
+ - libgtk-3-dev
+ make-parameters:
+ - FLAVOR=gtk3
+ plugin: make
+ source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
+ source-subdir: gtk
+ stage-packages:
+ - libxkbcommon0
+ - ttf-ubuntu-font-family
+ - dmz-cursor-theme
+ - light-themes
+ - adwaita-icon-theme
+ - gnome-themes-standard
+ - shared-mime-info
+ - libgtk-3-0
+ - libgdk-pixbuf2.0-0
+ - libglib2.0-bin
+ - libgtk-3-bin
+ - unity-gtk3-module
+ - libappindicator3-1
+ - locales-all
+ - xdg-user-dirs
+ - ibus-gtk3
+ - libibus-1.0-5
+
+
source-deerportal:
plugin: cmake
- #source: /tmp/v0.7.3-pre-snap.tar.gz
- source: https://github.com/deerportal/deerportal.git
- source-type: git
- #source: https://github.com/deerportal/deerportal/archive/v0.7.3-pre-snap.tar.gz
- source-depth: 1
+ configflags:
+ - -DCMAKE_BUILD_TYPE=Release
+ - -DCMAKE_INSTALL_PREFIX=/usr
+ source: .
+ source-type: local
+ # source-depth: 1
build-packages:
+ - g++
- libsfml-dev
- libgl1-mesa-dri
- libopenal-dev
-
+ - libsndio-dev
+ - libasound2-dev
+ - libasound2-data
+# stage-packages:
+# - libc6
+# - alsa
+ stage-packages:
+ - alsa
+ - libasound2
+ - libflac8
+ - libfreetype6
+ - libgl1
+ - libglvnd0
+ - libglx0
+ - libjpeg-turbo8
+ - libogg0
+ - libopenal1
+ - libpng16-16
+ - libsfml-audio2.4
+ - libsfml-graphics2.4
+ - libsfml-system2.4
+ - libsfml-window2.4
+ - libsndio6.1
+ - libvorbis0a
+ - libvorbisenc2
+ - libvorbisfile3
+ - libx11-6
+ - libxau6
+ - libxcb1
+ - libxdmcp6
+ - libxext6
+ - libxrandr2
+ - libxrender1
+ - libasound2-data
+ - libasound2-plugins
+ after: [desktop-gtk3]
diff --git a/src/boarddiamond.cpp b/src/boarddiamond.cpp
index f313253..90f6610 100644
--- a/src/boarddiamond.cpp
+++ b/src/boarddiamond.cpp
@@ -1,33 +1,33 @@
#include "boarddiamond.h"
BoardDiamond::BoardDiamond()
{
idNumber = 0;
playerNumber = 0;
textures = nullptr;
}
BoardDiamond::BoardDiamond(TextureHolder *textures, int idNumber,
int playerNumber, int boardPosition)
{
this->textures = textures;
this->playerNumber = playerNumber;
this->boardPosition = boardPosition;
this->idNumber = idNumber;
spriteHolder.setTexture(this->textures->textureBoardDiamond);
sf::IntRect textureRect(idNumber*44, 0, 44,44);
spriteHolder.setTextureRect(textureRect);
- spriteHolder.scale(0.5, 0.5);
+ // spriteHolder.scale(0.5, 0.5);
setBoardPosition(boardPosition);
}
void BoardDiamond::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
if (boardPosition>-1)
{
states.transform *= getTransform();
target.draw(spriteHolder, states);
}
}
diff --git a/src/bubble.cpp b/src/bubble.cpp
index f3182fa..e56bd58 100644
--- a/src/bubble.cpp
+++ b/src/bubble.cpp
@@ -1,41 +1,41 @@
#include <cmath>
#include <array>
#include "bubble.h"
Bubble::Bubble():
state(BubbleState::DICE),
timeCounter(0),
posY(0)
{
spritesBubbles = {{spriteDice, spriteFootSteps}};
- if (!textureDice.loadFromFile(ASSETS_PATH"assets/img/bubble_dice.png"))
+ if (!textureDice.loadFromFile(get_full_path(ASSETS_PATH"assets/img/bubble_dice.png")))
std::exit(1);
- if (!textureFootSteps.loadFromFile(ASSETS_PATH"assets/img/bubble_footsteps.png"))
+ if (!textureFootSteps.loadFromFile(get_full_path(ASSETS_PATH"assets/img/bubble_footsteps.png")))
std::exit(1);
spritesBubbles[0].setTexture(textureDice);
spritesBubbles[1].setTexture(textureFootSteps);
}
void Bubble::setPosition(float x, float y) {
Transformable::setPosition(x, y);
posY = y;
}
void Bubble::draw(sf::RenderTarget& target, sf::RenderStates states) const {
states.transform *= getTransform();
target.draw(spritesBubbles[state], states);
}
void Bubble::update(sf::Time deltaTime)
{
timeCounter += deltaTime.asSeconds()*10;
float modifier = sin(timeCounter)*5;
Transformable::setPosition(getPosition().x, posY+modifier);
}
diff --git a/src/bubble.h b/src/bubble.h
index f13a164..c65d955 100644
--- a/src/bubble.h
+++ b/src/bubble.h
@@ -1,29 +1,30 @@
#ifndef BUBBLE_H
#define BUBBLE_H
#include <SFML/Graphics.hpp>
+#include "filetools.h"
enum BubbleState {DICE=0, MOVE=1};
class Bubble: public sf::Drawable, public sf::Transformable
{
public:
Bubble();
public:
sf::Texture textureDice;
sf::Texture textureFootSteps;
sf::Sprite spriteDice;
sf::Sprite spriteFootSteps;
std::array<sf::Sprite,2> spritesBubbles;
BubbleState state;
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
void update(sf::Time deltaTime);
float timeCounter;
float posY;
void setPosition(float x, float y);
};
#endif // BUBBLE_H
diff --git a/src/calendar.h b/src/calendar.h
index 3f19ee2..7eb9ac1 100644
--- a/src/calendar.h
+++ b/src/calendar.h
@@ -1,76 +1,77 @@
/*
* Pagan
*
* $OpenBSD: calendar.pagan,v 1.2 2002/03/20 22:53:40 mickey Exp $
*/
#ifndef _calendar_pagan_
#define _calendar_pagan_
#include <iostream>
#include <array>
+#include <string>
static std::array<std::array<std::string,3>,59> PAGAN_HOLIDAYS = {{
{{"01", "02", "Frigg's Distaff"}},
{{"01", "06", "Celtic day of the Three-Fold Goddess"}},
{{"01", "10", "Geraints Day"}},
{{"01", "13", "Midvintersblot"}},
{{"01", "20", "Midvintersblot"}},
{{"01", "22", "Festival of the Muses"}},
{{"01", "25", "Old Disting Feast"}},
{{"01", "30", "Upelly - old fire festival"}},
{{"01", "31", "Honoring the Valkyries"}},
{{"02", "02", "1st Cross-Quarter Day"}},
{{"02", "02", "Imbolg / Imbolc (other Celtic names) / Brighid / Oimelc"}},
{{"02", "11", "The Day the Birds Begin to Sing"}},
{{"02", "14", "Festival of Vali"}},
{{"03", "02", "Day of the Crows"}},
{{"03", "13", "Burgsonndeg - festival of rebirth of the sun and the approach of spring"}},
{{"03", "17", "Celebration of Trefuilnid Treochar (St.Patrick's day)"}},
{{"03", "18", "Sheela's Day"}},
{{"03", "19", "1st Quarter Day - Spring (Vernal) Equinox"}},
{{"03", "20", "Festival of Iduna"}},
{{"03", "21", "Ostara / Eostre (Saxon goddess of Spring)"}},
{{"04", "30", "May Eve / Walpurgisnacht (witches' Sabbath) / Walpurgis Night (after St. Walpurga)"}},
{{"05", "01", "May Day / Beltane / Bealtaine - Celtic bonfire festival"}},
{{"05", "04", "2nd Cross-Quarter Day"}},
{{"05", "12", "The Cat Parade"}},
{{"05", "14", "Midnight Sun Festival"}},
{{"05", "18", "Festival of the Horned God Cennunos"}},
{{"05", "20", "Festival of Mjollnir, Thor's Hammer"}},
{{"05", "24", "Mother's Day, in celebration of the Triple Goddes"}},
{{"06", "20", "2nd Quarter Day - Summer Solstice"}},
{{"06", "21", "Litha (Norse/Anglo-Saxon for longest day)"}},
{{"06", "23", "St. John's Eve - European Midsummer celebration"}},
{{"08", "01", "Lugnasad / Lughnasada / Lunasa - Gaelic summer games of Lug (sun-god)"}},
{{"08", "02", "Lady Godiva Day"}},
{{"08", "04", "Loch mo Naire"}},
{{"08", "05", "3rd Cross-Quarter Day"}},
{{"08", "10", "Puck Faire"}},
{{"08", "14", "Day of the Burryma"}},
{{"08", "17", "Odin's Ordeal"}},
{{"08", "23", "Feast of Ilmatar"}},
{{"08", "28", "Frey Faxi"}},
{{"08", "29", "Festival of Urda"}},
{{"09", "21", "3rd Quarter Day - Fall (Autumnal) Equinox"}},
{{"10", "08", "Day of Remembrance for Erik the Red"}},
{{"10", "09", "Leif Erikson Day"}},
{{"10", "11", "Old Lady of the Trees"}},
{{"10", "14", "Winter Nights - festival celebrating the harvest"}},
{{"10", "18", "Great Horn Faire"}},
{{"10", "24", "Feast of the Spirits of the Air"}},
{{"10", "27", "Allan Apple Day"}},
{{"10", "31", "Hallowmas / Allhallowmas / Allhallows"}},
{{"11", "01", "Samhain - Celtic feast of departing Sun & new year"}},
{{"11", "05", "4th Cross-Quarter Day"}},
{{"12", "06", "Festival of Nicolas, an aspect of Odin, leader of the hunt"}},
{{"12", "09", "Yule Cleansing - The Danish fetch water for brewing the Yule-Ale"}},
{{"12", "13", "Wodan's Jag - the Wild Hunt of Odin and his Army"}},
{{"12", "18", "Festival of Epona"}},
{{"12", "20", "4th Quarter Day - Winter Solstice"}},
{{"12", "21", "Festival of Beiwe / Nertha / Alban Athuan"}},
{{"12", "21", "Yule (Norse for wheel) - Germanic 12-day feast"}}
}};
std::string getHoliday(int month, int day);
#endif /* !_calendar_pagan_ */
diff --git a/src/cardsdeck.cpp b/src/cardsdeck.cpp
index 7d644c3..e3ded5f 100644
--- a/src/cardsdeck.cpp
+++ b/src/cardsdeck.cpp
@@ -1,143 +1,143 @@
#include "cardsdeck.h"
CardsDeck::CardsDeck(TextureHolder *textures, sf::Font *gameFont, Command *command)
{
commandManager=command;
std::array<std::array<int,2>,4> cardsPos = {
{
{{1087,95}}, {{1225, 95}}, {{1225, 277}}, {{1087, 277}}
}
};
this->textures = textures;
for (int i=0;i<=3;i++)
{
// spriteCardBases[i].setTexture(this->textures->textureCardBases[i]);
spriteCardBases[i].setPosition(cardsPos[i][0],cardsPos[i][1]);
textPileTitle[i].setFont(*gameFont);
textPileTitle[i].setCharacterSize(16);
textPileTitle[i].setPosition(cardsPos[i][0]+10,cardsPos[i][1]+100);
for (unsigned int j=0;j<DP::cardsDistribution.size();j++)
{
int cardTypeInt = DP::cardsDistribution[j];
cardsList[i].cardsPile[j].cardType = DP::cardsTypes[cardTypeInt];
cardsList[i].cardsPile[j].cardTypeInt = cardTypeInt;
spriteCardBases[i].setTexture(this->textures->cardsTextures[i][cardTypeInt]);
}
}
reloadCards();
}
void CardsDeck::reloadCards(){
for (int i=0;i<=3;i++)
{
cardsList[i].shufflePile();
setTitles(i);
}
}
void CardsDeck::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
states.transform *= getTransform();
for (int i=0;i<=3;i++)
{
- if ((cardsList[i].invisibleLeft==0.0f) and (cardsList[i].active))
+ if ((cardsList[i].invisibleLeft==0.0f) && (cardsList[i].active))
{
target.draw(spriteCardBases[i], states);
target.draw(textPileTitle[i], states);
}
}
}
void CardsDeck::setTitles(int number)
{
int cardTypeInt = getCardTypeInt(number);
textPileTitle[number].setString(DP::cardsTypes[cardTypeInt]);
// int val = getCardTypeInt(number);
spriteCardBases[number].setTexture(textures->cardsTextures[number][cardTypeInt]);
}
void CardsDeck::setFonts(sf::Font *gameFont)
{
for (int i=0;i<=3;i++)
{
textPileTitle[i].setFont(*gameFont);
}
}
void CardsDeck::nextCard(int pileNumber)
{
if (cardsList[pileNumber].active)
{
cardsList[pileNumber].invisibleLeft = 0.75f;
unsigned int currentCard = getCurrentCard(pileNumber);
if (currentCard>=DP::cardsDistribution.size()-1)
{
cardsList[pileNumber].active = false;
commandManager->removeAllCardElement(pileNumber);
} else
{
currentCard += 1;
if (currentCard>3)
currentCard = 0;
cardsList[pileNumber].currentCard = currentCard;
setTitles(pileNumber);
}
}
// setSprites(pileNumber);
}
int CardsDeck::getCurrentCard(int pileNumber)
{
int currentCard = cardsList[pileNumber].currentCard;
return currentCard;
}
std::string CardsDeck::getTitle(int pileNumber)
{
std::string currentText = DP::cardsTypes[getCardTypeInt(pileNumber)];
return currentText;
}
int CardsDeck::getCardTypeInt(int pileNumber)
{
int result = cardsList[pileNumber].cardsPile[getCurrentCard(pileNumber)].cardTypeInt;
return result;
}
void CardsDeck::update(sf::Time deltaTime)
{
for (int i=0;i<=3;i++)
{
if (cardsList[i].invisibleLeft>0.0f)
{
cardsList[i].invisibleLeft -= deltaTime.asSeconds();
}
if (cardsList[i].invisibleLeft<0.0f)
{
cardsList[i].invisibleLeft = 0.0f;
}
}
}
diff --git a/src/cardslist.h b/src/cardslist.h
index 4e49c91..f7ea38d 100644
--- a/src/cardslist.h
+++ b/src/cardslist.h
@@ -1,45 +1,47 @@
#ifndef CARDSLIST_H
#define CARDSLIST_H
#include <vector>
#include <iostream> // std::cout
#include <algorithm> // std::shuffle
#include <random> // std::default_random_engine
#include <chrono> // std::chrono::system_clock
+#include <ctime>
#include "card.h"
+
namespace DP {
const static std::array<int,32> cardsDistribution = {{
0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,3,
}};
const static std::array<int,2> cardsDistributionDebug = {{
2,3
}};
const static int PILE_SIZE = DP::cardsDistribution.size();
}
class CardsList
{
public:
CardsList(); // To create an array of CardsList
explicit CardsList(int element);
// int amount;
// std::vector<Card*> sd;
/*!
* \brief element Number of the element
*/
std::array<Card, DP::PILE_SIZE> cardsPile;
int currentCard;
int element; /*!< Number of the element */
float invisibleLeft;
bool active;
void shufflePile();
};
#endif // CARDSLIST_H
diff --git a/src/filetools.cpp b/src/filetools.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/src/filetools.h b/src/filetools.h
new file mode 100644
index 0000000..fccb9a3
--- /dev/null
+++ b/src/filetools.h
@@ -0,0 +1,17 @@
+#ifndef FILETOOLS_H
+#define FILETOOLS_H
+
+#include <iostream>
+#include <string>
+
+static std::string get_full_path(std::string path)
+{
+ std::string new_path;
+ if ( getenv ( "DP_DIR" ) != NULL )
+ {
+ new_path = std::string(getenv("DP_DIR")) + path ;
+ return new_path;
+ }
+ return path;
+}
+#endif // FILETOOLS_H
diff --git a/src/filetools.h.gch b/src/filetools.h.gch
new file mode 100644
index 0000000..9a4a3a5
Binary files /dev/null and b/src/filetools.h.gch differ
diff --git a/src/game.cpp b/src/game.cpp
index b6d0115..dc27720 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1,1178 +1,1191 @@
#include "game.h"
#include "particle.h"
#include "calendar.h"
#include <algorithm>
namespace DP {
int initScreenX = 1360;
int initScreenY = 768;
int currentSeason = 1;
int month = 0;
/*!
* \brief The ResultTable struct contains data for the end of the game screen.
*/
struct ResultTable
{
int playerNumber;
int playerResult;
bool reachedPortal;
bool reachedPortalFirst;
ResultTable(int number,int result, bool portal, bool portalFirst) :
playerNumber(number), playerResult(result), reachedPortal(portal), reachedPortalFirst(portalFirst) {}
bool operator < (const ResultTable& otherResult) const
{
if ((playerResult!=otherResult.playerResult) || ((reachedPortal==false) && (otherResult.reachedPortal==false)))
return (playerResult > otherResult.playerResult);
else if (reachedPortalFirst==true){
return true;
} else
{
return false;
}
;
}
};
/*!
* \brief Game::setTxtEndGameAmount orders the results text for the end of the game.
*/
void Game::setTxtEndGameAmount(){
std::string elementNames[4] = {"Water","Earth", "Fire", "Air"};
int width=1360;
// int height = 768;
// int startHeight = 100;
int separator = 40;
std::array<ResultTable, 4> results = {
{
ResultTable(0,players[0].cash, players[0].reachedPortal,players[0].reachedPortalFirst),
ResultTable(1,players[1].cash, players[1].reachedPortal,players[1].reachedPortalFirst),
ResultTable(2,players[2].cash, players[2].reachedPortal,players[2].reachedPortalFirst),
ResultTable(3,players[3].cash, players[3].reachedPortal,players[3].reachedPortalFirst)
}
};
std::vector < ResultTable > resultsVector;
txtSurvivors.clear();
txtLoosers.clear();
for (int i=0;i<4;i++)
{
resultsVector.push_back(results[i]);
};
std::sort(resultsVector.begin(), resultsVector.end());
txtWinner.setFont(gameFont);
txtWinner.setCharacterSize(40);
for (int i=0;i<4;i++)
{
int playerNumber = resultsVector[i].playerNumber;
std::string elementName = elementNames[playerNumber];
sf::Text tmpText;
tmpText.setFont(gameFont);
tmpText.setCharacterSize(25);
tmpText.setString(elementName+ " " + std::to_string(players[playerNumber].cash));
sf::FloatRect rectTxt = tmpText.getLocalBounds();
if (players[playerNumber].reachedPortal==true)
{
int counter = txtSurvivors.size();
tmpText.setPosition((1360/2)-(rectTxt.width/2),200+(counter*separator));
txtSurvivors.push_back(tmpText);
} else
{
int counter = txtLoosers.size();
tmpText.setPosition((width/2)-(rectTxt.width/2),540+(counter*separator));
txtLoosers.push_back(tmpText);
}
}
if (txtSurvivors.size()>0)
{
txtWinner.setString("Winner: " + txtSurvivors[0].getString());
txtSurvivors.erase(txtSurvivors.begin()+0);
}
txtWinner.setCharacterSize(40);
sf::FloatRect rectTxt = txtWinner.getLocalBounds();
txtWinner.setPosition((1360/2)-(rectTxt.width/2),120);
}
void Game::initBoard()
{
time_t t = time(0);
struct tm * now = localtime( & t );
int month = now->tm_mon + 1;
int day = now->tm_mday;
paganHolidayString = getHoliday(month, day);
paganHolidayTxt.setString(paganHolidayString);
sfxClick.setBuffer(sfxClickBuffer);
sfxDone.setBuffer(sfxDoneBuffer);
spriteBackgroundDark.setTexture(textures.backgroundDark);
spriteBackgroundDark.setPosition(0,0);
spriteLestBegin.setTexture(textures.textureLetsBegin);
viewTiles.setViewport(sf::FloatRect(0.15f,0.1f, 1.0f, 1.0f));
viewGui.setViewport(sf::FloatRect(0.806f,0.066f, 1, 1));
groupHud.setFont(&gameFont);
groupHud.setSeason(currentSeason);
groupHud.setRoundName(roundNumber);
cardsDeck.setFonts(&gameFont);
spriteBigDiamond.setTexture(textures.textureBigDiamond);
spriteBigDiamond.setPosition(474,342);
spriteBigDiamond.setColor(sf::Color (255, 255, 255,196));
restartGame();
launchNextPlayer();
endGameTxt.setFont(gameFont);
endGameTxt.setString("End of the Game");
endGameTxt.setCharacterSize(30);
sf::FloatRect ss = endGameTxt.getLocalBounds();
endGameTxt.setPosition((1360/2)-(ss.width/2),60);
setTxtEndGameAmount();
bubble.setPosition(players[turn].characters[0].getPosition().x-30,
players[turn].characters[0].getPosition().y-45);
txtSurvivorsLabel.setString("Survivors");
txtSurvivorsLabel.setFont(gameFont);
txtSurvivorsLabel.setCharacterSize(30);
sf::FloatRect rectSurvivors = txtSurvivorsLabel.getLocalBounds();
txtSurvivorsLabel.setPosition((1360/2)-(rectSurvivors.width/2),200);
txtLoosersLabel.setString("Digested by The Elements");
txtLoosersLabel.setFont(gameFont);
txtLoosersLabel.setCharacterSize(30);
sf::FloatRect rectLoosers = txtLoosersLabel.getLocalBounds();
txtLoosersLabel.setPosition((1360/2)-(rectLoosers.width/2),500);
credits.setTxt(0);
}
/*!
* \brief Game::restartGame sets all the variables to the default value
*/
void Game::restartGame()
{
Player playerHud1(&textures, &gameFont,0);
Player playerHud2(&textures, &gameFont,1);
Player playerHud3(&textures, &gameFont,2);
Player playerHud4(&textures, &gameFont,3);
players[0] = playerHud1;
players[1] = playerHud2;
players[3] = playerHud3;
players[2] = playerHud4;
players[0].setActive(true);
setCurrentNeighbours();
diceResultPlayer = 6;
players[turn].characters[0].diceResult = diceResultPlayer;
roundDice.setColor(turn);
for (int i=0;i<4;i++)
{
players[i].restartPlayer();
players[i].reachedPortal = false;
boardDiamonds.reorder(i);
bubble.setPosition(players[i].characters[0].getPosition().x-30,
players[i].characters[0].getPosition().y-45);
players[i].done=false;
}
numberFinishedPlayers = 0;
turn = 0;
currentSeason = 1;
roundNumber = 1;
month = 0;
cardsDeck.reloadCards();
deerModeActive = false;
deerModeCounter = 16;
}
void Game::setCurrentNeighbours ()
{
currentNeighbours = players[turn].getNeighbours();
}
/*!
* \brief Game::loadAssets
*/
void Game::loadAssets()
{
- if (!gameFont.loadFromFile(ASSETS_PATH"assets/fnt/metal-mania.regular.ttf"))
+ if (!gameFont.loadFromFile(get_full_path(ASSETS_PATH"assets/fnt/metal-mania.regular.ttf")))
{
std::exit(1);
}
- if (!menuFont.loadFromFile(ASSETS_PATH"assets/fnt/metal-macabre.regular.ttf"))
+ if (!menuFont.loadFromFile(get_full_path(ASSETS_PATH"assets/fnt/metal-macabre.regular.ttf")))
{
std::exit(1);
}
menuBackground.setTexture(textures.textureMenu);
spriteDeerGod.setTexture(textures.textureDeerGod);
- if (!shaderBlur.loadFromFile(ASSETS_PATH"assets/shaders/blur.frag", sf::Shader::Fragment))
+ if (!shaderBlur.loadFromFile(get_full_path(ASSETS_PATH"assets/shaders/blur.frag"), sf::Shader::Fragment))
std::exit(1);
- if (!shaderPixel.loadFromFile(ASSETS_PATH"assets/shaders/pixelate.frag", sf::Shader::Fragment))
+ if (!shaderPixel.loadFromFile(get_full_path(ASSETS_PATH"assets/shaders/pixelate.frag"), sf::Shader::Fragment))
std::exit(1);
- if (!shaderDark.loadFromFile(ASSETS_PATH"assets/shaders/dark.frag", sf::Shader::Fragment))
+ if (!shaderDark.loadFromFile(get_full_path(ASSETS_PATH"assets/shaders/dark.frag"), sf::Shader::Fragment))
std::exit(1);
- if (!textureBackgroundArt.loadFromFile(ASSETS_PATH"assets/img/background_land.png"))
+ if (!textureBackgroundArt.loadFromFile(get_full_path(ASSETS_PATH"assets/img/background_land.png")))
std::exit(1);
- if (!musicGame.openFromFile(ASSETS_PATH"assets/audio/game.ogg"))
+ if (!musicGame.openFromFile(get_full_path(ASSETS_PATH"assets/audio/game.ogg")))
std::exit(1);
// if (!musicBackground.openFromFile(ASSETS_PATH"assets/audio/wind2.ogg"))
// std::exit(1);
- if (!musicMenu.openFromFile(ASSETS_PATH"assets/audio/menu.ogg"))
+ if (!musicMenu.openFromFile(get_full_path(ASSETS_PATH"assets/audio/menu.ogg")))
std::exit(1);
- if (!sfxClickBuffer.loadFromFile(ASSETS_PATH"assets/audio/click.ogg"))
+ if (!sfxClickBuffer.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/click.ogg")))
std::exit(1);
- if (!sfxDoneBuffer.loadFromFile(ASSETS_PATH"assets/audio/done.ogg"))
+ if (!sfxDoneBuffer.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/done.ogg")))
std::exit(1);
// if (!textureBackground.loadFromFile(ASSETS_PATH"assets/img/background.png"))
// std::exit(1);
spriteBackgroundArt.setTexture(textureBackgroundArt);
menuTxt.setFont(gameFont);
menuTxt.setCharacterSize(60);
menuTxt.setString(gameTitle);
int width = menuTxt.getLocalBounds().width;
int height = menuTxt.getLocalBounds().height;
menuTxt.setPosition(1050-(width/2),750-(height/2)-150);
menuTxt.setFillColor(sf::Color(255, 255, 255, 85));
cardsDeck.setFonts(&gameFont);
paganHolidayTxt.setFont(gameFont);
paganHolidayTxt.setCharacterSize(20);
paganHolidayTxt.setPosition(20,20);
for (int i=0;i<4;i++)
{
playersSprites[i].setTexture(textureBackgroundArt);
playersSprites[i].setTextureRect(sf::IntRect(playersSpritesCords[i][0],
playersSpritesCords[i][1], 280, 280));
playersSprites[i].setPosition(playersSpritesCords[i][0], playersSpritesCords[i][1]);
}
}
void Game::showMenu()
{
musicMenu.play();
musicMenu.setLoop(true);
currentState = state_menu;
}
void Game::hideMenu()
{
musicMenu.stop();
}
void Game::showGameBoard()
{
// musicGame.setVolume(20);
musicGame.play();
musicGame.setLoop(true);
sfx.playLetsBegin();
currentState = state_setup_players;
// currentState = state_lets_begin;
}
void Game::endGame()
{
musicGame.stop();
currentState = state_end_game;
downTimeCounter = 0;
numberFinishedPlayers = 4;
setTxtEndGameAmount();
// musicBackground.stop();
}
void Game::throwDiceMove() {
// Throw a dice action
diceResultPlayer = roundDice.throwDiceSix();
players[turn].characters[0].diceResult=diceResultPlayer;
currentState = state_game;
bubble.state = BubbleState::MOVE;
nextRotateElem.reset();
prevRotateElem.reset();
}
/*!
* \brief Game::playerMakeMove move the player into the position on the map
* \param mousePos
*/
void Game::playerMakeMove(int mousePos) {
players[turn].setFigurePos(mousePos);
commandManager.processField(mousePos);
const int *possibleExit = std::find(std::begin(DP::endPlayers),
std::end(DP::endPlayers), mousePos);
if (possibleExit != DP::endPlayers+4) {
players[turn].done=true;
players[turn].reachedPortal=true;
commandManager.removeAllItems(turn);
if (numberFinishedPlayers == 0)
{
players[turn].reachedPortalFirst=true;
int turnover = (rand() % 2)+5;
players[turn].cash += turnover;
players[turn].updatePlayer();
startDeerMode();
}
sfx.soundPortal.play();
numberFinishedPlayers += 1;
if (numberFinishedPlayers > 3)
{
endGame();
return;
}
}
nextPlayer();
return;
}
int Game::mostDiamonds() const
{
std::array<int,4> results = {{players[0].cash,players[1].cash,players[2].cash,players[3].cash}};
auto minmax = std::minmax_element(std::begin(results), std::end(results));
int maxResult = *(minmax.second);
int result = 0;
int pos = -1;
for (int i=0; i<4;i++)
{
if (players[i].cash == maxResult)
{
result += 1;
pos = i;
}
};
if (result==1)
{
return pos;
}
return -1;
}
/*!
* \brief Game::handleLeftClick
* \param pos
* \param posFull
* \param mousePos
*/
void Game::handleLeftClick(sf::Vector2f pos,sf::Vector2f posFull, int mousePos) {
if (currentState==state_game)
{
if (players[turn].human)
{
std::array<int,2> movements = players[turn].getMovements(diceResultPlayer);
if ((mousePos==movements[0]) || (mousePos==movements[1]))
{
playerMakeMove(mousePos);
}
}
}
if (currentState==state_setup_players)
{
for (int i=0;i<4;i++)
{
sf::IntRect spriteHumanRect(players[i].spriteAI.getGlobalBounds());
if (spriteHumanRect.intersects(sf::IntRect(posFull.x, posFull.y, 1, 1)))
{
players[i].swapHuman();
}
}
sf::IntRect startGameRect(580,640,180,80);
if (startGameRect.intersects(sf::IntRect(posFull.x, posFull.y, 1, 1)))
{
bigDiamondActive = true;
banner.setText("start game");
currentState=state_roll_dice;
launchNextPlayer();
return;
}
}
else if (currentState==state_roll_dice)
{
if (players[turn].human){
sf::IntRect diceRect(roundDice.spriteDice.getGlobalBounds());
if (diceRect.intersects(sf::IntRect(posFull.x, posFull.y, 1, 1)))
{
throwDiceMove();
}
}
}
if (currentState==state_menu)
{
downTimeCounter = 0;
hideMenu();
showGameBoard();
return;
}
if (currentState==state_gui_end_round)
{
std::string resultCommand = guiRoundDice.getElem(pos);
command(resultCommand);
}
if (currentState==state_lets_begin)
{
if (downTimeCounter>1)
{
currentState = state_roll_dice;
restartGame();
launchNextPlayer();
return;
}
}
if (currentState==state_end_game)
{
if (downTimeCounter>2)
{
currentState = state_menu;
musicMenu.play();
restartGame();
return ;
// restartGame();
}
}
}
Game::Game(bool newTestMode):
screenSize(DP::initScreenX,DP::initScreenY),
viewFull(sf::FloatRect(00, 00, screenSize.x, screenSize.y)),
viewGui(sf::FloatRect(00, 00, screenSize.x, screenSize.y)),
viewTiles(sf::FloatRect(0, 0, 1360, 768)),
selector(DP::TILE_SIZE),
character(&textures, 3),
gameTitle("deerportal"),
roundDice(players),
roundNumber(1),
guiRoundDice(&textures),
boardDiamonds(&textures),
- window(sf::VideoMode(DP::initScreenX, DP::initScreenY), "Deerportal - game about how human can be upgraded to the Deer", sf::Style::Fullscreen),
+ window(sf::VideoMode(DP::initScreenX, DP::initScreenY), "Deerportal - game about how human can be upgraded to the Deer"),
turn(0),
oscilator(-1),
oscilatorInc(true),
particleSystem( 430, 230),
commandManager(*this),
cardsDeck(&textures, &menuFont,&commandManager),
banner(&gameFont),
bigDiamondActive(false),
credits(&gameFont),
cpuTimeThinkingInterval(1.0f),
deerModeCounter(4),
deerModeActive(false),
- gameVersion()
+ gameVersion(),
+ v1(0.0f)
{
testMode = newTestMode;
// TODO: perhaps get rid of the particles at all...
particleSystem.setDissolve( true );
particleSystem.setDissolutionRate( 10 );
particleSystem.setShape( DP::CIRCLE );
particleSystem.fuel( 1000 );
playersSpritesCords[0][0] = 202;
playersSpritesCords[0][1] = 76;
playersSpritesCords[1][0] = 562;
playersSpritesCords[1][1] = 76;
playersSpritesCords[3][0] = 202;
playersSpritesCords[3][1] = 436;
playersSpritesCords[2][0] = 562;
playersSpritesCords[2][1] = 436;
textLoading.setString("loading...");
textLoading.setFont(menuFont);
textLoading.setPosition(200,200);
textLoading.setFillColor(sf::Color::White);
textLoading.setCharacterSize(10);
renderTexture.create(1360,768);
renderTexture.clear(sf::Color::White);
renderTexture.draw(textLoading);
renderTexture.display();
renderSprite.setTexture(renderTexture.getTexture());
numberFinishedPlayers = 0;
sf::Clock frameClock;
guiRoundDice.active = true;
showPlayerBoardElems = false;
window.setVerticalSyncEnabled(true);
std::srand (time(NULL));
window.clear(sf::Color(55,55,55));
renderTexture.draw(textLoading);
- window.display();
+ // window.display();
loadAssets();
textLoading.setFont(menuFont);
textLoading.setPosition(200,200);
textLoading.setFillColor(sf::Color::White);
textLoading.setCharacterSize(10);
renderTexture.clear(sf::Color::Black);
renderTexture.draw(textLoading);
window.display();
gameVersion.setString("version: " + std::string(DEERPORTAL_VERSION)+"-"+std::string(BASE_PATH));
gameVersion.setFont(gameFont);
gameVersion.setPosition(10,10);
gameVersion.setFillColor(sf::Color::White);
gameVersion.setCharacterSize(15);
initBoard();
renderTexture.clear(sf::Color::Black);
renderTexture.draw(textLoading);
renderTexture.display();
showMenu();
// run the main loop
if (testMode){
std::exit(0);
}
while (window.isOpen())
{
sf::Time frameTime = frameClock.restart();
// handle events
sf::Event event;
float xpos = 320.0f;
float ypos = 240.0f;
float xgrv = 0.0f;
float ygrv = 0.0f;
while (window.pollEvent(event))
{
switch (event.type) {
case sf::Event::Closed:
window.close(); break;
case sf::Event::KeyPressed:
if(event.key.code == sf::Keyboard::Escape )
window.close();
if( sf::Keyboard::isKeyPressed( sf::Keyboard::Space ) )
particleSystem.fuel( 200/* * window.getFrameTime() */);
if( sf::Keyboard::isKeyPressed( sf::Keyboard::A ) )
particleSystem.setPosition( --xpos, ypos );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::D ) )
particleSystem.setPosition( ++xpos, ypos );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::W ) )
particleSystem.setPosition( xpos, --ypos );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::S ) )
particleSystem.setPosition( xpos, ++ypos );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::Left ) )
particleSystem.setGravity( --xgrv * 0.1f, ygrv * 0.1f);
if( sf::Keyboard::isKeyPressed( sf::Keyboard::Right ) )
particleSystem.setGravity( ++xgrv * 0.1f, ygrv * 0.1f );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::Up ) )
particleSystem.setGravity( xgrv * 0.1f, --ygrv * 0.1f );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::Down ) )
particleSystem.setGravity( xgrv * 0.1f, ++ygrv * 0.1f );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::G ) )
particleSystem.setGravity( 0.0f, 0.0f );
if( sf::Keyboard::isKeyPressed( sf::Keyboard::P ) )
particleSystem.setPosition( 320.0f, 240.0f );
break;
default:
break;
}
sf::Vector2i localPositionTmp = sf::Mouse::getPosition(window);
sf::Vector2f localPosition = window.mapPixelToCoords(localPositionTmp,viewTiles);
// sf::Vector2f localPositionGui = window.mapPixelToCoords(localPositionTmp,viewGui);
sf::Vector2f localPositionFull = window.mapPixelToCoords(localPositionTmp,viewFull);
int mousePosX = (int)localPosition.x / DP::TILE_SIZE;
int mousePosY = (int)localPosition.y / DP::TILE_SIZE;
int mousePos = DP::transCords(sf::Vector2i(mousePosX, mousePosY));
if(event.type == sf::Event::Closed)
window.close();
// Showing mouse hover
if (currentState==state_game)
{
if ((localPosition.x>DP::TILE_SIZE*DP::BOARD_SIZE) || (localPosition.x<0) || (localPosition.y>DP::TILE_SIZE*DP::BOARD_SIZE) || (localPosition.y<0))
{
showPlayerBoardElems = false;
} else {
showPlayerBoardElems = true;
}
}
if ((localPosition.x>=0) && (localPosition.y>=0) && (localPosition.x<=DP::BOARD_SIZE*DP::TILE_SIZE) && (localPosition.y<=DP::BOARD_SIZE*DP::TILE_SIZE))
{
selector.setPosition((int) (localPosition.x / DP::TILE_SIZE)*DP::TILE_SIZE, ((int) localPosition.y / DP::TILE_SIZE)*DP::TILE_SIZE);
}
/*!
* Handling mouse click
*/
if (event.type == sf::Event::MouseButtonReleased)
{
if (event.mouseButton.button == sf::Mouse::Left)
handleLeftClick(localPosition,
localPositionFull, mousePos);
}
}
update(frameTime);
render(frameTime.asSeconds());
}
}
void Game::update(sf::Time frameTime) {
banner.update(frameTime);
credits.update(frameTime);
runningCounter += frameTime.asSeconds();
cpuTimeThinking -= frameTime.asSeconds();
if (oscilatorInc)
{
oscilator += frameTime.asSeconds();
} else {
oscilator -= frameTime.asSeconds();
}
if (oscilator<-1)
oscilatorInc = true;
if (oscilator>1)
oscilatorInc = false;
float modifier = sin(oscilator/2.5)*30.0f;
spriteBigDiamond.setPosition(474,342+modifier);
if (currentState==state_roll_dice)
{
if ((cpuTimeThinking<0) && (players[turn].human==false))
{
cpuTimeThinking = cpuTimeThinkingInterval;
throwDiceMove();
}
}
if (currentState==state_game)
{
std::array<int,2> currentMovements = players[turn].getMovements(diceResultPlayer);
if ((cpuTimeThinking<0) && (players[turn].human==false))
{
std::vector<int> listRandomPos;
if (currentMovements[0]>-1) {
listRandomPos.push_back(currentMovements[0]);
}
if (currentMovements[1]>-1) {
listRandomPos.push_back(currentMovements[1]);
}
unsigned int sizeRndPos = listRandomPos.size();
if (sizeRndPos==0) {
} else if (sizeRndPos==1) {
playerMakeMove(listRandomPos[0]);
} else if (sizeRndPos==2) {
if (deerModeActive)
{
playerMakeMove(listRandomPos[1]);
} else
{
if (players[turn].reachPortalMode == true)
{
playerMakeMove(listRandomPos[1]);
}
else
{
if (boardDiamonds.ifFieldIsEmpty(listRandomPos[1])==false)
{
playerMakeMove(listRandomPos[1]);
return;
}
if (boardDiamonds.ifFieldIsEmpty(listRandomPos[0])==false)
{
playerMakeMove(listRandomPos[0]);
return;
}
if ((boardDiamonds.ifFieldIsEmpty(listRandomPos[0])==false) && (boardDiamonds.ifFieldIsEmpty(listRandomPos[1])==false))
{
playerMakeMove(listRandomPos[1]);
return;
}
int randPos = rand() % 2;
playerMakeMove(listRandomPos[randPos]);
};
}
}
}
if (currentMovements[0]>-1)
{
prevRotateElem.spriteRotate.setPosition(players[turn].characters[0].leftChar.getPosition());
prevRotateElem.spriteRotate.move(10,20);
// Modificator to fit on the bigger view
prevRotateElem.spriteRotate.move(-202,-76);
prevRotateElem.update(frameTime);
prevRotateElem.setColor();
}
if (currentMovements[1]>-1)
{
nextRotateElem.spriteRotate.setPosition(players[turn].characters[0].rightChar.getPosition());
nextRotateElem.spriteRotate.move(10,20);
// Modificator to fit on the bigger view
nextRotateElem.spriteRotate.move(-202,-76);
nextRotateElem.update(frameTime);
nextRotateElem.setColor();
}
}
cardsDeck.update(frameTime);
for (int i=0;i<4;i++)
{
players[i].play();
players[i].update(frameTime);
}
if (currentState==state_lets_begin)
{
downTimeCounter += frameTime.asSeconds();
spriteLestBegin.setColor(sf::Color(255,255,255,255-(downTimeCounter*35)));
if (downTimeCounter>5)
{
currentState = state_roll_dice;
bubble.state = BubbleState::DICE;
}
}
if (currentState==state_end_game)
{
downTimeCounter += frameTime.asSeconds();
}
bubble.update(frameTime);
}
/*!
* \brief Game::nextRound is happening each every 4 months
*/
void Game::nextRound() {
turn = 0;
// std::string result = roundDice.drawRound();
roundNumber += 1;
month++;
if (month==13)
month=1;
if (month%4==0)
currentSeason++;
if (currentSeason>3)
currentSeason=0;
// if (players[turn].done==true)
// nextPlayer();
launchNextPlayer();
}
/*!
* \brief Game::nextPlayer calculates which player should play
*/
void Game::nextPlayer(){
// End of game - we don't calculate more players
if (currentState==state_end_game)
{
return;
}
// End of game - we don't calculate more players
if (numberFinishedPlayers==4)
{
endGame();
return ;
}
// Update old player
players[turn].updatePlayer();
if (turn>2)
{
nextRound();
return;
}
turn++;
launchNextPlayer();
}
void Game::launchNextPlayer(){
if (deerModeActive)
{
deerModeCounter -= 1;
}
if (deerModeCounter<0)
{
endGame();
return ;
}
// Just control
if (players[turn].done==true)
{
nextPlayer();
return;
}
// Frozen player
if (players[turn].frozenLeft>0)
{
players[turn].frozenLeft -= 1;
nextPlayer();
return;
}
// Here we process new player
selector.changeColor(turn);
for (int i=0;i<4;i++)
{
if (i==turn)
{
players[i].setActive(true);
currentNeighbours = players[i].getNeighbours();
}
else
players[i].setActive(false);
}
sfxClick.play();
diceResultPlayer = 6;
roundDice.setDiceTexture(diceResultPlayer);
players[turn].characters[0].diceResult = diceResultPlayer;
groupHud.setRoundName(roundNumber);
if (deerModeActive==false)
{
groupHud.setSeason(currentSeason);
groupHud.setMonthName(month%4);
} else
{
groupHud.setDeerModeActive();
int number = (deerModeCounter/4);
if (deerModeCounter<16)
number += 1;
if (number<0)
{
endGame();
return;
}
groupHud.setDeerModeCounter(number);
}
currentState = state_roll_dice;
bubble.state = BubbleState::DICE;
roundDice.setColor(turn);
bubble.setPosition(players[turn].characters[0].getPosition().x-30,
players[turn].characters[0].getPosition().y-45);
cpuTimeThinking = cpuTimeThinkingInterval;
if (mostDiamonds()==turn)
{
players[turn].reachPortalMode = true;
} else {
players[turn].reachPortalMode = false;
}
}
void Game::drawPlayersGui(){
for (int i=0;i<4;i++)
{
renderTexture.draw(players[i]);
}
}
void Game::drawSquares() {
if (showPlayerBoardElems)
{
renderTexture.draw(selector);
}
}
void Game::drawBaseGame()
{
renderTexture.setView(viewTiles);
for (int i=0;i<4;i++)
{
renderTexture.draw(players[i].elems);
}
drawSquares();
renderTexture.setView(viewGui);
renderTexture.setView(viewTiles);
renderTexture.setView(viewTiles); // Yeah Katia's inspiration
- shaderBlur.setParameter("blur_radius", sin(runningCounter*0.01f) );
-
+
+ float v;
+ v = sin(runningCounter*0.01f);
+ shaderBlur.setUniform("blur_radius", v );
+
// renderTexture.draw(gameBackground);
renderTexture.setView(viewFull);
// renderTexture.draw(spriteBackgroundArt, &shaderDark);
// spriteBackgroundArt.setColor(sf::Color(255, 255, 255, 208));
- shaderBlur.setParameter("blur_radius", 0.01);
+ shaderBlur.setUniform("blur_radius", 0.01f);
+
+
// shaderBlur.setParameter("blur_radius", sin(runningCounter*0.01) );
// shaderBlur.setParameter("blur_radius", sin(runningCounter*0.01) );
- shaderPixel.setParameter("pixel_threshold", sin(runningCounter* 0.005f));
+
+ v = sin(runningCounter*0.005f);
+ shaderPixel.setUniform("pixel_threshold", v);
renderTexture.draw(spriteBackgroundArt);
spriteBackgroundArt.setColor(sf::Color(255, 255, 255));
- shaderBlur.setParameter("blur_radius", sin(runningCounter* 0.05f)/2);
+ v = sin(runningCounter*0.05f)/2;
+ shaderBlur.setUniform("blur_radius", v);
renderTexture.draw(cardsDeck);
if (currentState==state_roll_dice)
{
spriteBackgroundArt.setColor(sf::Color(255, 255, 255));
- shaderBlur.setParameter("blur_radius", sin(runningCounter* 0.5f)/4);
+
+ v = sin(runningCounter*0.5f)/4;
+ shaderBlur.setUniform("blur_radius", v);
renderTexture.draw(roundDice.spriteDice);
}
else
renderTexture.draw(roundDice.spriteDice);
renderTexture.setView(viewTiles);
drawSquares();
}
void Game::drawCharacters(){
if (currentState==state_game)
{
std::array<int,2> currentMovements = players[turn].characters[0].getMovements(diceResultPlayer);
if (currentMovements[1]>-1)
{
if (nextRotateElem.active)
renderTexture.draw(nextRotateElem);
}
if (currentMovements[0]>-1)
{
if (prevRotateElem.active)
renderTexture.draw(prevRotateElem);
}
}
renderTexture.setView(viewFull);
- shaderBlur.setParameter("blur_radius", 0.005f);
+ shaderBlur.setUniform("blur_radius", 0.005f);
for (int i=0;i<4;i++)
{
for (auto&& j: players[i].characters)
{
if (currentState==state_game)
j.drawMovements = true;
else
j.drawMovements = false;
renderTexture.draw(j);
// renderTexture.draw(j, &shaderBlur);
}
}
}
/*!
* \brief Game::render main function responsible for drawing all elements
* \param deltaTime
*/
void Game::render(float deltaTime)
{
window.clear();
renderTexture.clear();
- if ((currentState==state_game) or (currentState==state_roll_dice))
+ if ((currentState==state_game) || (currentState==state_roll_dice))
{
renderTexture.setView(viewFull);
renderTexture.draw(spriteBackgroundDark);
renderTexture.setView(viewTiles);
drawBaseGame();
renderTexture.setView(viewFull);
renderTexture.draw(groupHud);
renderTexture.setView(viewTiles);
drawCharacters();
renderTexture.draw(boardDiamonds);
renderTexture.draw(bubble);
renderTexture.setView(viewFull);
drawPlayersGui();
renderTexture.setView(viewFull);
} else if (currentState==state_setup_players) {
renderTexture.setView(viewFull);
renderTexture.draw(spriteDeerGod);
for (int i=0;i<4;i++)
{
renderTexture.draw(players[i].spriteAI);
}
} else if (currentState==state_gui_elem) {
renderTexture.setView(viewFull);
- shaderBlur.setParameter("blur_radius", 2);
+ shaderBlur.setUniform("blur_radius", 2.0f);
renderTexture.draw(spriteBackgroundDark, &shaderBlur);
drawBaseGame();
drawCharacters();
renderTexture.setView(viewFull);
renderTexture.draw(groupHud);
} else if (currentState==state_menu) {
// shaderBlur.setParameter("blur_radius", 15);
renderTexture.draw(menuBackground);
// // renderTexture.draw(menuTxt, &shaderBlur);
// renderTexture.draw(menuTxt);
renderTexture.draw(paganHolidayTxt);
renderTexture.draw(gameVersion);
renderTexture.draw(credits);
} else if (currentState==state_lets_begin) {
renderTexture.setView(viewFull);
- shaderBlur.setParameter("blur_radius", 4);
+ shaderBlur.setUniform("blur_radius", 4.0f);
renderTexture.draw(spriteBackgroundDark, &shaderBlur);
renderTexture.setView(viewTiles);
drawBaseGame();
drawCharacters();
renderTexture.draw(boardDiamonds, &shaderBlur);
renderTexture.setView(viewFull);
drawPlayersGui();
renderTexture.draw(spriteLestBegin,&shaderBlur);
} else if (currentState==state_gui_end_round){
renderTexture.setView(viewFull);
renderTexture.draw(spriteBackgroundDark);
drawBaseGame();
- shaderBlur.setParameter("blur_radius", 0.05f);
+ shaderBlur.setUniform("blur_radius", 0.05f);
renderTexture.draw(guiRoundDice, &shaderBlur);
renderTexture.setView(viewFull);
renderTexture.draw(groupHud);
}
else if (currentState==state_end_game){
renderTexture.setView(viewFull);
renderTexture.draw(spriteBackgroundDark);
renderTexture.draw(spriteLestBegin,&shaderBlur);
renderTexture.draw(endGameTxt);
// for (int i=0;i<4;i++){
// if (players[i].reachedPortal)
// renderTexture.draw(endGameTxtAmount[i]);
// }
renderTexture.draw(txtWinner);
renderTexture.draw(txtSurvivorsLabel);
for (unsigned int i=0; i<txtSurvivors.size();i++) {
renderTexture.draw(txtSurvivors[i]);
}
renderTexture.draw(txtLoosersLabel);
for (unsigned int i=0; i<txtLoosers.size();i++) {
renderTexture.draw(txtLoosers[i]);
}
}
if (bigDiamondActive)
renderTexture.draw(spriteBigDiamond);
if (banner.active)
renderTexture.draw(banner);
renderTexture.display();
renderSprite.setTexture(renderTexture.getTexture());
- shaderBlur.setParameter("blur_radius", sin(deltaTime)*0.015f);
- shaderBlur.setParameter("blur_radius", 0.0003f);
+
+ v1 = sin(deltaTime)*0.015f;
+ shaderBlur.setUniform("blur_radius", v1);
+ shaderBlur.setUniform("blur_radius", 0.0003f);
window.draw(renderSprite, &shaderBlur);
- particleSystem.remove();
- particleSystem.update();
- particleSystem.render();
- window.draw( particleSystem.getSprite() );
+ // particleSystem.remove();
+ // particleSystem.update();
+ // particleSystem.render();
+ // window.draw( particleSystem.getSprite() );
window.display();
}
void Game::command(std::string command){
if (command.compare("end_of_round")==0)
{
std::string subResult = command.substr(13);
guiRoundDice.active = true;
guiRoundDice.setTitle(subResult);
currentState = state_gui_end_round;
}
if (command=="end_turn")
nextPlayer();
}
/*!
* \brief Game::startDeerMode launches last episode of the game
*/
void Game::startDeerMode() {
deerModeActive = true;
deerModeCounter = 16;
banner.setText("deer mode");
bigDiamondActive = false;
sfx.soundDeerMode.play();
}
}
diff --git a/src/game.h b/src/game.h
index f70b1af..603155b 100644
--- a/src/game.h
+++ b/src/game.h
@@ -1,221 +1,222 @@
#ifndef GAME_H
#define GAME_H
#include <stdlib.h>
#include <iostream>
#include <ctime>
#include <time.h> /* time */
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include "command.h"
#include "tilemap.h"
#include "selector.h"
#include "playerhud.h"
#include "textureholder.h"
#include "hover.h"
#include "guiwindow.h"
#include "rounddice.h"
#include "guirounddice.h"
#include "grouphud.h"
#include "animatedsprite.h"
#include "character.h"
#include "rotateelem.h"
#include "boarddiamondseq.h"
#include "soundfx.h"
#include "cardsdeck.h"
#include "calendar.h"
#include "particle.h"
#include "bubble.h"
//class Command;
#include "banner.h"
#include "credits.h"
namespace DP {
extern int initScreenX;
extern int initScreenY;
/*!
* \brief Game is a main class of the Deer Portal - contains most logic but also rendering.
*/
class Game
{
public:
sf::Vector2i screenSize;
sf::View viewFull;
sf::View viewGui;
sf::View viewTiles;
void setTxtEndGameAmount();
private:
Selector selector;
Character character;
std::string gameTitle;
std::string paganHolidayString;
RoundDice roundDice;
int roundNumber;
GuiRoundDice guiRoundDice;
+ float v1;
public:
Game(bool newTestMode);
BoardDiamondSeq boardDiamonds;
sf::RenderWindow window;
sf::RenderTexture renderTexture;
sf::Sprite renderSprite;
Player players[4];
SoundFX sfx;
int turn;
private:
void initBoard();
void restartGame();
void loadAssets();
void drawPlayersGui();
void drawSquares();
void drawMenu();
float runningCounter;
float oscilator;
bool oscilatorInc;
sf::Sprite playersSprites[4] ;
int playersSpritesCords[4][2];
enum states {
state_init,
state_menu,
state_setup_players,
state_lets_begin,
state_roll_dice,
state_game,
state_gui_elem,
state_select_building,
state_gui_end_round,
state_end_game,
state_quit
};
states currentState;
sf::Sprite spriteDeerGod;
sf::Sprite spriteBackgroundDark;
sf::Sprite spriteLestBegin;
sf::Texture textureBackgroundArt;
sf::Sprite spriteBackgroundArt;
sf::Texture textureTiles;
sf::Texture textureFaces;
sf::Font gameFont;
sf::Font menuFont;
sf::Text menuTxt;
sf::Text endGameTxt;
sf::Text endGameTxtAmount[4];
sf::Text paganHolidayTxt;
sf::Text gameVersion;
sf::Shader shaderBlur;
sf::Shader shaderPixel;
sf::Shader shaderDark;
int mapSize;
int level[256];
int levelElems[256];
TextureHolder textures;
std::set<int> currentNeighbours;
void command(std::string command);
int selectedPos;
void update(sf::Time frameTime);
void render(float deltaTime);
ParticleSystem particleSystem;
void setCurrentNeighbours ();
void nextPlayer();
void launchNextPlayer();
void nextRound();
sf::Sprite menuBackground;
sf::Sprite seasons[4];
sf::Music musicGame;
sf::Music musicMenu;
sf::SoundBuffer sfxClickBuffer;
sf::Sound sfxClick;
sf::SoundBuffer sfxDoneBuffer;
sf::Sound sfxDone;
void showMenu();
void hideMenu();
void showGameBoard();
GroupHud groupHud;
/*!
* \brief showPlayerBoardElems defines if show mouse hover for the player
*/
bool showPlayerBoardElems;
void drawBaseGame();
int month;
Animation walkingAnimationDown;
Animation walkingAnimationUp;
Animation walkingAnimationLeft;
Animation walkingAnimationRight;
Animation* currentAnimation;
AnimatedSprite animatedSprite;
void drawCharacters();
void handleLeftClick(sf::Vector2f pos, sf::Vector2f posFull, int mousePos);
std::set<int> busyTiles;
int diceResultPlayer;
int numberFinishedPlayers;
RotateElem nextRotateElem;
RotateElem prevRotateElem;
void endGame();
float downTimeCounter;
Command commandManager;
sf::Text textLoading;
public:
CardsDeck cardsDeck;
void startDeerMode();
sf::Text txtWinner;
sf::Text txtSurvivorsLabel;
sf::Text txtLoosersLabel;
std::vector<sf::Text> txtSurvivors;
std::vector<sf::Text> txtLoosers;
void throwDiceMove();
void playerMakeMove(int mousePos);
float cpuTimeThinking;
Banner banner;
sf::Sprite spriteBigDiamond;
bool bigDiamondActive;
int mostDiamonds() const;
Credits credits;
float cpuTimeThinkingInterval;
private:
Bubble bubble;
int deerModeCounter;
bool deerModeActive;
public:
bool testMode;
};
}
#endif // GAME_H
diff --git a/src/guiwindow.cpp b/src/guiwindow.cpp
index f41073d..0dba6f4 100644
--- a/src/guiwindow.cpp
+++ b/src/guiwindow.cpp
@@ -1,80 +1,82 @@
#include "guiwindow.h"
void GuiWindow::setTitle(std::string newTitle) {
title = newTitle;
guiTitleTxt.setString(title);
}
GuiWindow::GuiWindow(TextureHolder *textures)
{
// spriteClose.setTexture(textures->textureGui);
// spriteClose.setTextureRect(sf::IntRect(0,0,16,16));
// spriteClose.move(sf::Vector2f(150-16,0));
- if (!guiElemFont.loadFromFile(ASSETS_PATH"assets/fnt/metal-macabre.regular.ttf"))
+ if (!guiElemFont.loadFromFile(get_full_path(ASSETS_PATH"assets/fnt/metal-macabre.regular.ttf")))
{
std::exit(1);
};
bgdDark.setTexture(textures->backgroundDark);
// bgdDark.setColor(sf::Color(160, 160, 160, 200));
bgdDark.setTextureRect((sf::IntRect)rectangle.getLocalBounds());
title = "Choose building:";
guiTitleTxt.setFont(guiElemFont);
guiTitleTxt.setCharacterSize(58);
- guiTitleTxt.setColor(sf::Color(255,255,255,200));
+ // guiTitleTxt.setColor(sf::Color(255,255,255,200));
+ guiTitleTxt.setFillColor(sf::Color(255, 255, 255, 200));
+ guiTitleTxt.setOutlineColor(sf::Color(255, 255, 255, 200));
guiTitleTxt.move(2,0);
guiTitleTxt.setString(title);
setPosition(150, 100);
}
GuiWindow::GuiWindow(){
- if (!guiElemFont.loadFromFile(ASSETS_PATH"assets/fnt/metal-macabre.regular.ttf"))
+ if (!guiElemFont.loadFromFile(get_full_path(ASSETS_PATH"assets/fnt/metal-macabre.regular.ttf")))
{
std::exit(1);
};
setPosition(150, 100);
}
//void GuiWindow::setTextureHolder(TextureHolder *textures)
//{
//// spriteClose.setTexture(textures->textureGui);
//}
void GuiWindow::init(){
}
void GuiWindow::draw(sf::RenderTarget& target, sf::RenderStates states) const{
sf::RenderStates states2 = states;
states2.transform *= getTransform();
Hover::draw(target, states);
target.draw(bgdDark, states2);
target.draw(spriteClose, states2);
target.draw(guiTitleTxt, states2);
}
std::string GuiWindow::getElem(sf::Vector2f mousePosition)
{
sf::Vector2f hoverPos = getPosition();
sf::FloatRect spriteBounds = spriteClose.getLocalBounds();
sf::FloatRect closeRect;
closeRect.left = spriteClose.getPosition().x;
closeRect.top = spriteClose.getPosition().y;
closeRect.width = spriteBounds.width;
closeRect.height = spriteBounds.height;
if (closeRect.contains(mousePosition.x - hoverPos.x,mousePosition.y - hoverPos.y))
{
return "close_gui";
}
else
return "";
}
diff --git a/src/particle.h b/src/particle.h
index 1daef81..1b8f3fc 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -1,79 +1,79 @@
#ifndef PARTICLE_H
#define PARTICLE_H
#include <SFML/System/Vector2.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/Graphics/Color.hpp>
#include <SFML/Graphics/Image.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <vector>
#include <random>
-
+#include <cmath>
class Randomizer {
public:
- Randomizer() : device_(), engine_(device_()){};
- int rnd(int a, int b) {
- std::uniform_int_distribution<int> uni_dist(a, b);
- return uni_dist(engine_);
- };
- double rnd(double a, double b) {
- std::uniform_real_distribution<double> uni_dist(a, b);
- return uni_dist(engine_);
- };
+ Randomizer() : device_(), engine_(device_()) {};
+ int rnd(int a, int b) {
+ std::uniform_int_distribution<int> uni_dist(a, b);
+ return uni_dist(engine_);
+ };
+ double rnd(double a, double b) {
+ std::uniform_real_distribution<double> uni_dist(a, b);
+ return uni_dist(engine_);
+ };
private:
std::random_device device_;
std::default_random_engine engine_;
};
namespace DP { enum { CIRCLE, SQUARE }; }
struct Particle
{
sf::Vector2f pos; // Position
sf::Vector2f vel; // Velocity
sf::Color color; // RGBA
};
typedef std::vector<Particle*>::iterator ParticleIterator;
class ParticleSystem
{
public:
ParticleSystem( int width, int height );
~ParticleSystem();
void fuel( int particles ); // Adds new particles to m_particles
void update(); // Updates position, velocity and opacity of all particles
void render(); // Renders all particles onto m_image
void remove(); // Removes all particles from m_image
void setPosition( float x, float y ) { m_position.x = x; m_position.y = y; }
void setGravity( float x, float y ) { m_gravity.x = x; m_gravity.y = y; }
void setParticleSpeed( float speed ) { m_particleSpeed = speed; }
void setDissolve( bool enable ) { m_dissolve = enable; }
void setDissolutionRate( unsigned char rate ) { m_dissolutionRate = rate; }
void setShape( unsigned char shape ) { m_shape = shape; }
int getNumberOfParticles() { return m_particles.size(); }
std::string getNumberOfParticlesString();
sf::Sprite& getSprite() { return m_sprite; }
private:
sf::Vector2f m_position; // Particle origin (pixel co-ordinates)
sf::Vector2f m_gravity; // Affects particle velocities
sf::Clock m_clock; // Used to scale particle motion
sf::Color m_transparent; // sf::Color( 0, 0, 0, 0 )
sf::Image m_image; // See render() and remove()
sf::Texture m_texture;
Randomizer m_randomizer;
sf::Sprite m_sprite; // Connected to m_image
float m_particleSpeed;// Pixels per second (at most)
bool m_dissolve; // Dissolution enabled?
unsigned char m_dissolutionRate;
unsigned char m_shape;
std::vector<Particle*> m_particles;
};
#endif
diff --git a/src/particlesystem.cpp b/src/particlesystem.cpp
index af8a172..a4debd6 100644
--- a/src/particlesystem.cpp
+++ b/src/particlesystem.cpp
@@ -1,112 +1,116 @@
#include "particle.h"
#include <sstream>
ParticleSystem::ParticleSystem( int width, int height )
{
m_transparent = sf::Color( 0, 0, 0, 0 );
m_image.create( width, height, m_transparent );
m_texture.loadFromImage(m_image);
m_sprite = sf::Sprite(m_texture);
m_position.x = 0.5f * width;
m_position.y = 0.5f * height;
m_particleSpeed = 20.0f;
m_dissolve = false;
m_dissolutionRate = 4;
m_shape = DP::CIRCLE;
}
ParticleSystem::~ParticleSystem()
{
for( ParticleIterator it = m_particles.begin(); it != m_particles.end(); ++it )
for( ParticleIterator it = m_particles.begin(); it != m_particles.end(); ++it )
{
delete *it;
}
}
void ParticleSystem::fuel( int particles )
{
- float angle;
+ double angle;
for( int i = 0; i < particles; i++ )
{
Particle* particle;
particle = new Particle();
particle->pos.x = m_position.x;
particle->pos.y = m_position.y;
-
+ double cosangle;
+ double sinangle;
switch( m_shape )
{
case DP::CIRCLE:
- angle = m_randomizer.rnd(0.0f, 6.2832f);
- particle->vel.x = m_randomizer.rnd(0.0f, cos( angle ));
- particle->vel.y = m_randomizer.rnd(0.0f, sin( angle ));
+ angle = m_randomizer.rnd(0.0, 6.2832);
+ cosangle = fabs(cos(angle));
+ sinangle = fabs(sin(angle));
+ particle->vel.x = m_randomizer.rnd(0.0, cosangle);
+ // particle->vel.x = m_randomizer.rnd(0.0, 1.0);
+ particle->vel.y = m_randomizer.rnd(0.0, sinangle);
break;
case DP::SQUARE:
particle->vel.x = m_randomizer.rnd(-1.0f, 1.0f);
particle->vel.y = m_randomizer.rnd(-1.0f, 1.0f);
break;
default:
particle->vel.x = 0.5f; // Easily detected
particle->vel.y = 0.5f; // Easily detected
}
if( particle->vel.x == 0.0f && particle->vel.y == 0.0f )
{
delete particle;
continue;
}
particle->color.r = m_randomizer.rnd(0, 255);
particle->color.g = m_randomizer.rnd(0, 255);
particle->color.b = m_randomizer.rnd(0, 255);
particle->color.a = 255;
m_particles.push_back( particle );
}
}
void ParticleSystem::update()
{
float time = m_clock.restart().asSeconds();
for( ParticleIterator it = m_particles.begin(); it != m_particles.end(); ++it )
{
(*it)->vel.x += m_gravity.x * time;
(*it)->vel.y += m_gravity.y * time;
(*it)->pos.x += (*it)->vel.x * time * m_particleSpeed;
(*it)->pos.y += (*it)->vel.y * time * m_particleSpeed;
if( m_dissolve ) (*it)->color.a -= m_dissolutionRate;
if( (*it)->pos.x > m_image.getSize().x || (*it)->pos.x < 0 || (*it)->pos.y > m_image.getSize().y || (*it)->pos.y < 0 || (*it)->color.a < 10 )
{
delete (*it);
it = m_particles.erase( it );
if( it == m_particles.end() ) return;
}
}
}
void ParticleSystem::render()
{
for( ParticleIterator it = m_particles.begin(); it != m_particles.end(); ++it )
{
m_image.setPixel( (int)(*it)->pos.x, (int)(*it)->pos.y, (*it)->color );
}
m_texture.update(m_image);
}
void ParticleSystem::remove()
{
for( ParticleIterator it = m_particles.begin(); it != m_particles.end(); ++it )
{
m_image.setPixel( (int)(*it)->pos.x, (int)(*it)->pos.y, m_transparent );
}
}
std::string ParticleSystem::getNumberOfParticlesString()
{
std::ostringstream oss;
oss << m_particles.size();
return oss.str();
}
diff --git a/src/rotateelem.cpp b/src/rotateelem.cpp
index 5ec5ca8..061c29b 100644
--- a/src/rotateelem.cpp
+++ b/src/rotateelem.cpp
@@ -1,60 +1,61 @@
#include "rotateelem.h"
RotateElem::RotateElem():
timeCounter(0),
active(true)
{
- if (!textureRotate.loadFromFile(ASSETS_PATH"assets/img/rotate.png"))
+ if (!textureRotate.loadFromFile(get_full_path(ASSETS_PATH"assets/img/rotate.png")))
std::exit(1);
spriteRotate.setTexture(textureRotate);
spriteRotate.scale(0.7f,0.7f);
spriteRotate.setOrigin(32, 32);
}
void RotateElem::draw(sf::RenderTarget& target, sf::RenderStates states) const{
states.transform *= getTransform();
target.draw(spriteRotate, states);
}
void RotateElem::update(sf::Time deltaTime)
{
float speed;
-
- speed = 0.05f/deltaTime.asSeconds();
-
- spriteRotate.rotate(1.0f*speed);
+ const float timestep = 1.0f / 60.0f;
+ speed = 2.0f;
+ float accumulator = 0;
+ accumulator += deltaTime.asSeconds();
+ spriteRotate.rotate(speed * accumulator / timestep);
timeCounter += deltaTime.asSeconds();
if (timeCounter>0.40f)
if (timeCounter>0.40f)
{
if (active)
{
active = false;
} else {
active = true;
};
timeCounter = 0;
}
}
void RotateElem::setColor()
{
// spriteRotate.setColor(DP::playersColors[playerNumber]);
spriteRotate.setColor(sf::Color::White);
}
void RotateElem::reset()
{
active = true;
timeCounter = 0;
}
diff --git a/src/rotateelem.h b/src/rotateelem.h
index 4019b19..0be10b7 100644
--- a/src/rotateelem.h
+++ b/src/rotateelem.h
@@ -1,22 +1,24 @@
#ifndef ROTATEELEM_H
#define ROTATEELEM_H
#include <SFML/Graphics.hpp>
#include "data.h"
+#include "filetools.h"
+
class RotateElem : public sf::Drawable, public sf::Transformable
{
public:
RotateElem();
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
void update(sf::Time deltaTime);
sf::Texture textureRotate;
sf::Sprite spriteRotate;
void setColor();
float timeCounter;
bool active;
void reset();
};
#endif // ROTATEELEM_H
diff --git a/src/rounddice.cpp b/src/rounddice.cpp
index 07d14a8..46f99ba 100644
--- a/src/rounddice.cpp
+++ b/src/rounddice.cpp
@@ -1,68 +1,69 @@
#include "rounddice.h"
+
RoundDice::RoundDice(Player (&players)[4])
{
playersHud = players;
diceResult = 1;
diceResultSix = 6;
diceSize = 150;
- if (!sfxDiceBuffer.loadFromFile(ASSETS_PATH"assets/audio/dice.ogg"))
+ if (!sfxDiceBuffer.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/dice.ogg")))
std::exit(1);
- if (!textureDice.loadFromFile(ASSETS_PATH"assets/img/diceWhite.png"))
+ if (!textureDice.loadFromFile(get_full_path(ASSETS_PATH"assets/img/diceWhite.png")))
std::exit(1);
spriteDice.setTexture(textureDice);
sfxDice.setBuffer(sfxDiceBuffer);
sfxDice.setVolume(12);
spriteDice.setPosition(1140,550);
setDiceTexture();
}
void RoundDice::setDiceTexture(){
sf::IntRect diceRect(diceSize*diceResultSix, 0, diceSize, diceSize);
spriteDice.setTextureRect(diceRect);
}
void RoundDice::setColor(int playerNumber){
sf::Color color(DP::playersColors[playerNumber]);
spriteDice.setColor(color);
}
void RoundDice::setDiceTexture(int diceResult){
this->diceResultSix = diceResult;
setDiceTexture();
}
std::string RoundDice::drawRound(){
throwDice();
if (diceResult<33)
{
return "end_of_round_extra_grow";
} else if (diceResult<66)
{
return "end_of_round_extra_energy";
} else
{
// eventExtraCash();
return "end_of_round_extra_cash";
}
return "end_of_round_"+std::to_string(diceResult);
}
int RoundDice::throwDice(){
sfxDice.play();
int result = rand()%100;
diceResult = result;
return result;
}
int RoundDice::throwDiceSix(){
sfxDice.play();
int result = rand()%6;
diceResultSix = result;
setDiceTexture();
// return 26;
return result+1;
}
diff --git a/src/soundfx.cpp b/src/soundfx.cpp
index d54739c..132923b 100644
--- a/src/soundfx.cpp
+++ b/src/soundfx.cpp
@@ -1,53 +1,53 @@
#include "soundfx.h"
SoundFX::SoundFX()
{
- if (!soundCollectBuffer.loadFromFile(ASSETS_PATH"assets/audio/collect.ogg"))
+ if (!soundCollectBuffer.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/collect.ogg")))
exit(-1);
- if (!soundCardBuffer.loadFromFile(ASSETS_PATH"assets/audio/card.ogg"))
+ if (!soundCardBuffer.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/card.ogg")))
exit(-1);
- if (!bufferDeerMode.loadFromFile(ASSETS_PATH"assets/audio/dp-deermode.ogg"))
+ if (!bufferDeerMode.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/dp-deermode.ogg")))
exit(-1);
- if (!bufferMeditation.loadFromFile(ASSETS_PATH"assets/audio/dp-meditation.ogg"))
+ if (!bufferMeditation.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/dp-meditation.ogg")))
exit(-1);
- if (!bufferPortal.loadFromFile(ASSETS_PATH"assets/audio/dp-ok.ogg"))
+ if (!bufferPortal.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/dp-ok.ogg")))
exit(-1);
soundCollect.setBuffer(soundCollectBuffer);
soundCollect.setVolume(20);
soundCard.setBuffer(soundCardBuffer);
// soundCollect.setVolume(20);
- if (!soundLetsBeginBuffer.loadFromFile(ASSETS_PATH"assets/audio/letsbegin.ogg"))
+ if (!soundLetsBeginBuffer.loadFromFile(get_full_path(ASSETS_PATH"assets/audio/letsbegin.ogg")))
exit(-1);
soundLetsBegin.setBuffer(soundLetsBeginBuffer);
soundLetsBegin.setVolume(20);
soundPortal.setBuffer(bufferPortal);
soundPortal.setVolume(20);
soundDeerMode.setBuffer(bufferDeerMode);
soundDeerMode.setVolume(40);
soundMeditation.setBuffer(bufferMeditation);
soundMeditation.setVolume(20);
}
void SoundFX::playCollect()
{
soundCollect.play();
}
void SoundFX::playCard()
{
soundCard.play();
}
void SoundFX::playLetsBegin()
{
// std::cout << "playing.... begin lets" << std::endl;
soundLetsBegin.play();
}
diff --git a/src/soundfx.h b/src/soundfx.h
index 7a3ec2d..edd370f 100644
--- a/src/soundfx.h
+++ b/src/soundfx.h
@@ -1,33 +1,32 @@
#ifndef SOUNDFX_H
#define SOUNDFX_H
#include <iostream>
-
#include <SFML/Audio.hpp>
-
+#include "filetools.h"
/*!
* \brief The SoundFX various sounds
*/
class SoundFX
{
public:
SoundFX();
sf::SoundBuffer soundCollectBuffer;
sf::SoundBuffer soundCardBuffer;
sf::SoundBuffer bufferDeerMode;
sf::SoundBuffer bufferMeditation;
sf::SoundBuffer bufferPortal;
sf::Sound soundPortal;
sf::Sound soundDeerMode;
sf::Sound soundMeditation;
sf::Sound soundCollect;
sf::Sound soundCard;
void playCollect();
sf::SoundBuffer soundLetsBeginBuffer;
sf::Sound soundLetsBegin;
void playLetsBegin();
void playCard();
};
#endif // SOUNDFX_H
diff --git a/src/textureholder.cpp b/src/textureholder.cpp
index d87ce8b..0fa4197 100644
--- a/src/textureholder.cpp
+++ b/src/textureholder.cpp
@@ -1,154 +1,154 @@
#include <iostream>
#include "textureholder.h"
namespace DP {
std::set<int> getTerrainSet() {
std::set<int> terrain;
for (int i: DP::terrainArray)
{
terrain.insert(i);
}
return terrain;
}
}
TextureHolder::TextureHolder()
{
// "stop", "card", "diamond", "diamond x 2"
std::string cardsImages[4][4] = {
{"card-water-stop.small.png", "card-water-remove-card.small.png","card-water-diam.small.png", "card-water-2-diam.small.png" },
{"card-earth-stop.small.png", "card-earth-remove-card.small.png","card-earth-diam.small.png", "card-earth-2-diam.small.png"},
{"card-fire-stop.small.png", "card-fire-remove-card.small.png","card-fire-diam.small.png", "card-fire-2-diam.small.png"},
{"card-air-stop.small.png", "card-air-remove-card.small.png", "card-air-diam.small.png", "card-air-2-diam.small.png" }
};
for (int i=0;i<4;i++)
{
for (int j=0;j<4;j++)
{
- if(!cardsTextures[i][j].loadFromFile(ASSETS_PATH"assets/img/cards/"+cardsImages[i][j]))
+ if(!cardsTextures[i][j].loadFromFile(get_full_path(ASSETS_PATH"assets/img/cards/"+cardsImages[i][j])))
{
// std::cout << "assets/img/cards/" << cardsImages[i][j];
std::exit(1);
} else {
// std::cout << "assets/img/cards/" << cardsImages[i][j] << " ok " << i << " " << j << " " << std::endl;
}
}
}
- if (!textureCardBases[0].loadFromFile(ASSETS_PATH"assets/img/card-water-2-diam_m.png"))
+ if (!textureCardBases[0].loadFromFile(get_full_path(ASSETS_PATH"assets/img/card-water-2-diam_m.png")))
std::exit(1);
- if (!textureCardBases[1].loadFromFile(ASSETS_PATH"assets/img/card-earth-2-diam_m.png"))
+ if (!textureCardBases[1].loadFromFile(get_full_path(ASSETS_PATH"assets/img/card-earth-2-diam_m.png")))
std::exit(1);
- if (!textureCardBases[2].loadFromFile(ASSETS_PATH"assets/img/card-fire-2-diam_m.png"))
+ if (!textureCardBases[2].loadFromFile(get_full_path(ASSETS_PATH"assets/img/card-fire-2-diam_m.png")))
std::exit(1);
- if (!textureCardBases[3].loadFromFile(ASSETS_PATH"assets/img/card-air-2-diam_m.png"))
+ if (!textureCardBases[3].loadFromFile(get_full_path(ASSETS_PATH"assets/img/card-air-2-diam_m.png")))
std::exit(1);
// if (!textureGameBackground.loadFromFile(ASSETS_PATH"assets/img/game-ackground.png"))
// std::exit(1);
// if (!textureTiles.loadFromFile(ASSETS_PATH"assets/img/zw-tilesets/_MAP.png"))
// std::exit(1);
// if (!textureFaces.loadFromFile(ASSETS_PATH"assets/img/faces.jpg"))
// std::exit(1);
// if (!textureGui.loadFromFile(ASSETS_PATH"assets/img/gui.png"))
// std::exit(1);
// if (!textureSymbols.loadFromFile(ASSETS_PATH"assets/img/symbols.png"))
// std::exit(1);
// if (!textureSeasons.loadFromFile(ASSETS_PATH"assets/img/seasons.png"))
// std::exit(1);
- if (!textureCharacters.loadFromFile(ASSETS_PATH"assets/img/characters-new.png"))
+ if (!textureCharacters.loadFromFile(get_full_path(ASSETS_PATH"assets/img/characters-new.png")))
std::exit(1);
- if (!backgroundDark.loadFromFile(ASSETS_PATH"assets/img/background_dark.png"))
+ if (!backgroundDark.loadFromFile(get_full_path(ASSETS_PATH"assets/img/background_dark.png")))
std::exit(1);
- if (!textureBoardDiamond.loadFromFile(ASSETS_PATH"assets/img/board_diamonds.png"))
+ if (!textureBoardDiamond.loadFromFile(get_full_path(ASSETS_PATH"assets/img/board_diamonds.png")))
std::exit(1);
- if (!textureMenu.loadFromFile(ASSETS_PATH"assets/img/dp_intro_menu.png"))
+ if (!textureMenu.loadFromFile(get_full_path(ASSETS_PATH"assets/img/dp_intro_menu.png")))
std::exit(1);
- if (!textureLetsBegin.loadFromFile(ASSETS_PATH"assets/img/letsbegin.png"))
+ if (!textureLetsBegin.loadFromFile(get_full_path(ASSETS_PATH"assets/img/letsbegin.png")))
std::exit(1);
- if (!textureButtonCpu.loadFromFile(ASSETS_PATH"assets/img/button-cpu.png"))
+ if (!textureButtonCpu.loadFromFile(get_full_path(ASSETS_PATH"assets/img/button-cpu.png")))
std::exit(1);
- if (!textureButtonHuman.loadFromFile(ASSETS_PATH"assets/img/button-human.png"))
+ if (!textureButtonHuman.loadFromFile(get_full_path(ASSETS_PATH"assets/img/button-human.png")))
std::exit(1);
- if (!textureDeerGod.loadFromFile(ASSETS_PATH"assets/img/deer-god.png"))
+ if (!textureDeerGod.loadFromFile(get_full_path(ASSETS_PATH"assets/img/deer-god.png")))
std::exit(1);
- if (!textureBigDiamond.loadFromFile(ASSETS_PATH"assets/img/diamond-big.png"))
+ if (!textureBigDiamond.loadFromFile(get_full_path(ASSETS_PATH"assets/img/diamond-big.png")))
std::exit(1);
int defaultArray[5][8] = {
//Cash Food Energy Faith
{10, 2, 0, 0, 0, 0, 0, 0}, // base
{10, 1, 2, 0, 0, 5, 0, 0}, // windmill
{15, 0, 0, 2, 2, 0, 0, 0}, // granary
{20, 5, 4, 0, 4, 0, 0, 0}, // marketplace
{5, 0, 2, 0, 0, 0, 0, 2} // monasterium
};
int defaultFields[5] = {443, 651, 442, 585, 1100};
/*
* Array with description of the field
* global rule = even indexes are price, odd - monthly cost
* [0] - price in cash
* [1] - monthly cash cost
* [2] - price - in food
* [3] - monthly food cost
* [4] - price in energy
* [5] - monthly energy cost
* [6] - price in faith
* [7] - monthly cost in faith
*
*/
int counter = 0;
for (int i: defaultFields)
{
std::map<int, int> params;
for (int j=0;j<8;j++)
{
params.insert({j, defaultArray[counter][j]});
}
// params.insert({0, 10});
// params.insert({1, 2});
// params.insert({2, 10});
// params.insert({3, 0});
// params.insert({4, 10});
// params.insert({5, 0});
// params.insert({6, 0});
// params.insert({7, 0});
tilesDescription.insert({i, params});
counter++;
};
tilesTxt.insert({443, "Your base."});
tilesTxt.insert({651, "Windmill, produces energy.\nEnergy is a basic resource in a game,\nneeded by other buildings to running them."});
tilesTxt.insert({442, "Granary, food storehouse.\nFood gives your people ability to live.\nWithout the food your people will face\na death by starvation."});
tilesTxt.insert({585, "Marketplace, generates cash.\nProvides your tribe trading area.\nToday's offer - dog's bone."});
tilesTxt.insert({1100, "Monasterium, increase your faith.\nAs we all know, our world is being ruled\nby four ancient gods..."});
}
diff --git a/src/textureholder.h b/src/textureholder.h
index ede2f44..fb80258 100644
--- a/src/textureholder.h
+++ b/src/textureholder.h
@@ -1,57 +1,58 @@
#ifndef TEXTUREHOLDER_H
#define TEXTUREHOLDER_H
#include <set>
+#include <array>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include "data.h"
-#include <array>
+#include "filetools.h"
namespace DP {
std::set<int> getTerrainSet();
}
/*!
* \brief The TextureHolder contains most textures.
*/
class TextureHolder
{
public:
TextureHolder();
// sf::Texture textureTiles;
// sf::Texture textureFaces;
// sf::Texture textureGui;
sf::Texture textureMenu;
// sf::Texture textureSymbols;
// sf::Texture textureSeasons;
sf::Texture backgroundDark;
sf::Texture textureCharacters;
// sf::Texture textureGameBackground;
sf::Texture textureBoardDiamond;
sf::Texture textureLetsBegin;
sf::Texture textureCardBase0;
sf::Texture textureCardBase1;
sf::Texture textureCardBase2;
sf::Texture textureCardBase3;
sf::Texture textureButtonCpu;
sf::Texture textureButtonHuman;
sf::Texture textureDeerGod;
std::array<sf::Texture, 4> textureCardBases;
std::map<int, std::map<int, int>> tilesDescription;
std::map<int, std::string> tilesTxt;
std::array<std::array<sf::Texture,4>,4> cardsTextures;
sf::Texture textureBigDiamond;
};
#endif // TEXTUREHOLDER_H
diff --git a/version.txt b/version.txt
index db89a4b..aec258d 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-0.7.5-more-plugs
+0.8

File Metadata

Mime Type
text/x-diff
Expires
Wed, Jun 17, 9:33 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
72037
Default Alt Text
(91 KB)

Event Timeline