From a214f329a731f9927732be145a80d2aadf0165c1 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Thu, 30 May 2024 11:40:31 +0200 Subject: [PATCH] [Maintenance] grzview: Copy-paste .GRZ stream arrays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unfortunate, but we won't be able to reuse the same .OBJ file once we compile all pipeline tools with the `pascal` calling convention. Separately compiling `th01/formats/img_data.cpp` would also turn into a mess with the upcoming `#include` cleanup: • `img_data.cpp` requires `ptn.hpp`, • which will require `egc.h`, • which requires `defconv.h`, • which requires `GAME` to be defined, • which makes no sense for pipeline tools. Part of P0002, funded by GhostPhanom. --- Makefile.mak | 2 +- Pipeline/grzview.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.mak b/Makefile.mak index 8a5e8c12..69e8b2f2 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -56,7 +56,7 @@ th05:: $(TH05:\=bin\th05\) .obj.com: tlink /t /3 $** -bin\Pipeline\grzview.com: Pipeline\grzview.cpp th01\formats\grz.cpp bin\th01\f_imgd.obj platform\x86real\pc98\palette.cpp +bin\Pipeline\grzview.com: Pipeline\grzview.cpp th01\formats\grz.cpp platform\x86real\pc98\palette.cpp $(CC) $(CFLAGS) -Z -DGAME=1 -mt -lt -nbin\Pipeline\ @&&| $** | masters.lib diff --git a/Pipeline/grzview.cpp b/Pipeline/grzview.cpp index 5e10b8de..d359c3f8 100644 --- a/Pipeline/grzview.cpp +++ b/Pipeline/grzview.cpp @@ -8,6 +8,12 @@ #include "platform/x86real/pc98/palette.hpp" #include "th01/formats/grz.h" +// Copied from th01/formats/img_data.cpp. Unfortunate, but better than linking +// in or separately compiling this translation unit. +uint8_t* rle_streams[GRX_COUNT]; +dots8_t* planar_streams[GRX_COUNT][PLANAR_STREAM_PER_GRX_COUNT]; +uint8_t planar_stream_count[GRX_COUNT]; + void grcg_setcolor_rmw(vc2 col) { grcg_setcolor(GC_RMW, col);