Skip to content

Commit

Permalink
- add initial flare gamefiles
Browse files Browse the repository at this point in the history
- add offset support to BaseLevelObject
- add support to load part of image
- add support to loading flare animation offsets
- add support to position drawables in top/center/bottom of screen
- BaseAnimation class
- cache images when loading
- don't hide cursor when loading new cursor
- fix glitches with level view when zooming resizing
- fix small bugs
- fix small bugs in menu
- refactor classes that use animations to use BaseAnimation
- refactor Fonts
- refactor items
- refactor level parser to get map size from map if none provided
- refactor PCX decoder
- refactor RectTexturePack
- refactor SimpleIndexedTexturePack to IndexedTexturePack
- refactor texturePack to support setting start index
- refactor texturePacks/level/itemClass/playerClass
- try to parse bitmap button and then text button (if bitmap button fails to parse)
- update gamefiles
- update level draw code
- update parseLevel to handle invalid data better
  • Loading branch information
demo committed Mar 10, 2018
1 parent 5b68007 commit b68b61f
Show file tree
Hide file tree
Showing 248 changed files with 7,915 additions and 2,083 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ set(SOURCE_FILES
src/Anchor.h
src/Animation.cpp
src/Animation.h
src/AnimationType.h
src/AudioSource.h
src/BaseAnimation.cpp
src/BaseAnimation.h
src/BitmapButton.cpp
src/BitmapButton.h
src/BitmapFont.cpp
Expand All @@ -48,7 +51,8 @@ set(SOURCE_FILES
src/FadeInOut.h
src/FileUtils.cpp
src/FileUtils.h
src/Font2.h
src/Font.h
src/FreeTypeFont.h
src/Game.cpp
src/Game.h
src/GameUtils.cpp
Expand Down Expand Up @@ -199,8 +203,6 @@ set(SOURCE_FILES
src/Parser/ParseAudio.h
src/Parser/ParseAudioCommon.cpp
src/Parser/ParseAudioCommon.h
src/Parser/ParseBitmapFont.cpp
src/Parser/ParseBitmapFont.h
src/Parser/ParseButton.cpp
src/Parser/ParseButton.h
src/Parser/ParseCircle.cpp
Expand Down Expand Up @@ -321,10 +323,10 @@ set(SOURCE_FILES
src/rapidjson/msinttypes/stdint.h
src/TexturePacks/CachedTexturePack.cpp
src/TexturePacks/CachedTexturePack.h
src/TexturePacks/IndexedTexturePack.cpp
src/TexturePacks/IndexedTexturePack.h
src/TexturePacks/RectTexturePack.cpp
src/TexturePacks/RectTexturePack.h
src/TexturePacks/SimpleIndexedTexturePack.cpp
src/TexturePacks/SimpleIndexedTexturePack.h
src/TexturePacks/SimpleTexturePack.cpp
src/TexturePacks/SimpleTexturePack.h
src/TexturePacks/TexturePack.cpp
Expand Down
12 changes: 7 additions & 5 deletions DGEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Animation.cpp" />
<ClCompile Include="src\BaseAnimation.cpp" />
<ClCompile Include="src\BitmapButton.cpp" />
<ClCompile Include="src\BitmapFont.cpp" />
<ClCompile Include="src\BitmapText.cpp" />
Expand Down Expand Up @@ -86,7 +87,6 @@
<ClCompile Include="src\Parser\ParseAnimation.cpp" />
<ClCompile Include="src\Parser\ParseAudio.cpp" />
<ClCompile Include="src\Parser\ParseAudioCommon.cpp" />
<ClCompile Include="src\Parser\ParseBitmapFont.cpp" />
<ClCompile Include="src\Parser\ParseButton.cpp" />
<ClCompile Include="src\Parser\ParseCircle.cpp" />
<ClCompile Include="src\Parser\ParseCondition.cpp" />
Expand Down Expand Up @@ -141,8 +141,8 @@
<ClCompile Include="src\StringText.cpp" />
<ClCompile Include="src\Text2.cpp" />
<ClCompile Include="src\TexturePacks\CachedTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\IndexedTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\RectTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\SimpleIndexedTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\SimpleTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\TexturePack.cpp" />
<ClCompile Include="src\TexturePacks\VectorTexturePack.cpp" />
Expand Down Expand Up @@ -186,11 +186,15 @@
<ClInclude Include="src\Alignment.h" />
<ClInclude Include="src\Anchor.h" />
<ClInclude Include="src\Animation.h" />
<ClInclude Include="src\AnimationType.h" />
<ClInclude Include="src\AudioSource.h" />
<ClInclude Include="src\BaseAnimation.h" />
<ClInclude Include="src\CachedImagePack.h" />
<ClInclude Include="src\Circle.h" />
<ClInclude Include="src\FadeInOut.h" />
<ClInclude Include="src\FileUtils.h" />
<ClInclude Include="src\Font.h" />
<ClInclude Include="src\FreeTypeFont.h" />
<ClInclude Include="src\GameUtils.h" />
<ClInclude Include="src\Game\BaseClass.h" />
<ClInclude Include="src\Game\BaseLevelObject.h" />
Expand Down Expand Up @@ -242,7 +246,6 @@
<ClInclude Include="src\Parser\ParseAnimation.h" />
<ClInclude Include="src\Parser\ParseAudio.h" />
<ClInclude Include="src\Parser\ParseAudioCommon.h" />
<ClInclude Include="src\Parser\ParseBitmapFont.h" />
<ClInclude Include="src\Parser\ParseButton.h" />
<ClInclude Include="src\Parser\ParseCircle.h" />
<ClInclude Include="src\Parser\ParseCondition.h" />
Expand Down Expand Up @@ -301,7 +304,6 @@
<ClInclude Include="src\Dun.h" />
<ClInclude Include="src\Event.h" />
<ClInclude Include="src\EventManager.h" />
<ClInclude Include="src\Font2.h" />
<ClInclude Include="src\Game.h" />
<ClInclude Include="src\LoadingScreen.h" />
<ClInclude Include="src\Menu.h" />
Expand All @@ -320,8 +322,8 @@
<ClInclude Include="src\StringText.h" />
<ClInclude Include="src\Text2.h" />
<ClInclude Include="src\TexturePacks\CachedTexturePack.h" />
<ClInclude Include="src\TexturePacks\IndexedTexturePack.h" />
<ClInclude Include="src\TexturePacks\RectTexturePack.h" />
<ClInclude Include="src\TexturePacks\SimpleIndexedTexturePack.h" />
<ClInclude Include="src\TexturePacks\SimpleTexturePack.h" />
<ClInclude Include="src\TexturePacks\TexturePack.h" />
<ClInclude Include="src\TexturePacks\VectorTexturePack.h" />
Expand Down
12 changes: 7 additions & 5 deletions android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ LOCAL_SRC_FILES += Alignment.h
LOCAL_SRC_FILES += Anchor.h
LOCAL_SRC_FILES += Animation.cpp
LOCAL_SRC_FILES += Animation.h
LOCAL_SRC_FILES += AnimationType.h
LOCAL_SRC_FILES += AudioSource.h
LOCAL_SRC_FILES += BaseAnimation.cpp
LOCAL_SRC_FILES += BaseAnimation.h
LOCAL_SRC_FILES += BitmapButton.cpp
LOCAL_SRC_FILES += BitmapButton.h
LOCAL_SRC_FILES += BitmapFont.cpp
Expand All @@ -34,7 +37,8 @@ LOCAL_SRC_FILES += FadeInOut.cpp
LOCAL_SRC_FILES += FadeInOut.h
LOCAL_SRC_FILES += FileUtils.cpp
LOCAL_SRC_FILES += FileUtils.h
LOCAL_SRC_FILES += Font2.h
LOCAL_SRC_FILES += Font.h
LOCAL_SRC_FILES += FreeTypeFont.h
LOCAL_SRC_FILES += Game.cpp
LOCAL_SRC_FILES += Game.h
LOCAL_SRC_FILES += GameUtils.cpp
Expand Down Expand Up @@ -185,8 +189,6 @@ LOCAL_SRC_FILES += Parser/ParseAudio.cpp
LOCAL_SRC_FILES += Parser/ParseAudio.h
LOCAL_SRC_FILES += Parser/ParseAudioCommon.cpp
LOCAL_SRC_FILES += Parser/ParseAudioCommon.h
LOCAL_SRC_FILES += Parser/ParseBitmapFont.cpp
LOCAL_SRC_FILES += Parser/ParseBitmapFont.h
LOCAL_SRC_FILES += Parser/ParseButton.cpp
LOCAL_SRC_FILES += Parser/ParseButton.h
LOCAL_SRC_FILES += Parser/ParseCircle.cpp
Expand Down Expand Up @@ -307,10 +309,10 @@ LOCAL_SRC_FILES += rapidjson/msinttypes/inttypes.h
LOCAL_SRC_FILES += rapidjson/msinttypes/stdint.h
LOCAL_SRC_FILES += TexturePacks/CachedTexturePack.cpp
LOCAL_SRC_FILES += TexturePacks/CachedTexturePack.h
LOCAL_SRC_FILES += TexturePacks/IndexedTexturePack.cpp
LOCAL_SRC_FILES += TexturePacks/IndexedTexturePack.h
LOCAL_SRC_FILES += TexturePacks/RectTexturePack.cpp
LOCAL_SRC_FILES += TexturePacks/RectTexturePack.h
LOCAL_SRC_FILES += TexturePacks/SimpleIndexedTexturePack.cpp
LOCAL_SRC_FILES += TexturePacks/SimpleIndexedTexturePack.h
LOCAL_SRC_FILES += TexturePacks/SimpleTexturePack.cpp
LOCAL_SRC_FILES += TexturePacks/SimpleTexturePack.h
LOCAL_SRC_FILES += TexturePacks/TexturePack.cpp
Expand Down
16 changes: 4 additions & 12 deletions gamefilesd/level/item/amulets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,29 @@
"itemClass": [
{
"id": "amulet",
"replaceVars": true,
"dropTexturePack": "itemDrop",
"dropTextureIndex": 35,
"fromId": "baseItem",
"dropTexturePack": "ring",
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 56,
"name": "Amulet",
"shortName": "Amulet",
"type": "Amulet",
"defaultOutline": "%outlineItem%",
"defaultOutlineIgnore": "0x000000",
"defaults": {
"price": 1200,
"identified": false,
"magical": true,
"durability": "max",
"durabilityMax": "max"
},
"formulas": {
"sell": "price * 0.25"
},
"descriptions": [
{ "index": 0, "name": "indestructible" },
{ "index": 1, "name": "magic" },
{ "index": 2, "name": "magic", "skip": 1 },
{ "index": 3, "name": "noAttributes" }
],
"inventorySize": [1, 1],
"actions": {
"action": "pickItemInLevel",
"levelDrop": { "name": "sound.play", "id": "flipring" },
"inventoryDrop": { "name": "sound.play", "id": "invring" },
"inventoryPick": "pickItemInInventory"
"inventoryDrop": { "name": "sound.play", "id": "invring" }
},
"prefix": "jewelleryPrefixes",
"suffix": "jewellerySuffixes"
Expand Down
60 changes: 6 additions & 54 deletions gamefilesd/level/item/armors.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{
"id": "rags",
"fromId": "baseArmor",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"dropTexturePack": "larmor",
"inventoryTextureIndex": 139,
"name": "Rags",
"shortName": "Rags",
Expand All @@ -21,9 +19,6 @@
{
"id": "cape",
"fromId": "rags",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 161,
"name": "Cape",
"shortName": "Cape",
Expand All @@ -37,9 +32,6 @@
{
"id": "cloak",
"fromId": "rags",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 160,
"name": "Cloak",
"shortName": "Cloak",
Expand All @@ -53,9 +45,6 @@
{
"id": "robe",
"fromId": "rags",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 148,
"name": "Robe",
"shortName": "Robe",
Expand All @@ -69,9 +58,6 @@
{
"id": "quiltedArmor",
"fromId": "rags",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 140,
"name": "Quilted Armor",
"shortName": "Armor",
Expand All @@ -86,9 +72,6 @@
{
"id": "leatherArmor",
"fromId": "quiltedArmor",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 146,
"name": "Leather Armor",
"defaults": {
Expand All @@ -101,9 +84,6 @@
{
"id": "hardLeatherArmor",
"fromId": "quiltedArmor",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 138,
"name": "Hard Leather Armor",
"defaults": {
Expand All @@ -116,9 +96,6 @@
{
"id": "studdedLeatherArmor",
"fromId": "quiltedArmor",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 32,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 118,
"name": "Studded Leather Armor",
"defaults": {
Expand All @@ -132,10 +109,8 @@
{
"id": "ringMail",
"fromId": "quiltedArmor",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": {1},
"dropTexturePack": "FPlateAr",
"inventoryTextureIndex": 165,
"name": "Ring Mail",
"shortName": "Mail",
"subType": "Plate",
Expand All @@ -154,9 +129,6 @@
{
"id": "chainMail",
"fromId": "ringMail",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 122,
"name": "Chain Mail",
"defaults": {
Expand All @@ -170,9 +142,6 @@
{
"id": "scaleMail",
"fromId": "ringMail",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 125,
"name": "Scale Mail",
"defaults": {
Expand All @@ -186,9 +155,6 @@
{
"id": "breastPlate",
"fromId": "ringMail",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 164,
"name": "Breast Plate",
"shortName": "Plate",
Expand All @@ -203,9 +169,6 @@
{
"id": "splintMail",
"fromId": "ringMail",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 147,
"name": "Splint Mail",
"defaults": {
Expand All @@ -219,9 +182,6 @@
{
"id": "fieldPlate",
"fromId": "breastPlate",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 114,
"name": "Field Plate",
"defaults": {
Expand All @@ -235,10 +195,7 @@
{
"id": "gothicPlate",
"fromId": "breastPlate",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": {2},
"inventoryTextureIndex": 163,
"name": "Gothic Plate",
"defaults": {
"price": 8000,
Expand All @@ -251,9 +208,6 @@
{
"id": "fullPlateMail",
"fromId": "breastPlate",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 28,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": 162,
"name": "Full Plate Mail",
"defaults": {
Expand All @@ -267,10 +221,8 @@
{
"id": "valorArmor",
"fromId": "ringMail",
"dropTexturePack": "itemDrop",
"dropTextureIndex": 0,
"inventoryTexturePack": "itemIcons",
"inventoryTextureIndex": {3},
"dropTexturePack": "armor2",
"inventoryTextureIndex": 168,
"name": "Arkaine's Valor",
"shortName": "Arkaine's Valor",
"descriptions": [
Expand Down

0 comments on commit b68b61f

Please sign in to comment.