Skip to content

Commit 7b4595f

Browse files
authored
Merge pull request #11 from vircon32/PNGJoiner
Merge PNGJoiner branch to main
2 parents 7ba2865 + 69169ab commit 7b4595f

19 files changed

Lines changed: 1443 additions & 34 deletions

File tree

DevelopmentTools/Assembler/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void PrintUsage()
5353

5454
void PrintVersion()
5555
{
56-
cout << "assemble v24.8.4" << endl;
56+
cout << "assemble v25.1.4" << endl;
5757
cout << "Vircon32 assembler by Javier Carracedo" << endl;
5858
}
5959

DevelopmentTools/CCompiler/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void PrintUsage()
5757

5858
void PrintVersion()
5959
{
60-
cout << "compile v24.8.4" << endl;
60+
cout << "compile v25.1.4" << endl;
6161
cout << "Vircon32 C compiler by Javier Carracedo" << endl;
6262
}
6363

DevelopmentTools/CMakeLists.txt

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ set(WAV_CONVERTER_DIR "WAV2Vircon/"
3434
CACHE PATH "The path to the WAV converter sources.")
3535
set(TILED_CONVERTER_DIR "Tiled2Vircon/"
3636
CACHE PATH "The path to the Tiled converter sources.")
37+
set(PNG_JOINER_DIR "PNGJoiner/"
38+
CACHE PATH "The path to the PNG joiner sources.")
3739
set(DISASSEMBLER_DIR "Disassembler/"
3840
CACHE PATH "The path to the disassembler sources.")
3941
set(ROM_UNPACKER_DIR "RomUnpacker/"
@@ -56,17 +58,6 @@ if(NOT CMAKE_BUILD_TYPE)
5658
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
5759
endif()
5860

59-
# Configure some legacy CMake behavior ("policies")
60-
if(POLICY CMP0054)
61-
cmake_policy(SET CMP0054 NEW) # Ignore Quoted Arguments
62-
endif()
63-
if(POLICY CMP0072)
64-
cmake_policy(SET CMP0072 NEW) # Ignore Legacy GL
65-
endif()
66-
if(POLICY CMP0074)
67-
cmake_policy(SET CMP0074 NEW) # Root Variables
68-
endif()
69-
7061
# -----------------------------------------------------
7162
# DEFINE THE PROJECT
7263
# -----------------------------------------------------
@@ -75,8 +66,8 @@ endif()
7566
project("Vircon32")
7667

7768
# Define version
78-
set(PROJECT_VERSION_MAJOR 24)
79-
set(PROJECT_VERSION_MINOR 8)
69+
set(PROJECT_VERSION_MAJOR 25)
70+
set(PROJECT_VERSION_MINOR 1)
8071
set(PROJECT_VERSION_PATCH 4)
8172

8273
# Set names for final executables
@@ -86,14 +77,14 @@ set(ROM_PACKER_BINARY_NAME "packrom")
8677
set(PNG_CONVERTER_BINARY_NAME "png2vircon")
8778
set(WAV_CONVERTER_BINARY_NAME "wav2vircon")
8879
set(TILED_CONVERTER_BINARY_NAME "tiled2vircon")
80+
set(PNG_JOINER_BINARY_NAME "joinpngs")
8981

9082
# Set names for reverse tools executables
9183
set(DISASSEMBLER_BINARY_NAME "disassemble")
9284
set(ROM_UNPACKER_BINARY_NAME "unpackrom")
9385
set(PNG_EXTRACTOR_BINARY_NAME "vircon2png")
9486
set(WAV_EXTRACTOR_BINARY_NAME "vircon2wav")
9587

96-
9788
# -----------------------------------------------------
9889
# IDENTIFY HOST ENVIRONMENT
9990
# -----------------------------------------------------
@@ -120,7 +111,7 @@ endif()
120111

121112
# Set compilation flags for C and C++
122113
if (MINGW OR TARGET_OS STREQUAL "linux")
123-
set(cxx_flags "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -Wno-unused-parameter")
114+
set(cxx_flags "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter")
124115
set(c_flags "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter")
125116
elseif (MSVC)
126117
set(cxx_flags "${CMAKE_CXX_FLAGS} /W3 /EHsc /MP /GS /wd4267 /wd4244")
@@ -208,6 +199,7 @@ set(ALL_INCLUDE_DIRS
208199
${PNG_CONVERTER_DIR}
209200
${WAV_CONVERTER_DIR}
210201
${TILED_CONVERTER_DIR}
202+
${PNG_JOINER_DIR}
211203
${ROM_PACKER_DIR}
212204
${DISASSEMBLER_DIR}
213205
${ROM_UNPACKER_DIR}
@@ -250,6 +242,11 @@ set(TILED_CONVERTER_LIBS
250242
${TINYXML2_LIBRARY}
251243
${CMAKE_DL_LIBS})
252244

245+
# Libraries to link with the PNG joiner
246+
set(PNG_JOINER_LIBS
247+
${PNG_LIBRARY}
248+
${CMAKE_DL_LIBS})
249+
253250
# -----------------------------------------------------
254251
# LINKED LIBRARIES FILES (REVERSE TOOLS)
255252
# -----------------------------------------------------
@@ -349,6 +346,15 @@ set(TILED_CONVERTER_SRC
349346
${TILED_CONVERTER_DIR}/Tiled2Vircon.cpp
350347
${INFRASTRUCTURE_DIR}/FilePaths.cpp)
351348

349+
# Source files to compile for the PNG joiner
350+
set(PNG_JOINER_SRC
351+
${PNG_JOINER_DIR}/Globals.cpp
352+
${PNG_JOINER_DIR}/PNGImage.cpp
353+
${PNG_JOINER_DIR}/PNGJoiner.cpp
354+
${PNG_JOINER_DIR}/RectangleNode.cpp
355+
${INFRASTRUCTURE_DIR}/FilePaths.cpp
356+
${INFRASTRUCTURE_DIR}/StringFunctions.cpp)
357+
352358
# -----------------------------------------------------
353359
# SOURCE FILES (REVERSE TOOLS)
354360
# -----------------------------------------------------
@@ -412,13 +418,18 @@ set_property(TARGET ${WAV_CONVERTER_BINARY_NAME} PROPERTY CXX_STANDARD 11)
412418
add_executable(${TILED_CONVERTER_BINARY_NAME} ${TILED_CONVERTER_SRC})
413419
set_property(TARGET ${TILED_CONVERTER_BINARY_NAME} PROPERTY CXX_STANDARD 11)
414420

421+
# this tool needs C++17 for a portable way to iterate over folders
422+
add_executable(${PNG_JOINER_BINARY_NAME} ${PNG_JOINER_SRC})
423+
set_property(TARGET ${PNG_JOINER_BINARY_NAME} PROPERTY CXX_STANDARD 17)
424+
415425
# Libraries to link to the C compiler executables
416426
target_link_libraries(${C_COMPILER_BINARY_NAME} ${C_COMPILER_LIBS})
417427
target_link_libraries(${ASSEMBLER_BINARY_NAME} ${ASSEMBLER_LIBS})
418428
target_link_libraries(${ROM_PACKER_BINARY_NAME} ${ROM_PACKER_LIBS})
419429
target_link_libraries(${PNG_CONVERTER_BINARY_NAME} ${PNG_CONVERTER_LIBS})
420430
target_link_libraries(${WAV_CONVERTER_BINARY_NAME} ${WAV_CONVERTER_LIBS})
421431
target_link_libraries(${TILED_CONVERTER_BINARY_NAME} ${TILED_CONVERTER_LIBS})
432+
target_link_libraries(${PNG_JOINER_BINARY_NAME} ${PNG_JOINER_LIBS})
422433

423434
# -----------------------------------------------------
424435
# EXECUTABLES (REVERSE TOOLS)
@@ -456,6 +467,7 @@ if(TARGET_OS STREQUAL "windows")
456467
${PNG_CONVERTER_BINARY_NAME}
457468
${WAV_CONVERTER_BINARY_NAME}
458469
${TILED_CONVERTER_BINARY_NAME}
470+
${PNG_JOINER_BINARY_NAME}
459471
RUNTIME
460472
COMPONENT binaries
461473
DESTINATION DevTools)
@@ -486,6 +498,7 @@ else()
486498
${PNG_CONVERTER_BINARY_NAME}
487499
${WAV_CONVERTER_BINARY_NAME}
488500
${TILED_CONVERTER_BINARY_NAME}
501+
${PNG_JOINER_BINARY_NAME}
489502
RUNTIME
490503
COMPONENT binaries
491504
DESTINATION ${CMAKE_PROJECT_NAME}/DevTools)

DevelopmentTools/Data/Readme.txt

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
================================================
22
PC development tools for Vircon32 console
3-
(version 24.8.4). README written by Carra
3+
(version 25.1.4). README written by Carra
44
================================================
55

66

@@ -55,6 +55,15 @@ Included programs (build tools)
5555
into a single file, that will be executable from any
5656
Vircon32 emulator or implementation.
5757

58+
- "joinpngs": this tool can take a folder with several PNG
59+
images and join them into a single, larger image. For
60+
performance this is much better than using a texture for
61+
every single small image. This program will also create
62+
a project file for the texture region editor (which is
63+
distributed separately). From the editor you can then
64+
edit region hotspots visually and export C or ASM
65+
headers to use the texture in your programs.
66+
5867
------------------------------------------------------------
5968

6069
Included programs (reverse tools)
@@ -79,14 +88,31 @@ Included programs (reverse tools)
7988

8089
------------------------------------------------------------
8190

82-
What's new in version 24.8.4?
91+
What's new in version 25.1.4?
8392

84-
- Reverse tools are now included in the dev tools.
85-
- On Linux and Mac systems the default installation
86-
directory for dev tools has been changed from
87-
/opt/Vircon32/DevTools to /usr/local/Vircon32/DevTools.
88-
- Along with this, file and folder permissions should
89-
now allow the compiler to save logs.
93+
- Added new tool: "joinpngs", to join multiple images into
94+
a single texture and generate its region editor project.
95+
- Because of joinpns, the required C++ version to build
96+
the tools from source now changes from C++11 to C++17.
97+
- Added new command-line options for debugging to compiler
98+
and assembler:
99+
- With option -g they will output additional files with
100+
debug info for the generated program.
101+
- With option --debugmode they will create additional
102+
files detailing the result of their internal stages
103+
(like the compiler's AST tree).
104+
- Added support for character literals in the assembler,
105+
using notation 'A', and escaped as '\'' or '\x41'.
106+
- Fixed a compiler bug: type consistency was not being
107+
checked in declarations of extern variables.
108+
- Fixed a typo in compiler's math.h header: in function
109+
atan2, the names of the arguments x and y were swapped.
110+
However this was just a naming issue. The inner workings
111+
of atan2 did not change.
112+
- Fixed a bug in wav2vircon: output sound was not always
113+
being created correctly if inputs had sample rates
114+
different from the default 44100 Hz.
115+
- Updated and fixed the assembler tests folder.
90116

91117
------------------------------------------------------------
92118

@@ -96,7 +122,7 @@ License
96122
under the 3-Clause BSD License, which full text is the
97123
following:
98124

99-
Copyright 2021-2024 Carra.
125+
Copyright 2021-2025 Carra.
100126
All rights reserved.
101127

102128
Redistribution and use in source and binary forms, with or

DevelopmentTools/Disassembler/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void PrintUsage()
4343

4444
void PrintVersion()
4545
{
46-
cout << "disassemble v24.8.4" << endl;
46+
cout << "disassemble v25.1.4" << endl;
4747
cout << "Vircon32 disassembler by Javier Carracedo" << endl;
4848
}
4949

DevelopmentTools/PNG2Vircon/png2vircon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void PrintUsage()
167167

168168
void PrintVersion()
169169
{
170-
cout << "png2vircon v24.8.4" << endl;
170+
cout << "png2vircon v25.1.4" << endl;
171171
cout << "Vircon32 PNG file importer by Javier Carracedo" << endl;
172172
}
173173

DevelopmentTools/PNG2Vircon/vircon2png.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void PrintUsage()
188188

189189
void PrintVersion()
190190
{
191-
cout << "vircon2png v24.8.4" << endl;
191+
cout << "vircon2png v25.1.4" << endl;
192192
cout << "Vircon32 PNG file extractor by Javier Carracedo" << endl;
193193
}
194194

0 commit comments

Comments
 (0)