Skip to content

Commit

Permalink
Merge branch 'JackMaster' into mergeJackOntoSquash
Browse files Browse the repository at this point in the history
Conflicts:
	ZAPD/Declaration.h
	ZAPD/Globals.cpp
	ZAPD/Globals.h
	ZAPD/Main.cpp
	ZAPD/OtherStructs/SkinLimbStructs.cpp
	ZAPD/OtherStructs/SkinLimbStructs.h
	ZAPD/ZAnimation.cpp
	ZAPD/ZCollision.cpp
	ZAPD/ZCollision.h
	ZAPD/ZDisplayList.cpp
	ZAPD/ZFile.cpp
	ZAPD/ZLimb.cpp
	ZAPD/ZLimb.h
	ZAPD/ZPath.cpp
	ZAPD/ZResource.h
	ZAPD/ZRoom/Commands/SetCsCamera.cpp
	ZAPD/ZRoom/Commands/SetCutsceneEntryList.cpp
	ZAPD/ZRoom/Commands/SetCutscenes.cpp
	ZAPD/ZRoom/Commands/SetCutscenes.h
	ZAPD/ZRoom/Commands/SetEntranceList.cpp
	ZAPD/ZRoom/Commands/SetLightingSettings.cpp
	ZAPD/ZRoom/Commands/SetMesh.cpp
	ZAPD/ZRoom/Commands/SetMinimapList.cpp
	ZAPD/ZTexture.cpp
	ZAPDUtils/Makefile
	ZAPDUtils/Utils/BitConverter.h
	ZAPDUtils/Utils/Directory.h
	ZAPDUtils/Utils/File.h
	ZAPDUtils/Utils/Path.h
	ZAPDUtils/Utils/StringHelper.h
	ZAPDUtils/ZAPDUtils.vcxproj
  • Loading branch information
briaguya-ai committed Oct 18, 2023
2 parents e9f4fc6 + 094e797 commit 3f878d4
Show file tree
Hide file tree
Showing 78 changed files with 3,660 additions and 2,302 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
Expand Down
6 changes: 3 additions & 3 deletions ExporterTest/CollisionExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] const fs::

for (auto entry : col->camData->entries)
{
writer->Write(entry->cameraSType);
writer->Write(entry->numData);
writer->Write(entry->cameraPosDataSeg);
writer->Write(entry.cameraSType);
writer->Write(entry.numData);
writer->Write(entry.cameraPosDataSeg);
}

writer->Seek(oldOffset, SeekOffsetType::Start);
Expand Down
2 changes: 1 addition & 1 deletion ExporterTest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clean:
rm -rf build $(LIB)

format:
clang-format-11 -i $(CPP_FILES) $(H_FILES)
clang-format-14 -i $(CPP_FILES) $(H_FILES)

.PHONY: all clean format

Expand Down
2 changes: 1 addition & 1 deletion ExporterTest/RoomExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void ExporterExample_Room::Save(ZResource* res, const fs::path& outPath, BinaryW
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(baseStreamEnd, SeekOffsetType::Start);

for (EntranceEntry entry : cmdEntrance->entrances)
for (Spawn entry : cmdEntrance->entrances)
{
writer->Write((uint8_t)entry.startPositionIndex);
writer->Write((uint8_t)entry.roomToLoad);
Expand Down
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ COPYCHECK_ARGS ?=
LLD ?= 0
WERROR ?= 0

# On MacOS 10.14, use boost::filesystem, because
# the system doesn't supply std::filesystem.
ifneq ($(OS),Windows_NT)
ifeq ($(shell uname -s),Darwin)
MACOS_VERSION := $(shell sw_vers -productVersion | cut -d . -f 1,2)
ifeq ($(MACOS_VERSION),10.14)
USE_BOOST_FS ?= 1
endif
endif
endif
USE_BOOST_FS ?= 0

# Use clang++ if available, else use g++
ifeq ($(shell command -v clang++ >/dev/null 2>&1; echo $$?),0)
CXX := clang++
Expand Down Expand Up @@ -46,6 +58,11 @@ endif

LDFLAGS := -lm -ldl -lpng

ifneq ($(USE_BOOST_FS),0)
CXXFLAGS += -DUSE_BOOST_FS
LDFLAGS += -lboost_filesystem
endif

# Use LLD if available. Set LLD=0 to not use it
ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
LLD := 1
Expand Down Expand Up @@ -106,7 +123,7 @@ clean:
rebuild: clean all

format:
clang-format-11 -i $(ZAPD_CPP_FILES) $(ZAPD_H_FILES)
clang-format-14 -i $(ZAPD_CPP_FILES) $(ZAPD_H_FILES)
$(MAKE) -C ZAPDUtils format
$(MAKE) -C ExporterTest format

Expand Down
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ to install it via Homebrew.

#### Linux / *nix

ZAPD uses the clasic `Makefile` approach. To build just run `make` (or even better `make -j` for faster compilations).
ZAPD uses the classic `Makefile` approach. To build just run `make` (or even better `make -j` for faster compilations).

You can configure a bit your ZAPD build with the following options:

Expand Down Expand Up @@ -139,22 +139,23 @@ Each warning type uses one of these by default, but can be modified with flags,

All warning types currently implemented, with their default levels:

| Warning type | Default level | Description |
| --------------------------- | ------------- | ------------------------------------------------------------------------ |
| `-Wdeprecated` | Warn | Deprecated features |
| `-Whardcoded-pointer` | Warn | ZAPD lacks the info to make a symbol, so must output a hardcoded pointer |
| `-Wintersection` | Warn | Two assets intersect |
| `-Winvalid-attribute-value` | Err | Attribute declared in XML is wrong |
| `-Winvalid-extracted-data` | Err | Extracted data does not have correct form |
| `-Winvalid-jpeg` | Err | JPEG file does not conform to the game's format requirements |
| `-Winvalid-png` | Err | Issues arising when processing PNG data |
| `-Winvalid-xml` | Err | XML has syntax errors |
| `-Wmissing-attribute` | Warn | Required attribute missing in XML tag |
| `-Wmissing-offsets` | Warn | Offset attribute missing in XML tag |
| `-Wmissing-segment` | Warn | Segment not given in File tag in XML |
| `-Wnot-implemented` | Warn | ZAPD does not currently support this feature |
| `-Wunaccounted` | Off | Large blocks of unaccounted |
| `-Wunknown-attribute` | Warn | Unknown attribute in XML entry tag |
| Warning type | Default level | Description |
| ----------------------------- | ------------- | ------------------------------------------------------------------------ |
| `-Wdeprecated` | Warn | Deprecated features |
| `-Whardcoded-generic-pointer` | Off | A generic segmented pointer must be produced |
| `-Whardcoded-pointer` | Warn | ZAPD lacks the info to make a symbol, so must output a hardcoded pointer |
| `-Wintersection` | Warn | Two assets intersect |
| `-Winvalid-attribute-value` | Err | Attribute declared in XML is wrong |
| `-Winvalid-extracted-data` | Err | Extracted data does not have correct form |
| `-Winvalid-jpeg` | Err | JPEG file does not conform to the game's format requirements |
| `-Winvalid-png` | Err | Issues arising when processing PNG data |
| `-Winvalid-xml` | Err | XML has syntax errors |
| `-Wmissing-attribute` | Warn | Required attribute missing in XML tag |
| `-Wmissing-offsets` | Warn | Offset attribute missing in XML tag |
| `-Wmissing-segment` | Warn | Segment not given in File tag in XML |
| `-Wnot-implemented` | Warn | ZAPD does not currently support this feature |
| `-Wunaccounted` | Off | Large blocks of unaccounted |
| `-Wunknown-attribute` | Warn | Unknown attribute in XML entry tag |

There are also errors that do not have a type, and cannot be disabled.

Expand Down
1 change: 1 addition & 0 deletions ZAPD/CrashHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#endif

#include <array>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <ctime>
Expand Down
Loading

0 comments on commit 3f878d4

Please sign in to comment.