Page MenuHomePhabricator (Chris)

No OneTemporary

Size
17 KB
Referenced Files
None
Subscribers
None
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f248689..45a29f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,18 @@
cmake_minimum_required(VERSION 3.14)
-project(SDL_Game)
+project(bloonstd)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
include_directories(include)
find_package(Boost REQUIRED COMPONENTS filesystem)
-include_directories(${Boost_INCLUDE_DIRS})
+find_package(SDL2 REQUIRED)
+include_directories(${Boost_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS})
link_directories(lib)
-link_libraries(mingw32 SDL2main SDL2 SDL2_image SDL2_gfx SDL2_ttf)
-add_executable(SDL_Game src/SDL_FontCache.c src/SDL_FontCache.h src/main.cpp src/Game.cpp src/Game.h src/Entity.h src/Component.h src/System.h src/systems/RenderSystem.cpp src/systems/RenderSystem.h src/components/Visibility.cpp src/components/Visibility.h src/components/Velocity.cpp src/components/Velocity.h src/systems/MovementSystem.cpp src/systems/MovementSystem.h src/components/Position.h src/components/PathIndex.h src/GameData.h src/components/Sequence.cpp src/components/Sequence.h src/systems/BloonsSpawnSystem.cpp src/systems/BloonsSpawnSystem.h src/GameData.cpp src/components/Action.h src/systems/EventSystem.cpp src/systems/EventSystem.h src/components/Draggable.h src/systems/DraggingSystem.cpp src/systems/DraggingSystem.h src/Settings.h src/systems/RemoveEntitiesSystem.cpp src/systems/RemoveEntitiesSystem.h src/components/MoveEntityEvent.h src/components/RangeShadow.h src/Physics.cpp src/Physics.h src/systems/CollisionSystem.cpp src/systems/CollisionSystem.h src/systems/ShotsSpawnSystem.cpp src/systems/ShotsSpawnSystem.h src/components/IntegerComponents.h src/components/FloatComponents.h src/components/AttackSpeed.h src/components/AttackSpeed.cpp src/components/PoppedBloons.h src/systems/DamageSystem.cpp src/systems/DamageSystem.h src/components/FlagComponents.h src/System.cpp src/Entity.cpp src/components/DamageEvent.h src/systems/MenuSystem.cpp src/systems/MenuSystem.h src/components/Regrow.h src/systems/LoadLevelSystem.cpp src/systems/LoadLevelSystem.h src/components/Goo.h src/components/Upgrades.h src/systems/PopEffectSystem.cpp src/systems/PopEffectSystem.h)
-target_link_libraries(SDL_Game ${Boost_LIBRARIES})
\ No newline at end of file
+IF (WIN32)
+ link_libraries(mingw32)
+ENDIF()
+link_libraries(SDL2main SDL2 SDL2_image SDL2_gfx SDL2_ttf)
+add_executable(bloonstd src/SDL_FontCache.c src/SDL_FontCache.h src/main.cpp src/Game.cpp src/Game.h src/Entity.h src/Component.h src/System.h src/systems/RenderSystem.cpp src/systems/RenderSystem.h src/components/Visibility.cpp src/components/Visibility.h src/components/Velocity.cpp src/components/Velocity.h src/systems/MovementSystem.cpp src/systems/MovementSystem.h src/components/Position.h src/components/PathIndex.h src/GameData.h src/components/Sequence.cpp src/components/Sequence.h src/systems/BloonsSpawnSystem.cpp src/systems/BloonsSpawnSystem.h src/GameData.cpp src/components/Action.h src/systems/EventSystem.cpp src/systems/EventSystem.h src/components/Draggable.h src/systems/DraggingSystem.cpp src/systems/DraggingSystem.h src/Settings.h src/systems/RemoveEntitiesSystem.cpp src/systems/RemoveEntitiesSystem.h src/components/MoveEntityEvent.h src/components/RangeShadow.h src/Physics.cpp src/Physics.h src/systems/CollisionSystem.cpp src/systems/CollisionSystem.h src/systems/ShotsSpawnSystem.cpp src/systems/ShotsSpawnSystem.h src/components/IntegerComponents.h src/components/FloatComponents.h src/components/AttackSpeed.h src/components/AttackSpeed.cpp src/components/PoppedBloons.h src/systems/DamageSystem.cpp src/systems/DamageSystem.h src/components/FlagComponents.h src/System.cpp src/Entity.cpp src/components/DamageEvent.h src/systems/MenuSystem.cpp src/systems/MenuSystem.h src/components/Regrow.h src/systems/LoadLevelSystem.cpp src/systems/LoadLevelSystem.h src/components/Goo.h src/components/Upgrades.h src/systems/PopEffectSystem.cpp src/systems/PopEffectSystem.h)
+target_link_libraries(bloonstd ${Boost_LIBRARIES} ${SDL2_LIBRARIES})
+if (UNIX)
+ install(TARGETS bloonstd RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/games)
+endif()
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..04cbd68
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+bloonstd (1.0.1-1) groovy; urgency=medium
+
+ * Initial release for groovy
+
+ -- Chris <dpkg@chris-nz.com> Sun, 04 Apr 2021 19:43:00 +1300
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..bff771d
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,18 @@
+Source: bloonstd
+Section: games
+Priority: optional
+Maintainer: Chris <dpkg@chris-nz.com>
+Build-Depends: debhelper-compat (= 12), libsdl2-image-dev, libsdl2-ttf-dev, libsdl2-gfx-dev, libsdl2-dev, libboost-filesystem-dev
+Standards-Version: 4.4.1
+Homepage: https://github.com/idomoz/BloonsTD
+
+Package: bloonstd
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: A remake of Ninja Kiwi's BTD5 + BTD6 games
+ Bloons TD is a Tower Defense game.
+ The premise is simple: buy turrets (monkeys) and position them
+ such that they can pop the largest possible number of balloons.
+ The balloons travel on a fixed path past the turrets,
+ and the player's job is to prevent any of the balloons from
+ reaching the end of the path.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..e475563
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,29 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: BloonsTD
+Upstream-Contact: idomoz <ido.mozes@gmail.com>
+Source: https://github.com/idomoz/BloonsTD
+
+Files: *
+Copyright: 2019 idomoz <ido.mozes@gmail.com>
+License: All Rights Reserved
+
+Files: debian/*
+Copyright: 2021 Chris <dpkg@chris-nz.com>
+License: GPL-2
+
+License: GPL-2
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/debian/data/bloonstd.desktop b/debian/data/bloonstd.desktop
new file mode 100644
index 0000000..21a22a4
--- /dev/null
+++ b/debian/data/bloonstd.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Bloons TD
+GenericName=Arcade Game
+Comment=A A remake of Ninja Kiwi's BTD5 + BTD6 games
+Comment[de]=Ein Klon des BTD5/BTD6
+Exec=bloonstd
+Icon=bloonstd
+Terminal=false
+Type=Application
+Categories=Game;ArcadeGame;
+Keywords=bloons;tower;defense;td;balloons;level;
diff --git a/debian/data/bloonstd.man b/debian/data/bloonstd.man
new file mode 100644
index 0000000..e3c81e1
--- /dev/null
+++ b/debian/data/bloonstd.man
@@ -0,0 +1,31 @@
+.\" bloonstd.man
+.\"
+.\"
+.TH BLOONSTD 6
+.SH NAME
+bloonstd \- the tower defense game with balloons
+.SH SYNOPSIS
+.B "bloonstd"
+[grey]
+.SH DESCRIPTION
+.PP
+.I Bloons TD
+is an remake of Ninja Kiwi's famous BTD5/BTD6 games.
+.PP
+Bloons games are built on the simple premise that
+.I popping balloons is fun.
+Purchase and upgrade towers, and position them so as to maximize the destruction!
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+To get default display.
+.SH AUTHOR
+.if t idomoz\(aes,
+.if n idomoz,
+ido.mozes@gmail.com.
+.br
+This man page written by
+.if t J\(:org Chris,
+.if n Chris,
+manpages@chris-nz.com.
diff --git a/debian/data/bloonstd.png b/debian/data/bloonstd.png
new file mode 100644
index 0000000..689657b
Binary files /dev/null and b/debian/data/bloonstd.png differ
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..c153f64
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,3 @@
+debian/data/bloonstd.desktop /usr/share/applications
+debian/data/bloonstd.png /usr/share/icons/hicolor/128x128/apps
+assets /usr/share/bloonstd
\ No newline at end of file
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000..b84982d
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+debian/data/bloonstd.man
diff --git a/debian/patches/Fix-build-on-Linux b/debian/patches/Fix-build-on-Linux
new file mode 100644
index 0000000..1286219
--- /dev/null
+++ b/debian/patches/Fix-build-on-Linux
@@ -0,0 +1,40 @@
+Description: Fix build on Linux
+ Change exe name, add SDL2 header and linker flags, remove mingw32 stuff
+Last-Update: 2021-04-05
+
+--- bloonstd-1.0.1.orig/CMakeLists.txt
++++ bloonstd-1.0.1/CMakeLists.txt
+@@ -1,11 +1,15 @@
+ cmake_minimum_required(VERSION 3.14)
+-project(SDL_Game)
++project(bloonstd)
+ set(CMAKE_CXX_STANDARD 17)
+ set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
+ include_directories(include)
+ find_package(Boost REQUIRED COMPONENTS filesystem)
+-include_directories(${Boost_INCLUDE_DIRS})
++find_package(SDL2 REQUIRED)
++include_directories(${Boost_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS})
+ link_directories(lib)
+-link_libraries(mingw32 SDL2main SDL2 SDL2_image SDL2_gfx SDL2_ttf)
+-add_executable(SDL_Game src/SDL_FontCache.c src/SDL_FontCache.h src/main.cpp src/Game.cpp src/Game.h src/Entity.h src/Component.h src/System.h src/systems/RenderSystem.cpp src/systems/RenderSystem.h src/components/Visibility.cpp src/components/Visibility.h src/components/Velocity.cpp src/components/Velocity.h src/systems/MovementSystem.cpp src/systems/MovementSystem.h src/components/Position.h src/components/PathIndex.h src/GameData.h src/components/Sequence.cpp src/components/Sequence.h src/systems/BloonsSpawnSystem.cpp src/systems/BloonsSpawnSystem.h src/GameData.cpp src/components/Action.h src/systems/EventSystem.cpp src/systems/EventSystem.h src/components/Draggable.h src/systems/DraggingSystem.cpp src/systems/DraggingSystem.h src/Settings.h src/systems/RemoveEntitiesSystem.cpp src/systems/RemoveEntitiesSystem.h src/components/MoveEntityEvent.h src/components/RangeShadow.h src/Physics.cpp src/Physics.h src/systems/CollisionSystem.cpp src/systems/CollisionSystem.h src/systems/ShotsSpawnSystem.cpp src/systems/ShotsSpawnSystem.h src/components/IntegerComponents.h src/components/FloatComponents.h src/components/AttackSpeed.h src/components/AttackSpeed.cpp src/components/PoppedBloons.h src/systems/DamageSystem.cpp src/systems/DamageSystem.h src/components/FlagComponents.h src/System.cpp src/Entity.cpp src/components/DamageEvent.h src/systems/MenuSystem.cpp src/systems/MenuSystem.h src/components/Regrow.h src/systems/LoadLevelSystem.cpp src/systems/LoadLevelSystem.h src/components/Goo.h src/components/Upgrades.h src/systems/PopEffectSystem.cpp src/systems/PopEffectSystem.h)
+-target_link_libraries(SDL_Game ${Boost_LIBRARIES})
+\ No newline at end of file
++IF (WIN32)
++ link_libraries(mingw32)
++ENDIF()
++link_libraries(SDL2main SDL2 SDL2_image SDL2_gfx SDL2_ttf)
++add_executable(bloonstd src/SDL_FontCache.c src/SDL_FontCache.h src/main.cpp src/Game.cpp src/Game.h src/Entity.h src/Component.h src/System.h src/systems/RenderSystem.cpp src/systems/RenderSystem.h src/components/Visibility.cpp src/components/Visibility.h src/components/Velocity.cpp src/components/Velocity.h src/systems/MovementSystem.cpp src/systems/MovementSystem.h src/components/Position.h src/components/PathIndex.h src/GameData.h src/components/Sequence.cpp src/components/Sequence.h src/systems/BloonsSpawnSystem.cpp src/systems/BloonsSpawnSystem.h src/GameData.cpp src/components/Action.h src/systems/EventSystem.cpp src/systems/EventSystem.h src/components/Draggable.h src/systems/DraggingSystem.cpp src/systems/DraggingSystem.h src/Settings.h src/systems/RemoveEntitiesSystem.cpp src/systems/RemoveEntitiesSystem.h src/components/MoveEntityEvent.h src/components/RangeShadow.h src/Physics.cpp src/Physics.h src/systems/CollisionSystem.cpp src/systems/CollisionSystem.h src/systems/ShotsSpawnSystem.cpp src/systems/ShotsSpawnSystem.h src/components/IntegerComponents.h src/components/FloatComponents.h src/components/AttackSpeed.h src/components/AttackSpeed.cpp src/components/PoppedBloons.h src/systems/DamageSystem.cpp src/systems/DamageSystem.h src/components/FlagComponents.h src/System.cpp src/Entity.cpp src/components/DamageEvent.h src/systems/MenuSystem.cpp src/systems/MenuSystem.h src/components/Regrow.h src/systems/LoadLevelSystem.cpp src/systems/LoadLevelSystem.h src/components/Goo.h src/components/Upgrades.h src/systems/PopEffectSystem.cpp src/systems/PopEffectSystem.h)
++target_link_libraries(bloonstd ${Boost_LIBRARIES} ${SDL2_LIBRARIES})
+--- bloonstd-1.0.1.orig/src/Game.h
++++ bloonstd-1.0.1/src/Game.h
+@@ -13,7 +13,9 @@
+
+ #include "SDL.h"
+ #include "SDL_image.h"
++#ifdef __MINGW32__
+ #include <comdef.h>
++#endif
+ #include "Entity.h"
+ #include "System.h"
+ #include "systems/RenderSystem.h"
diff --git a/debian/patches/add-install-path-for-bin b/debian/patches/add-install-path-for-bin
new file mode 100644
index 0000000..2d5628b
--- /dev/null
+++ b/debian/patches/add-install-path-for-bin
@@ -0,0 +1,13 @@
+Description: add install path for bin
+ Adds an install target for bloonstd binary
+Last-Update: 2021-04-05
+
+--- bloonstd-1.0.1.orig/CMakeLists.txt
++++ bloonstd-1.0.1/CMakeLists.txt
+@@ -13,3 +13,6 @@ ENDIF()
+ link_libraries(SDL2main SDL2 SDL2_image SDL2_gfx SDL2_ttf)
+ add_executable(bloonstd src/SDL_FontCache.c src/SDL_FontCache.h src/main.cpp src/Game.cpp src/Game.h src/Entity.h src/Component.h src/System.h src/systems/RenderSystem.cpp src/systems/RenderSystem.h src/components/Visibility.cpp src/components/Visibility.h src/components/Velocity.cpp src/components/Velocity.h src/systems/MovementSystem.cpp src/systems/MovementSystem.h src/components/Position.h src/components/PathIndex.h src/GameData.h src/components/Sequence.cpp src/components/Sequence.h src/systems/BloonsSpawnSystem.cpp src/systems/BloonsSpawnSystem.h src/GameData.cpp src/components/Action.h src/systems/EventSystem.cpp src/systems/EventSystem.h src/components/Draggable.h src/systems/DraggingSystem.cpp src/systems/DraggingSystem.h src/Settings.h src/systems/RemoveEntitiesSystem.cpp src/systems/RemoveEntitiesSystem.h src/components/MoveEntityEvent.h src/components/RangeShadow.h src/Physics.cpp src/Physics.h src/systems/CollisionSystem.cpp src/systems/CollisionSystem.h src/systems/ShotsSpawnSystem.cpp src/systems/ShotsSpawnSystem.h src/components/IntegerComponents.h src/components/FloatComponents.h src/components/AttackSpeed.h src/components/AttackSpeed.cpp src/components/PoppedBloons.h src/systems/DamageSystem.cpp src/systems/DamageSystem.h src/components/FlagComponents.h src/System.cpp src/Entity.cpp src/components/DamageEvent.h src/systems/MenuSystem.cpp src/systems/MenuSystem.h src/components/Regrow.h src/systems/LoadLevelSystem.cpp src/systems/LoadLevelSystem.h src/components/Goo.h src/components/Upgrades.h src/systems/PopEffectSystem.cpp src/systems/PopEffectSystem.h)
+ target_link_libraries(bloonstd ${Boost_LIBRARIES} ${SDL2_LIBRARIES})
++if (UNIX)
++ install(TARGETS bloonstd RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/games)
++endif()
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..28ba509
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+Fix-build-on-Linux
+add-install-path-for-bin
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..c26f85e
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,18 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+export DH_VERBOSE = 1
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export DEB_CXXFLAGS_MAINT_APPEND = -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT
+
+%:
+ dh $@ --buildsystem=cmake
+
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+#override_dh_auto_configure:
+# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/include-binaries b/debian/source/include-binaries
new file mode 100644
index 0000000..56ca8a8
--- /dev/null
+++ b/debian/source/include-binaries
@@ -0,0 +1 @@
+debian/data/bloonstd.png
diff --git a/src/Game.h b/src/Game.h
index 61a7953..4b55519 100644
--- a/src/Game.h
+++ b/src/Game.h
@@ -1,58 +1,60 @@
//
// Created by Ido Mozes on 18/06/2019.
//
#ifndef SDL2_GAME_GAME_H
#define SDL2_GAME_GAME_H
#include <iostream>
#include <cmath>
#include <fstream>
#include <memory>
#include <vector>
#include "SDL.h"
#include "SDL_image.h"
+#ifdef __MINGW32__
#include <comdef.h>
+#endif
#include "Entity.h"
#include "System.h"
#include "systems/RenderSystem.h"
#include "systems/MovementSystem.h"
#include "systems/EventSystem.h"
#include "systems/BloonsSpawnSystem.h"
#include "systems/ShotsSpawnSystem.h"
#include "systems/DraggingSystem.h"
#include "systems/RemoveEntitiesSystem.h"
#include "systems/CollisionSystem.h"
#include "systems/DamageSystem.h"
#include "systems/MenuSystem.h"
#include "systems/LoadLevelSystem.h"
#include "systems/PopEffectSystem.h"
#include "GameData.h"
#include "boost/filesystem.hpp"
#include <iostream>
struct TempPoint {
short X;
short Y;
};
class Game {
std::vector<std::unique_ptr<System>> systems;
std::array<Entities, N_LAYERS> layers;
RenderSystem *renderSystem;
public:
GameData gameData;
explicit Game(bool fullscreen, float mapScale = 1.5);
~Game();
void update();
bool running() { return gameData.isRunning; }
void loadMap();
};
#endif //SDL2_GAME_GAME_H

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 11, 2:10 PM (23 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42683
Default Alt Text
(17 KB)

Event Timeline