Skip to content

Commit

Permalink
- refactor CompositeTexture as a TexturePack
Browse files Browse the repository at this point in the history
- add Vector2D and refactor Dun to use it
  • Loading branch information
dgengin committed Jan 8, 2021
1 parent c34aee0 commit da93575
Show file tree
Hide file tree
Showing 56 changed files with 650 additions and 836 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ set(SOURCE_FILES
src/Circle.h
src/CmdLineUtils.cpp
src/CmdLineUtils.h
src/CompositeTexture.cpp
src/CompositeTexture.h
src/DrawableText.h
src/Dun.cpp
src/Dun.h
Expand Down Expand Up @@ -254,8 +252,6 @@ set(SOURCE_FILES
src/Parser/ParseButton.h
src/Parser/ParseCircle.cpp
src/Parser/ParseCircle.h
src/Parser/ParseCompositeTexture.cpp
src/Parser/ParseCompositeTexture.h
src/Parser/ParseCondition.cpp
src/Parser/ParseCondition.h
src/Parser/ParseCursor.cpp
Expand Down Expand Up @@ -384,6 +380,8 @@ set(SOURCE_FILES
src/TexturePacks/BitmapFontTexturePack.h
src/TexturePacks/CachedTexturePack.cpp
src/TexturePacks/CachedTexturePack.h
src/TexturePacks/CompositeTexturePack.cpp
src/TexturePacks/CompositeTexturePack.h
src/TexturePacks/IndexedTexturePack.cpp
src/TexturePacks/IndexedTexturePack.h
src/TexturePacks/RectTexturePack.cpp
Expand All @@ -409,6 +407,7 @@ set(SOURCE_FILES
src/Utils/UnorderedStringMap.h
src/Utils/Utils.cpp
src/Utils/Utils.h
src/Utils/Vector2D.h
)

if(FFmpeg_FOUND)
Expand Down
7 changes: 3 additions & 4 deletions Project.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
<ClCompile Include="src\CachedImagePack.cpp" />
<ClCompile Include="src\Circle.cpp" />
<ClCompile Include="src\CmdLineUtils.cpp" />
<ClCompile Include="src\CompositeTexture.cpp" />
<ClCompile Include="src\DS1.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug NoDiabloFormatSupport'">true</ExcludedFromBuild>
</ClCompile>
Expand Down Expand Up @@ -174,7 +173,6 @@
<ClCompile Include="src\Parser\ParseAudioCommon.cpp" />
<ClCompile Include="src\Parser\ParseButton.cpp" />
<ClCompile Include="src\Parser\ParseCircle.cpp" />
<ClCompile Include="src\Parser\ParseCompositeTexture.cpp" />
<ClCompile Include="src\Parser\ParseCondition.cpp" />
<ClCompile Include="src\Parser\ParseCursor.cpp" />
<ClCompile Include="src\Parser\ParseEvent.cpp" />
Expand Down Expand Up @@ -270,6 +268,7 @@
<ClCompile Include="src\Text.cpp" />
<ClCompile Include="src\TexturePacks\BitmapFontTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\CachedTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\CompositeTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\IndexedTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\RectTexturePack.cpp" />
<ClCompile Include="src\TexturePacks\SimpleTexturePack.cpp" />
Expand Down Expand Up @@ -330,7 +329,6 @@
<ClInclude Include="src\CachedImagePack.h" />
<ClInclude Include="src\Circle.h" />
<ClInclude Include="src\CmdLineUtils.h" />
<ClInclude Include="src\CompositeTexture.h" />
<ClInclude Include="src\DS1.h">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug NoDiabloFormatSupport'">true</ExcludedFromBuild>
</ClInclude>
Expand Down Expand Up @@ -429,7 +427,6 @@
<ClInclude Include="src\Parser\ParseAudioCommon.h" />
<ClInclude Include="src\Parser\ParseButton.h" />
<ClInclude Include="src\Parser\ParseCircle.h" />
<ClInclude Include="src\Parser\ParseCompositeTexture.h" />
<ClInclude Include="src\Parser\ParseCondition.h" />
<ClInclude Include="src\Parser\ParseCursor.h" />
<ClInclude Include="src\Parser\ParseEvent.h" />
Expand Down Expand Up @@ -562,6 +559,7 @@
<ClInclude Include="src\TextureInfo.h" />
<ClInclude Include="src\TexturePacks\BitmapFontTexturePack.h" />
<ClInclude Include="src\TexturePacks\CachedTexturePack.h" />
<ClInclude Include="src\TexturePacks\CompositeTexturePack.h" />
<ClInclude Include="src\TexturePacks\IndexedTexturePack.h" />
<ClInclude Include="src\TexturePacks\RectTexturePack.h" />
<ClInclude Include="src\TexturePacks\SimpleTexturePack.h" />
Expand All @@ -584,6 +582,7 @@
<ClInclude Include="src\Utils\ReverseIterable.h" />
<ClInclude Include="src\Utils\UnorderedStringMap.h" />
<ClInclude Include="src\Utils\Utils.h" />
<ClInclude Include="src\Utils\Vector2D.h" />
<ClInclude Include="src\Variable.h" />
<ClInclude Include="src\VarOrPredicate.h" />
</ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions gamefilesd/res/fonts.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"texturePack": [
{
"id": "font16g",
"font": true,
"type": "font",
"texture": "font16g",
"charSizeFile": "ui_art/font16.bin",
"rows": 16,
Expand All @@ -69,7 +69,7 @@
},
{
"id": "font16s",
"font": true,
"type": "font",
"texture": "font16s",
"charSizeFile": "ui_art/font16.bin",
"rows": 16,
Expand All @@ -78,7 +78,7 @@
},
{
"id": "font24g",
"font": true,
"type": "font",
"texture": "font24g",
"charSizeFile": "ui_art/font24.bin",
"rows": 16,
Expand All @@ -87,7 +87,7 @@
},
{
"id": "font24s",
"font": true,
"type": "font",
"texture": "font24s",
"charSizeFile": "ui_art/font24.bin",
"rows": 16,
Expand All @@ -96,7 +96,7 @@
},
{
"id": "font30g",
"font": true,
"type": "font",
"texture": "font30g",
"charSizeFile": "ui_art/font30.bin",
"rows": 16,
Expand All @@ -105,7 +105,7 @@
},
{
"id": "font30s",
"font": true,
"type": "font",
"texture": "font30s",
"charSizeFile": "ui_art/font30.bin",
"rows": 16,
Expand All @@ -114,7 +114,7 @@
},
{
"id": "font42g",
"font": true,
"type": "font",
"texture": "font42g",
"charSizeFile": "ui_art/font42.bin",
"rows": 16,
Expand All @@ -123,7 +123,7 @@
},
{
"id": "font42y",
"font": true,
"type": "font",
"texture": "font42y",
"charSizeFile": "ui_art/font42.bin",
"rows": 16,
Expand Down
6 changes: 3 additions & 3 deletions gamefilesd/res/level/fonts.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
"texturePack": [
{
"id": "smaltext",
"font": true,
"type": "font",
"texture": "smaltext",
"palette": "town",
"charSizeFile": "res/level/smaltextSize.bin"
},
{
"id": "medtexts",
"font": true,
"type": "font",
"texture": "medtexts",
"palette": "town",
"charSizeFile": "res/level/medtextsSize.bin"
},
{
"id": "bigtgold",
"font": true,
"type": "font",
"texture": "bigtgold",
"palette": "town",
"charSizeFile": "res/level/bigtgoldSize.bin"
Expand Down
20 changes: 10 additions & 10 deletions gamefilesd2/level/map/town/playerTextureFiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@
"id": "wmnn",
"imageContainer": "wmnn",
"palette": "town"
},
{
"id": "strytell",
"file": "data/global/monsters/MP/cof/MPNUHTH.COF",
"texturePacks": [
"MPTRLITNUHTH",
"MPLALITNUHTH",
"MPRALITNUHTH"
]
}
],
"compositeTexture": {
"id": "strytell",
"file": "data/global/monsters/MP/cof/MPNUHTH.COF",
"texturePacks": [
"MPTRLITNUHTH",
"MPLALITNUHTH",
"MPRALITNUHTH"
]
}
]
}
3 changes: 2 additions & 1 deletion gamefilesd2/level/player/Amazon/textures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"load": "level/player/Amazon/textureFiles.json",
"compositeTexture": [
"texturePack": [
{
"id": "amazonNormal",
"type": "composite",
"groups": [
{
"file": "data/global/CHARS/AM/COF/amnuhth.cof",
Expand Down
3 changes: 2 additions & 1 deletion gamefilesd2/level/player/Barbarian/textures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"load": "level/player/Barbarian/textureFiles.json",
"compositeTexture": [
"texturePack": [
{
"id": "barbarianNormal",
"type": "composite",
"groups": [
{
"file": "data/global/CHARS/BA/COF/BANUHTH.COF",
Expand Down
3 changes: 2 additions & 1 deletion gamefilesd2/level/player/Necromancer/textures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"load": "level/player/Necromancer/textureFiles.json",
"compositeTexture": [
"texturePack": [
{
"id": "necromancerNormal",
"type": "composite",
"groups": [
{
"file": "data/global/CHARS/NE/COF/NENUHTH.COF",
Expand Down
3 changes: 2 additions & 1 deletion gamefilesd2/level/player/Paladin/textures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"load": "level/player/Paladin/textureFiles.json",
"compositeTexture": [
"texturePack": [
{
"id": "paladinNormal",
"type": "composite",
"groups": [
{
"file": "data/global/CHARS/PA/COF/PANUHTH.COF",
Expand Down
3 changes: 2 additions & 1 deletion gamefilesd2/level/player/Sorceress/textures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"load": "level/player/Sorceress/textureFiles.json",
"compositeTexture": [
"texturePack": [
{
"id": "sorceressNormal",
"type": "composite",
"groups": [
{
"file": "data/global/CHARS/SO/COF/SONUHTH.COF",
Expand Down
28 changes: 14 additions & 14 deletions gamefilesd2/res/fonts.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"texturePack": [
{
"id": "font6",
"font": true,
"type": "font",
"texture": "font6",
"charSizeFile": "data/local/font/LATIN/font6.tbl",
"charSizeFileStart": 15,
Expand All @@ -112,7 +112,7 @@
},
{
"id": "font8",
"font": true,
"type": "font",
"texture": "font8",
"charSizeFile": "data/local/font/LATIN/font8.tbl",
"charSizeFileStart": 15,
Expand All @@ -122,7 +122,7 @@
},
{
"id": "font16",
"font": true,
"type": "font",
"texture": "font16",
"charSizeFile": "data/local/font/LATIN/font16.tbl",
"charSizeFileStart": 15,
Expand All @@ -132,7 +132,7 @@
},
{
"id": "font24",
"font": true,
"type": "font",
"texture": "font24",
"charSizeFile": "data/local/font/LATIN/font24.tbl",
"charSizeFileStart": 15,
Expand All @@ -142,7 +142,7 @@
},
{
"id": "font30",
"font": true,
"type": "font",
"texture": "font30",
"charSizeFile": "data/local/font/LATIN/font30.tbl",
"charSizeFileStart": 15,
Expand All @@ -152,7 +152,7 @@
},
{
"id": "font42",
"font": true,
"type": "font",
"texture": "font42",
"charSizeFile": "data/local/font/LATIN/font42.tbl",
"charSizeFileStart": 15,
Expand All @@ -162,7 +162,7 @@
},
{
"id": "fontexocet8",
"font": true,
"type": "font",
"texture": "fontexocet8",
"charSizeFile": "data/local/font/LATIN/fontexocet8.tbl",
"charSizeFileStart": 15,
Expand All @@ -172,7 +172,7 @@
},
{
"id": "fontexocet10",
"font": true,
"type": "font",
"texture": "fontexocet10",
"charSizeFile": "data/local/font/LATIN/fontexocet10.tbl",
"charSizeFileStart": 15,
Expand All @@ -182,7 +182,7 @@
},
{
"id": "fontformal10",
"font": true,
"type": "font",
"texture": "fontformal10",
"charSizeFile": "data/local/font/LATIN/fontformal10.tbl",
"charSizeFileStart": 15,
Expand All @@ -192,7 +192,7 @@
},
{
"id": "fontformal11",
"font": true,
"type": "font",
"texture": "fontformal11",
"charSizeFile": "data/local/font/LATIN/fontformal11.tbl",
"charSizeFileStart": 15,
Expand All @@ -202,7 +202,7 @@
},
{
"id": "fontformal12",
"font": true,
"type": "font",
"texture": "fontformal12",
"charSizeFile": "data/local/font/LATIN/fontformal12.tbl",
"charSizeFileStart": 15,
Expand All @@ -212,7 +212,7 @@
},
{
"id": "fontingamechat",
"font": true,
"type": "font",
"texture": "fontingamechat",
"charSizeFile": "data/local/font/LATIN/fontingamechat.tbl",
"charSizeFileStart": 15,
Expand All @@ -222,7 +222,7 @@
},
{
"id": "fontridiculous",
"font": true,
"type": "font",
"texture": "fontridiculous",
"charSizeFile": "data/local/font/LATIN/fontridiculous.tbl",
"charSizeFileStart": 15,
Expand All @@ -232,7 +232,7 @@
},
{
"id": "ReallyTheLastSucker",
"font": true,
"type": "font",
"texture": "ReallyTheLastSucker",
"charSizeFile": "data/local/font/LATIN/ReallyTheLastSucker.tbl",
"charSizeFileStart": 15,
Expand Down
Loading

0 comments on commit da93575

Please sign in to comment.