Compare commits

...

248 commits
v0.1 ... master

Author SHA1 Message Date
mibi88
b5759bd95d Merge remote-tracking branch 'origin/dev' 2024-08-01 11:02:17 +02:00
attilavs2
6c47d5d83c Revert "git : Ajout de level*.json au gitignore"
This reverts commit 7eaea821b6.
2024-08-01 00:11:48 +02:00
attilavs2
3f03c37bd2 clang-format sur src/* (+ hook clang-format ?) 2024-08-01 00:01:34 +02:00
attilavs2
7eaea821b6 git : Ajout de level*.json au gitignore 2024-07-31 23:53:21 +02:00
mibi88
40bfea66aa Merge pull request 'Add portal support' (#61) from portals into dev
Reviewed-on: https://git.planet-casio.com/Slyvtt/Collab_RPG/pulls/61
2024-07-31 22:22:26 +02:00
mibi88
a3d0ca40c1 Added portal support 2024-07-31 22:21:34 +02:00
mibi88
48f1f44b5b Converting portals. Not tested yet. 2024-07-31 21:57:37 +02:00
mibi88
d34398f9b9 Added back Fcalva's new assets 2024-07-31 20:30:15 +02:00
mibi88
2692b928c3 Fixed submodule 2024-07-31 20:16:44 +02:00
mibi88
0e46c490ae Restore everything... 2024-07-31 20:10:45 +02:00
mibi88
6b1289f46d revert 159e65a1c8
revert revert 84f85e1905

revert Merge branch 'new_converter' into dev
2024-07-31 19:52:25 +02:00
mibi88
159e65a1c8 revert 84f85e1905
revert Merge branch 'new_converter' into dev
2024-07-31 19:38:33 +02:00
mibi88
8758202431 Merge branch 'dev' of git.planet-casio.com:Slyvtt/Collab_RPG into dev 2024-07-31 19:35:02 +02:00
mibi88
84f85e1905 Merge branch 'new_converter' into dev 2024-07-31 19:21:32 +02:00
mibi88
a1811da9f1 Added some comments. 2024-07-31 18:53:46 +02:00
mibi88
e801bb5632 Moved tiled lib to a separate repository 2024-07-31 18:44:02 +02:00
attilavs2
b46545b562 Unlock level0 and restore visibility of layers 2024-07-31 18:32:49 +02:00
attilavs2
766c222320 Improve tileset, polish maps 2024-07-31 18:30:15 +02:00
mibi88
5d4a862620 Running clang-format 2024-07-31 17:27:23 +02:00
mibi88
3dbf00f53d Bug fixes 2024-07-31 17:26:08 +02:00
mibi88
bbf366ed6e Running clang-format 2024-07-31 17:12:12 +02:00
mibi88
3dd4b6466a Map change working 2024-07-31 17:11:29 +02:00
mibi88
aa448c4dc6 Smoother NPC movement 2024-07-31 14:46:39 +02:00
mibi88
490fceca25 Running clang-format 2024-07-31 14:39:09 +02:00
mibi88
6cfe0ab687 Got NPCs working again! 2024-07-31 14:38:29 +02:00
mibi88
6ab37ee4fb NPCs nearly working 2024-07-31 14:12:55 +02:00
mibi88
dfb61f18fe Started adding NPCs back to the game 2024-07-31 13:53:47 +02:00
mibi88
da63b8ce06 Added sign support back 2024-07-31 12:54:40 +02:00
mibi88
563ed47753 Moved parts of the converter to another file 2024-07-31 12:06:00 +02:00
mibi88
ea50bed171 Running clang-format 2024-07-30 22:47:40 +02:00
mibi88
91e0e4b74d Adding back dialog support. Not tested yet, because NPCs are not added back yet. 2024-07-30 22:37:04 +02:00
mibi88
efde68f9c7 Got map rendering back working 2024-07-30 20:15:39 +02:00
mibi88
537e4d5e96 Run clang format 2024-07-30 18:21:22 +02:00
mibi88
2202ec6d38 Merge dev into new_converter 2024-07-30 18:19:49 +02:00
attilavs2
1daa58723c Optimisation du rendu 2024-07-30 17:49:40 +02:00
mibi88
bc8382ac65 Started writing a new converter 2024-07-30 17:44:12 +02:00
mibi88
5eb1d18ea7 Small improvement 2024-07-29 21:08:55 +02:00
mibi88
2ca939430d Better .clang-format (maybe I added some useless things: I don't know what the LLVM style sets the settings to) 2024-07-29 21:04:23 +02:00
mibi88
84d83d85c0 Update styles 2024-07-29 11:39:58 +02:00
mibi88
dafe7032f3 Using clang-format 2024-07-29 11:36:11 +02:00
attilavs2
a06977469c Remove debug hint breaking everything 2024-07-29 10:59:58 +02:00
attilavs2
9efb47c3b6 Revert "Continue debugging of converters.py"
This reverts commit 499856e38c.
2024-07-28 23:20:19 +02:00
attilavs2
499856e38c Continue debugging of converters.py 2024-07-28 23:19:44 +02:00
attilavs2
522f6d25a8 Remove silly goofy string breaking everything 2024-07-28 23:08:56 +02:00
attilavs2
f29fbf73de Add gdb support if DEBUGMODE is enabled 2024-07-28 22:08:32 +02:00
mibi88
eb6cd35830 Small fix. 2024-07-28 22:06:54 +02:00
mibi88
18ee9bcffe Updated styles. 2024-07-28 22:05:49 +02:00
attilavs2
32764e675a Alignement entre converters.py et game.h 2024-07-28 22:03:11 +02:00
attilavs2
82a519659d Debug de ExtraData 2.0 2024-07-28 21:04:26 +02:00
mibi88
cac86e35ff Added level4 to the game 2024-07-28 16:20:04 +02:00
mibi88
da7ed0df0c level4 2024-07-28 15:45:00 +02:00
mibi88
36f397997c Création d'un village abandonné avec des lieux de culte entre autre (voir scénario) 2024-07-28 14:36:12 +02:00
mibi88
29dc53b94a Started adding tilesets for the inside of the houses 2024-07-28 13:32:24 +02:00
attilavs2
dae4bd8a55 Revert "Revert "Première compilation refactoring ExtraData""
This reverts commit 35a7a5f923.
2024-07-28 12:40:39 +02:00
attilavs2
35a7a5f923 Revert "Première compilation refactoring ExtraData"
This reverts commit 5bdee9b5af.
2024-07-28 12:38:18 +02:00
attilavs2
5bdee9b5af Première compilation refactoring ExtraData 2024-07-28 12:35:23 +02:00
mibi88
7c432286ae Merge pull request 'Fixed 1b version, using fxg3a for the 1bpp and 2bpp modes on cg' (#56) from graphics into dev
Reviewed-on: https://git.planet-casio.com/Slyvtt/Collab_RPG/pulls/56
2024-07-27 18:47:01 +02:00
mibi88
d4e9aa8d80 Merge branch 'dev' into graphics 2024-07-27 18:46:38 +02:00
mibi88
f6ac4963b8 Fixed 1b version, using fxg3a for the 1bpp and 2bpp modes on cg 2024-07-27 18:44:29 +02:00
mibi88
e1df10b54c Merge pull request 'Better graphics' (#55) from graphics into dev
Reviewed-on: https://git.planet-casio.com/Slyvtt/Collab_RPG/pulls/55
2024-07-27 17:40:03 +02:00
mibi88
3f38bf4ac2 Very simple player selection 2024-07-27 17:38:58 +02:00
mibi88
587e8e872d Small improvements 2024-07-27 17:28:19 +02:00
mibi88
8ef79972c8 Use the right tiny npc 2024-07-27 17:20:06 +02:00
mibi88
d100d0c160 Merge branch 'dev' of git.planet-casio.com:Slyvtt/Collab_RPG into graphics 2024-07-27 16:55:00 +02:00
mibi88
09839a707d Better characters 2024-07-27 16:51:47 +02:00
mibi88
903755f010 Merge pull request 'Merge npc' (#54) from npc into dev
Reviewed-on: https://git.planet-casio.com/Slyvtt/Collab_RPG/pulls/54
2024-07-27 15:32:20 +02:00
mibi88
04480f2c2c Merge branch 'dev' of git.planet-casio.com:Slyvtt/Collab_RPG into npc 2024-07-27 15:31:11 +02:00
mibi88
74d30dc575 Revert "Merge branch 'dev' of git.planet-casio.com:Slyvtt/Collab_RPG"
This reverts commit 685e4b8824, reversing
changes made to 9929e7bb08.
2024-07-27 15:26:55 +02:00
mibi88
5c58e11fea Revert "Fixes"
This reverts commit 47cd6dc351.
2024-07-27 15:26:31 +02:00
mibi88
47cd6dc351 Fixes 2024-07-27 15:20:02 +02:00
mibi88
685e4b8824 Merge branch 'dev' of git.planet-casio.com:Slyvtt/Collab_RPG 2024-07-27 15:13:18 +02:00
attilavs2
21a5659d58 Continue working on pathfinding 2024-07-27 14:02:04 +02:00
mibi88
05199df22a Removed auto scaling to allow for more detail in the graphics. 2024-07-27 13:55:08 +02:00
mibi88
0919808be6 Police and milkman faces with EGA palette 2024-07-27 13:20:11 +02:00
mibi88
ca2e9c1ae9 Better male and female faces with EGA color palette 2024-07-27 12:59:44 +02:00
mibi88
fc39bc8902 Improved NPC female. 2024-07-27 12:25:42 +02:00
mibi88
37af5081e9 Improving graphics on cg using an EGA64 palette. 2024-07-27 00:33:31 +02:00
mibi88
badf915358 Better EGA tileset + fixed the guardian's house 2024-07-26 18:16:05 +02:00
mibi88
1e367b0aff Better female NPC 2024-07-26 17:09:11 +02:00
mibi88
1daba61188 NPC face property 2024-07-26 17:01:51 +02:00
mibi88
3b2fc58c57 More faces :) + reduced map converter logs. 2024-07-25 19:08:23 +02:00
mibi88
f91fd572ac Bug fix 2024-07-25 17:20:52 +02:00
mibi88
5a5fe87490 Better graphics :) 2024-07-25 17:03:34 +02:00
mibi88
2547f82238 Bug fixes 2024-07-25 13:20:56 +02:00
mibi88
25ea360713 Refactoring 2024-07-25 13:07:19 +02:00
mibi88
f6d142c920 Started refactoring. 2024-07-24 21:43:21 +02:00
mibi88
c755be82dd Remove useless warnings. 2024-07-24 19:00:30 +02:00
mibi88
b98545a28f Merge pull request 'Gestion des événements.' (#46) from events into dev
Reviewed-on: https://git.planet-casio.com/Slyvtt/Collab_RPG/pulls/46
2024-07-24 18:58:12 +02:00
mibi88
83200852d9 Bug fix! 2024-07-24 18:56:53 +02:00
mibi88
12eba00f62 Merge branch 'dev' of git.planet-casio.com:Slyvtt/Collab_RPG into events 2024-07-24 15:38:06 +02:00
mibi88
9929e7bb08 Revert "Merge pull request 'Gestion des événements.' (#41) from events into master"
This reverts commit 841d9621a0, reversing
changes made to 3ddb6d60bc.
2024-07-24 15:32:52 +02:00
attilavs2
52da4be1af npc : correction de warnings 2024-07-23 18:17:02 +02:00
attilavs2
49303ba6ad npc : ajout des déclarations des nouvelles fonctions, typo 2024-07-23 18:06:42 +02:00
attilavs2
b5a5ae2a5a Fix : Fuite de mémoire 2024-07-23 17:57:22 +02:00
attilavs2
c0d0c23ef9 npc_pathfind complété*
*Testé avec un nombre limité de cas
2024-07-23 17:54:22 +02:00
attilavs2
6de033d259 Début de débbugage de npc_pathfind 2024-07-21 12:26:41 +02:00
attilavs2
e7ada9d3da Pathfinding NPC complet (a tester) 2024-07-21 11:50:12 +02:00
attilavs2
96f413eb14 Début de pathfinding pour les NPCs 2024-07-21 02:42:50 +02:00
mibi88
841d9621a0 Merge pull request 'Gestion des événements.' (#41) from events into master
Reviewed-on: https://git.planet-casio.com/Slyvtt/Collab_RPG/pulls/41
2024-07-20 17:52:45 +02:00
mibi88
15570a8d91 Fully working dialogs 2024-07-20 17:44:44 +02:00
mibi88
7a34fefad5 Started adding support for events. 2024-07-20 16:53:13 +02:00
Sylvain PILLOT
6b333303ec Added FXG3A build targets with dully corrected code [dev] 2024-03-27 10:44:15 +01:00
Sylvain PILLOT
66a24edb44 added target to let build fx9860g_fxascg 2024-03-26 21:19:52 +01:00
3ddb6d60bc Ajout du design document au repo pour les nouveaux contributeurs 2023-12-05 20:37:47 +01:00
Fcalva
8309b67ac6 Merge pull request 'Sync PR' (#3) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/3
2023-12-05 20:33:23 +01:00
SlyVTT
f6b8b792fd finished solving all the last warmings (unused parameters) to make the situation clear 2023-10-01 10:42:04 +02:00
Fcalva
37f9eb213b Merge pull request 'Merge' (#40) from Fcalva/Collab_RPG_Fcalva:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/40
2023-09-30 17:00:52 +02:00
1b00ef67d8 Suppresion de warnings 2023-09-30 15:18:57 +02:00
Fcalva
baf40d040e Merge pull request 'master' (#1) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/1
2023-09-17 13:40:46 +02:00
SlyVTT
32d364e117 corrected one remaining typo in a dialog 2023-08-26 17:15:11 +02:00
SlyVTT
53663f61ec added NPCs movement along paths + adjusted interraction system to work with moving positions 2023-08-26 17:13:05 +02:00
SlyVTT
126bd87d6e corrected some dialogs with special accentued characters and two question that were too long for fx version 2023-08-23 21:30:54 +02:00
SlyVTT
2a71edf947 adjusted .gitignore and README.md 2023-08-22 11:21:37 +02:00
SlyVTT
fd182b5f3c Some minor tuning on dialogs sequence + remove/adjust DEBUGMODE infos 2023-08-22 10:48:01 +02:00
SlyVTT
d81616ad38 separated dialogs into 1 file per map with link in tmx + created dialog sequence/kinkage system + adjusted all maps data accordingly 2023-08-22 10:39:37 +02:00
SlyVTT
4a81853505 Ok, bugs are fixed - need now to implement dialog sequence and automatic story mode 2023-08-21 22:53:33 +02:00
SlyVTT
35e173f838 first attempt of external dialogs with level0.tmx only - currently buggy - not compiling 2023-08-21 21:35:49 +02:00
SlyVTT
9c38862507 corrected a little bug in path (forgot to take the last point of the track + edited a bit maps for aesthetic reasons :D 2023-08-21 14:05:22 +02:00
SlyVTT
4dec9677ff adjusted some images to get correct upscaling on CG versions 2023-08-20 11:02:00 +02:00
SlyVTT
311ee090b0 Merge remote-tracking branch 'origin/lephe-art' into dev 2023-08-20 10:52:03 +02:00
SlyVTT
db2880dc8f Fixed NPCs path alignement and importation (thanks Lephé) 2023-08-20 10:29:10 +02:00
SlyVTT
8a7a09d960 Merge remote-tracking branch 'origin/converter-fix' into dev 2023-08-20 10:22:48 +02:00
Lephenixnoir
4eac46ee71
fix alignment of NPC xdata/ydata with fxconv workaround
fxconv.ptr() should have an alignment parameter
2023-08-19 23:42:48 +02:00
Lephenixnoir
b196419d5c
some art/font improvements + auto scaling 2023-08-19 17:33:00 +02:00
Fcalva
608c668b00 Merge pull request 'Debug de npc.c/coverters.py' (#35) from Fcalva/Collab_RPG_Fcalva:master into dev
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/35
2023-08-19 15:57:16 +02:00
e6a677a392 avancées de debug 2023-08-19 15:53:31 +02:00
5b74a5e4b9 Solved TLB miss by changing bytes() to bytes("", "UTF-16") 2023-08-19 15:34:26 +02:00
Fcalva
ea3ffd8fe3 Merge pull request 'MaJ vers dev' (#4) from Slyvtt/Collab_RPG:dev into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/4
2023-08-19 14:22:08 +02:00
SlyVTT
8639a3feed added representation of NPCs + finalized path importation for NPCs - data alignement issue to be solved 2023-08-19 14:18:41 +02:00
SlyVTT
196cbb97ae tuned a bit dialogs (validate with SHIFT) + start working on NPCs path 2023-08-19 11:16:51 +02:00
SlyVTT
f56b6432f2 interaction with items of the map (NPC, INFO, SIGNS, ...) 2023-08-18 20:56:44 +02:00
Fcalva
74f0e3844d Merge pull request 'font and 64x64 icon improvements' (#34) from lephe-art into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/34
2023-08-18 19:24:27 +02:00
Lephenixnoir
7d6945dd16
font and 64x64 icon improvements 2023-08-18 18:23:13 +02:00
Fcalva
07043b9209 Merge pull request 'Icones 2b au lieu de 1b' (#33) from Fcalva/Collab_RPG_Fcalva:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/33
2023-08-18 16:46:37 +02:00
Fcalva
4679610643 Merge branch 'master' into master 2023-08-18 16:46:25 +02:00
13d60a6536 Ajout d'icones 2b 2023-08-18 16:44:23 +02:00
mibi88
67816ae2f3 Merge pull request 'Fixed a little displaying error in the dialog code' (#32) from mibi88/Collab_RPG-affichage-dialogues:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/32
2023-08-18 16:14:57 +02:00
mibi88
f03281507c Fixed a little displaying error in the dialog code 2023-08-18 15:41:19 +02:00
Fcalva
f55b3b8fbf Merge pull request 'MaJ2 : Le retour' (#3) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/3
2023-08-18 12:44:31 +02:00
SlyVTT
8f5eb159a1 forgot EGA64 tileset in the previous commit 2023-08-18 12:41:22 +02:00
SlyVTT
6040652f92 converted CG images into P8 so save some (few) Kb on ROM 2023-08-18 12:31:03 +02:00
Fcalva
5775488575 Merge pull request 'Nouveaux icones EGA64 pour CG' (#31) from Fcalva/Collab_RPG_Fcalva:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/31
2023-08-17 22:37:39 +02:00
fccac648e4 Amélioration + conversion EGA64 des icones 2023-08-17 22:34:04 +02:00
Fcalva
4193026e25 Merge pull request 'MaJ' (#2) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/2
2023-08-17 19:47:41 +02:00
SlyVTT
4786d3cddc major refactoring of folders structure + added new icons for each version of the game 2023-08-17 18:43:55 +02:00
Fcalva
9f9c782c79 Merge pull request 'Ajout de ma fiche de sprites' (#30) from Fcalva/Collab_RPG_Fcalva:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/30
2023-08-17 14:30:13 +02:00
6b4d143910 Ajout de mes sprites 2b version fx et cg 2023-08-17 10:49:06 +02:00
Fcalva
e394b69196 Merge pull request 'MaJ de la fork' (#1) from Slyvtt/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Fcalva/Collab_RPG_Fcalva/pulls/1
2023-08-17 10:15:14 +02:00
SlyVTT
ad525b8693 Corrected bug regarding interactions with items in maps - used local coordinates instead of world coordinates :( 2023-08-17 07:11:52 +02:00
SlyVTT
9d8464e0d5 added items on all maps - one bug to be corrected with coodinates 2023-08-16 23:12:16 +02:00
SlyVTT
a5328d0be6 Added support for Player actions and interaction with the items within the map 2023-08-16 19:36:31 +02:00
SlyVTT
47b8bfa25a implementing the basis of player action 2023-08-16 19:25:24 +02:00
SlyVTT
c5975889bc Added importation of ExtraData from ObjectLayer in Tiled TMX files 2023-08-16 17:34:45 +02:00
SlyVTT
6075e47ba8 try to import Extra Data from world and maps 2023-08-15 16:50:51 +02:00
SlyVTT
df33d2f090 added a new 1bit (N&B) target for CG to test the maps in the emulator 2023-08-15 12:55:06 +02:00
SlyVTT
217221cd6c added a verification on walkability of the target tile on next map 2023-08-14 21:15:38 +02:00
SlyVTT
f895171e40 Merge branch 'dev' 2023-08-14 20:49:01 +02:00
SlyVTT
cb24bee3f8 implementation of map change during gameplay by crossing map borders 2023-08-14 20:46:51 +02:00
SlyVTT
272d60b0aa preparing stuff for map change when reaching borders during gameplay 2023-08-14 18:40:36 +02:00
mibi88
bbb415df15 Merge pull request 'Fixed a bug when displaying 3 choices.' (#28) from mibi88/Collab_RPG-affichage-dialogues:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/28
2023-08-11 12:31:16 +02:00
mibi88
d4fc8db489 Fixed a bug when displaying 3 choices. 2023-08-11 12:23:07 +02:00
SlyVTT
e012e5a428 A loooooooot of refactoring to make the function calls easier and more consistant 2023-08-11 08:54:04 +02:00
SlyVTT
1bf630dfcb refactor structures to pack everything in typedef struct Game 2023-08-11 08:04:17 +02:00
Lephenixnoir
fe2492b7de
fix buggy access to converted map 2023-08-10 18:33:17 +02:00
SlyVTT
16a198bc64 try to find the source of the bug (need to get map data correctly filled) in map with converter.py 2023-08-10 16:22:31 +02:00
SlyVTT
d84fd7f886 Cleaned CMakeLists.txt 2023-08-08 09:52:34 +02:00
SlyVTT
53b0ddf750 converter.py correctly reads and treat maps in world file (importation into data structure in C files not fully working yet 2023-08-08 09:46:07 +02:00
SlyVTT
7d04e62848 corrected maps + start implementing world with multiple maps 2023-08-03 21:55:51 +02:00
SlyVTT
f805cf7b16 added map level3.tmx 2023-08-03 08:11:39 +02:00
SlyVTT
5e0612f7ec corrected maps level1.tmx and level2.tmx to get correct split per layer 2023-08-02 19:37:29 +02:00
SlyVTT
d3684acaed clean mapstruct.h from useless structures 2023-08-01 22:39:21 +02:00
SlyVTT
e0e4140c9b Made map importation from tmx a bit cleaner + map structure slightly lighter 2023-08-01 22:26:59 +02:00
mibi88
5a1ba659a7 Added some line jumps & some improvements 2023-07-20 13:34:13 +02:00
mibi88
dd39c30be9 Mise à jour de 'README.md' 2023-07-20 13:32:37 +02:00
mibi88
6f4ff02f51 I'll merge that, if newline support and/or support for words that don't fit in the screen is needed, I'll make another PR.
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/25
2023-07-20 13:26:28 +02:00
mibi88
ea9244ca61 Finished adding comments to the dialogs code. 2023-07-20 13:11:36 +02:00
mibi88
6acb9ab93b Fixed the last graphical issue. 2023-07-20 11:27:19 +02:00
mibi88
d1e32de9c5 Started adding comments. Still have this weird bug on the mono calculator 2023-07-19 23:11:00 +02:00
mibi88
c82a9fc5da Fixed some graphical issues, only one is still there on mono 2023-07-19 20:53:14 +02:00
mibi88
65ed14fc37 Everything is working now. 2023-07-19 20:06:28 +02:00
mibi88
aafa52f4ae Changed showtext_opt to redraw the screen on the animation at the end of an interaction, like Lephé recommended it. 2023-07-19 17:43:02 +02:00
mibi88
afc2623ad0 Fixed a little bug, animation working on th CG50 (thanks Sly) 2023-07-19 16:57:40 +02:00
mibi88
5c02111ac2 Still trying to fix my image_t problems ... 2023-07-19 00:17:38 +02:00
mibi88
ea66f50f44 Everything is now working, except the animation after choosing. 2023-07-18 21:08:12 +02:00
mibi88
acb859eaa8 Already did some fixes, trying to improve animations. 2023-07-18 19:47:47 +02:00
mibi88
f71121a79e Added interactive dialogs, but they are not working properly yet. 2023-07-15 19:26:32 +02:00
mibi88
e53c3d612d Merge branch 'master' of gitea.planet-casio.com:Slyvtt/Collab_RPG 2023-07-15 11:43:34 +02:00
mibi88
1a6ed047ea Managing interactive dialogs. Nothing tested yet. 2023-07-15 11:43:24 +02:00
SlyVTT
d3c6e319d9 correction of a minor position issue in Dialogs on CG + better definition and use of GRAYMODEOK 2023-07-14 15:28:00 +02:00
mibi88
44e966039c Merge pull request 'Dialogs with Sly's fixes for the grey engine.' (#23) from mibi88/Collab_RPG-affichage-dialogues:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/23
2023-07-13 23:52:10 +02:00
mibi88
6ccd93843d Fixed the code to work with Sly's changes 2023-07-13 23:49:07 +02:00
mibi88
a743b88569 Merge branch 'master' of gitea.planet-casio.com:Slyvtt/Collab_RPG 2023-07-13 23:33:50 +02:00
SlyVTT
2cfff4525b added some screenshots 2023-07-13 22:23:59 +02:00
SlyVTT
04f0a75472 added transparency to all mode + working dialogs on all plateforms and for all colorsets (thanks Lephe) 2023-07-13 22:23:31 +02:00
mibi88
f71c185a8d Start of the interactive dialogs code 2023-07-13 12:06:48 +02:00
mibi88
90ddeabbf1 Merge branch 'master' of gitea.planet-casio.com:Slyvtt/Collab_RPG 2023-07-12 12:45:32 +02:00
mibi88
4e06ddce10 Dialogs displaying now works on cg! 2023-07-12 12:42:28 +02:00
mibi88
ca69693c5c Fixed a little typo 2023-07-12 11:44:41 +02:00
mibi88
4956d0de31 Fixed a displaying bug (thanks Slyvtt !) 2023-07-11 23:32:09 +02:00
mibi88
6fa6f03c1a More improvements but something is still buggy :/ 2023-07-11 13:46:18 +02:00
mibi88
dc2a0b1473 Continued improving it. 2023-07-11 13:29:48 +02:00
mibi88
813c23ad00 Dialogs management should work, had not the time to test it yet. 2023-07-11 11:23:27 +02:00
SlyVTT
5f55b46bad added custom font support for both plateform + created a dummy font + corrected dialog text line spacing 2023-07-10 20:55:27 +02:00
SlyVTT
17758d07f0 All tilesets converted to add transparency on foreground layer tiles 2023-07-10 20:22:54 +02:00
SlyVTT
66a66bae91 split map into Background and Foreground layers + added transparency for foreground layer (CG only at present) + split rendering layer by layer 2023-07-10 19:35:22 +02:00
SlyVTT
6ec5895acc corrected a bug on CG that make impossible to reach certain position on screen + added some non walkable tiles on map 2023-07-10 13:11:35 +02:00
mibi88
c7008cc4d1 Player position fix for cg version 2023-07-09 22:20:53 +02:00
mibi88
32d40773ac Merge branch 'master' of gitea.planet-casio.com:Slyvtt/Collab_RPG 2023-07-09 22:05:22 +02:00
mibi88
474aa17573 Collisions are now entirely working, started implementing dialogs (I know currently it is only an animation and a little message that it is not implemented). 2023-07-09 22:02:59 +02:00
SlyVTT
396c9c9bfe code made complaitn with the 'max 80-char per line' rule 2023-07-09 21:53:07 +02:00
SlyVTT
05f3f8ff4f recover Mibi's README.md 2023-07-09 20:55:20 +02:00
SlyVTT
a7d6e8f2d7 added a layer Walkable in Tiled level0.tmx, importation in fxconv + dedicated walkable array in Map struct 2023-07-09 20:27:22 +02:00
mibi88
7913b336b7 Collisions are finally completely working
Fixed collisions, only items in the hard tiles array are missing, but they can be easily filled with Fcalva's list.
2023-07-09 16:17:33 +02:00
mibi88
48854d5108 Merge branch 'master' of gitea.planet-casio.com:Slyvtt/Collab_RPG 2023-07-09 16:15:13 +02:00
mibi88
86430b853a Collisions are now completely working, just need to fill the array of all tiles where the player can't go through. 2023-07-09 15:45:46 +02:00
mibi88
83b37d8abf Merge pull request 'Finition du premier jet du tileset couleur' (#19) from Fcalva/Collab_RPG_Fcalva3:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/19
2023-07-09 15:08:47 +02:00
d771f2ed39 Finition du premier jet du tileset couleur 2023-07-09 14:00:17 +02:00
mibi88
6afde39af8 \o/ The collisions are working PERFECTLY now except on the borders of the map! \o/ 2023-07-09 13:37:49 +02:00
mibi88
909e0760c5 Collisions are not sticky anymore and the player can't go trough the blocks but he is shaking when you collide with a wall and is not stopped by the borders of the map. 2023-07-09 13:22:20 +02:00
mibi88
9a85dfc20b Tileset en couleur en utilisant la palette EGA64 de Fcalva
Le CMakeLists.txt est fonctionnel et on peut choisir entre le tileset 2b et celui EGA64, j'ai testé les deux sur CG donc ça devrait être bon !
2023-07-09 12:42:19 +02:00
mibi88
50d32811a0 Fixed CMakeLists.txt to be able to choose between the color and the 2b tileset on the CG 2023-07-09 12:39:08 +02:00
mibi88
a1b6a5d697 Merge pull request 'Tileset couleur' (#16) from Fcalva/Collab_RPG_Couleur_CG:master into tileset-couleur
Bon, je merge ça dans une branche séparée pour l'implémenter correctement.
2023-07-09 11:29:52 +02:00
84f2f80cb0 J'avais oublié d'exporter ^^' 2023-07-09 10:42:54 +02:00
0baa26c142 Delete 'assets-cg/tilesetEGA_CG.xcf' 2023-07-09 10:35:34 +02:00
8783e0e796 Tileset couleur 2023-07-09 10:30:27 +02:00
SlyVTT
9666d21ec1 corrected Player struct to avoid char overflow on CG (resolution is 396px wide > 255 (so out of bound for char) 2023-07-08 23:02:57 +02:00
SlyVTT
8258bc7bb8 corrected tile issue with full map 2023-07-08 22:48:46 +02:00
SlyVTT
4b419694fc added a full map 25x14 tiles + start a Tile_Data structure for collision 2023-07-08 22:39:06 +02:00
Sylvain PILLOT
4b27ca950f Merge pull request 'Collision management' (#15) from mibi88/Collab_RPG-collisions:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/15
2023-07-08 21:24:26 +02:00
mibi88
23dde6593c Improved collisions and CG port. Still need to make the collisions less sticky. 2023-07-08 20:07:34 +02:00
mibi88
3fdc9fffe6 Merge branch 'master' into master 2023-07-08 18:43:47 +02:00
mibi88
cb452383ad Fixed a little filename error 2023-07-08 18:02:05 +02:00
mibi88
c90a80d5c9 Merge branch 'master' into master 2023-07-08 17:46:18 +02:00
mibi88
a16679bcd6 Fixed a bad file name 2023-07-08 17:45:35 +02:00
mibi88
ec5dcf281d Merge branch 'master' into master 2023-07-08 17:27:08 +02:00
mibi88
227e688243 Mise à jour du tileset avec les dernières corrections de Shadow
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/13
2023-07-08 17:25:54 +02:00
Shadow15510
0050c2ddf8 Update Shadow's master branch 2023-07-08 17:24:17 +02:00
mibi88
f40e07d847 Update mibi88-master 2023-07-08 16:59:48 +02:00
mibi88
a857091f74 Merge branch 'master' into master 2023-07-08 16:58:41 +02:00
mibi88
94b2187ad4 Added some comments. 2023-07-08 16:57:04 +02:00
mibi88
8d316d0d0d Collisions are working :D! I only need to add a framerate limit and add some comments, then everything will be good to merge! 2023-07-08 16:40:25 +02:00
mibi88
908b971317 Restructured a lot of things. Collisions are not working properly but I'll fix that 2023-07-08 15:55:06 +02:00
Shadow15510
47190712d5 Fix the right border of the window 2023-07-08 13:58:35 +02:00
SlyVTT
60c26b8c22 merged Shadow's PR - Brand New B&W Tileset 2023-07-08 13:16:49 +02:00
Sylvain PILLOT
1bfaf75a78 Merge pull request '1-bit tileset' (#10) from Shadow/Collab_RPG:master into master
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/10
2023-07-08 12:57:23 +02:00
Shadow15510
b7b602125b Finishing a first proposal of W&B tileset 2023-07-08 11:40:54 +02:00
Shadow15510
70d6dd62b4 Progress of the W&B tileset 2023-07-08 11:14:45 +02:00
Shadow15510
2df10f8d62 Begenning of the W&B tileset redesign 2023-07-07 14:33:51 +02:00
141 changed files with 4996 additions and 394 deletions

12
.clang-format Normal file
View file

@ -0,0 +1,12 @@
BasedOnStyle: LLVM
IndentWidth: 4
PointerAlignment: Right
SpaceBeforeAssignmentOperators: true
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpaceBeforeParens: Never
IndentCaseBlocks: true
IncludeBlocks: Regroup
AllowShortBlocksOnASingleLine: Empty
ColumnLimit: 80

3
.gitignore vendored
View file

@ -2,6 +2,7 @@
/build-fx
/build-cg
/build-cg-push
/build-fxg3a
/*.g1a
/*.g3a
@ -13,4 +14,4 @@ __pycache__/
*.sublime-workspace
.vscode
*.json
tilesetnpp.json

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "assets/tinytiled"]
path = assets/tinytiled
url = https://git.planet-casio.com/mibi88/tinytiled
[submodule "assets/--force"]
path = assets/--force
url = https://git.planet-casio.com/mibi88/tinytiled

View file

@ -4,101 +4,184 @@
cmake_minimum_required(VERSION 3.15)
project(MyAddin)
#set the color mode either to 1b or 2b
set(COLORMODE_fx 1b)
#set the color mode either to 1b, 2b or EGA64
set(COLORMODE_cg EGA64)
if(NOT "${COLORMODE_cg}" STREQUAL EGA64)
set(FXSDK_PLATFORM_LONG fx9860G_G3A)
set(FXSDK_PLATFORM fx)
endif()
include(GenerateG1A)
include(GenerateG3A)
include(Fxconv)
find_package(Gint 2.9 REQUIRED)
find_package(Gint 2.11 REQUIRED)
# Gint 2.11 is required, because we're using the new macros like GINT_RENDER_RGB
find_package(LibProf 2.4 REQUIRED)
#set the color mode either to 1bit or 2bits
set(COLORMODE 2b)
fxconv_declare_converters(assets/converters.py)
add_custom_command(
COMMENT "Convert Tiled TMX map to usable JSON file"
COMMAND tiled --export-tileset json tilesetnpp.tsx tilesetnpp.json
COMMAND find | grep .*.tmx | sed 's/.tmx//g' | xargs -l bash -c 'tiled --export-map json $$0.tmx $$0.json'
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets/
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets/level0.json"
# if several levels/maps are created, just copy the previous line and change the .json name with the new level/map
DEPENDS assets/converters.py
assets/tileset.png
assets/tilesetnpp.tsx
assets/level0.tmx
# if several levels/maps are created, just copy the previous line and change the .json name with the new level/map
)
set(SOURCES
src/main.c
src/map.c
src/player.c
src/memory.c
src/game.c
src/dialogs.c
src/npc.c
src/events.c
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
assets/level0.json
assets/demo_player.png
assets/level0_dialogs.json
assets/level1_dialogs.json
assets/level2_dialogs.json
assets/level3_dialogs.json
assets/level4_dialogs.json
assets/level0.tmx
assets/level1.tmx
assets/level2.tmx
assets/level3.tmx
assets/level4.tmx
assets/interior1_0_dialogs.json
assets/interior1_0.tmx
# ...
)
set(ASSETS_cg
assets-cg/tileset2b_CG.png
assets-cg/player_male.png
assets-cg/player_female.png
assets-cg/npc/char/npc_male.png
assets-cg/npc/char/npc_female.png
assets-cg/npc/char/npc_milkman.png
assets-cg/npc/char/npc_police.png
assets-cg/SignAction.png
assets-cg/npc/face/npc_male.png
assets-cg/npc/face/npc_female.png
assets-cg/npc/face/npc_milkman.png
assets-cg/npc/face/npc_police.png
assets-cg/SGN_Icon.png
assets-cg/INFO_Icon.png
assets-cg/player_face.png
assets-cg/font.png
)
set(ASSETS_cg_EGA64
assets-cg/ega64/tileset/tilesetEGA64_CG.png
)
set(ASSETS_fx
assets-fx/player_male.png
assets-fx/player_female.png
assets-fx/SignAction.png
assets-fx/SGN_Icon.png
assets-fx/player_face.png
assets-fx/font.png
# ...
)
set(ASSETS_fx_1b
assets-fx/levels/tileset1b.png
assets-fx/1b/tileset/tileset1b.png
assets-fx/1b/npc/char/npc_male.png
assets-fx/1b/npc/char/npc_female.png
assets-fx/1b/npc/char/npc_milkman.png
assets-fx/1b/npc/char/npc_police.png
assets-fx/1b/npc/face/npc_male.png
assets-fx/1b/npc/face/npc_female.png
assets-fx/1b/npc/face/npc_milkman.png
assets-fx/1b/npc/face/npc_police.png
assets-fx/1b/INFO_Icon.png
# ...
)
set(ASSETS_fx_2b
assets-fx/levels/tileset2b.png
assets-fx/2b/tileset/tileset2b.png
assets-fx/2b/npc/char/npc_male.png
assets-fx/2b/npc/char/npc_female.png
assets-fx/2b/npc/char/npc_milkman.png
assets-fx/2b/npc/char/npc_police.png
assets-fx/2b/npc/face/npc_male.png
assets-fx/2b/npc/face/npc_female.png
assets-fx/2b/npc/face/npc_milkman.png
assets-fx/2b/npc/face/npc_police.png
assets-fx/1b/INFO_Icon.png
# ...
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} WITH_METADATA)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} ${ASSETS_fx_1b} ${ASSETS_fx_2b} ${ASSETS_cg_1b} ${ASSETS_cg_2b} ${ASSETS_cg_EGA64} WITH_METADATA)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE}} )
if("${COLORMODE}" STREQUAL 1b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR1BIT)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} )
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_cg}} )
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}} ${ASSETS_${FXSDK_PLATFORM}_${COLORMODE_fx}} )
endif()
if("${COLORMODE}" STREQUAL 2b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -DCOLOR2BIT)
endif()
target_link_options(myaddin PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage)
target_link_libraries(myaddin LibProf::LibProf Gint::Gint)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
if("${COLORMODE}" STREQUAL 1b)
generate_g1a(TARGET myaddin OUTPUT "PrjPC1b.g1a"
NAME "Col RPG NB" ICON assets-fx/icon1.png)
# fx colormode
if("${COLORMODE_fx}" STREQUAL 1b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR1BIT)
endif()
if("${COLORMODE}" STREQUAL 2b)
generate_g1a(TARGET myaddin OUTPUT "PrjPC2b.g1a"
NAME "Col RPG Grey" ICON assets-fx/icon2.png)
if("${COLORMODE_fx}" STREQUAL 2b)
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os -g -DCOLOR2BIT)
endif()
if("${COLORMODE_fx}" STREQUAL 1b)
generate_g1a(TARGET myaddin OUTPUT "RPG_1b.g1a"
NAME "RPG PC 1b" ICON assets-fx/1b/icon1b.png)
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
generate_g1a(TARGET myaddin OUTPUT "RPG_2b.g1a"
NAME "RPG PC 2b" ICON assets-fx/2b/icon2b.png)
endif()
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
# cg colormode
if("${COLORMODE_cg}" STREQUAL EGA64)
target_compile_options(myaddin PRIVATE -Wall -Wextra -O0 -g -DCOLOREGA)
endif()
generate_g3a(TARGET myaddin OUTPUT "PRJPC_CG.g3a"
NAME "Col_RPG_CG" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
if("${COLORMODE_cg}" STREQUAL 1b)
generate_g3a(TARGET myaddin OUTPUT "RPG_1bfx.g3a"
NAME "RPG PC 1b fx" ICONS assets-cg/1b/icon-uns-1b.png assets-cg/1b/icon-sel-1b.png)
endif()
endif()
if("${COLORMODE_cg}" STREQUAL 2b)
generate_g3a(TARGET myaddin OUTPUT "RPG_2bfx.g3a"
NAME "RPG PC 2b fx" ICONS assets-cg/2b/icon-uns-2b.png assets-cg/2b/icon-sel-2b.png)
endif()
if("${COLORMODE_cg}" STREQUAL EGA64)
generate_g3a(TARGET myaddin OUTPUT "RPG_ega.g3a"
NAME "RPG PC EGA" ICONS assets-cg/ega64/icon-uns-ega64.png assets-cg/ega64/icon-sel-ega64.png)
endif()
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_G3A)
if("${COLORMODE_fx}" STREQUAL 1b)
generate_g3a(TARGET myaddin OUTPUT "RPG_1bfx.g3a"
NAME "RPG PC 1b fx" ICONS assets-cg/1b/icon-uns-1b.png assets-cg/1b/icon-sel-1b.png)
endif()
if("${COLORMODE_fx}" STREQUAL 2b)
generate_g3a(TARGET myaddin OUTPUT "RPG_2bfx.g3a"
NAME "RPG PC 2b fx" ICONS assets-cg/2b/icon-uns-2b.png assets-cg/2b/icon-sel-2b.png)
endif()
endif()

View file

@ -1,9 +1,674 @@
This is free and unencumbered software released into the public domain.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
Preamble
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
For more information, please refer to https://unlicense.org
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program 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 3 of the License, or
(at your option) any later version.
This program 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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

26
PROJECT_STRUCTURE.md Normal file
View file

@ -0,0 +1,26 @@
# Project structure
* `assets` contains the tiled maps, and the tiled map converters.
* `assets-cg` contains the assets for cg calculators like the cg-50.
* `assets-fx` contains the assets for monochrome calculators.
* `captures` contains screenshots.
* `src` This folder contains the source code.
* `config.h` This header file contains defines for the size of various
things on screen, like the size of a tile in the tilemap, the size of the
dialog box, etc.
* `dialogs.c` and `dialogs.h` contain various functions to display dialogs
and also let the user respond.
* `events.c` and `events.h` parse tags in the messages that are displayed
using the dialogs procedures to modify variables (and soon, call
procedures).
* `game.c` and `game.h` handles the rendering, the input, etc.
* `main.c` handles the USB connection and the gint gray rendering, for 2bpp
rendering on monochrome calculators. Contains the mainloop. Also contains
code to display debug informations.
* `map.c` and `map.h` contain code to render, get a tile in the map, see if
the tile is walkable, etc.
* `mapdata.h` contains the available maps.
* `memory.c` and `memory.h` procedures to handle arrays (currently: search
in an array of short ints).
* `npc.c` and `npc.h` npc rendering and movement (and soon pathfinding).
* `player.c` and `player.h` handle the player movement, collision, etc.

View file

@ -1,32 +1,39 @@
# Projet Collaboratif Planete Casio
## Template
Plus d'infos sur ce projet ici : [Le projet Collaboratif de PC](https://www.planet-casio.com/Fr/forums/topic17343-last-projet-collaboratif-avec-toute-la-commu.html)
Voici un premier jet de template pour le projet collaboratif de Planete Casio.
## Contribuer!
Style du code [STYLE.md](STYLE.md).
PLus d'infos sur ce projet ici : [Le projet Collaboratif de PC](https://www.planet-casio.com/Fr/forums/topic17343-last-projet-collaboratif-avec-toute-la-commu.html)
Structure du projet [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md).
## Dispo / Pas Dispo
## Avancement du projet
Le template initialise un projet avec moteur de gris pour les calculatrices fx9860G toute version.
A ce stade, on a déjà implémenté :
Importation d'un tileset via un convertisseur tiled/fxconv
Importation d'une carte de tiles (map) via un convertisseur
Dessin de la Map en niveau de gris
- [x] Screenshots, etc. par USB
- [x] Affichage de la map courante selon la position du joueur
- [x] Gestion des touches
- [x] Gestion des collisions
- [x] Multiple cartes avec importation automatique des fichiers `world` issus de Tiled
- [x] Carte Multilayer (Background, Foreground + accessibilité / Dommages) avec transparence du calque Foreground
- [x] Personnage
- [x] Dialogues avec fichiers externes `json` et séquenceage possible de ceux-ci via un arbre d'histoire (sauts de lignes et mots plus grands que l'écran pas supportés + limite d'un kibibyte)
- [x] Fontes de caractères
- [x] Interaction
- [ ] NPC
- [x] Changement de map durant le jeu
- [ ] Système d'événements
- [ ] Pathfinding
A ce stade, rien de plus :
Pas de gestion des touches
Pas de personnage
Pas d'interraction
Bref, c'est juste le minimum pour offrir qq fonctions de base et ne pas partir de zéro.
## Crédits
Les tiles sont issues de Game Boy Top-down RPG Fantasy Tileset (FREE)
"Background Assets by Gumpy Function (gumpyfunction.itch.io)"
Les tiles sont issues de Game Boy Top-down RPG Fantasy Tileset (FREE)
"Background Assets by Gumpy Function (gumpyfunction.itch.io)"
[Tiles Background Assets by Gumpy Function](https://gumpyfunction.itch.io/game-boy-rpg-fantasy-tileset-free)
Converties en niveau de gris avec Gimp
Une version 1-bit (N&B) à été réalisée par Shadow15510
Et une version couleur CG (palette EGA64) à été réalisée par Fcalva

44
README_en.md Normal file
View file

@ -0,0 +1,44 @@
# Planet Casio Collaborative Project
(maybe I should've used google translate)
More informations can be found here (in french):
[Le projet Collaboratif de PC](https://www.planet-casio.com/Fr/forums/topic17343-last-projet-collaboratif-avec-toute-la-commu.html)
## Contribute!
Style guidelines [STYLE.md](STYLE.md).
Project structure [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md).
## Current state
What we've implemented so far:
- [x] Screenshots via USB
- [x] Displaying the current map at the players position
- [x] Handling keyboard inputs
- [x] Handling collisions.
- [x] Multiple maps with automatic `world` files import (made with Tiled)
- [x] Multilayer map (Background, Foreground + accessibility / damage) with
foreground layer transparency.
- [x] Player character.
- [x] Dialogs from external `json` files (line jumps and words bigger than the
screen are unsupported + 1 kibibyte per message limit)
- [x] Font
- [x] Interaction
- [ ] NPC
- [x] Changing map in game.
- [ ] Event system
- [ ] Pathfinding
## Credits
The tiles are from Game Boy Top-down RPG Fantasy Tileset (FREE)
"Background Assets by Gumpy Function (gumpyfunction.itch.io)"
[Tiles Background Assets by Gumpy Function](https://gumpyfunction.itch.io/game-boy-rpg-fantasy-tileset-free)
Converted to greyscale with gimp.
1-bit (black and white) version by Shadow15510
CG (palette EGA64) color version by Fcalva

14
STYLE.md Normal file
View file

@ -0,0 +1,14 @@
# Style guidelines in Collab RPG
(Mibi88) Fcalva, SlyVTT: What do you think of this?
Variables names in sneak_case.
Name your procedures as following: `filename_whatitdoes`.
The procedures are documented using sphinx.
We're using `clang-formatter` to keep the code readable. Please run it before
committing your code as following: `clang-format -i *` in the `src` folder.
Have I forgotten something?

5
TODO.txt Normal file
View file

@ -0,0 +1,5 @@
[OK] - Jeu de tuile 1bit pour CG pour avoir la version 1bit vérifiable en fonctionnement dans l'émulateur de Heath
[OK] - corriger les tuiles 1bit pour les rivières (tiles 1 2 3 et 4) avec niveaux de diphering pour tiles 1 et 3 (gris 33% et 66%)
[OK] - ajouter face pour dialogue pour PNJ
[OK] - ajouter indicateur visuel pour action joueur quand on est proche d'un PNJ ou d'un panneau
[OK] - faire des fonts lisibles avec le set `print` disponible intégralement

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -0,0 +1,4 @@
tileset1b_CG.png:
type: bopti-image
name: img_tilesetnpp
profile: p8

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View file

@ -0,0 +1,5 @@
tileset2b_CG.png:
type: bopti-image
name: img_tilesetnpp
profile: p8

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
assets-cg/INFO_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B

BIN
assets-cg/NPC_Icon_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

BIN
assets-cg/SGN_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

BIN
assets-cg/SignAction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -0,0 +1,5 @@
tilesetEGA64_CG.png:
type: bopti-image
name: img_tilesetnpp
profile: p8

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
assets-cg/font.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,5 +1,14 @@
tileset2b_CG.png:
type: bopti-image
name: img_tilesetnpp
*.png:
custom-type: bopti-image
name_regex: (.*)\.png \1_img
profile: p8
font.png:
name: fontRPG
custom-type: font
charset: print
grid.size: 10x10
grid.padding: 2
grid.border: 0
proportional: true
height: 10

View file

@ -0,0 +1,15 @@
npc_male.png:
type: bopti-image
name: tiny_npc_male
npc_female.png:
type: bopti-image
name: tiny_npc_female
npc_milkman.png:
type: bopti-image
name: tiny_npc_milkman
npc_police.png:
type: bopti-image
name: tiny_npc_police

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

View file

@ -0,0 +1,12 @@
npc_male.png:
type: bopti-image
name: npc_male
npc_female.png:
type: bopti-image
name: npc_female
npc_milkman.png:
type: bopti-image
name: npc_milkman
npc_police.png:
type: bopti-image
name: npc_police

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,000 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

BIN
assets-cg/player_face.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
assets-cg/player_female.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

BIN
assets-cg/player_male.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

BIN
assets-fx/1b/INFO_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

View file

@ -0,0 +1,3 @@
INFO_Icon.png:
type: bopti-image
name: INFO_Icon_img

BIN
assets-fx/1b/icon1b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

View file

@ -0,0 +1,12 @@
npc_male.png:
type: bopti-image
name: tiny_npc_male
npc_female.png:
type: bopti-image
name: tiny_npc_female
npc_milkman.png:
type: bopti-image
name: tiny_npc_milkman
npc_police.png:
type: bopti-image
name: tiny_npc_police

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

View file

@ -0,0 +1,12 @@
npc_male.png:
type: bopti-image
name: npc_male
npc_female.png:
type: bopti-image
name: npc_female
npc_milkman.png:
type: bopti-image
name: npc_milkman
npc_police.png:
type: bopti-image
name: npc_police

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

View file

@ -0,0 +1,4 @@
tileset1b.png:
type: bopti-image
name: img_tilesetnpp

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets-fx/2b/INFO_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View file

@ -0,0 +1,3 @@
INFO_Icon.png:
type: bopti-image
name: INFO_Icon_img

BIN
assets-fx/2b/icon2b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

View file

@ -0,0 +1,12 @@
npc_male.png:
type: bopti-image
name: tiny_npc_male
npc_female.png:
type: bopti-image
name: tiny_npc_female
npc_milkman.png:
type: bopti-image
name: tiny_npc_milkman
npc_police.png:
type: bopti-image
name: tiny_npc_police

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

View file

@ -0,0 +1,12 @@
npc_male.png:
type: bopti-image
name: npc_male
npc_female.png:
type: bopti-image
name: npc_female
npc_milkman.png:
type: bopti-image
name: npc_milkman
npc_police.png:
type: bopti-image
name: npc_police

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,3 @@
tileset2b.png:
type: bopti-image
name: img_tilesetnpp

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
assets-fx/2bpp_palette.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 B

BIN
assets-fx/SGN_Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets-fx/SignAction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets-fx/font.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -0,0 +1,28 @@
player_male.png:
type: bopti-image
name: player_male_img
player_female.png:
type: bopti-image
name: player_female_img
player_face.png:
type: bopti-image
name: player_face_img
SignAction.png:
type: bopti-image
name: SignAction_img
SGN_Icon.png:
type: bopti-image
name: SGN_Icon_img
font.png:
name: fontRPG
type: font
charset: print
grid.size: 5x5
grid.padding: 1
grid.border: 0
proportional: true
height: 5

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,8 +0,0 @@
tileset1b.png:
type: bopti-image
name: img_tilesetnpp
tileset2b.png:
type: bopti-image
name: img_tilesetnpp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

BIN
assets-fx/player_face.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

BIN
assets-fx/player_female.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

BIN
assets-fx/player_male.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

BIN
assets/Tilesetwalkable.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

4
assets/Walkable.tsx Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.10.1" name="Walkable" tilewidth="8" tileheight="8" tilecount="4" columns="4">
<image source="Tilesetwalkable.png" width="32" height="8"/>
</tileset>

41
assets/WorldRPG.world Normal file
View file

@ -0,0 +1,41 @@
{
"maps": [
{
"fileName": "level0.tmx",
"height": 192,
"width": 384,
"x": 0,
"y": 0
},
{
"fileName": "level1.tmx",
"height": 192,
"width": 384,
"x": 384,
"y": 0
},
{
"fileName": "level2.tmx",
"height": 192,
"width": 384,
"x": 0,
"y": 192
},
{
"fileName": "level3.tmx",
"height": 192,
"width": 384,
"x": 384,
"y": 192
},
{
"fileName": "level4.tmx",
"height": 192,
"width": 384,
"x": 384,
"y": 384
}
],
"onlyShowAdjacentMaps": false,
"type": "world"
}

View file

@ -1,56 +1,392 @@
from random import randint
import fxconv
"""
This is the main converter script. It uses the tiled.py script to handle the
tiled maps.
We're trying to follow the PEP, so please read PEP 8 (if you haven't already):
https://peps.python.org/pep-0008/, so please write variable names in sneak_case
and class names in PascalCase.
To improve the lisibility of this code, please document your methods, add
comments (yes, it's hard to add the right amount of comments), and add type
hints, to avoid bugs and make it easy to understand how to use them.
To document your methods, you should read PEP 257:
https://peps.python.org/pep-0257/.
Thanks,
Mibi88
"""
import xml.etree.ElementTree as ET
import json
import pathlib
import csv
import os
import sys
# Add the assets folder to the path, to be able to import the tiled script.
sys.path.append("../assets/")
import fxconv
from tinytiled import *
def convert(input, output, params, target):
if params["custom-type"] == "map":
convert_map(input, output, params, target)
return 0
else:
return 1
# If the output of the converter should be verbose.
VERBOSE = 1
# The sign types, used to find the sign icon.
SIGN_TYPES = ["SGN", "INFO"]
# The NPC faces, used to find the face id.
FACES = ["MALE", "FEMALE", "MILKMAN", "POLICE"]
# The precision of the fixed point numbers.
# WARNING: The PRECISION define in config.h should contain the same value!
PRECISION = 8
def convert_map(input, output, params, target):
data = json.load(open(input, "r"))
def convert(input: str, output: str, params: dict, target):
"""
This method gets called by fxconv for each asset to convert.
"""
if params["custom-type"] == "tmx":
convert_map(input, output, params, target)
return 0
elif params["custom-type"] == "dialog":
convert_dialog(input, output, params, target)
return 0
#find the tileset in use. it's a relative path (like ../tileset.tsx)
nameTileset = data["tilesets"][0]["source"].replace(".tsx","")
print(nameTileset)
#the name of the tileset without the .something
nameTilesetFree = nameTileset.split("/")[-1]
#count the number of "back" (cd ..) to locate the tileset on the computer
nbRetour = nameTileset.count("..")+1
#create the tileset absolute path
tilesetPath = "/".join(input.split("/")[:-nbRetour]) + "/" + nameTileset + ".json"
def convert_map(input: str, output: str, params: dict, target):
"""
Convert a map.
"""
if VERBOSE: print(f"INFO: Converting map {input} -> {output}")
input_map = Map(input)
dialog_file = ""
background_layer = []
foreground_layer = []
walkable_layer = []
map_x = 0
map_y = 0
width = 0
height = 0
outdoor_tileset = None
walkable_tileset = None
dialog_num = 0
dialog_ids = []
tileset = open(tilesetPath, "r")
data_tileset = json.load(tileset)
tileset_size = data_tileset.get("columns")
tileset.close()
npc_paths = {}
npcs = {}
signs = {}
portals = {}
name = os.path.splitext(os.path.basename(input))[0]
#Extract from the json the width, height
w, h = data["width"], data["height"]
map_struct = fxconv.Structure()
#nbTileLayer is the number of "true" layers (without ObjectsLayer)
nbTilelayer = ["data" in i for i in data["layers"]].count(True)
# Get the dialog file
try:
if VERBOSE: print("INFO: Getting the dialog file")
dialog_file = input_map.get_property("dialogFile")
if VERBOSE: print(f"INFO: Dialog file: {dialog_file}.")
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the dialog file.\n"
+ f" Error message: {e}\n")
sys.exit(1)
# Get the map position
try:
if VERBOSE: print("INFO: Getting the map position")
map_x = int(input_map.get_property("mapX"))
map_y = int(input_map.get_property("mapY"))
if VERBOSE: print(f"INFO: Map position: ({map_x}, {map_y}).")
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the map position.\n"
+ f" Error message: {e}\n")
sys.exit(1)
# Get informations about dialogs
try:
if VERBOSE: print("INFO: Getting informations about dialogs")
with open(f"{input_map.parent_dir}/{dialog_file}", "r") as file:
dialog_data = json.load(file)
dialog_num = len(dialog_data["dialogs"])
for i in dialog_data["dialogs"]:
dialog_ids.append(i["ID"])
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get informations about dialogs.\n"
+ f" Error message: {e}\n")
sys.exit(1)
structMap = fxconv.Structure()
# Get the outdoor tileset
try:
if VERBOSE: print("INFO: Getting the outdoor tileset")
outdoor_tileset = input_map.get_tileset_by_firstgid(1)
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the outdoor tileset.\n"
+ f" Error message: {e}\n")
sys.exit(1)
# Get the walkable tileset
try:
if VERBOSE: print("INFO: Getting the walkable tileset")
walkable_tileset = input_map.get_tileset_by_firstgid(409)
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the walkable tileset.\n"
+ f" Error message: {e}\n")
sys.exit(1)
structMap += fxconv.u32(w) + fxconv.u32(h) + fxconv.u32(nbTilelayer)
structMap += fxconv.ref(f"img_{nameTilesetFree}")
structMap += fxconv.u32(tileset_size)
# Get the background
try:
if VERBOSE: print("INFO: Getting the background layer")
bg_layer = input_map.get_layer_by_name("Background")
# The bg layer will be used to set the map width and height.
width = bg_layer.get_width()
height = bg_layer.get_height()
if VERBOSE: print(f"INFO: Map size: ({width}, {height}).")
# Get the layer data himself
background_layer = bg_layer.get_data_with_tileset(outdoor_tileset)
# Check if the size of the layer data is correct.
if len(background_layer) != width*height:
raise Exception("Bad layer size!")
if VERBOSE: print("INFO: Layer data has the right size.")
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the background layer.\n"
+ f" Error message: {e}\n")
sys.exit(1)
# Get the foreground
try:
if VERBOSE: print("INFO: Getting the foreground layer")
fg_layer = input_map.get_layer_by_name("Foreground")
# Get the layer data himself
foreground_layer = fg_layer.get_data_with_tileset(outdoor_tileset)
# Check if the size of the layer data is correct.
if len(foreground_layer) != width*height:
raise Exception("Bad layer size!")
if VERBOSE: print("INFO: Layer data has the right size.")
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the foreground layer.\n"
+ f" Error message: {e}\n")
sys.exit(1)
# Get the walkable layer
try:
if VERBOSE: print("INFO: Getting the walkable layer")
wk_layer = input_map.get_layer_by_name("Walkable")
# Get the layer data himself
walkable_layer = wk_layer.get_data_with_tileset(walkable_tileset)
# Check if the size of the layer data is correct.
if len(walkable_layer) != width*height:
raise Exception("Bad layer size!")
if VERBOSE: print("INFO: Layer data has the right size.")
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the walkable layer.\n"
+ f" Error message: {e}\n")
sys.exit(1)
#generate the array of tiles from the layer
for i in range(nbTilelayer):
layer_data = bytes()
layer = data["layers"][i]
for tile in layer["data"]:
layer_data += fxconv.u16(tile-1)
# Get the extra data
try:
if VERBOSE: print("INFO: Getting the extra data")
ed_objgroup = input_map.get_objectgroup_by_name("ExtraData")
# Get the paths the NPCs take.
for object in ed_objgroup.objects:
if object.get_data_type() == "polyline":
npc_paths[object.id] = object.get_data()
# Get the NPCs
for object in ed_objgroup.objects:
if object.get_data_type() == "point" and object.type == "NPC":
path = [0, 0]
if int(object.get_property("hasPath")):
if object.get_property("path") in npc_paths:
path = npc_paths[object.get_property("path")]
else:
raise Exception("Path required but not found!")
dialog_id = 0
has_dialog = 0
try:
dialog_id = int(object.get_property("dialogID"))
has_dialog = 1
except:
pass
data = {
"position": object.get_data(),
"name": object.name,
"needAction": int(object.get_property("needAction")),
"dialogID": dialog_id,
"hasDialog": has_dialog,
"face": FACES.index(object.get_property("face")),
"path": path
}
npcs[object.id] = data
# Get the signs
for object in ed_objgroup.objects:
if object.get_data_type() == "point" and object.type in SIGN_TYPES:
data = {
"position": object.get_data(),
"name": object.name,
"needAction": int(object.get_property("needAction")),
"dialogID": int(object.get_property("dialogID")),
"icon": SIGN_TYPES.index(object.type)
}
signs[object.id] = data
# Get the portals
for object in ed_objgroup.objects:
if (object.get_data_type() == "rectangle"
and object.type == "PORTAL"):
data = {
"rect": object.get_data(),
"name": object.name,
"dest": object.get_property("dest"),
"destPortal": object.get_property("destPortal")
}
portals[object.id] = data
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the extra data.\n"
+ f" Error message: {e}\n")
sys.exit(1)
# Generate the structs
# Map struct
map_struct += fxconv.u32(map_x)
map_struct += fxconv.u32(map_y)
map_struct += fxconv.u32(width)
map_struct += fxconv.u32(height)
map_struct += fxconv.u32(3)
map_struct += fxconv.u32(outdoor_tileset.columns)
tileset_name = os.path.splitext(os.path.basename(outdoor_tileset.source))[0]
map_struct += fxconv.ref(f"img_{tileset_name}")
structMap += fxconv.ptr(layer_data)
# Store the walkable layer
walkable_data = bytes()
for i in walkable_layer:
if i < 0: i = 0
walkable_data += fxconv.u8(i)
map_struct += fxconv.ptr(walkable_data)
#generate !
fxconv.elf(structMap, output, "_" + params["name"], **target)
# Load NPCs
map_struct += fxconv.u32(len(npcs))
npc_struct = fxconv.Structure()
for i in npcs.values():
# Convert currentpos to a fixed point value.
npc_struct += fxconv.u32((i["position"][0]+i["path"][0])<<PRECISION)
npc_struct += fxconv.u32((i["position"][1]+i["path"][1])<<PRECISION)
npc_struct += fxconv.u32(i["position"][0])
npc_struct += fxconv.u32(i["position"][1])
npc_struct += fxconv.u16(i["face"])
npc_struct += fxconv.u8(0)
npc_struct += fxconv.u8(i["hasDialog"])
npc_struct += fxconv.u32(i["dialogID"])
npc_struct += fxconv.u32(i["needAction"])
npc_struct += fxconv.string(i["name"])
npc_struct += fxconv.u32(len(i["path"]) > 2)
npc_struct += fxconv.u32(len(i["path"])//2)
npc_struct += fxconv.u32(0)
xpath = bytes()
ypath = bytes()
x = True
for n in i["path"]:
if x: xpath += fxconv.u16(n)
else: ypath += fxconv.u16(n)
x = not x
npc_struct += fxconv.ptr(xpath)
npc_struct += fxconv.ptr(ypath)
npc_struct += fxconv.u32(0) # TODO: Type
npc_struct += fxconv.u8(0) # TODO: Group
npc_struct += fxconv.u8(0) # TODO: Hostile to
npc_struct += fxconv.u16(0) # TODO: Padding (what is it ?)
map_struct += fxconv.ptr(npc_struct)
# Load signs
map_struct += fxconv.u32(len(signs))
sign_struct = fxconv.Structure()
for i in signs.values():
# Create a sign struct for each sign.
sign_struct += fxconv.u32(i["position"][0])
sign_struct += fxconv.u32(i["position"][1])
sign_struct += fxconv.u32(i["icon"])
sign_struct += fxconv.string(i["name"])
sign_struct += fxconv.u32(i["dialogID"])
sign_struct += fxconv.u32(i["needAction"])
map_struct += fxconv.ptr(sign_struct)
# Load portals
map_struct += fxconv.u32(len(portals))
portal_struct = fxconv.Structure()
for i in portals.values():
dest_file_name = os.path.splitext(os.path.basename(i["dest"]))[0]
dest_portal = i["destPortal"]
portal_name = i["name"]
if VERBOSE: print(f"INFO: Storing portal {name}_{portal_name}")
portal_struct += fxconv.sym(f"{name}_{portal_name}")
# Add the collider
rect = i["rect"]
portal_struct += fxconv.u32(rect[0])
portal_struct += fxconv.u32(rect[1])
portal_struct += fxconv.u32(rect[2])
portal_struct += fxconv.u32(rect[3])
# Add a reference to the destination portal
portal_struct += fxconv.ref(f"{dest_file_name}_{dest_portal}")
portal_struct += fxconv.ref(f"{dest_file_name}")
map_struct += fxconv.ptr(portal_struct)
map_struct += fxconv.u32(dialog_num)
# Get the name of the dialog file and create a reference to it: it is built
# separately.
dialog_name = os.path.splitext(os.path.basename(dialog_file))[0]
map_struct += fxconv.ref(f"_{dialog_name}")
# Store the background layer
background_data = bytes()
for i in background_layer:
background_data += fxconv.u16(i)
map_struct += fxconv.ptr(background_data)
# Store the foreground layer
foreground_data = bytes()
for i in foreground_layer:
foreground_data += fxconv.u16(i)
map_struct += fxconv.ptr(foreground_data)
# Create the fxconv object
fxconv.elf(map_struct, output, f"_{name}", **target)
def convert_dialog(input: str, output: str, params: dict, target):
"""
Convert a JSON dialog file.
"""
if VERBOSE: print(f"INFO: Converting dialog file {input} -> {output}")
# Load the JSON dialog file.
dialog_data = None
try:
with open(input, "r") as file:
dialog_data = json.load(file)
except Exception as e:
sys.stderr.write(f"ERROR: Failed parse json.\n"
+ f" Error message: {e}\n")
sys.exit(1)
# Create the dialog struct
dialog_struct = fxconv.Structure()
try:
for i in dialog_data["dialogs"]:
# Create a dialog structure for each dialog.
dialog_id = i["ID"]
dialog_struct += fxconv.u32(dialog_id)
dialog_struct += fxconv.string(i["dialog"])
dialog_struct += fxconv.u32(i["isQuestion"])
dialog_struct += fxconv.string(i["choice"].replace('$', '\0'))
dialog_struct += fxconv.string(i["conclusion1"])
dialog_struct += fxconv.u32(i["next1"])
dialog_struct += fxconv.string(i["conclusion2"])
dialog_struct += fxconv.u32(i["next2"])
dialog_struct += fxconv.u32(i["nextOther"])
# Save this struct
name = os.path.splitext(os.path.basename(input))[0]
fxconv.elf(dialog_struct, output, f"__{name}", **target)
except Exception as e:
# Show an error message if the conversion fails.
sys.stderr.write(f"ERROR: Failed convert dialogs.\n"
+ f" Error message: {e}\n")
sys.exit(1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

View file

@ -1,7 +1,47 @@
*.json:
custom-type: map
name_regex: (.*)\.json map_\1
level0.tmx:
custom-type: tmx
name: level0
demo_player.png:
type: bopti-image
name: demo_player_img
level1.tmx:
custom-type: tmx
name: level1
level2.tmx:
custom-type: tmx
name: level2
level3.tmx:
custom-type: tmx
name: level3
level4.tmx:
custom-type: tmx
name: level4
level0_dialogs.json:
custom-type: dialog
name: level0_dialogs
level1_dialogs.json:
custom-type: dialog
name: level1_dialogs
level2_dialogs.json:
custom-type: dialog
name: level2_dialogs
level3_dialogs.json:
custom-type: dialog
name: level3_dialogs
level4_dialogs.json:
custom-type: dialog
name: level4_dialogs
interior1_0.tmx:
custom-type: tmx
name: level0
interior1_0_dialogs.json:
custom-type: dialog
name: interior1_0_dialogs

54
assets/interior1_0.tmx Normal file
View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.8" tiledversion="1.8.2" orientation="orthogonal" renderorder="right-down" width="12" height="8" tilewidth="8" tileheight="8" infinite="0" nextlayerid="5" nextobjectid="3">
<properties>
<property name="dialogFile" type="file" value="interior1_0_dialogs.json"/>
<property name="mapX" type="int" value="65536"/>
<property name="mapY" type="int" value="65536"/>
</properties>
<tileset firstgid="1" source="tilesetnpp.tsx"/>
<tileset firstgid="409" source="Walkable.tsx"/>
<layer id="1" name="Background" width="12" height="8">
<data encoding="csv">
86,90,91,89,90,91,89,90,91,89,90,92,
110,114,115,113,114,115,113,114,115,113,114,116,
86,93,94,1,1,1,1,1,9,10,1,92,
110,117,118,1,1,1,1,1,33,34,1,116,
86,1,1,1,1,1,1,1,1,1,1,92,
110,1,1,1,1,133,2,1,1,1,1,116,
110,1,1,1,1,2,2,1,1,1,1,92,
110,114,114,114,114,114,114,114,114,114,114,116
</data>
</layer>
<layer id="2" name="Foreground" width="12" height="8">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="3" name="Walkable" width="12" height="8">
<data encoding="csv">
410,410,410,410,410,410,410,410,410,410,410,410,
410,410,410,410,410,410,410,410,410,410,410,410,
410,410,410,0,0,0,0,0,410,0,0,410,
410,410,410,0,0,0,0,0,410,0,0,410,
410,0,0,0,0,0,0,0,0,0,0,410,
410,0,0,0,0,0,0,0,0,0,0,410,
410,0,0,0,0,0,0,0,0,0,0,410,
410,410,410,410,410,410,410,410,410,410,410,410
</data>
</layer>
<objectgroup id="4" name="ExtraData">
<object id="2" name="porte" type="PORTAL" x="39.6736" y="40.0979" width="15.8058" height="15.9119">
<properties>
<property name="dest" type="file" value="level0.tmx"/>
<property name="destPortal" value="taverne"/>
</properties>
</object>
</objectgroup>
</map>

Some files were not shown because too many files have changed in this diff Show more