diff --git a/Daedalus.sln b/Daedalus.sln
new file mode 100644
index 0000000..5a83c5f
--- /dev/null
+++ b/Daedalus.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29215.179
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Daedalus", "Daedalus.vcxproj", "{3F41CB08-9973-4856-ACC3-66ABE55D0E4D}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Debug|Win32.Build.0 = Debug|Win32
+ {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Release|Win32.ActiveCfg = Release|Win32
+ {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {EA36D49B-46A9-4EAF-BE0B-377A08A90A33}
+ EndGlobalSection
+EndGlobal
diff --git a/Daedalus.vcproj b/Daedalus.vcproj
new file mode 100644
index 0000000..63496f6
--- /dev/null
+++ b/Daedalus.vcproj
@@ -0,0 +1,334 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Daedalus.vcxproj b/Daedalus.vcxproj
new file mode 100644
index 0000000..370769c
--- /dev/null
+++ b/Daedalus.vcxproj
@@ -0,0 +1,134 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {3F41CB08-9973-4856-ACC3-66ABE55D0E4D}
+ Daedalus
+ Win32Proj
+
+
+
+ Application
+ v142
+
+
+ Application
+ v142
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>16.0.29124.152
+
+
+ ..\G\
+ ..\G\
+ true
+
+
+ ..\G\
+ ..\G\
+ true
+
+
+
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;SECURE;%(PreprocessorDefinitions)
+ false
+ EnableFastChecks
+ MultiThreadedDebugDLL
+
+ Level3
+ EditAndContinue
+
+
+ shlwapi.lib Winmm.lib %(AdditionalOptions)
+ true
+ Windows
+ MachineX86
+
+
+
+
+ Neither
+ WIN32;NDEBUG;_WINDOWS;SECURE;%(PreprocessorDefinitions)
+ MultiThreaded
+
+ Level3
+ ProgramDatabase
+
+
+ shlwapi.lib Winmm.lib %(AdditionalOptions)
+ true
+ Windows
+ true
+ true
+ MachineX86
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f8000bd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+# Daedalus (Version 3.4) File: Makefile
+# By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
+#
+# IMPORTANT NOTICE: Daedalus and all Maze generation and general
+# graphics routines used in this program are Copyright (C) 1998-2023 by
+# Walter D. Pullen. Permission is granted to freely use, modify, and
+# distribute these routines provided these credits and notices remain
+# unmodified with any altered or distributed versions of the program.
+# The user does have all rights to Mazes and other graphic output
+# they make in Daedalus, like a novel created in a word processor.
+#
+# First created 12/7/2018.
+#
+# This Makefile is included only for convenience. One could easily compile
+# Daedalus on a Unix system by hand with the command:
+# % g++ -c -O *.cpp; g++ -o daedalus *.o -lm
+# Generally, all that needs to be done to compile once util.h has been
+# edited, is compile each source file, and link them together with the math
+# library.
+#
+NAME = daedalus
+OBJS = color.o command.o create.o create2.o create3.o daedalus.o\
+ draw.o draw2.o game.o graphics.o inside.o labyrnth.o maze.o solids.o\
+ solve.o threed.o util.o
+
+LIBS = -lm -s
+CPPFLAGS = -O -Wno-write-strings -Wno-narrowing -Wno-comment
+RM = rm -f
+
+daedalus:: $(OBJS)
+ g++ -o $(NAME) $(OBJS) $(LIBS)
+
+clean:
+ $(RM) $(OBJS) $(NAME)
+#
\ No newline at end of file
diff --git a/changes.doc b/changes.doc
index 74c6d07..dbf28c5 100644
Binary files a/changes.doc and b/changes.doc differ
diff --git a/color.cpp b/color.cpp
index 9532424..c15ba96 100644
--- a/color.cpp
+++ b/color.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: color.cpp
+** Daedalus (Version 3.4) File: color.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** bitmap, unrelated to Mazes.
**
** Old last code change: 6/29/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -227,6 +227,8 @@ KV KvBlendR(KV kv1, KV kv2, real r)
KV KvBlendN(KV kv1, KV kv2, int n1, int n2)
{
Assert(FBetween(n1, 0, n2));
+ if (n2 == 0)
+ n2 = 1;
return Rgb((RgbR(kv2) - RgbR(kv1)) * n1 / n2 + RgbR(kv1),
(RgbG(kv2) - RgbG(kv1)) * n1 / n2 + RgbG(kv1),
(RgbB(kv2) - RgbB(kv1)) * n1 / n2 + RgbB(kv1));
@@ -646,7 +648,7 @@ void CCol::BitmapSet(KV kv)
if (kv == kvBlack || kv == kvWhite || kv == ~0) {
// For the simplest colors, set 32 bits at a time.
- l = kv == kvBlack ? 0 : ~0;
+ l = kv == kvBlack ? 0 : dwSet;
pl = (dword *)_Pb(0);
for (il = m_y * m_clRow; il > 0; il--)
*pl++ = l;
@@ -976,7 +978,7 @@ void CCol::ColmapExchange(KV kv1, KV kv2)
for (y = 0; y < m_y; y++)
for (x = 0; x < m_x; x++) {
- kv = Get(x, y);
+ kv = _Get(x, y);
if (kv == kv1)
Set(x, y, kv2);
else if (kv == kv2)
@@ -994,7 +996,7 @@ void CCol::ColmapOrAndKv(KV kv, int nOp)
for (y = 0; y < m_y; y++)
for (x = 0; x < m_x; x++) {
- kvT = Get(x, y);
+ kvT = _Get(x, y);
switch (nOp) {
// Boolean bit combining
@@ -2120,6 +2122,42 @@ flag CCol::FColmapBlendFromBitmap(CONST CMon *b1, CONST CMon *b2,
}
+// Make a color bitmap an equal blending together of N other color bitmaps.
+// The N other bitmaps are stacked vertically within a second bitmap. Black
+// pixels are skipped, and make that subbitmap not contribute to the result.
+
+void CCol::ColmapBlendBitmaps(CONST CCol &c)
+{
+ int cc, x, y, i, nT, ccol, nR, nG, nB;
+ KV kv;
+
+ BitmapOff();
+ cc = c.m_y + (m_y - 1) / m_y;
+ for (y = 0; y < m_y; y++)
+ for (x = 0; x < m_x; x++) {
+ ccol = nR = nG = nB = 0;
+ for (i = 0; i < cc; i++) {
+ kv = c.Get(x, i * m_y + y);
+ if (kv == kvBlack)
+ continue;
+ ccol++;
+ nR += RgbR(kv);
+ nG += RgbG(kv);
+ nB += RgbB(kv);
+ }
+ if (ccol <= 0)
+ continue;
+ nT = ccol >> 1;
+ nR = (nR + nT) / ccol;
+ nG = (nG + nT) / ccol;
+ nB = (nB + nT) / ccol;
+ kv = Rgb(nR, nG, nB);
+ if (kv != kvBlack)
+ Set(x, y, kv);
+ }
+}
+
+
// Copy a monochrome bitmap to a color bitmap, where off and on pixels in the
// monochrome bitmap are mapped to the passed in colors. All off pixels
// reachable from a start point or points will be filled with a blend of
@@ -2503,6 +2541,8 @@ flag CCol::FReadColmapTarga(FILE *file)
for (i = 0; i < 12; i++)
skipbyte();
+ if (feof(file))
+ return fFalse;
fscanf(file, "%c%c", S1(&ch), S1(&chR));
x = (int)(chR)*256 + (int)ch;
fscanf(file, "%c%c", S1(&ch), S1(&chR));
@@ -2512,6 +2552,8 @@ flag CCol::FReadColmapTarga(FILE *file)
skipword();
for (y = m_y-1; y >= 0; y--) {
for (x = 0; x < m_x; x++) {
+ if (feof(file))
+ return fFalse;
fscanf(file, "%c%c%c%c", S1(&chB), S1(&chG), S1(&chR), S1(&ch));
Set(x, y, Rgb(chR, chG, chB));
}
diff --git a/color.h b/color.h
index d1723d8..c29a109 100644
--- a/color.h
+++ b/color.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: color.h
+** Daedalus (Version 3.4) File: color.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** on a color bitmap, unrelated to Mazes.
**
** Old last code change: 6/29/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
/*
@@ -104,9 +104,12 @@ enum _colorreplace {
#define UdD(l) ((int)((dword)(l) >> 12))
#define ITextureWall(kv, d) ((int)(((kv) >> ((d) * 6)) & (cTexture-1)))
#define ITextureWall2(kv, d) ((int)(((kv) >> (FOdd(d) * 12)) & 4095))
+#define ITextureWall3(kv, d) ((int)(((kv) >> (((d) > 1) * 12)) & 4095))
#define GetT(c, x, y, d) ITextureWall((c).Get(x, y), d)
#define SetT(c, x, y, d, t) ((c).Get(x, y) & \
~((KV)(cTexture-1) << ((d) * 6)) | ((KV)(t) << ((d) * 6)))
+#define SetU(c, x, y, f, t) ((c).Get(x, y) & \
+ ~((KV)4095 << ((f) * 12)) | ((KV)(t) << ((f) * 12)))
/*
@@ -214,6 +217,7 @@ class CCol : virtual public CMap // Color bitmap
flag FColmapPutToBitmap(CMon &, int) CONST;
void ColmapOrAndFromBitmap(CONST CMon &, KV, KV, int);
flag FColmapBlendFromBitmap(CONST CMon *, CONST CMon *, CONST CMon *);
+ void ColmapBlendBitmaps(CONST CCol &);
flag FColmapBlur(flag);
void ColmapContrast(flag);
diff --git a/command.cpp b/command.cpp
index 8928a34..cea7dfd 100644
--- a/command.cpp
+++ b/command.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: command.cpp
+** Daedalus (Version 3.4) File: command.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** execute macros and script files.
**
** Created: 11/26/2001.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -184,6 +184,7 @@ CONST CMD rgcmd[ccmd] = {
{cmdCreateInfinite3, "InfiniteRestart", "", MZ | M2},
{cmdCreateKruskal, "Kruskal", "al", MZ | ME | M2},
{cmdCreateLabyrinth, "Labyrinth", "C", MZ | ME | M2},
+{cmdCreateOmicron, "Omicron", "", MZ | ME | M2},
{cmdCreatePatchOverview, "MakePatch", "", HG},
{cmdCreatePerfect, "Perfect", "P", MZ | ME | M2},
{cmdCreatePlanair, "Planair", "J", MZ | M2},
@@ -445,6 +446,7 @@ CONST CMD rgcmd[ccmd] = {
{cmdScript27, "Script27", "ac7", 0},
{cmdScript28, "Script28", "ac8", 0},
{cmdScript29, "Script29", "ac9", 0},
+{cmdScript30, "Script30", "ac0", 0},
{cmdScrollDown, "ScrollDown", "aPgDn",R2},
{cmdScrollEnd, "ScrollEnd", "aEnd", R2},
{cmdScrollHome, "ScrollHome", "aHome",R2},
@@ -556,6 +558,7 @@ enum _operationindex {
oprOpenPaint,
oprOpenWire,
oprOpenPatch,
+ oprDlgDB,
oprDlgPaint,
oprEmbedXbm,
oprEmbed3D,
@@ -578,6 +581,7 @@ enum _operationindex {
oprSaveOverview,
oprSavePatch,
oprSavePicture,
+ oprSaveVector,
oprSaveSolids,
oprSize,
oprSizeC,
@@ -659,6 +663,7 @@ enum _operationindex {
oprSetCE,
oprSetCA,
oprSetX,
+ oprSetY,
oprSet3,
oprSet3T,
oprSet3E,
@@ -668,6 +673,7 @@ enum _operationindex {
oprSet3CE,
oprSet3CA,
oprSet3X,
+ oprSet3Y,
oprZapTexture,
oprMark2,
oprUnmark2,
@@ -676,6 +682,7 @@ enum _operationindex {
oprTextFont,
oprPerimeter,
oprThicken2,
+ oprBlendN,
oprConvex,
oprAllMoire,
opr2ndLine2,
@@ -701,12 +708,15 @@ enum _operationindex {
oprSymmetricX,
oprSymmetricY,
oprSymmetricZ,
+ oprZoomPic,
oprOverview2,
oprAltitude,
oprGetWire,
oprSetWire,
oprGetPatch,
oprSetPatch,
+ oprGetStar,
+ oprSetStar,
oprStereogram,
oprSetLife,
oprEvolution,
@@ -735,6 +745,7 @@ CONST OPR rgopr[copr] = {
{oprOpenPaint, "OpenPaint", 1, SZ | R2 | C2},
{oprOpenWire, "OpenWire", 1, SZ},
{oprOpenPatch, "OpenPatch", 1, SZ},
+{oprDlgDB, "DlgOpenDB", 0, R2},
{oprDlgPaint, "DlgOpenPaint", 0, R2 | C2},
{oprEmbedXbm, "EmbedX11", 0, R2 | B2},
{oprEmbed3D, "Embed3D", 0, R2 | B2 | M3},
@@ -757,6 +768,7 @@ CONST OPR rgopr[copr] = {
{oprSaveOverview,"SaveWire", 1, SZ},
{oprSavePatch, "SavePatch", 1, SZ},
{oprSavePicture, "SavePicture", 1, SZ},
+{oprSaveVector, "SaveVector", 1, SZ},
{oprSaveSolids, "SaveSolids", 1, SZ},
{oprSize, "Size", 4, R2 | B1},
{oprSizeC, "SizeC", 4, R2 | C1},
@@ -838,6 +850,7 @@ CONST OPR rgopr[copr] = {
{oprSetCE, "SetCE", 3, 0},
{oprSetCA, "SetCA", 4, R1},
{oprSetX, "SetX", 4, R1},
+{oprSetY, "SetY", 4, R1},
{oprSet3, "Set3", 4, R2},
{oprSet3T, "Set3T", 4, R1},
{oprSet3E, "Set3E", 4, R1},
@@ -847,6 +860,7 @@ CONST OPR rgopr[copr] = {
{oprSet3CE, "Set3CE", 4, 0},
{oprSet3CA, "Set3CA", 5, R1},
{oprSet3X, "Set3X", 5, R1},
+{oprSet3Y, "Set3Y", 5, R1},
{oprZapTexture, "ZapTexture", 1, R1},
{oprMark2, "MarkX2", 0, R1},
{oprUnmark2, "EraseX2", 0, R1},
@@ -855,6 +869,7 @@ CONST OPR rgopr[copr] = {
{oprTextFont, "TextFont", 3, SZ},
{oprPerimeter, "Perimeter", 0, 0},
{oprThicken2, "Thicken2", 1, R2 | HG | B1},
+{oprBlendN, "BlendN", 0, R2 | HG},
{oprConvex, "Convex", 0, R2 | HG | B1},
{oprAllMoire, "AllMoire", 0, R2 | HG | B2},
{opr2ndLine2, "2ndLineUntil", 1, R2 | B2},
@@ -880,12 +895,15 @@ CONST OPR rgopr[copr] = {
{oprSymmetricX, "SymmetricX", 0, R2 | HG | B1 | M2},
{oprSymmetricY, "SymmetricY", 0, R2 | HG | B1 | M2},
{oprSymmetricZ, "SymmetricZ", 0, R2 | HG | B1 | M2},
+{oprZoomPic, "ZoomBiasPic", 0, R2 | HG | B1 | M2},
{oprOverview2, "Overview2", 0, R2 | HG},
{oprAltitude, "Altitude", 2, R2 | HG | NC | M2},
{oprGetWire, "GetWireframe", 2, 0},
{oprSetWire, "SetWireframe", 2, 0},
{oprGetPatch, "GetPatch", 2, 0},
{oprSetPatch, "SetPatch", 2, 0},
+{oprGetStar, "GetStar", 3, 0},
+{oprSetStar, "SetStar", 5, R2},
{oprStereogram, "Stereogram", 2, R2 | HG},
{oprSetLife, "SetLife", 1, 0},
{oprEvolution, "Evolution", 2, R2 | HG | C1},
@@ -1192,6 +1210,7 @@ enum _variableindex {
varSunMoon2,
varSunMoonY,
varStarColor,
+ varStarSize,
varSkyAll,
varSky3D,
varShowDelay,
@@ -1215,6 +1234,7 @@ enum _variableindex {
varTextureVar,
varTextureElev,
varTextureDual,
+ varTextureDual2,
varTextureBlend,
varMarkElevX1,
varMarkElevY1,
@@ -1235,6 +1255,7 @@ enum _variableindex {
varLineSort,
varLineDistance,
varFaceOrigin,
+ varStereo3D,
varWireCount,
varPatchCount,
varMandelbrot,
@@ -1534,6 +1555,7 @@ CONST VAR rgvar[cvar] = {
{varSunMoon2, "nSunMoon", R1},
{varSunMoonY, "nSunMoonY", R1},
{varStarColor, "nStarColor", 0},
+{varStarSize, "nStarSize", R1},
{varSkyAll, "fSkyAll", R1},
{varSky3D, "fSky3D", R1},
{varShowDelay, "fFrameDelay", R1},
@@ -1557,6 +1579,7 @@ CONST VAR rgvar[cvar] = {
{varTextureVar, "nTextureBlock", R1},
{varTextureElev, "nTextureElev", R1},
{varTextureDual, "fTextureDual", R1},
+{varTextureDual2, "fTextureDual2", R1},
{varTextureBlend, "fTextureBlend", R1},
{varMarkElevX1, "nMarkElevX1", 0},
{varMarkElevY1, "nMarkElevY1", 0},
@@ -1577,6 +1600,7 @@ CONST VAR rgvar[cvar] = {
{varLineSort, "fWireSort", R1},
{varLineDistance, "nWireDistance", R1},
{varFaceOrigin, "nDrawFaceOrigin", R1},
+{varStereo3D, "fStereo3D", R1},
{varWireCount, "nWireframeSize", 0},
{varPatchCount, "nPatchSize", 0},
{varMandelbrot, "fMandelbrotShip", 0},
@@ -1619,15 +1643,19 @@ enum _functionindex {
funInv,
funShftL,
funShftR,
+ funAndL,
+ funOrL,
funOdd,
funAbs,
funSgn,
funMin,
funMax,
+ funTween,
funRnd,
funIf,
funSqr,
funDist,
+ funLn,
funSin,
funCos,
funTan,
@@ -1746,15 +1774,19 @@ CONST FUN rgfun[cfun] = {
{funInv, "Inv", 1},
{funShftL, "<<", 2},
{funShftR, ">>", 2},
+{funAndL, "&&", 2},
+{funOrL, "||", 2},
{funOdd, "Odd", 1},
{funAbs, "Abs", 1},
{funSgn, "Sgn", 1},
{funMin, "Min", 2},
{funMax, "Max", 2},
+{funTween, "Tween", 3},
{funRnd, "Rnd", 2},
{funIf, "?:", 3},
{funSqr, "Sqr", 1},
{funDist, "Dist", 4},
+{funLn, "Ln", 2},
{funSin, "Sin", 2},
{funCos, "Cos", 2},
{funTan, "Tan", 2},
@@ -2014,6 +2046,7 @@ void DoSetVariable(int ivar, CONST char *sz, int cch, long l)
case varFogLength: dr.nFog = n; break;
case varClipPlane: dr.nClip = n; break;
case varViewSpan: dr.dInside = (real)n / 100.0; break;
+ case varStereo: ds.nStereo = n; break;
case varTrans: dr.nTrans = n; break;
case varFrameMove: dr.nFrameXY = n; break;
case varFrameTurn: dr.nFrameD = n; break;
@@ -2168,6 +2201,7 @@ void DoSetVariable(int ivar, CONST char *sz, int cch, long l)
case varSunMoon2: dr.nSunMoon = n; break;
case varSunMoonY: dr.ySunMoon = n; break;
case varStarColor: ds.lStarColor = n; break;
+ case varStarSize: ds.nStarSize = n; break;
case varSkyAll: ds.fSkyAll = f; break;
case varSky3D: dr.fSky3D = f; break;
case varShowDelay: dr.fDelay = f; break;
@@ -2191,12 +2225,12 @@ void DoSetVariable(int ivar, CONST char *sz, int cch, long l)
case varTextureVar: dr.nTextureVar = n; break;
case varTextureElev: dr.nTextureElev = n; break;
case varTextureDual: dr.fTextureDual = f; break;
+ case varTextureDual2: dr.fTextureDual2 = f; break;
case varTextureBlend: dr.fTextureBlend = f; break;
case varMarkElevX1: dr.nMarkElevX1 = n; break;
case varMarkElevY1: dr.nMarkElevY1 = n; break;
case varMarkElevX2: dr.nMarkElevX2 = n; break;
case varMarkElevY2: dr.nMarkElevY2 = n; break;
- case varStereo: dr.nStereo = n; break;
case varMazeCellMax: ms.nCellMax = n; break;
case varHuntType: ms.nHuntType = n; break;
case varFractalDepth: ms.nFractalD = n; break;
@@ -2212,6 +2246,7 @@ void DoSetVariable(int ivar, CONST char *sz, int cch, long l)
case varLineSort: ds.fWireSort = f; break;
case varLineDistance: ds.nWireDistance = n; break;
case varFaceOrigin: ds.nFaceOrigin = n; break;
+ case varStereo3D: ds.fStereo3D = f; break;
case varWireCount:
if (FSetWireSize(&bm.coor, bm.ccoor, n)) bm.ccoor = n; break;
case varPatchCount:
@@ -2377,6 +2412,7 @@ void GetVariable(int ivar, char **psz, int *pcch, long *pl)
case varFogLength: n = dr.nFog; break;
case varClipPlane: n = dr.nClip; break;
case varViewSpan: n = (int)(dr.dInside * 100.0); break;
+ case varStereo: n = ds.nStereo; break;
case varTrans: n = dr.nTrans; break;
case varFrameMove: n = dr.nFrameXY; break;
case varFrameTurn: n = dr.nFrameD; break;
@@ -2530,6 +2566,7 @@ void GetVariable(int ivar, char **psz, int *pcch, long *pl)
case varSunMoon2: n = dr.nSunMoon; break;
case varSunMoonY: n = dr.ySunMoon; break;
case varStarColor: n = ds.lStarColor; break;
+ case varStarSize: n = ds.nStarSize; break;
case varSkyAll: n = ds.fSkyAll; break;
case varSky3D: n = dr.fSky3D; break;
case varShowDelay: n = dr.fDelay; break;
@@ -2553,12 +2590,12 @@ void GetVariable(int ivar, char **psz, int *pcch, long *pl)
case varTextureVar: n = dr.nTextureVar; break;
case varTextureElev: n = dr.nTextureElev; break;
case varTextureDual: n = dr.fTextureDual; break;
+ case varTextureDual2: n = dr.fTextureDual2; break;
case varTextureBlend: n = dr.fTextureBlend; break;
case varMarkElevX1: n = dr.nMarkElevX1; break;
case varMarkElevY1: n = dr.nMarkElevY1; break;
case varMarkElevX2: n = dr.nMarkElevX2; break;
case varMarkElevY2: n = dr.nMarkElevY2; break;
- case varStereo: n = dr.nStereo; break;
case varMazeCellMax: n = ms.nCellMax; break;
case varHuntType: n = ms.nHuntType; break;
case varFractalDepth: n = ms.nFractalD; break;
@@ -2574,6 +2611,7 @@ void GetVariable(int ivar, char **psz, int *pcch, long *pl)
case varLineSort: n = ds.fWireSort; break;
case varLineDistance: n = ds.nWireDistance; break;
case varFaceOrigin: n = ds.nFaceOrigin; break;
+ case varStereo3D: n = ds.fStereo3D; break;
case varWireCount: n = bm.ccoor; break;
case varPatchCount: n = bm.cpatch; break;
case varMandelbrot: n = cs.fMandelbrot; break;
@@ -2630,15 +2668,19 @@ long EvalFunction(int ifun, char *rgsz[], CONST int *rgcch, CONST long *rgl)
case funInv: n = ~n1; break;
case funShftL: n = n1 << n2; break;
case funShftR: n = n1 >> n2; break;
+ case funAndL: n = n1 && n2; break;
+ case funOrL: n = n1 || n2; break;
case funOdd: n = FOdd(n1); break;
case funAbs: n = NAbs(n1); break;
case funSgn: n = NSgn(n1); break;
case funMin: n = Min(n1, n2); break;
case funMax: n = Max(n1, n2); break;
+ case funTween: n = FBetween(n1, n2, n3); break;
case funRnd: n = Rnd(n1, n2); break;
case funIf: n = n1 ? n2 : n3; break;
case funSqr: n = NSqr(NAbs(n1)); break;
case funDist: n = (int)LengthN(n1, n2, n3, n4); break;
+ case funLn: n = (int)((real)n1 * log((real)n2)); break;
case funSin: n = (int)(((real)n1 + rRound) * RSinD((real)n2)); break;
case funCos: n = (int)(((real)n1 + rRound) * RCosD((real)n2)); break;
case funTan: n = (int)(((real)n1 + rRound) * RTanD((real)n2)); break;
@@ -2766,7 +2808,7 @@ long EvalFunction(int ifun, char *rgsz[], CONST int *rgcch, CONST long *rgl)
PchGetParameter(sz, NULL, NULL, (long *)&n, 1);
break;
case funEvent: n = NGetVariableW(n1 ? vosEventMouse : vosEventKey); break;
- case funVer: n = 3300; break; // Daedalus 3.3
+ case funVer: n = 3400; break; // Daedalus 3.4
case funFileOpen:
CopyRgchToSz(rgsz[0], rgcch[0], sz, cchSzMax);
@@ -2966,6 +3008,7 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
{
size_t cursorPrev = NULL;
CMap3 *pbSrc, *pbDst, *bT;
+ STAR *pstar;
char sz[cchSzOpr], szT[cchSzMax], sz3[cchSzDef];
char *pch, *pchT;
int nRet = 0, n1, n2, n3, n4, n5, n6, n7, x, y, cch, i;
@@ -3042,6 +3085,10 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
case oprOpenPatch:
FFileOpen(cmdOpenPatch, sz, NULL);
break;
+
+ case oprDlgDB:
+ FFileOpen(cmdOpenDB, NULL, NULL);
+ break;
case oprDlgPaint:
FFileOpen(cmdOpenColmapPaint, NULL, NULL);
break;
@@ -3110,6 +3157,9 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
case oprSavePicture:
FFileSave(cmdSavePicture, sz);
break;
+ case oprSaveVector:
+ FFileSave(cmdSaveVector, sz);
+ break;
case oprSaveSolids:
CreateSolids(sz);
break;
@@ -3475,7 +3525,8 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
pbDst = BitmapGetMask(n2);
if (iopr == oprMaskSwap &&
(n1 != -1 || !pbDst->FNull()) && (n2 != -1 || !pbSrc->FNull())) {
- pbSrc->SwapWith(*pbDst);
+ if (pbSrc != pbDst)
+ pbSrc->SwapWith(*pbDst);
break;
}
if (!pbSrc->FNull())
@@ -3493,7 +3544,8 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
pbSrc = ColmapGetTexture(n1);
pbDst = ColmapGetTexture(n2);
if (iopr == oprTextureSwap) {
- pbSrc->SwapWith(*pbDst);
+ if (pbSrc != pbDst)
+ pbSrc->SwapWith(*pbDst);
if (bm.k.FNull())
FShowColmap(fFalse);
break;
@@ -3608,7 +3660,8 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
bm.b.Turtle("_");
ws.fSpree = dr.fDot2 = dr.fSky3D = dr.fNoCompass = dr.fNoLocation =
dr.fPolishMaze = dr.fFogFloor = dr.fMarkColor = dr.fMarkAll =
- dr.fMarkBlock = dr.fTextureDual = dr.fTextureBlend = fFalse;
+ dr.fMarkBlock = dr.fTextureDual = dr.fTextureDual2 = dr.fTextureBlend =
+ fFalse;
ms.nCellMax = ws.nTitleMessage = dr.zStep =
dr.kvInWall2 = dr.kvInSky2 = dr.kvInDirt2 = dr.kvInCeil2 = dr.kvInMtn2 =
dr.kvInCld2 = dr.nMarkSky = dr.nWallVar = dr.nFogLit = -1;
@@ -3680,6 +3733,18 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
l = UD(n4, n4);
bT->Set(n1, n2, l);
break;
+ case oprSetY:
+ bT = ColmapGetTexture(dr.nTextureWall);
+ if (bT == NULL)
+ break;
+ if (n3 >= 0)
+ l = SetU(*bT, n1, n2, n3, n4);
+ else if (n3 == -1)
+ l = UD(n4, n4);
+ else
+ l = NWSE(n4, n4, n4, n4);
+ bT->Set(n1, n2, l);
+ break;
case oprSet3:
bm.b.Set3(n1, n2, n3, n4);
break;
@@ -3727,6 +3792,18 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
l = UD(n5, n5);
bT->Set3(n1, n2, n3, l);
break;
+ case oprSet3Y:
+ bT = ColmapGetTexture(dr.nTextureWall);
+ if (bT == NULL)
+ break;
+ if (n4 >= 0)
+ l = SetU3(*bT, n1, n2, n3, n4, n5);
+ else if (n4 == -1)
+ l = NWSE(n5, n5, n5, n5);
+ else
+ l = UD(n5, n5);
+ bT->Set3(n1, n2, n3, l);
+ break;
case oprZapTexture:
DotZap(cmdZapTexture, n1);
break;
@@ -3763,6 +3840,9 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
l = bm.b.BitmapThicken2(n1, !dr.fNoCorner);
SetMacroReturn(l);
break;
+ case oprBlendN:
+ bm.k.ColmapBlendBitmaps(bm.k2);
+ break;
case oprConvex:
bm.b.FBitmapConvex(xl, yl, xh, yh);
break;
@@ -3875,6 +3955,9 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
SetMacroReturn(l);
PrintSzL("Asymmetries in Maze: %ld\n", l);
break;
+ case oprZoomPic:
+ bm.b.MazeZoomWithPicture(&bm.k);
+ break;
case oprOverview2:
if (!dr.f3D)
DrawOverview2(bm.b);
@@ -3939,6 +4022,25 @@ int DoOperation(int iopr, char **rgsz, CONST int *rgcch, CONST long *rgl,
bm.patch[n1].nTrans = (short)ws.rglVar[y+2];
}
break;
+ case oprGetStar:
+ pstar = !n1 ? dr.rgstar : ds.rgstar;
+ if (pstar != NULL && FBetween(n2, 0, istarMax-1) &&
+ FEnsureLVar(n3 + 2)) {
+ ws.rglVar[n3] = pstar[n2].x;
+ ws.rglVar[n3+1] = pstar[n2].y;
+ ws.rglVar[n3+2] = pstar[n2].kv;
+ }
+ break;
+ case oprSetStar:
+ if (dr.rgstar == NULL)
+ FCreateInsideStars(NULL, 0.0, 0, fFalse);
+ pstar = !n1 ? dr.rgstar : ds.rgstar;
+ if (pstar != NULL && FBetween(n2, 0, istarMax-1)) {
+ pstar[n2].x = n3;
+ pstar[n2].y = n4;
+ pstar[n2].kv = ParseColor(rgsz[4], fFalse);
+ }
+ break;
case oprStereogram:
if (!bm.fColor)
bm.b.FStereogram(bm.b2, n1, n2);
@@ -5480,6 +5582,10 @@ flag DoCommand(int wCmd)
bm.b.CreateMazeUpsilon();
break;
+ case cmdCreateOmicron:
+ bm.b.CreateMazeOmicron();
+ break;
+
case cmdCreateZeta:
bm.b.CreateMazeZeta();
break;
@@ -6305,10 +6411,10 @@ char *ReadEmbedLines(FILE *file)
char szLine[cchSzOpr], ch, *sz = NULL, *szNew = NULL;
int cch = 0, i, j, fSpace;
- if (file == NULL)
+ if (file == NULL && ws.rgszStartup == NULL)
return NULL;
loop {
- for (i = 0; i < cchSzOpr && !feof(file) &&
+ for (i = 0; i < cchSzOpr && (file == NULL || !feof(file)) &&
(ch = getbyte()) >= ' '; i++)
szLine[i] = ch;
skiplf();
diff --git a/create.cpp b/create.cpp
index eec4f0d..545962b 100644
--- a/create.cpp
+++ b/create.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: create.cpp
+** Daedalus (Version 3.4) File: create.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** produce standard orthogonal 2D Mazes.
**
** Created: 9/4/2000.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -1695,8 +1695,8 @@ flag CMaz::CreateMazeAldousBroder()
MazeClear(!fWall);
MakeEntranceExit(0);
if (!fWall) {
- x = RndSkip(xl + 1, xh - 1);
- y = RndSkip(yl + 1, yh - 1);
+ x = ms.fTreeRandom ? RndSkip(xl + 1, xh - 1) : xl + 1;
+ y = ms.fTreeRandom ? RndSkip(yl + 1, yh - 1) : yl + 1;
Set0(x, y);
} else
x = y = 0;
@@ -1807,7 +1807,7 @@ flag CMaz::CreateMazeWilson()
UpdateDisplay();
while (count > 0) {
- i = Rnd(0, count-1);
+ i = ms.fTreeRandom ? Rnd(0, count-1) : count-1;
x = x0 = wils[i].zList % xs; y = y0 = wils[i].zList / xs;
// From a random uncreated location, do a random walk until run into part
diff --git a/create2.cpp b/create2.cpp
index f739786..aace01b 100644
--- a/create2.cpp
+++ b/create2.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: create2.cpp
+** Daedalus (Version 3.4) File: create2.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** produce orthogonal Mazes, however which aren't standard 2D Mazes.
**
** Created: 11/22/1996.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -2208,6 +2208,8 @@ flag CMaz::FValidPlanair(CONST char *sz) CONST
}
+CONST KV rgkvCube[6] = {kvGreen, kvBlue, kvMagenta, kvYellow, kvRed, kvOrange};
+
// Create a new planair Maze in a bitmap, or a Maze on the surface of a set of
// rectangles, whose edges can connect in arbitrary ways. Like a 3D Maze this
// is technically a 3D construct stored as a sequence of levels, where the
@@ -2219,6 +2221,7 @@ flag CMaz::CreateMazePlanair()
int jx = Even(m_x3), jy = Even(m_y3), jz, jw = m_w3,
fHunt = fFalse, pass = 0, x, y, z, xnew, ynew, znew,
xInc = 2, yInc = 2, zInc = 1, d, e, i, iMax, j;
+ int a0, b0, c0, ax, bx, cx, ay, by, cy;
long count;
if (!FValidPlanair(ms.szPlanair))
@@ -2312,6 +2315,54 @@ flag CMaz::CreateMazePlanair()
}
}
LDone:
+
+ // Create a wireframe for this Planair Maze if it's making a cube.
+ if (!(ms.nOmegaDraw == 1 && FEqSz(ms.szPlanair,
+ "e2d3f0b1 e7a3f3c1 e4b3f6d1 e1c3f5a1 c4d0a0b4 a2d6c6b2")))
+ return fTrue;
+ if (InitCoordinates((jx + jy) / 2 * jz) < 0)
+ return fFalse;
+ d = 25; e = d << 1;
+ i = (Max(jx, jy)-2)*d;
+ for (z = 0; z < jz; z++) {
+ ax = bx = cx = ay = by = cy = 0;
+ switch (z) {
+ case 0: a0=0; b0=1; c0=1; ax=1; by=-1; break;
+ case 1: a0=1; b0=1; c0=1; cx=-1; by=-1; break;
+ case 2: a0=1; b0=1; c0=0; ax=-1; by=-1; break;
+ case 3: a0=0; b0=1; c0=0; cx=1; by=-1; break;
+ case 4: a0=0; b0=1; c0=0; ax=1; cy=1; break;
+ case 5: a0=0; b0=0; c0=1; ax=1; cy=-1; break;
+ }
+ a0 = ((a0 << 1) - 1) * i;
+ b0 = ((b0 << 1) - 1) * i;
+ c0 = ((c0 << 1) - 1) * i;
+ ax *= e; ay *= e; bx *= e; by *= e; cx *= e; cy *= e;
+ for (y = 0; y < jy; y += 2)
+ for (x = 0; x < jx; x += 2) {
+ if (x+2 < jx && JG(x+1, y, z) && (y > 0 || PZTo(ms.szPlanair, z, 0) <
+ z) && (y < jy-2 || PZTo(ms.szPlanair, z, 2) < z))
+ FSetCoordinates(a0 + x*ax + y*ay, b0 + x*bx + y*by, c0 + x*cx + y*cy,
+ a0 + (x+2)*ax + y*ay, b0 + (x+2)*bx + y*by, c0 + (x+2)*cx + y*cy,
+ KvBlend(rgkvCube[z], rgkvCube[y <= 0 ? PZTo(ms.szPlanair, z, 0) :
+ (y >= jy-2 ? PZTo(ms.szPlanair, z, 2) : z)]));
+ if (y+2 < jy && JG(x, y+1, z) && (x > 0 || PZTo(ms.szPlanair, z, 1) <
+ z) && (x < jx-2 || PZTo(ms.szPlanair, z, 3) < z))
+ FSetCoordinates(a0 + x*ax + y*ay, b0 + x*bx + y*by, c0 + x*cx + y*cy,
+ a0 + x*ax + (y+2)*ay, b0 + x*bx + (y+2)*by, c0 + x*cx + (y+2)*cy,
+ KvBlend(rgkvCube[z], rgkvCube[x <= 0 ? PZTo(ms.szPlanair, z, 1) :
+ (x >= jx-2 ? PZTo(ms.szPlanair, z, 3) : z)]));
+ }
+ }
+ // Draw two arrows for the entrance and exit to the cube Maze.
+ for (j = -1; j <= 1; j += 2) {
+ zInc = j < 0 ? kvWhite : kvDkGray;
+ FSetCoordinates((i+d)*j, 0, 0, (i+d*10)*j, 0, 0, zInc);
+ e = j < 0 ? -i-d*10 : i+d;
+ FSetCoordinates(e, 0, 0, e+d*3, d*3, 0, zInc);
+ FSetCoordinates(e, 0, 0, e+d*3, -d*3, 0, zInc);
+ }
+ InitCoordinates(0);
return fTrue;
}
diff --git a/create3.cpp b/create3.cpp
index 8add7e4..1812917 100644
--- a/create3.cpp
+++ b/create3.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: create3.cpp
+** Daedalus (Version 3.4) File: create3.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** produce non-orthogonal Mazes.
**
** Created: 9/4/2000.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -55,6 +55,8 @@ class Generic
flag FIsOnMaze(long);
void CreateMazeGeneral();
void GenerateWireframe();
+ virtual void WireframeLine(int, int, int, int);
+ virtual void WireframeOpening();
// Creates an entrance or exit, returning the cell index next to it.
virtual long LMakeOpening(int, flag) = 0;
@@ -241,46 +243,54 @@ void Generic::CreateMazeGeneral()
void Generic::GenerateWireframe()
{
long area, test, hunt;
- int count, d, x1, y1, x2, y2, f, cEdge = 0;
+ int count, d, x1, y1, x2, y2;
if (ms.nOmegaDraw <= 0)
return;
- for (f = 0; f <= 1; f++) {
- for (area = 0; !FIsOnMaze(area) || !FIsRoom(area); area = LNext(area))
- ;
- hunt = area;
- loop {
- if (!FIsOnMaze(area) || !FIsRoom(area))
+ InitCoorPatch(ms.nOmegaDraw == 2, ms.omega * ms.omega);
+ for (area = 0; !FIsOnMaze(area) || !FIsRoom(area); area = LNext(area))
+ ;
+ hunt = area;
+ loop {
+ if (!FIsOnMaze(area) || !FIsRoom(area))
+ continue;
+ count = NCount(area);
+ for (d = 0; d < count; d++) {
+ test = LEnum(area, d);
+ if (test < area && FIsOnMaze(test))
continue;
- count = NCount(area);
- for (d = 0; d < count; d++) {
- test = LEnum(area, d);
- if (test < area && FIsOnMaze(test))
- continue;
- if (!FIsPassage(area, d)) {
- if (!f)
- cEdge++;
- else {
- MapDir(area, d, &x1, &y1, &x2, &y2);
- if (ms.nOmegaDraw == 1)
- FSetCoordinates(x1, y1, 0, x2, y2, 0, -1);
- else
- FSetPatch(x1, y1, 0, x2, y2, 10, -1);
- }
- }
+ if (!FIsPassage(area, d)) {
+ MapDir(area, d, &x1, &y1, &x2, &y2);
+ WireframeLine(x1, y1, x2, y2);
}
- area = LNext(area);
- if (area == hunt)
- break;
- }
- if (!f) {
- if (ms.nOmegaDraw == 1)
- FInitCoordinates(cEdge);
- else
- FInitPatch(cEdge);
}
+ area = LNext(area);
+ if (area == hunt)
+ break;
}
- PrintSzN("Total number of edges generated: %d", cEdge);
+ WireframeOpening();
+ PrintSzN("Total number of edges generated: %d",
+ InitCoorPatch(ms.nOmegaDraw == 2, 0));
+}
+
+
+// Output a wireframe line given a pair of coordinates in the generic Maze.
+
+void Generic::WireframeLine(int x1, int y1, int x2, int y2)
+{
+ KV kv;
+
+ kv = -1;
+ /*if (m_c != NULL && m_c->m_x == m_b.m_x && m_c->m_y == m_b.m_y)
+ kv = CG(*m_c, (x1+x2) >> 1, (y1+y2) >> 1);*/
+ FSetCoorPatch(ms.nOmegaDraw == 2, x1, y1, 0, x2, y2, 10, kv);
+}
+
+
+// Output wireframe arrows for the start and end in the generic Maze.
+
+void Generic::WireframeOpening()
+{
}
@@ -811,7 +821,7 @@ flag Sigma::FCreateMaze(CMaz &b)
return fFalse;
}
b.BitmapOff();
- for (y = 0; y < SYMax; y++) {
+ for (y = 0; y < SYMax; y++)
for (x = 0; x < SXMax(y); x++) {
m = SMapX(x, y); n = SMapY(y);
GLine(m, n, m-ox1, n+oy1);
@@ -824,7 +834,6 @@ flag Sigma::FCreateMaze(CMaz &b)
if ((x >= SXMax(y)-1 && y >= ms.omega-1) || y >= SYMax-1)
GLine(m+ox1, n+oy1*3, m, n+oy1*4);
}
- }
CreateMazeGeneral();
return fTrue;
}
@@ -990,7 +999,7 @@ int Theta::NDirBinary(long area)
XYArea(x, y, area);
if (y <= ms.omega2)
- return 1;
+ return x > 0 ? 1 : -1;
return Rnd(0, 1);
}
@@ -1012,7 +1021,7 @@ flag Theta::FCreateMaze(CMaz &b)
return fFalse;
}
b.BitmapOff();
- for (y = ms.omega2; y <= ms.omega; y++) {
+ for (y = ms.omega2; y <= ms.omega; y++)
for (x = 0; x < TPoint(y); x++) {
m = (x + 1) & (TPoint(y) - 1);
GLine(TMapX(x, y), TMapY(x, y), TMapX(m, y), TMapY(m, y));
@@ -1021,7 +1030,6 @@ flag Theta::FCreateMaze(CMaz &b)
GLine(TMapX(x, y), TMapY(x, y), TMapX(m, y+1), TMapY(m, y+1));
}
}
- }
CreateMazeGeneral();
return fTrue;
}
@@ -1203,7 +1211,7 @@ flag Upsilon::FCreateMaze(CMaz &b)
return fFalse;
}
b.BitmapOff();
- for (y = 0; y <= ms.omega; y++) {
+ for (y = 0; y <= ms.omega; y++)
for (x = 0; x <= ms.omega; x++) {
m = UMapX(x); n = UMapY(y);
if (((x | y) & 1) == 0) {
@@ -1222,7 +1230,6 @@ flag Upsilon::FCreateMaze(CMaz &b)
if (y < ms.omega)
GLine(m - ox2*(!USquare(x, y)), n, m - ox2*(!USquare(x, y)), n+oy1);
}
- }
CreateMazeGeneral();
return fTrue;
}
@@ -1234,6 +1241,229 @@ flag CMaz::CreateMazeUpsilon()
}
+// Create an Omicron Maze, or a Maze formed of concentric circles on a sphere.
+
+#define OMapX(x, y) (ox0 + (x) * ox1 * (m_x / OPoint(y)))
+#define OMapY(y) (oy0 + (y) * oy1)
+#define OPoint(y) \
+ TPoint((y) < ((ms.omega+1) >> 1) ? Max(0, y) : Max(0, ms.omega-1-(y)))
+
+class Omicron : Generic
+{
+private:
+ int m_x;
+
+ long LMakeOpening(int, flag);
+ flag FIsRoom(long);
+ int NCount(long);
+ long LEnum(long, int);
+ long LNext(long);
+ int NDirBinary(long);
+ void MapDir(long, int, int *, int *, int *, int *);
+ void WireframeLine(int, int, int, int);
+ void WireframeOpening();
+
+public:
+ flag FCreateMaze(CMaz &);
+};
+
+void Omicron::MapDir(long area, int dir, int *x1, int *y1, int *x2, int *y2)
+{
+ int x, y, d, dd, m, m1, m2, n1, n2;
+
+ XYArea(x, y, area);
+ d = y < ((ms.omega+1) >> 1) ? 1 : -1;
+ dd = d < 0;
+ n1 = y + dd;
+ n2 = y + 1 - dd;
+ m = (x + 1) & (OPoint(y) - 1);
+ m1 = x << (int)(OPoint(y) < OPoint(y + d));
+ m2 = m << (int)(OPoint(y) < OPoint(y + d));
+ switch (dir) {
+ case 0:
+ *x1 = OMapX(x, n1-dd); *y1 = OMapY(n1);
+ *x2 = OMapX(x+1, n1-dd); *y2 = *y1;
+ break;
+ case 1:
+ *x1 = OMapX(x, n1-dd); *y1 = OMapY(n1);
+ *x2 = *x1; *y2 = OMapY(n2);
+ break;
+ case 2:
+ *x1 = OMapX(m, n1-dd); *y1 = OMapY(n1);
+ *x2 = *x1; *y2 = OMapY(n2);
+ break;
+ case 3:
+ *x1 = OMapX(m1, n2-dd); *y1 = OMapY(n2);
+ *x2 = OMapX(m1+1, n2-dd); *y2 = *y1;
+ break;
+ case 4:
+ *x1 = OMapX(m1+1, n2-dd); *y1 = OMapY(n2);
+ *x2 = OMapX(m1+2, n2-dd); *y2 = *y1;
+ break;
+ }
+}
+
+long Omicron::LMakeOpening(int hint, flag fExit)
+{
+ long area;
+ int x, y, dir, x1, y1, x2, y2;
+
+ x = Rnd(0, 3);
+ y = fExit ? ms.omega-1 : 0;
+ dir = fExit && ms.omega <= 1 ? 3 : 0;
+ AreaXY(area, x, y);
+ MakePassage(area, dir);
+ if (!fExit) {
+ MapDir(area, dir, &x1, &y1, &x2, &y2);
+ ms.xEntrance = (x1 + x2) >> 1; ms.yEntrance = (y1 + y2) >> 1;
+ }
+ return area;
+}
+
+flag Omicron::FIsRoom(long area)
+{
+ int x, y, d;
+
+ XYArea(x, y, area);
+ if (y < 0 || y >= ms.omega)
+ return fTrue;
+ for (d = 0; d < NCount(area); d++)
+ if (FIsPassage(area, d))
+ return fTrue;
+ return fFalse;
+}
+
+int Omicron::NCount(long area)
+{
+ int x, y, d;
+
+ // Cells in a ring have four sides, except when the number of cells in a
+ // ring doubles, in which case the cell in smaller ring has five sides.
+ XYArea(x, y, area);
+ d = y < ((ms.omega+1) >> 1) ? 1 : -1;
+ return 4 + (OPoint(y) < OPoint(y+d));
+}
+
+long Omicron::LEnum(long area, int dir)
+{
+ int x, y, d;
+
+ XYArea(x, y, area);
+ d = y < ((ms.omega+1) >> 1) ? 1 : -1;
+ switch (dir) {
+ case 0: x = x >> (int)(OPoint(y) > OPoint(y-d)); y -= d; break;
+ case 1: x = (x - 1) & (OPoint(y) - 1); break;
+ case 2: x = (x + 1) & (OPoint(y) - 1); break;
+ case 3: x = x << (int)(OPoint(y) < OPoint(y+d)); y += d; break;
+ case 4: x = (x << (int)(OPoint(y) < OPoint(y+d))) + 1; y += d; break;
+ }
+ AreaXY(area, x, y);
+ return area;
+}
+
+long Omicron::LNext(long area)
+{
+ int x, y;
+
+ XYArea(x, y, area);
+ x++;
+ if (x >= OPoint(y)) {
+ x = 0;
+ y++;
+ if (y >= ms.omega)
+ y = 0;
+ }
+ AreaXY(area, x, y);
+ return area;
+}
+
+int Omicron::NDirBinary(long area)
+{
+ int x, y;
+
+ XYArea(x, y, area);
+ if (y <= 0 || y >= ms.omega-1)
+ return x > 0 ? 1 : -1;
+ return Rnd(0, 1);
+}
+
+flag Omicron::FCreateMaze(CMaz &b)
+{
+ int x, y, z;
+
+ m_b = &b;
+ z = ms.omega*2 + 1;
+ x = Max(b.m_x, z); y = Max(b.m_y, z);
+ if (!b.FBitmapSizeSet(x, y))
+ return fFalse;
+ m_x = OPoint(ms.omega >> 1);
+ ox1 = (b.m_x - 1) / m_x;
+ ox0 = (b.m_x - ox1 * m_x) >> 1;
+ oy1 = (b.m_y - 1) / ms.omega;
+ oy0 = (b.m_y - oy1 * ms.omega) >> 1;
+ if (ox1 < 2 || oy1 < 2) {
+ PrintSzN_W("Bitmap too small to make omicron Maze of size: %d", ms.omega);
+ return fFalse;
+ }
+ b.BitmapOff();
+ for (y = 0; y <= ms.omega; y++)
+ for (x = OPoint(y)-1; x >= 0; x--) {
+ GLine(OMapX(x, y), OMapY(y), OMapX(x+1, y), OMapY(y));
+ if (y < ms.omega)
+ GLine(OMapX(x, y), OMapY(y), OMapX(x, y), OMapY(y+1));
+ }
+ CreateMazeGeneral();
+ return fTrue;
+}
+
+void Omicron::WireframeLine(int x1, int y1, int x2, int y2)
+{
+ int z1, z2;
+ real m1, n1, m2, n2, r1, r2;
+ KV kv;
+
+ if (ms.nOmegaDraw == 2)
+ FSetPatch(x1, y1, 0, x2, y2, 10, -1);
+ else {
+ r1 = (real)OPoint(ms.omega >> 1);
+ m1 = (real)((x1 - ox0) / ox1) * rDegMax / r1;
+ m2 = (real)((x2 - ox0) / ox1) * rDegMax / r1;
+ n1 = (real)((y1 - oy0) / oy1 + 1) * rDegHalf / (ms.omega+2) - rDegQuad;
+ n2 = (real)((y2 - oy0) / oy1 + 1) * rDegHalf / (ms.omega+2) - rDegQuad;
+ r1 = RCosD(n1); r2 = RCosD(n2);
+ z1 = (int)(1000.0 * RSinD(n1));
+ z2 = (int)(1000.0 * RSinD(n2));
+ y1 = (int)(1000.0 * RSinD(m1) * r1);
+ y2 = (int)(1000.0 * RSinD(m2) * r2);
+ x1 = (int)(1000.0 * RCosD(m1) * r1);
+ x2 = (int)(1000.0 * RCosD(m2) * r2);
+ kv = Hue((int)(((n1 + n2) / 2.0 + rDegQuad) * 2.0 * 10.0));
+ FSetCoordinates(x1, y1, z1, x2, y2, z2, kv);
+ }
+}
+
+void Omicron::WireframeOpening()
+{
+ int i, j;
+ KV kv;
+
+ // Draw two arrows for the entrance and exit to the Omicron Maze.
+ for (i = -1; i <= 1; i += 2) {
+ kv = i < 0 ? kvDkGray : kvWhite;
+ FSetCoordinates(0, 0, (1000+25)*i, 0, 0, (1000+25*9)*i, kv);
+ j = i < 0 ? -1000-25 : 1000+25*9;
+ FSetCoordinates(0, 0, j, 25*3, 0, j-25*3, kv);
+ FSetCoordinates(0, 0, j, -25*3, 0, j-25*3, kv);
+ }
+}
+
+flag CMaz::CreateMazeOmicron()
+{
+ Omicron omicron;
+ return omicron.FCreateMaze(*this);
+}
+
+
/*
******************************************************************************
** Recursive Fractal Maze Routines
@@ -2237,6 +2467,15 @@ long CMaz::CreateMazeCrack(flag fClear)
MakeEntranceExit(1);
UpdateDisplay();
}
+ if (ms.nOmegaDraw) {
+ InitCoorPatch(ms.nOmegaDraw == 2, 100);
+ FSetCoorPatch(ms.nOmegaDraw == 2, xl, yl, 0, xl, yh, 10, -1);
+ FSetCoorPatch(ms.nOmegaDraw == 2, xh, yl, 0, xh, yh, 10, -1);
+ FSetCoorPatch(ms.nOmegaDraw == 2, xl, yl, 0, ms.xEntrance-1, yl, 10, -1);
+ FSetCoorPatch(ms.nOmegaDraw == 2, ms.xEntrance+1, yl, 0, xh, yl, 10, -1);
+ FSetCoorPatch(ms.nOmegaDraw == 2, xl, yh, 0, ms.xExit-1, yh, 10, -1);
+ FSetCoorPatch(ms.nOmegaDraw == 2, ms.xExit+1, yh, 0, xh, yh, 10, -1);
+ }
// Draw lines appending onto what's already present.
while (pass < ms.nCrackPass) {
@@ -2288,6 +2527,7 @@ long CMaz::CreateMazeCrack(flag fClear)
d >>= 1;
// Draw the line a pixel at a time. Stop before hitting any other wall.
+ x2 = x; y2 = y;
for (z = 0; z <= zMax; z++) {
x += xInc; y += yInc; d += dInc;
if (d >= zMax) {
@@ -2300,6 +2540,9 @@ long CMaz::CreateMazeCrack(flag fClear)
k = (k << 1) + Get(x + xoff[i], y + yoff[i]);
if (mpgrff[k]) {
Set1(x, y);
+ if (ms.nOmegaDraw)
+ FSetCoorPatch(ms.nOmegaDraw == 2, x2, y2, 0, x, y, 10, -1);
+ x2 = x; y2 = y;
f = fTrue;
} else
break;
@@ -2315,6 +2558,8 @@ long CMaz::CreateMazeCrack(flag fClear)
} else
pass++;
}
+ if (ms.nOmegaDraw)
+ InitCoorPatch(ms.nOmegaDraw == 2, 0);
return count;
}
@@ -2333,6 +2578,8 @@ flag CMaz::ZetaGenerate(flag fClear, int x, int y)
while ((y - yl & 3) != 3)
y--;
count = ((xh - xl) >> 2)*((yh - yl) >> 2) - 1;
+ if (ms.nOmegaDraw)
+ InitCoorPatch(ms.nOmegaDraw == 2, count+2);
iMax = ms.fRiver ? DIRS2 : 1;
Set0(x, y);
UpdateDisplay();
@@ -2359,6 +2606,8 @@ flag CMaz::ZetaGenerate(flag fClear, int x, int y)
Set0(x + xoff2[d], y + yoff2[d]);
Set0(xnew - xoff[d], ynew - yoff[d]);
Set0(xnew, ynew);
+ if (ms.nOmegaDraw)
+ FSetCoorPatch(ms.nOmegaDraw == 2, x, y, 0, xnew, ynew, 10, -1);
x = xnew; y = ynew;
pass = 0;
fHunt = fFalse;
@@ -2406,7 +2655,15 @@ flag CMaz::CreateMazeZeta()
MazeClear(fOn);
MakeEntranceExit(3);
UpdateDisplay();
- return ZetaGenerate(fTrue, Rnd(xl + 3, xh), Rnd(yl + 3, yh));
+ if (!ZetaGenerate(fTrue, Rnd(xl + 3, xh), Rnd(yl + 3, yh)))
+ return fFalse;
+ if (ms.nOmegaDraw) {
+ FSetCoorPatch(ms.nOmegaDraw == 2, ms.xEntrance, 0, 0, ms.xEntrance, 3, 10,
+ -1);
+ FSetCoorPatch(ms.nOmegaDraw == 2, ms.xExit, m_y-1, 0, ms.xExit, m_y-4, 10,
+ -1);
+ }
+ return fTrue;
}
diff --git a/daedalus.cpp b/daedalus.cpp
index 3782c7b..c5254b2 100644
--- a/daedalus.cpp
+++ b/daedalus.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: daedalus.cpp
+** Daedalus (Version 3.4) File: daedalus.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** underlying operating system.
**
** Created: 11/18/1993.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -94,9 +94,9 @@ DR dr = {
-1, -1, -1, -1, -1, -1, fFalse, 94001225, 0, 0, 50, 333,
fFalse, fFalse, -1, fFalse, fFalse, fFalse, fFalse, fFalse, fFalse,
fFalse, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
- fFalse, fFalse, 11, 3412, 4, 427, 0, 0,
+ fFalse, fFalse, fFalse, 11, 3412, 4, 427, 0,
// Internal settings
- fFalse, 0.0, NULL, 0, NULL, NULL, NULL, NULL, 50, 40, 99999};
+ fFalse, 0, 0.0, NULL, 0, NULL, NULL, NULL, NULL, 50, 40, 99999, 0};
// Constant data
@@ -119,7 +119,7 @@ CONST char *rgszScript[cmdScriptLast - cmdScript01 + 1] = {
"survmaz0.ds", "survmaz1.ds", "survmaz2.ds", "survmaz3.ds", "survmaz4.ds",
"survmaz5.ds", "survmaz6.ds", "survmaz7.ds", "survmaz8.ds", "survmaz9.ds",
"carletn1.ds", "carletn2.ds", "stocker.ds", "glacier.ds", "safari.ds",
- "mousemaz.ds", "squared.ds", "mandy.ds", "pentris.ds"};
+ "mousemaz.ds", "squared.ds", "mandy.ds", "pentris.ds", "gripsox.ds"};
CONST char *rgszShortcut[cmdScriptLast - cmdScript01 + 1] = {
"Daedalus demos", "Word Mazes", "World's largest Maze",
"4D Mazes", "5D Mazes", "Dragonslayer",
@@ -130,7 +130,8 @@ CONST char *rgszShortcut[cmdScriptLast - cmdScript01 + 1] = {
"Survivor Maze game #7", "Survivor Maze game #8", "Survivor Maze game #9",
"Carleton Farm Maze #1", "Carleton Farm Maze #2", "Stocker Farms Maze",
"Glacier Maze game", "Safari Maze", "Mouse Maze game",
- "Survivor Squares game", "Mandelbrot set", "Pentris"};
+ "Survivor Squares game", "Mandelbrot set", "Pentris",
+ "Grippy Socks"};
// Command lines to run on startup. When embedding a complex script file, in
// it first delete the leading DS, then replace \ with \\, " with \", and ?
@@ -188,14 +189,27 @@ byte BRead(FILE *file)
// Initialize a new wireframe list in memory of the specified size.
-flag FInitCoordinates(int cCoor)
+int InitCoordinates(int cCoor)
{
+ COOR *coor;
+ flag fExtend = cCoor < 0;
+
+ if (cCoor == 0)
+ cCoor = ds.cCoorPatch;
+ else if (fExtend)
+ cCoor = NAbs(cCoor);
+ if (cCoor == bm.ccoor)
+ return bm.ccoor;
+ coor = (COOR *)ReallocateArray(bm.coor, bm.ccoor, sizeof(COOR), cCoor);
+ if (coor == NULL)
+ return -1;
if (bm.coor != NULL)
DeallocateP(bm.coor);
- bm.coor = RgAllocate(cCoor, COOR);
+ bm.coor = coor;
bm.ccoor = cCoor;
- ds.cCoorPatch = 0;
- return bm.coor != NULL;
+ if (!fExtend)
+ ds.cCoorPatch = 0;
+ return bm.ccoor;
}
@@ -203,6 +217,9 @@ flag FInitCoordinates(int cCoor)
flag FSetCoordinates(int x1, int y1, int z1, int x2, int y2, int z2, KV kv)
{
+ if (ds.cCoorPatch >= bm.ccoor && InitCoordinates(bm.ccoor * -2) < 0)
+ return fFalse;
+ Assert(ds.cCoorPatch < bm.ccoor);
WriteCoordinates(bm.coor, x1, y1, z1, x2, y2, z2, kv < 0 ? ds.kvTrim : kv);
return fTrue;
}
@@ -210,14 +227,27 @@ flag FSetCoordinates(int x1, int y1, int z1, int x2, int y2, int z2, KV kv)
// Initialize a new patch list in memory of the specified size.
-flag FInitPatch(int cPat)
+int InitPatch(int cPat)
{
+ PATCH *patch;
+ flag fExtend = cPat < 0;
+
+ if (cPat == 0)
+ cPat = ds.cCoorPatch;
+ else if (fExtend)
+ cPat = NAbs(cPat);
+ if (cPat == bm.cpatch)
+ return bm.cpatch;
+ patch = (PATCH *)ReallocateArray(bm.patch, bm.cpatch, sizeof(PATCH), cPat);
+ if (patch == NULL)
+ return -1;
if (bm.patch != NULL)
DeallocateP(bm.patch);
- bm.patch = RgAllocate(cPat, PATCH);
+ bm.patch = patch;
bm.cpatch = cPat;
- ds.cCoorPatch = 0;
- return bm.patch != NULL;
+ if (!fExtend)
+ ds.cCoorPatch = 0;
+ return bm.cpatch;
}
@@ -227,15 +257,41 @@ flag FSetPatch(int x1, int y1, int z1, int x2, int y2, int z2, KV kv)
{
PATN pat[cPatch];
+ if (ds.cCoorPatch >= bm.cpatch && InitPatch(bm.cpatch * -2) < 0)
+ return fFalse;
pat[0].x = x1; pat[0].y = y1; pat[0].z = z1; pat[0].fLine = fTrue;
pat[1].x = x1; pat[1].y = y1; pat[1].z = z2; pat[1].fLine = fTrue;
pat[2].x = x2; pat[2].y = y2; pat[2].z = z2; pat[2].fLine = fTrue;
pat[3].x = x2; pat[3].y = y2; pat[3].z = z1; pat[3].fLine = fTrue;
+ Assert(ds.cCoorPatch < bm.cpatch);
WritePatch(bm.patch, pat, fFalse, kv < 0 ? ds.kvObject : kv);
return fTrue;
}
+// Initialize either the wireframe or patch list in memory to a given size.
+
+int InitCoorPatch(flag fPatch, int cCoorPatch)
+{
+ if (!fPatch)
+ return InitCoordinates(cCoorPatch);
+ else
+ return InitPatch(cCoorPatch);
+}
+
+
+// Append either a line or patch to the wireframe or patch list in memory.
+
+flag FSetCoorPatch(flag fPatch, int x1, int y1, int z1, int x2, int y2, int z2,
+ KV kv)
+{
+ if (!fPatch)
+ return FSetCoordinates(x1, y1, z1, x2, y2, z1/*z2*/, kv);
+ else
+ return FSetPatch(x1, y1, z1, x2, y2, z2, kv);
+}
+
+
/*
******************************************************************************
** Daedalus Routines
@@ -295,6 +351,7 @@ flag FReadDaedalusBitmap(FILE *file)
skipcrlf();
} else {
ws.iszStartup++;
+ ws.ichStartup = 0;
}
if (z == 1) {
if (bm.b.FReadDaedalusBitmapCore(file, x, y))
@@ -687,8 +744,7 @@ CMaz *BitmapGetMask(int ib)
if (pbT == NULL)
return NULL;
for (iT = ws.cbMask; iT <= ib; iT++)
- new(&pbT[iT]) CMaz();
- //pbT[iT].CMaz::CMaz();
+ new(&pbT[iT]) CMaz(); // Effectively does: pbT[iT].CMaz::CMaz();
if (ws.rgbMask != NULL)
DeallocateP(ws.rgbMask);
ws.rgbMask = pbT;
@@ -725,8 +781,7 @@ CMazK *ColmapGetTexture(int ic)
if (pcT == NULL)
return NULL;
for (iT = ws.ccTexture; iT <= ic; iT++)
- new(&pcT[iT]) CMazK();
- //pcT[iT].CMazK::CMazK();
+ new(&pcT[iT]) CMazK(); // Effectively does: pcT[iT].CMazK::CMazK();
if (ws.rgcTexture != NULL)
DeallocateP(ws.rgcTexture);
ws.rgcTexture = pcT;
@@ -3008,6 +3063,10 @@ void *PAllocate(long lcb)
char sz[cchSzMax];
void *pv;
+#ifndef PC
+ // For Unix systems in which longs are 8 bytes instead of 4 bytes.
+ lcb += 4;
+#endif
#ifdef DEBUG
pv = malloc(lcb + sizeof(dword)*3);
#else
diff --git a/daedalus.def b/daedalus.def
index 8a78c60..baf29b4 100644
--- a/daedalus.def
+++ b/daedalus.def
@@ -1,8 +1,8 @@
-; Daedalus (Version 3.3) File: daedalus.def
+; Daedalus (Version 3.4) File: daedalus.def
; By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
;
; IMPORTANT NOTICE: Daedalus and all Maze generation and general
-; graphics routines used in this program are Copyright (C) 1998-2018 by
+; graphics routines used in this program are Copyright (C) 1998-2023 by
; Walter D. Pullen. Permission is granted to freely use, modify, and
; distribute these routines provided these credits and notices remain
; unmodified with any altered or distributed versions of the program.
@@ -19,10 +19,10 @@
; General Public License for more details, a copy of which is in the
; LICENSE.HTM included with Daedalus, and at http://www.gnu.org
;
-; Last code change: 11/28/2018.
+; Last code change: 8/29/2023.
NAME DAEDALUS
-DESCRIPTION "Daedalus 3.3 - By Walter D. Pullen"
+DESCRIPTION "Daedalus 3.4 - By Walter D. Pullen"
EXETYPE WINDOWS
STUB 'WINSTUB.EXE'
CODE PRELOAD MOVEABLE DISCARDABLE
diff --git a/daedalus.doc b/daedalus.doc
index f2ac3f0..1e6f691 100644
Binary files a/daedalus.doc and b/daedalus.doc differ
diff --git a/daedalus.h b/daedalus.h
index 2203cc7..95c06c6 100644
--- a/daedalus.h
+++ b/daedalus.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: daedalus.h
+** Daedalus (Version 3.4) File: daedalus.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -23,7 +23,7 @@
** This file contains system independent definitions for Daedalus as a whole.
**
** Created: 11/22/1993.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
@@ -34,7 +34,7 @@
*/
#define szDaedalus "Daedalus"
-#define szVersion "3.3"
+#define szVersion "3.4"
#define cchSzMaxFile 128
#define cchSzOpr (cchSzMax*4)
#define cMacro 48
@@ -45,13 +45,13 @@
#define szFileTempCore "daedalus.tmp"
#define icmdBase 1001
-#define cmdScriptLast cmdScript29
+#define cmdScriptLast cmdScript30
#define cmdSizeLast cmdSize19
#define iActionMax ccmd
-#define ccmd 467
-#define copr 173
-#define cvar 325
-#define cfun 121
+#define ccmd 469
+#define copr 181
+#define cvar 328
+#define cfun 125
enum _edgebehavior {
nEdgeVoid = 0,
@@ -366,6 +366,7 @@ typedef struct _transparentwall {
int yLo2; // Scaled pixel height of bottom of back wall
int yHi2; // Scaled pixel height of top of back wall
int yElev; // Pixel height of ground elevation clipping
+ int yElev2; // Pixel height of ceiling elevation clipping
int nFog; // Fog percentage at depth of this wall
int iTexture; // What color texture to apply to this wall, if any
int iMask; // What monochrome texture to apply to this wall, if any
@@ -452,6 +453,7 @@ typedef struct _dotrendering {
int nFog;
int nClip;
real dInside;
+ //int nStereo; // Stored in DS structure
int nTrans;
// Inside dialog Settings - Smooth & Free Movement
@@ -536,17 +538,18 @@ typedef struct _dotrendering {
int nTextureVar;
int nTextureElev;
flag fTextureDual;
+ flag fTextureDual2;
flag fTextureBlend;
int nMarkElevX1;
int nMarkElevY1;
int nMarkElevX2;
int nMarkElevY2;
- int nStereo;
int nStretchMode;
// Internal settings
flag fInSmooth;
+ int xCalc;
real rdCalc;
CALC *rgcalc;
int ccalc;
@@ -557,6 +560,7 @@ typedef struct _dotrendering {
int nTransPct;
int nTransPct2;
int yElevMax;
+ int yElevMin;
} DR;
@@ -663,6 +667,7 @@ char *ReadEmbedLines(FILE *);
int AFromInside(long);
long InsideFromA(int);
+flag FCreateInsideStars(CMazK *, real, int, flag);
flag FMoveCloud(int, int);
void ResetInside();
void FormatCompass(char *, flag, int *);
diff --git a/daedalus.rc b/daedalus.rc
index 4e4fc69..5beea3f 100644
--- a/daedalus.rc
+++ b/daedalus.rc
@@ -1,5 +1,7 @@
// Microsoft Visual C++ generated resource script.
//
+#pragma code_page(65001)
+
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
@@ -15,20 +17,17 @@
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
+// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
-menu MENU
+menu MENU
BEGIN
POPUP "&File"
BEGIN
@@ -66,6 +65,7 @@ BEGIN
MENUITEM "Survivor S&quares Game\tAlt+Ctrl+7", cmdScript27
MENUITEM "&Mandelbrot Set Fractal\tAlt+Ctrl+8", cmdScript28
MENUITEM "P&entris Game\tAlt+Ctrl+9", cmdScript29
+ MENUITEM "Gr&ippy Socks\tAlt+Ctrl+0", cmdScript30
END
MENUITEM SEPARATOR
MENUITEM "Open &Bitmap...\tAlt+o", cmdOpenBitmap
@@ -94,7 +94,7 @@ BEGIN
MENUITEM "Save &Normal...", cmdSave3DN
MENUITEM "Save &Supercompressed...", cmdSave3DS
END
- POPUP "Save As &Wallpaper"
+ POPUP "Save as &Wallpaper"
BEGIN
MENUITEM "&Center Bitmap", cmdSaveWallCenter
MENUITEM "&Tile Bitmap", cmdSaveWallTile
@@ -110,21 +110,22 @@ BEGIN
MENUITEM "Open Do&cumentation\t)", cmdShellHelp
POPUP "More &Help"
BEGIN
+ MENUITEM "Open &Documentation\t)", cmdShellHelp
MENUITEM "Open &Scripting", cmdShellScript
MENUITEM "Open &Changes", cmdShellChange
MENUITEM "Open &License", cmdShellLicense
MENUITEM SEPARATOR
MENUITEM "Open &Website", cmdShellWeb
- MENUITEM "Open Website Mirror", cmdShellWeb2
+ MENUITEM "Open Website &Mirror", cmdShellWeb2
END
POPUP "&Setup"
BEGIN
- MENUITEM "Program Group (&User)", cmdSetupUser
- MENUITEM "Program Group (&All)", cmdSetupAll
- MENUITEM "&Desktop Icon", cmdSetupDesktop
- MENUITEM "File &Extensions", cmdSetupExtension
+ MENUITEM "Create Program Group (&User)", cmdSetupUser
+ MENUITEM "Create Program Group (&All)", cmdSetupAll
+ MENUITEM "Create &Desktop Icon", cmdSetupDesktop
+ MENUITEM "Install File &Extensions", cmdSetupExtension
MENUITEM SEPARATOR
- MENUITEM "Uninstall E&xtensions", cmdUnsetup
+ MENUITEM "Uninstall File E&xtensions", cmdUnsetup
END
MENUITEM "&About Daedalus...\tAlt+0", cmdAbout
MENUITEM "E&xit\tEsc", cmdExit
@@ -209,24 +210,24 @@ BEGIN
MENUITEM "&Display Settings...\tTab", cmdDlgDisplay
POPUP "Cell &Viewport Span"
BEGIN
- MENUITEM "&Decrease By 1\t{", cmdCellDec1
- MENUITEM "&Increase By 1\t}", cmdCellInc1
- MENUITEM "D&ecrease By 10\t[", cmdCellDec10
- MENUITEM "I&ncrease By 10\t]", cmdCellInc10
+ MENUITEM "&Decrease by 1\t{", cmdCellDec1
+ MENUITEM "&Increase by 1\t}", cmdCellInc1
+ MENUITEM "D&ecrease by 10\t[", cmdCellDec10
+ MENUITEM "I&ncrease by 10\t]", cmdCellInc10
END
POPUP "&Window"
BEGIN
MENUITEM "Size Window &Full Screen\tShift+Tab", cmdWindowFull
- MENUITEM "Size Window To &Bitmap\tCtrl+Shift+Tab", cmdWindowBitmap
- MENUITEM "Size Bitmap To &Window\tCtrl+Tab", cmdSizeWindow
+ MENUITEM "Size Window to &Bitmap\tCtrl+Shift+Tab", cmdWindowBitmap
+ MENUITEM "Size Bitmap to &Window\tCtrl+Tab", cmdSizeWindow
MENUITEM SEPARATOR
MENUITEM "&Update Window\tn", cmdRedrawNow
MENUITEM "&Redraw Window\tSpace", cmdRepaintNow
MENUITEM SEPARATOR
MENUITEM "Scroll &Page Up\tAlt+PgUp", cmdScrollUp
MENUITEM "Scroll Page &Down\tAlt+PgDn", cmdScrollDown
- MENUITEM "&Scroll To Beginning\tAlt+Home", cmdScrollHome
- MENUITEM "Scroll To &End\tAlt+End", cmdScrollEnd
+ MENUITEM "&Scroll to Beginning\tAlt+Home", cmdScrollHome
+ MENUITEM "Scroll to &End\tAlt+End", cmdScrollEnd
END
MENUITEM "Set &Colors...\tCtrl+k", cmdDlgColor
MENUITEM "&Ignore Messages\t?", cmdMessage
@@ -299,12 +300,12 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "S&how Dot\t.", cmdDotShow
MENUITEM "Walls &Impassable\t,", cmdDotWall
- MENUITEM "Move By T&wo\te", cmdDotTwo
+ MENUITEM "Move by T&wo\te", cmdDotTwo
MENUITEM "&Drag Move Dot\ta", cmdDotDrag
MENUITEM "Dra&g Is Erase\tc", cmdDotOn
MENUITEM "Drag &Big Dot\tb", cmdDotBig
- MENUITEM "Drag B&y Two\tf", cmdDotBoth
- MENUITEM "Set At D&ot\th", cmdDotSet
+ MENUITEM "Drag b&y Two\tf", cmdDotBoth
+ MENUITEM "Set at D&ot\th", cmdDotSet
POPUP "&Zap Dot"
BEGIN
MENUITEM "&Destroy Wall\tCtrl+z", cmdDotZap
@@ -313,7 +314,7 @@ BEGIN
END
POPUP "&2nd Dot"
BEGIN
- MENUITEM "&Set To Dot\tg", cmd2nd
+ MENUITEM "&Set to Dot\tg", cmd2nd
MENUITEM SEPARATOR
MENUITEM "Draw &Line", cmd2ndLine
MENUITEM "Draw Bloc&k", cmd2ndBlock
@@ -322,17 +323,17 @@ BEGIN
MENUITEM "Draw &Circle", cmd2ndCircle
MENUITEM SEPARATOR
MENUITEM "&Get Section\tAlt+g", cmd2ndGet
- MENUITEM "&Put At Dot\tAlt+G", cmd2ndPut
+ MENUITEM "&Put at Dot\tAlt+G", cmd2ndPut
MENUITEM SEPARATOR
- MENUITEM "Put With &Or", cmd2ndOr
- MENUITEM "Put With &And", cmd2ndAnd
- MENUITEM "Put With &Xor", cmd2ndXor
+ MENUITEM "Put with &Or", cmd2ndOr
+ MENUITEM "Put with &And", cmd2ndAnd
+ MENUITEM "Put with &Xor", cmd2ndXor
END
MENUITEM SEPARATOR
MENUITEM "&View Inside\ti", cmdInsideView
MENUITEM "Ma&p Inside\t:", cmdInsideMap
- MENUITEM "Mark '&X' At Dot\tx", cmdMark
- MENUITEM "&Erase 'X' At Dot\ty", cmdUnmark
+ MENUITEM "Mark '&X' at Dot\tx", cmdMark
+ MENUITEM "&Erase 'X' at Dot\ty", cmdUnmark
MENUITEM "I&nside Settings...\tq", cmdDlgInside
END
POPUP "&Bitmap"
@@ -370,7 +371,7 @@ BEGIN
MENUITEM "&Random All", cmdAllRandom
END
MENUITEM "&Zoom...\tz", cmdDlgZoom
- POPUP "Flip And &Rotate"
+ POPUP "Flip and &Rotate"
BEGIN
MENUITEM "Flip &Horizontal", cmdFlipX
MENUITEM "Flip &Vertical", cmdFlipY
@@ -404,27 +405,27 @@ BEGIN
MENUITEM "&Delete", cmdDrawDel
END
MENUITEM SEPARATOR
- MENUITEM "Colla&pse To Set", cmdCollapse
+ MENUITEM "Colla&pse to Set", cmdCollapse
MENUITEM "S&mooth Zoomed", cmdSmooth
MENUITEM "Smooth Cor&ners", cmdCorner
MENUITEM "Thic&ken", cmdThicken
MENUITEM "Make T&hinner", cmdThinner
MENUITEM "Accent &Boundaries", cmdAccentBoundary
MENUITEM SEPARATOR
- MENUITEM "&Fill At Dot\t`", cmdFloodDot
- MENUITEM "Floo&d At Dot\t~", cmdFloodDot2
- MENUITEM "Sl&ide To Dot", cmdSlide
+ MENUITEM "&Fill at Dot\t`", cmdFloodDot
+ MENUITEM "Floo&d at Dot\t~", cmdFloodDot2
+ MENUITEM "Sl&ide to Dot", cmdSlide
POPUP "Ro&w Column Edits"
BEGIN
- MENUITEM "Insert &Column At Dot", cmdAddX
- MENUITEM "Delete Co&lumn At Dot", cmdDelX
- MENUITEM "Insert &Row At Dot", cmdAddY
- MENUITEM "Delete Ro&w At Dot", cmdDelY
+ MENUITEM "Insert &Column at Dot", cmdAddX
+ MENUITEM "Delete Co&lumn at Dot", cmdDelX
+ MENUITEM "Insert &Row at Dot", cmdAddY
+ MENUITEM "Delete Ro&w at Dot", cmdDelY
MENUITEM SEPARATOR
- MENUITEM "Insert Col&umns At Dots", cmdAddX2
- MENUITEM "Delete Colu&mns At Dots", cmdDelX2
- MENUITEM "Insert R&ows At Dots", cmdAddY2
- MENUITEM "Delete Row&s At Dots", cmdDelY2
+ MENUITEM "Insert Col&umns at Dots", cmdAddX2
+ MENUITEM "Delete Colu&mns at Dots", cmdDelX2
+ MENUITEM "Insert R&ows at Dots", cmdAddY2
+ MENUITEM "Delete Row&s at Dots", cmdDelY2
END
MENUITEM SEPARATOR
MENUITEM "Bitmap Is &3D\tj", cmd3D
@@ -441,20 +442,20 @@ BEGIN
MENUITEM SEPARATOR
POPUP "&Bitmap"
BEGIN
- MENUITEM "&Get From Bitmap\t''", cmdColmapGet
- MENUITEM "&Put To Bitmap", cmdColmapPut
- MENUITEM "Put To Bitmap (&Nearest)", cmdColmapPutNearest
- MENUITEM "Put To Bitmap (&Dither)", cmdColmapPutDither
+ MENUITEM "&Get from Bitmap\t''", cmdColmapGet
+ MENUITEM "&Put to Bitmap", cmdColmapPut
+ MENUITEM "Put to Bitmap (&Nearest)", cmdColmapPutNearest
+ MENUITEM "Put to Bitmap (&Dither)", cmdColmapPutDither
MENUITEM SEPARATOR
- MENUITEM "&Or From Bitmap", cmdColmapOr
- MENUITEM "&And From Bitmap", cmdColmapAnd
- MENUITEM "&Xor From Bitmap", cmdColmapXor
+ MENUITEM "&Or from Bitmap", cmdColmapOr
+ MENUITEM "&And from Bitmap", cmdColmapAnd
+ MENUITEM "&Xor from Bitmap", cmdColmapXor
END
- MENUITEM "Blend From &2 Bitmaps", cmdColmapBlend
- MENUITEM "Blend From &3 Bitmaps", cmdColmapBlend2
+ MENUITEM "Blend from &2 Bitmaps", cmdColmapBlend
+ MENUITEM "Blend from &3 Bitmaps", cmdColmapBlend2
MENUITEM "&Graph Distance", cmdColmapDistance
MENUITEM "Graph &Walls", cmdColmapDistance2
- POPUP "&Antialias From Bitmap"
+ POPUP "&Antialias from Bitmap"
BEGIN
MENUITEM "&2x2", cmdColmapAntialias2
MENUITEM "&3x3", cmdColmapAntialias3
@@ -467,23 +468,23 @@ BEGIN
MENUITEM SEPARATOR
POPUP "&Dot Color"
BEGIN
- MENUITEM "&Set To Color", cmdColmapDotSet
- MENUITEM "&Or With Color", cmdColmapDotOr
- MENUITEM "&And With Color", cmdColmapDotAnd
- MENUITEM "&Xor With Color", cmdColmapDotXor
+ MENUITEM "&Set to Color", cmdColmapDotSet
+ MENUITEM "&Or with Color", cmdColmapDotOr
+ MENUITEM "&And with Color", cmdColmapDotAnd
+ MENUITEM "&Xor with Color", cmdColmapDotXor
MENUITEM SEPARATOR
- MENUITEM "A&dd With Color", cmdColmapDotAdd
- MENUITEM "S&ubtract With Color", cmdColmapDotSub
- MENUITEM "Mu<iply With Color", cmdColmapDotMul
- MENUITEM "M&in With Color", cmdColmapDotMin
- MENUITEM "&Max With Color", cmdColmapDotMax
- MENUITEM "&Blend With Color", cmdColmapDotBlend
+ MENUITEM "A&dd with Color", cmdColmapDotAdd
+ MENUITEM "S&ubtract with Color", cmdColmapDotSub
+ MENUITEM "Mu<iply with Color", cmdColmapDotMul
+ MENUITEM "M&in with Color", cmdColmapDotMin
+ MENUITEM "&Max with Color", cmdColmapDotMax
+ MENUITEM "&Blend with Color", cmdColmapDotBlend
END
POPUP "C&olor Bitmap"
BEGIN
- MENUITEM "&Add With Temp", cmdTempAdd
- MENUITEM "&Subtract With Temp", cmdTempSub
- MENUITEM "A&lpha With Temp", cmdTempAlpha
+ MENUITEM "&Add with Temp", cmdTempAdd
+ MENUITEM "&Subtract with Temp", cmdTempSub
+ MENUITEM "A&lpha with Temp", cmdTempAlpha
MENUITEM SEPARATOR
MENUITEM "&Delete", cmdColmapDel
END
@@ -551,8 +552,8 @@ BEGIN
MENUITEM "Room &Thinned", cmdRoomThin
MENUITEM "Tweak &Endpoints\tE", cmdTweakEndpoint
MENUITEM "Tweak Passa&ges\tH", cmdTweakPassage
- MENUITEM "Wea&ve To 3D", cmdWeave3D
- MENUITEM "Weave To &Inside", cmdWeaveInside
+ MENUITEM "Wea&ve to 3D", cmdWeave3D
+ MENUITEM "Weave to &Inside", cmdWeaveInside
MENUITEM "Clari&fy Weave", cmdClarifyWeave
MENUITEM "Clarify &3D", cmdClarify3D
MENUITEM "Clarify &4D", cmdClarify4D
@@ -581,7 +582,7 @@ BEGIN
MENUITEM "Recursive &Division\tAlt+j", cmdCreateDivision
MENUITEM "&Binary Tree\tAlt+y", cmdCreateBinary
MENUITEM "&Sidewinder\tAlt+s", cmdCreateSidewinder
- MENUITEM "&Hunt And Kill\tP", cmdCreatePerfect
+ MENUITEM "&Hunt and Kill\tP", cmdCreatePerfect
MENUITEM SEPARATOR
MENUITEM "Ra&ndom Perfect\tAlt+n", cmdCreateRandom
END
@@ -622,6 +623,8 @@ BEGIN
MENUITEM "&Delta (Triangle)\tY", cmdCreateDelta
MENUITEM "&Sigma (Hexagon)\tX", cmdCreateSigma
MENUITEM "&Upsilon (Octagon)\tAlt+u", cmdCreateUpsilon
+ MENUITEM "&Omicron (Sphere)", cmdCreateOmicron
+ MENUITEM SEPARATOR
MENUITEM "&Zeta (8 Way)\tZ", cmdCreateZeta
END
POPUP "&Labyrinth"
@@ -632,7 +635,7 @@ BEGIN
MENUITEM "&Classical", cmdLabyrinthClassical
MENUITEM "C&hartres", cmdLabyrinthChartres
MENUITEM "Cre&tan", cmdLabyrinthCretan
- MENUITEM "&Man In The Maze", cmdLabyrinthMan
+ MENUITEM "&Man in the Maze", cmdLabyrinthMan
MENUITEM "&Flat Classical", cmdLabyrinthClassicalF
MENUITEM "Fl&at Chartres", cmdLabyrinthChartresF
MENUITEM "Chartres &Replica", cmdLabyrinthChartresR
@@ -641,19 +644,19 @@ BEGIN
MENUITEM SEPARATOR
POPUP "Partial &Create"
BEGIN
- MENUITEM "&Perfect At Dot\tCtrl+P", cmdPartPerfect
+ MENUITEM "&Perfect at Dot\tCtrl+P", cmdPartPerfect
MENUITEM "&Braid Add Walls\tAlt+B", cmdPartBraid
MENUITEM "&Unicursal Thinned\tCtrl+U", cmdPartUnicursal
MENUITEM SEPARATOR
- MENUITEM "&Recursive At Dot", cmdPartRecursive
- MENUITEM "Pri&m's At Dot", cmdPartPrim
+ MENUITEM "&Recursive at Dot", cmdPartRecursive
+ MENUITEM "Pri&m's at Dot", cmdPartPrim
MENUITEM "&Kruskal Passages", cmdPartKruskal
- MENUITEM "&Tree At Dot", cmdPartTree
+ MENUITEM "&Tree at Dot", cmdPartTree
MENUITEM SEPARATOR
- MENUITEM "&Weave At Dot\tCtrl+V", cmdPartWeave
+ MENUITEM "&Weave at Dot\tCtrl+V", cmdPartWeave
MENUITEM "&Crack Add Walls\tCtrl+K", cmdPartCrack
- MENUITEM "Ca&vern At Dot", cmdPartCavern
- MENUITEM "&Zeta At Dot", cmdPartZeta
+ MENUITEM "Ca&vern at Dot", cmdPartCavern
+ MENUITEM "&Zeta at Dot", cmdPartZeta
END
MENUITEM "Polished Ma&zes\t/", cmdPolishMaze
MENUITEM "Create &Settings...\tM", cmdDlgCreate
@@ -664,7 +667,7 @@ BEGIN
MENUITEM "Fill Cul-De-&Sacs", cmdSolveCuldsac
MENUITEM "Fill &Blind Alleys", cmdSolveBlindAlley
MENUITEM "Fill &Collisions", cmdSolveCollision
- MENUITEM "Find A &Path", cmdSolveRecursive
+ MENUITEM "Find a &Path", cmdSolveRecursive
MENUITEM "Find S&hortest Path", cmdSolveShortest
MENUITEM "Find Sh&ortest Paths", cmdSolveShortest2
POPUP "&Wall Following"
@@ -710,8 +713,8 @@ BEGIN
MENUITEM "Save W&ireframe...", cmdSaveWire
POPUP "Wireframe &File"
BEGIN
- MENUITEM "&Save Picture...", cmdSavePicture
- MENUITEM "&Copy Picture", cmdCopyPicture
+ MENUITEM "&Save Metafile...", cmdSavePicture
+ MENUITEM "&Copy Metafile", cmdCopyPicture
MENUITEM SEPARATOR
MENUITEM "Save &Vector...", cmdSaveVector
END
@@ -723,7 +726,7 @@ BEGIN
MENUITEM "&Save Patches...", cmdSavePatch
MENUITEM "&Make Patch Bitmap Overview", cmdCreatePatchOverview
MENUITEM "&Render Patch Perspective", cmdRenderPatchPerspective
- MENUITEM "&Convert Patches To Wireframe", cmdPatchToWire
+ MENUITEM "&Convert Patches to Wireframe", cmdPatchToWire
END
END
@@ -736,10 +739,18 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
icon ICON "DAEICON1.ICO"
+
icon2 ICON "DAEICON2.ICO"
+
icon3 ICON "DAEICON3.ICO"
+
icon4 ICON "DAEICON4.ICO"
+icon5 ICON "DAEICON5.ICO"
+
+icon6 ICON "DAEICON6.ICO"
+
+
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
@@ -781,7 +792,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,60,120,50,14
PUSHBUTTON "Cancel",IDCANCEL,5,120,50,14
CONTROL "&Set Lower Right Bound",dr1,"Button",BS_AUTORADIOBUTTON,5,5,105,10
- CONTROL "Shift Down And Right &By",dr2,"Button",BS_AUTORADIOBUTTON,5,15,105,10
+ CONTROL "Shift Down and Right &By",dr2,"Button",BS_AUTORADIOBUTTON,5,15,105,10
EDITTEXT deSi_x,65,30,45,13,ES_AUTOHSCROLL
EDITTEXT deSi_y,65,45,45,13,ES_AUTOHSCROLL
CONTROL "&Clear Bitmap After Sizing",dxSi_c,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,60,105,10
@@ -808,13 +819,13 @@ BEGIN
ICON icon2,IDC_STATIC,172,4,20,20
ICON icon3,IDC_STATIC,196,4,20,20
LTEXT "",ds1,4,4,135,8
- LTEXT "Created November 1993 - November 2018",IDC_STATIC,4,12,139,8
+ LTEXT "Created November 1993 - August 2023",IDC_STATIC,4,12,139,8
LTEXT "By Walter D. Pullen (Astara@msn.com)",IDC_STATIC,4,20,135,8
LTEXT "Daedalus Website: http://www.astrolog.org/labyrnth.htm",IDC_STATIC,4,28,211,8
LTEXT "Website mirror: http://www.magitech.com/astrolog/labyrnth.htm",IDC_STATIC,4,36,211,8
LTEXT "IMPORTANT NOTICE: Daedalus and all Maze generation and",IDC_STATIC,4,52,212,8
LTEXT "general graphics routines used in this program are Copyright (C)",IDC_STATIC,4,60,212,8
- LTEXT "1998-2018 by Walter D. Pullen. Permission is granted to freely",IDC_STATIC,4,68,212,8
+ LTEXT "1998-2023 by Walter D. Pullen. Permission is granted to freely",IDC_STATIC,4,68,212,8
LTEXT "use, modify, and distribute these routines provided these credits",IDC_STATIC,4,76,212,8
LTEXT "and notices remain with any altered or distributed versions of the",IDC_STATIC,4,84,212,8
LTEXT "program. The user does have all rights to Mazes and other output",IDC_STATIC,4,92,215,8
@@ -829,8 +840,8 @@ BEGIN
LTEXT "PARTICULAR PURPOSE. See the GNU General Public License",IDC_STATIC,4,172,212,8
LTEXT "for more details, in File / More Help / Open License command.",IDC_STATIC,4,180,212,8
LTEXT "Dedicated to my father Kent, who drew me many Mazes as a",IDC_STATIC,4,196,212,8
- LTEXT "child and inspired me to be the most a-Maze-ing person I can. :)",IDC_STATIC,4,204,212,8
- LTEXT "Remember, life is a Maze. Think Labyrinth! :)",IDC_STATIC,4,220,152,8
+ LTEXT "child and inspired me to be the most a-Maze-ing person I can. :-)",IDC_STATIC,4,204,212,8
+ LTEXT "Remember, life is a Maze. Think Labyrinth! :-)",IDC_STATIC,4,220,152,8
END
dlgRandom DIALOGEX 32, 32, 159, 55
@@ -855,13 +866,13 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,60,95,50,14
PUSHBUTTON "Cancel",IDCANCEL,5,95,50,14
- CONTROL "Zoom &By Factor",dr1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,5,65,10
- CONTROL "Zoom &To Size",dr2,"Button",BS_AUTORADIOBUTTON,5,15,65,10
+ CONTROL "Zoom &by Factor",dr1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,5,65,10
+ CONTROL "Zoom &to Size",dr2,"Button",BS_AUTORADIOBUTTON,5,15,65,10
EDITTEXT deZo_x,70,30,40,13,ES_AUTOHSCROLL
EDITTEXT deZo_y,70,45,40,13,ES_AUTOHSCROLL
CONTROL "&Drop Lines When Shrinking",dr3,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,60,105,10
CONTROL "&Preserve On When Shrinking",dr4,"Button",BS_AUTORADIOBUTTON,5,70,105,10
- CONTROL "Tessellate &Instead Of Zoom",dr5,"Button",BS_AUTORADIOBUTTON,5,80,105,10
+ CONTROL "Tessellate &Instead of Zoom",dr5,"Button",BS_AUTORADIOBUTTON,5,80,105,10
LTEXT "Horizontal Zoom:",IDC_STATIC,5,30,60,8
LTEXT "Vertical Zoom:",IDC_STATIC,5,45,60,8
END
@@ -915,12 +926,12 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,290,165,50,14
PUSHBUTTON "Cancel",IDCANCEL,235,165,50,14
CONTROL "&Entire Bitmap",dr1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,15,95,10
- CONTROL "Certain &Number Of Pixels",dr2,"Button",BS_AUTORADIOBUTTON,10,25,95,10
- CONTROL "Certain Si&ze Of Pixels",dr3,"Button",BS_AUTORADIOBUTTON,10,35,95,10
- CONTROL "&Fixed Size Of Pixels",dr4,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,65,95,10
+ CONTROL "Certain &Number of Pixels",dr2,"Button",BS_AUTORADIOBUTTON,10,25,95,10
+ CONTROL "Certain Si&ze of Pixels",dr3,"Button",BS_AUTORADIOBUTTON,10,35,95,10
+ CONTROL "&Fixed Size of Pixels",dr4,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,65,95,10
CONTROL "Largest &Square Size",dr5,"Button",BS_AUTORADIOBUTTON,10,75,95,10
CONTROL "Largest &Rectangular Size",dr6,"Button",BS_AUTORADIOBUTTON,10,85,95,10
- CONTROL "Stretch To &Window",dr7,"Button",BS_AUTORADIOBUTTON,10,95,95,10
+ CONTROL "Stretch to &Window",dr7,"Button",BS_AUTORADIOBUTTON,10,95,95,10
EDITTEXT deRe_x,80,115,30,13,ES_AUTOHSCROLL
EDITTEXT deRe_y,80,130,30,13,ES_AUTOHSCROLL
CONTROL "Show &Color Bitmap",dxRe_c,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,145,105,10
@@ -931,7 +942,7 @@ BEGIN
EDITTEXT deRe_sx,180,85,35,13,ES_AUTOHSCROLL
EDITTEXT deRe_sy,180,100,35,13,ES_AUTOHSCROLL
CONTROL "Size Is Drawa&ble Area",dxRe_wc,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,115,95,10
- CONTROL "Window Always On &Top",dxRe_wt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,125,95,10
+ CONTROL "Window Always on &Top",dxRe_wt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,125,95,10
CONTROL "Hide &Menu",dxRe_wm,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,135,95,10
CONTROL "Hide Scro&ll Bars",dxRe_ws,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,145,95,10
CONTROL "Re&draw When Bitmap Edited",dxRe_d,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,15,105,10
@@ -939,7 +950,7 @@ BEGIN
CONTROL "Show &Individual Pixel Edits",dxRe_td,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,35,105,10
EDITTEXT deRe_td,310,45,25,13,ES_AUTOHSCROLL
CONTROL "Error Check Pi&xel Operations",dxRe_ec,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,60,105,10
- CONTROL "&Hourglass Cursor On Redraw",dxRe_hg,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,70,105,10
+ CONTROL "&Hourglass Cursor on Redraw",dxRe_hg,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,70,105,10
CONTROL "&Autorepeat Last Command",dxRe_ar,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,100,105,10
EDITTEXT deRe_ti,310,110,25,13,ES_AUTOHSCROLL
CONTROL "&Pause Timer",dxRe_pt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,125,105,10
@@ -954,9 +965,9 @@ BEGIN
LTEXT "Horizontal Scroll:",IDC_STATIC,120,85,60,8
LTEXT "Vertical Scroll:",IDC_STATIC,120,100,55,8
LTEXT "Pixel Display Delay:",IDC_STATIC,230,45,75,8
- LTEXT "Repeat Delay In Msec:",IDC_STATIC,230,110,75,8
- GROUPBOX "What To Draw",IDC_STATIC,5,5,105,45
- GROUPBOX "How To Draw It",IDC_STATIC,5,55,105,55
+ LTEXT "Repeat Delay in Msec:",IDC_STATIC,230,110,75,8
+ GROUPBOX "What to Draw",IDC_STATIC,5,5,105,45
+ GROUPBOX "How to Draw It",IDC_STATIC,5,55,105,55
GROUPBOX "Window Information",IDC_STATIC,115,5,105,155
GROUPBOX "Redraw",IDC_STATIC,225,5,115,80
GROUPBOX "System",IDC_STATIC,225,90,115,70
@@ -970,7 +981,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,280,185,50,14
PUSHBUTTON "Cancel",IDCANCEL,225,185,50,14
CONTROL "Create With ""&River""",dxCr_r,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,15,95,10
- CONTROL "Have ""River"" At &Edges",dxCr_re,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,95,10
+ CONTROL "Have ""River"" at &Edges",dxCr_re,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,95,10
CONTROL "No ""River"" &Flowback",dxCr_rf,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,35,95,10
EDITTEXT deCr_o,70,60,35,13,ES_AUTOHSCROLL
EDITTEXT deCr_o2,70,75,35,13,ES_AUTOHSCROLL
@@ -981,7 +992,7 @@ BEGIN
CONTROL "Make &Patches Also",dr3,"Button",BS_AUTORADIOBUTTON,10,140,80,10
EDITTEXT deCr_j,40,160,70,13,ES_AUTOHSCROLL
EDITTEXT deCr_l,40,175,70,13,ES_AUTOHSCROLL
- CONTROL "Create With &Wall Adding",dxCr_tw,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,15,95,10
+ CONTROL "Create with &Wall Adding",dxCr_tw,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,15,95,10
CONTROL "&Value Is Random Chance",dxCr_tr,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,25,95,10
EDITTEXT deCr_t,180,35,35,13,ES_AUTOHSCROLL
EDITTEXT deCr_fi,180,50,35,13,ES_AUTOHSCROLL
@@ -992,7 +1003,7 @@ BEGIN
EDITTEXT deCr_fx,135,155,25,13,ES_AUTOHSCROLL
EDITTEXT deCr_fy,190,155,25,13,ES_AUTOHSCROLL
EDITTEXT deCr_fn,180,170,35,13,ES_AUTOHSCROLL
- CONTROL "&Allow Isolations In Fractal",dxCr_fi,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,185,95,10
+ CONTROL "&Allow Isolations in Fractal",dxCr_fi,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,185,95,10
CONTROL "&Lines May Head Off",dxCr_c,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,230,15,95,10
EDITTEXT deCr_cl,290,25,35,13,ES_AUTOHSCROLL
EDITTEXT deCr_cp,290,40,35,13,ES_AUTOHSCROLL
@@ -1001,7 +1012,7 @@ BEGIN
CONTROL "Eller's Al&gorithm Variation",dr5,"Button",BS_AUTORADIOBUTTON,230,95,95,10
CONTROL "Tilt Te&mplate",dr6,"Button",BS_AUTORADIOBUTTON,230,105,95,10
EDITTEXT deCr_vs,295,125,35,13,ES_AUTOHSCROLL
- CONTROL "&Kruskal Based On Picture",dxCr_kp,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,225,140,110,10
+ CONTROL "&Kruskal Based on Picture",dxCr_kp,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,225,140,110,10
CONTROL "Weave Crossings May &Corner",dxCr_wc,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,225,150,110,10
CONTROL "&Tilt Lines Make No Diamonds",dxCr_t,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,225,160,110,10
EDITTEXT deCr_ts,295,170,35,13,ES_AUTOHSCROLL
@@ -1061,14 +1072,14 @@ BEGIN
CONTROL "&Follow Passages",dxDs_fp,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,110,75,10
EDITTEXT deDs_ra,150,120,25,13,ES_AUTOHSCROLL
EDITTEXT deDs_mc,150,135,25,13,ES_AUTOHSCROLL
- CONTROL "Move B&y Two",dxDs_mt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,15,75,10
+ CONTROL "Move b&y Two",dxDs_mt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,15,75,10
CONTROL "D&rag Move Dot",dxDs_dm,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,25,75,10
CONTROL "Drag Is &Erase",dxDs_de,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,35,75,10
CONTROL "Drag &Big Dot",dxDs_db,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,45,75,10
- CONTROL "Drag By T&wo",dxDs_dt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,55,75,10
- CONTROL "Do Drag &On Temp",dxDs_et,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,65,75,10
- CONTROL "Move Into &Void",dr1,"Button",BS_AUTORADIOBUTTON,190,95,75,10
- CONTROL "&Stop At Edge",dr2,"Button",BS_AUTORADIOBUTTON,190,105,75,10
+ CONTROL "Drag by T&wo",dxDs_dt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,55,75,10
+ CONTROL "Do Drag &on Temp",dxDs_et,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,65,75,10
+ CONTROL "Move into &Void",dr1,"Button",BS_AUTORADIOBUTTON,190,95,75,10
+ CONTROL "&Stop at Edge",dr2,"Button",BS_AUTORADIOBUTTON,190,105,75,10
CONTROL "&Torus Wrapping",dr3,"Button",BS_AUTORADIOBUTTON,190,115,75,10
LTEXT "",ds1,5,155,85,8
LTEXT "Horizontal:",IDC_STATIC,10,15,40,8
@@ -1143,14 +1154,14 @@ BEGIN
EDITTEXT deDr_mx,75,90,35,13,ES_AUTOHSCROLL
EDITTEXT deDr_my,75,105,35,13,ES_AUTOHSCROLL
EDITTEXT deDr_mz,75,120,35,13,ES_AUTOHSCROLL
- CONTROL "Move With &Arrow Keys",dxDr_ak,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,140,85,10
+ CONTROL "Move with &Arrow Keys",dxDr_ak,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,140,85,10
EDITTEXT deDr_vx,185,5,35,13,ES_AUTOHSCROLL
EDITTEXT deDr_vy,185,20,35,13,ES_AUTOHSCROLL
EDITTEXT deDr_th,190,39,30,13,ES_AUTOHSCROLL
EDITTEXT deDr_ph,190,55,30,13,ES_AUTOHSCROLL
EDITTEXT deDr_sm,185,75,35,13,ES_AUTOHSCROLL
EDITTEXT deDr_sr,185,90,35,13,ES_AUTOHSCROLL
- CONTROL "View From &Right",dxDr_ri,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,115,110,95,10
+ CONTROL "View from &Right",dxDr_ri,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,115,110,95,10
CONTROL "&Merge Blocks Together",dxDr_mc,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,115,121,95,10
LTEXT "Horizontal Size:",IDC_STATIC,5,5,53,8
LTEXT "Vertical Size:",IDC_STATIC,5,20,53,8
@@ -1177,7 +1188,7 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,5,160,50,14
COMBOBOX dcRc_1,30,5,80,170,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
COMBOBOX dcRc_2,30,20,80,150,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
- CONTROL "&Swap Instead Of Replace",dxRc_x,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,35,105,10
+ CONTROL "&Swap Instead of Replace",dxRc_x,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,35,105,10
CONTROL "&Rainbow Blend",dr1,"Button",BS_AUTORADIOBUTTON,10,70,95,10
CONTROL "Straight &Color Blend",dr2,"Button",BS_AUTORADIOBUTTON,10,80,95,10
EDITTEXT deRc_s,80,100,30,13,ES_AUTOHSCROLL
@@ -1191,7 +1202,7 @@ BEGIN
LTEXT "Rainbow Distance:",IDC_STATIC,5,115,70,8
LTEXT "Blend1:",IDC_STATIC,5,130,25,8
LTEXT "Blend2:",IDC_STATIC,5,145,25,8
- GROUPBOX "Special To Pattern Is",IDC_STATIC,5,60,105,35
+ GROUPBOX "Special to Pattern Is",IDC_STATIC,5,60,105,35
END
dlgFile DIALOGEX 32, 32, 231, 135
@@ -1206,15 +1217,15 @@ BEGIN
EDITTEXT deFs_in,75,45,35,13,ES_AUTOHSCROLL
CONTROL "Use &Eller's Algorithm",dxFs_e,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,60,100,10
CONTROL "Don't &Autostart Infinite",dxFs_is,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,70,100,10
- CONTROL "&Don't Save To File",dr1,"Button",BS_AUTORADIOBUTTON,10,85,100,10
- CONTROL "Save As Te&xt",dr2,"Button",BS_AUTORADIOBUTTON,10,95,100,10
- CONTROL "Save As &DOS Text",dr3,"Button",BS_AUTORADIOBUTTON,10,105,100,10
- CONTROL "Save As &Bitmaps",dr4,"Button",BS_AUTORADIOBUTTON,10,115,100,10
+ CONTROL "&Don't Save to File",dr1,"Button",BS_AUTORADIOBUTTON,10,85,100,10
+ CONTROL "Save as Te&xt",dr2,"Button",BS_AUTORADIOBUTTON,10,95,100,10
+ CONTROL "Save as &DOS Text",dr3,"Button",BS_AUTORADIOBUTTON,10,105,100,10
+ CONTROL "Save as &Bitmaps",dr4,"Button",BS_AUTORADIOBUTTON,10,115,100,10
EDITTEXT deFs_2x,190,5,35,13,ES_AUTOHSCROLL
EDITTEXT deFs_2y,190,20,35,13,ES_AUTOHSCROLL
EDITTEXT deFs_3,190,35,35,13,ES_AUTOHSCROLL
CONTROL "Save Text Bitmaps &Clipped",dxFs_t,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,50,105,10
- CONTROL "&Line Chars In Text Bitmaps",dxFs_l,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,60,105,10
+ CONTROL "&Line Chars in Text Bitmaps",dxFs_l,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,60,105,10
CONTROL "Save Text Bitmaps &Tabbed",dxFs_b,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,70,105,10
LTEXT "Current Generation:",IDC_STATIC,10,15,64,8
LTEXT "Generation Cutoff:",IDC_STATIC,10,30,60,8
@@ -1270,22 +1281,23 @@ BEGIN
LTEXT "Z Light Vector:",IDC_STATIC,90,130,55,8
END
-dlgCubeFlip DIALOGEX 32, 32, 114, 116
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+dlgCubeFlip DIALOGEX 32, 32, 115, 127
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "3D Bitmap"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- DEFPUSHBUTTON "OK",IDOK,60,95,50,14
- PUSHBUTTON "Cancel",IDCANCEL,5,95,50,14
+ DEFPUSHBUTTON "OK",IDOK,60,105,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,5,105,50,14
CONTROL "&X",dr1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,15,20,10
CONTROL "&Y",dr2,"Button",BS_AUTORADIOBUTTON,40,15,20,10
CONTROL "&Z",dr3,"Button",BS_AUTORADIOBUTTON,70,15,20,10
CONTROL "&Flip",dr4,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,45,95,10
- CONTROL "Rotate &Left Or Forward",dr6,"Button",BS_AUTORADIOBUTTON,10,55,95,10
- CONTROL "Rotate &Right Or Backward",dr5,"Button",BS_AUTORADIOBUTTON,10,65,95,10
+ CONTROL "Rotate &Left or Forward",dr6,"Button",BS_AUTORADIOBUTTON,10,55,95,10
+ CONTROL "Rotate &Right or Backward",dr5,"Button",BS_AUTORADIOBUTTON,10,65,95,10
CONTROL "Rotate &Across",dr7,"Button",BS_AUTORADIOBUTTON,10,75,95,10
+ CONTROL "&Transpose",dr8,"Button",BS_AUTORADIOBUTTON,10,85,95,10
GROUPBOX "Axis",IDC_STATIC,5,5,105,25
- GROUPBOX "Operation",IDC_STATIC,5,35,105,55
+ GROUPBOX "Operation",IDC_STATIC,5,35,105,65
END
dlgBright DIALOGEX 32, 32, 115, 141
@@ -1295,16 +1307,16 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,60,120,50,14
PUSHBUTTON "Cancel",IDCANCEL,5,120,50,14
- CONTROL "Brighten All By &Factor",dr1,"Button",BS_AUTORADIOBUTTON,10,15,95,10
- CONTROL "Brighten All By &Offset",dr2,"Button",BS_AUTORADIOBUTTON,10,25,95,10
- CONTROL "Brighten All By &Multiplier",dr3,"Button",BS_AUTORADIOBUTTON,10,35,95,10
- CONTROL "&Limit Brightness To Value",dr4,"Button",BS_AUTORADIOBUTTON,10,45,95,10
+ CONTROL "Brighten All by &Factor",dr1,"Button",BS_AUTORADIOBUTTON,10,15,95,10
+ CONTROL "Brighten All by &Offset",dr2,"Button",BS_AUTORADIOBUTTON,10,25,95,10
+ CONTROL "Brighten All by &Multiplier",dr3,"Button",BS_AUTORADIOBUTTON,10,35,95,10
+ CONTROL "&Limit Brightness to Value",dr4,"Button",BS_AUTORADIOBUTTON,10,45,95,10
EDITTEXT deBr_v,75,100,35,13,ES_AUTOHSCROLL
LTEXT "Transform Amount:",IDC_STATIC,5,100,65,8
GROUPBOX "Brightness",IDC_STATIC,5,5,105,55
GROUPBOX "Rotation",IDC_STATIC,5,60,105,35
- CONTROL "&Rotate All By Degree",dr5,"Button",BS_AUTORADIOBUTTON,10,70,95,10
- CONTROL "&Twist Middle By Degree",dr6,"Button",BS_AUTORADIOBUTTON,10,80,95,10
+ CONTROL "&Rotate All by Degree",dr5,"Button",BS_AUTORADIOBUTTON,10,70,95,10
+ CONTROL "&Twist Middle by Degree",dr6,"Button",BS_AUTORADIOBUTTON,10,80,95,10
END
dlgMaze DIALOGEX 32, 32, 297, 121
@@ -1315,13 +1327,13 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,240,100,50,14
PUSHBUTTON "Cancel",IDCANCEL,240,80,50,14
CONTROL "Create Ma&zes Polished",dxMa_pm,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,5,140,10
- CONTROL "Apply Commands To Rectangle &Section",dxMa_ad,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,15,140,10
- CONTROL "&Teleport To Entrance On Maze Creation",dxMa_te,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,25,140,10
+ CONTROL "Apply Commands to Rectangle &Section",dxMa_ad,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,15,140,10
+ CONTROL "&Teleport to Entrance on Maze Creation",dxMa_te,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,25,140,10
CONTROL "Connect &Poles Never Adds Dead Ends",dxMa_cp,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,35,140,10
CONTROL "Solve Fillers Check &Every Pixel",dxMa_ep,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,45,140,10
- CONTROL "Solve Fillers Consider &Dots As Exits",dxMa_de,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,55,140,10
- CONTROL "&Find A Path Finds Random Path",dxMa_rp,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,65,140,10
- CONTROL "Show Count &Of Shortest Solutions",dxMa_cs,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,75,140,10
+ CONTROL "Solve Fillers Consider &Dots as Exits",dxMa_de,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,55,140,10
+ CONTROL "&Find a Path Finds Random Path",dxMa_rp,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,65,140,10
+ CONTROL "Show Count &of Shortest Solutions",dxMa_cs,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,75,140,10
EDITTEXT deMa_tp,105,85,40,13,ES_AUTOHSCROLL
EDITTEXT deMa_mc,105,100,40,13,ES_AUTOHSCROLL
EDITTEXT deMa_ww,250,5,40,13,ES_AUTOHSCROLL
@@ -1360,7 +1372,7 @@ BEGIN
CONTROL "Mount&ains",dxIn_mt,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,145,80,10
EDITTEXT deIn_mt,65,156,25,13,ES_AUTOHSCROLL
EDITTEXT deIn_cl,65,170,25,13,ES_AUTOHSCROLL
- CONTROL "S&un And Moon",dxIn_sm,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,185,80,10
+ CONTROL "S&un and Moon",dxIn_sm,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,185,80,10
CONTROL "Rain&bow",dxIn_rb,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,195,80,10
CONTROL "&Stars",dxIn_si,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,205,80,10
EDITTEXT deIn_si,65,215,25,13,ES_AUTOHSCROLL
@@ -1417,7 +1429,7 @@ BEGIN
LTEXT "Up Down Offset:",IDC_STATIC,205,160,60,8
LTEXT "Direction Offset:",IDC_STATIC,205,175,60,8
GROUPBOX "Inside Display Mode",IDC_STATIC,5,5,90,75
- GROUPBOX "What To Draw",IDC_STATIC,5,85,90,165
+ GROUPBOX "What to Draw",IDC_STATIC,5,85,90,165
GROUPBOX "Wall Characteristics",IDC_STATIC,100,5,95,185
GROUPBOX "Semitransparent Walls",IDC_STATIC,100,195,95,55
GROUPBOX "Smooth Movement",IDC_STATIC,200,5,100,60
@@ -1473,11 +1485,11 @@ BEGIN
EDITTEXT deEv_cn,205,65,25,13,ES_AUTOHSCROLL
EDITTEXT deEv_mm,205,80,25,13,ES_AUTOHSCROLL
EDITTEXT deEv_ex,205,95,25,13,ES_AUTOHSCROLL
- LTEXT "On Move Off Bitmap:",IDC_STATIC,5,5,80,8
- LTEXT "On Move Into Wall:",IDC_STATIC,5,20,80,8
- LTEXT "On Move To New Cell:",IDC_STATIC,5,35,80,8
- LTEXT "After Move To New Cell:",IDC_STATIC,5,50,80,8
- LTEXT "On Follow To New Cell:",IDC_STATIC,5,65,80,8
+ LTEXT "On Move off Bitmap:",IDC_STATIC,5,5,80,8
+ LTEXT "On Move into Wall:",IDC_STATIC,5,20,80,8
+ LTEXT "On Move to New Cell:",IDC_STATIC,5,35,80,8
+ LTEXT "After Move to New Cell:",IDC_STATIC,5,50,80,8
+ LTEXT "On Follow to New Cell:",IDC_STATIC,5,65,80,8
LTEXT "After Redraw Inside:",IDC_STATIC,5,80,80,8
LTEXT "On Redraw Inside",IDC_STATIC,5,95,80,8
LTEXT "On Run Command:",IDC_STATIC,5,110,80,8
@@ -1536,7 +1548,7 @@ BEGIN
CONTROL "&Classical",dr1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,15,70,10
CONTROL "C&hartres",dr2,"Button",BS_AUTORADIOBUTTON,10,25,70,10
CONTROL "Creta&n",dr3,"Button",BS_AUTORADIOBUTTON,10,35,70,10
- CONTROL "&Man In The Maze",dr4,"Button",BS_AUTORADIOBUTTON,10,45,70,10
+ CONTROL "&Man in the Maze",dr4,"Button",BS_AUTORADIOBUTTON,10,45,70,10
CONTROL "Chartres &Replica",dr5,"Button",BS_AUTORADIOBUTTON,10,55,70,10
CONTROL "C&ustom",dr6,"Button",BS_AUTORADIOBUTTON,10,65,70,10
CONTROL "C&ircle",dr7,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,95,70,10
@@ -1576,7 +1588,7 @@ END
// Accelerator
//
-accelerator ACCELERATORS
+accelerator ACCELERATORS
BEGIN
"""", cmdColmapGet, ASCII, NOINVERT
"'", cmdEraseCorner, ASCII, NOINVERT
@@ -1588,6 +1600,7 @@ BEGIN
"0", cmdMoveRandom, VIRTKEY, NOINVERT
"0", cmdGoRandom, VIRTKEY, CONTROL, NOINVERT
"0", cmdAbout, VIRTKEY, ALT, NOINVERT
+ "0", cmdScript30, VIRTKEY, CONTROL, ALT, NOINVERT
"0", cmdShellHelp, VIRTKEY, SHIFT, NOINVERT
"0", cmdScript10, VIRTKEY, SHIFT, ALT, NOINVERT
28, cmdSize14, ASCII, NOINVERT
@@ -1910,8 +1923,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,3,0,0
- PRODUCTVERSION 3,3,0,0
+ FILEVERSION 3,4,0,0
+ PRODUCTVERSION 3,4,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -1927,13 +1940,13 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "astrolog.org"
- VALUE "FileDescription", "Daedalus 3.3 for Windows"
- VALUE "FileVersion", "3, 3, 0, 0"
+ VALUE "FileDescription", "Daedalus 3.4 for Windows"
+ VALUE "FileVersion", "3, 4, 0, 0"
VALUE "InternalName", "Daedalus"
- VALUE "LegalCopyright", "Copyright (c) 2018"
+ VALUE "LegalCopyright", "Copyright (c) 2023"
VALUE "OriginalFilename", "daedalus.exe"
VALUE "ProductName", "Daedalus"
- VALUE "ProductVersion", "3, 3, 0, 0"
+ VALUE "ProductVersion", "3, 4, 0, 0"
END
END
BLOCK "VarFileInfo"
@@ -1949,8 +1962,14 @@ END
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
+ dlgCubeFlip, DIALOG
+ BEGIN
+ RIGHTMARGIN, 114
+ BOTTOMMARGIN, 116
+ END
+
dlgMaze, DIALOG
BEGIN
RIGHTMARGIN, 152
@@ -1966,7 +1985,18 @@ BEGIN
END
#endif // APSTUDIO_INVOKED
-#endif // English (U.S.) resources
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// AFX_DIALOG_LAYOUT
+//
+
+dlgCubeFlip AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
+
+#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/daeicon1.ico b/daeicon1.ico
index cb1d6aa..60f2304 100644
Binary files a/daeicon1.ico and b/daeicon1.ico differ
diff --git a/daeicon5.ico b/daeicon5.ico
new file mode 100644
index 0000000..09b26f6
Binary files /dev/null and b/daeicon5.ico differ
diff --git a/daeicon6.ico b/daeicon6.ico
new file mode 100644
index 0000000..b4f2254
Binary files /dev/null and b/daeicon6.ico differ
diff --git a/draw.cpp b/draw.cpp
index 4e111f8..baceda5 100644
--- a/draw.cpp
+++ b/draw.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: draw.cpp
+** Daedalus (Version 3.4) File: draw.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** Mazes.
**
** Created: 6/15/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -44,9 +44,9 @@ DS ds = {
fTrue, fFalse, fFalse, fTrue, fFalse, fFalse, 1, 1, 200.0, 20.0, 20.0, 20.0,
kvBlack, kvBlue, kvYellow, kvGray, kvGreen, kvRed, {100.0, 75.0, 50.0},
// Inside settings
- fFalse, 500,
+ fFalse, 500, 0,
// Macro accessible only settings
- 10990099, fFalse, fFalse, 0, 0, 0, 1000, fTrue, 0,
+ 10990099, -1, fFalse, fFalse, 0, 0, 0, 1000, fTrue, 0, fFalse,
// Internal settings
fFalse, xStart, 0.0, 0, NULL};
@@ -1273,7 +1273,7 @@ void WriteWireframeMetafile(FILE *file, CONST COOR *coor, long ccoor)
MetaLong(14); // Bytes in string
MetaLong(LFromBB('D', 'a', 'e', 'd')); // "Daed"
MetaLong(LFromBB('a', 'l', 'u', 's')); // "alus"
- MetaLong(LFromBB(' ', '3', '.', '3')); // " 3.3"
+ MetaLong(LFromBB(' ', '3', '.', '4')); // " 3.4"
MetaWord(WFromBB('0', 0)); // "0"
MetaSaveDc();
MetaWindowOrg(xmin, ymin);
diff --git a/draw.h b/draw.h
index 4e801f5..96ea19f 100644
--- a/draw.h
+++ b/draw.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: draw.h
+** Daedalus (Version 3.4) File: draw.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** graphics routines, unrelated to Mazes.
**
** Created: 6/15/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
/*
@@ -39,6 +39,8 @@
((int)(((c).Get3(x, y, z) >> ((d) * 6)) & (cTexture-1)))
#define SetT3(c, x, y, z, d, t) ((c).Get3(x, y, z) & \
~((KV)(cTexture-1) << ((d) * 6)) | ((KV)(t) << ((d) * 6)))
+#define SetU3(c, x, y, z, f, t) ((c).Get3(x, y, z) & \
+ ~((KV)4095 << ((f) * 12)) | ((KV)(t) << ((f) * 12)))
/*
@@ -98,12 +100,14 @@ typedef struct _drawsettings {
// Inside settings
- flag fStar;
- int cStar;
+ flag fStar; // Used by Inside view too
+ int cStar; // Used by Inside view too
+ int nStereo; // Used by Inside view too
// Macro accessible only settings
long lStarColor; // Used by Inside view too
+ int nStarSize; // Used by Inside view too
flag fSkyAll; // Used by Inside view too
flag fArrowFree;
int nTrans;
@@ -112,6 +116,7 @@ typedef struct _drawsettings {
int nWireDistance;
flag fWireSort;
int nFaceOrigin;
+ flag fStereo3D; // Used by Inside view too
// Internal settings
@@ -210,7 +215,9 @@ extern flag CreateSolids(CONST char *);
extern KV KvStarRandom(void);
extern void CalculateCoordinate(int *, int *, real, real, real);
+extern flag FRenderPerspectiveWireCore(CMap &, COOR *, long);
extern flag FRenderPerspectiveWire(CMap &, COOR *, long);
+extern flag FRenderPerspectivePatchCore(CMap &, PATCH *, long);
extern flag FRenderPerspectivePatch(CMap &, PATCH *, long);
extern flag FRenderAerial(CMap &, CONST COOR *, long);
extern long ConvertPatchToWire(COOR **, CONST PATCH *, long);
diff --git a/draw2.cpp b/draw2.cpp
index 9c6d4a1..17521a7 100644
--- a/draw2.cpp
+++ b/draw2.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: draw2.cpp
+** Daedalus (Version 3.4) File: draw2.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** Mazes.
**
** Created: 7/17/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -119,7 +119,8 @@ flag FRenderInitialize(CMap &b, real theta, real phi)
CalculateCoordinate(&x, &y, rx, ry, rz);
kv = fColor ? ds.rgstar[i].kv : fOff;
b.Set(x, y, kv);
- if (FOdd(i))
+ if (ds.nStarSize < 0 ? FOdd(i) :
+ RgbR(kv) + RgbG(kv) + RgbB(kv) >= ds.nStarSize)
for (d = 0; d < DIRS; d++)
b.Set(x+xoff[d], y+yoff[d], kv);
}
@@ -144,6 +145,64 @@ void RenderFinalize(CMap &b)
}
+// Draw a stereoscopic 3D version of a wireframe or patch list to a color or
+// monochrome bitmap. This involves drawing "left eye" and "right eye"
+// versions of the scene from slightly different points of view.
+
+flag FRenderPerspectiveStereo(CMap &b, COOR *coor, long ccoor,
+ PATCH *patch, long cpatch)
+{
+ int mSav = ds.hormin, nSav = ds.vermin, dSav = ds.theta, x, f, m, n;
+ flag fWire = coor != NULL, fRet = fFalse;
+ CMap *bs = NULL;
+ CCol *c, *cs;
+
+ x = !ds.fStereo3D ? b.m_x >> 1 : b.m_x;
+ bs = b.Create();
+ if (bs == NULL || !bs->FBitmapSizeSet(x, b.m_y))
+ goto LExit;
+ f = FOdd(b.m_x) && !ds.fStereo3D;
+ m = NCosRD(ds.nStereo, ds.theta); n = NSinRD(ds.nStereo, ds.theta);
+
+ // Draw left eye view of scene.
+ ds.hormin += m; ds.vermin += n; //ds.theta += 1;
+ if (!(fWire ? FRenderPerspectiveWireCore(*bs, coor, ccoor) :
+ FRenderPerspectivePatchCore(*bs, patch, cpatch)))
+ goto LExit;
+ if (ds.fStereo3D && b.FColor()) {
+ c = dynamic_cast(&b);
+ cs = dynamic_cast(bs);
+ cs->ColmapGrayscale();
+ cs->ColmapOrAndKv(kvCyan, 0);
+ }
+ b.BlockMove(*bs, 0, 0, x-1, b.m_y-1, 0, 0);
+
+ // Draw right eye view of scene.
+ ds.hormin -= m*2; ds.vermin -= n*2; //ds.theta -= 1*2;
+ if (!(fWire ? FRenderPerspectiveWireCore(*bs, coor, ccoor) :
+ FRenderPerspectivePatchCore(*bs, patch, cpatch)))
+ goto LExit;
+ if (!ds.fStereo3D)
+ b.BlockMove(*bs, 0, 0, x-1, b.m_y-1, x+f, 0);
+ else if (b.FColor()) {
+ cs->ColmapGrayscale();
+ cs->ColmapOrAndKv(kvRed, 0);
+ c->ColmapOrAnd(*cs, 1);
+ }
+
+ // Draw line down middle if outer bitmap is odd sized.
+ if (f)
+ b.LineY(x, 0, b.m_y-1, ds.kvTrim);
+ ds.hormin = mSav; ds.vermin = nSav; ds.theta = dSav;
+
+ fRet = fTrue;
+LExit:
+ if (bs != NULL)
+ bs->Destroy();
+ return fRet;
+}
+
+
// Return a randomly chosen color for a star or meteor.
KV KvStarRandom()
@@ -342,7 +401,7 @@ void PushdownWire(COOR *coor, long p, long size)
// Implements the Render Wireframe Perspective command for both monochrome and
// color bitmaps.
-flag FRenderPerspectiveWire(CMap &b, COOR *coor, long ccoor)
+flag FRenderPerspectiveWireCore(CMap &b, COOR *coor, long ccoor)
{
COOR *coorT, coorSwap;
long ccoor2 = 0, ccoor3 = 0, i;
@@ -491,6 +550,17 @@ flag FRenderPerspectiveWire(CMap &b, COOR *coor, long ccoor)
}
+// Like FRenderPerspectiveWireCore but handles stereoscopic rendering of two
+// images side by side if that setting is in effect.
+
+flag FRenderPerspectiveWire(CMap &b, COOR *coor, long ccoor)
+{
+ if (ds.nStereo != 0)
+ return FRenderPerspectiveStereo(b, coor, ccoor, NULL, 0);
+ return FRenderPerspectiveWireCore(b, coor, ccoor);
+}
+
+
/*
******************************************************************************
** Render Perspective Patches
@@ -521,7 +591,7 @@ void PushdownPatch(PATCH *patch, long p, long size)
// patches in 3D space. Implements the Render Wireframe Perspective command
// for both monochrome and color bitmaps.
-flag FRenderPerspectivePatch(CMap &b, PATCH *patch, long cpatch)
+flag FRenderPerspectivePatchCore(CMap &b, PATCH *patch, long cpatch)
{
PATCH *patchT, patT;
PATR patrT;
@@ -809,6 +879,17 @@ flag FRenderPerspectivePatch(CMap &b, PATCH *patch, long cpatch)
}
+// Like FRenderPerspectivePatchCore but handles stereoscopic rendering of two
+// images side by side if that setting is in effect.
+
+flag FRenderPerspectivePatch(CMap &b, PATCH *patch, long cpatch)
+{
+ if (ds.nStereo != 0)
+ return FRenderPerspectiveStereo(b, NULL, 0, patch, cpatch);
+ return FRenderPerspectivePatchCore(b, patch, cpatch);
+}
+
+
/*
******************************************************************************
** Other Render Routines
diff --git a/game.cpp b/game.cpp
index e26fc28..22276a5 100644
--- a/game.cpp
+++ b/game.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: game.cpp
+** Daedalus (Version 3.4) File: game.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** come with Daedalus.
**
** Created: 11/6/2018.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
diff --git a/graphics.cpp b/graphics.cpp
index d151b46..029f4ae 100644
--- a/graphics.cpp
+++ b/graphics.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: graphics.cpp
+** Daedalus (Version 3.4) File: graphics.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** bitmap, unrelated to Mazes.
**
** Converted from Modula2: 3/8/1991.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -90,18 +90,18 @@ CONST char *szTurtleCh1[128-32] = {
"BRGFEHBR3"}; // Symbols
// Turtle font for 5x9 characters.
-CONST char *szTurtleCh2[256-32] = {
- "", "BR2D4BD2D0", "BRD2BR2U2", "BD2R4BD2L4BD2BRU6BR2D6",
- "BR2D6BENL3EHL2HER3", "RDLNUBR4G4BR4DLUR", "BD2NF4UEFDG2DFRE2", "BR2DG",
- "BR3G2D2F2", "BRF2D2G2", "BD2FNGRNU2ND2RNEF", "BD3R2NU2ND2R2", "BD5BR2DG",
- "BD3R4", "BD6BRRULD", "BD5E4", // Symbols
+CONST char *szTurtleCh2[256-32] = {"",
+ "BR2D4BD2D0", "BRD2BR2U2", "BD2R4BD2L4BFU4BR2D4", "BR2D6BENL3EHL2HER3",
+ "RDLNUBR4G4BR4DLUR", "BD2NF4UEFDG2DFRE2", "BR2DG", "BR3G2D2F2", "BRF2D2G2",
+ "BD2FNGRNU2ND2RNEF", "BD3R2NU2ND2R2", "BD5BR2DG", "BD3R4", "BD6BRRULD",
+ "BD5E4", // Special Characters
"BDD4NE4FR2EU4HL2G", "BFED6NLR", "BDER2FDG4R4", "BDER2FDGNLFDGL2H",
"D3R3NU3ND3R", "NR4D3R3FDGL2H", "BR3NFL2GD4FR2EUHL3", "R4DG4D",
"BDDFNR2GDFR2EUHEUHL2G", "BD5FR2EU4HL2GDFR3", // Numbers
"BR2BD2D0BD2D0", "BR2BD2D0BD2G", "BR3G3F3", "BD2R4BD2L4", "BRF3G3",
- "BDER2FDGLDBD2D0", "BF2DFEU2HL2GD4FR2", // Symbols
+ "BDER2FDGLDBD2D0", "BF2DFEU2HL2GD4FR2", // Special Characters
"BD6U4E2F2D2NL4D2", "D6R3EUHNL3EUHL3", "BR3NFL2GD4FR2E", "D6R2E2U2H2L2",
"NR4D3NR3D3R4", "NR4D3NR3D3", "BR3NFL2GD4FR2EU2L2", "D3ND3R4NU3D3",
@@ -121,22 +121,22 @@ CONST char *szTurtleCh2[256-32] = {
"BD2D3FRE2NU2D2", "BD2DFDFEUEU", "BD2D3FENUFEU3", "BD2F2NG2NE2F2",
"BD2D3FR2ENU3D2GL3", "BD2R4G4R4", // Lower Case Letters
- "BR3GDGFDF", "BR2D2BD2D2", "BRFDFGDG", "BFEFE", "BR2GFEH", // Symbols
+ "BR3GDGFDF", "BR2D2BD2D2", "BRFDFGDG", "BFEFE", "", // Symbols
"BR3NFLGDNRNLD2NRNLDFRE", "BR2FGHE", "BR2BD4DG", "BR4LGD2NRNLD2GL",
"BD6EBFE", "BD6D0BR2D0BR2D0", "BR2DNL2NR2D4", "BR2DNL2NR2D4NL2NR2D",
"BR2NGF", "RDLNUBR4G2L2BD2RDLUBR3RDLU", "BD5FR2EUHL2HUER2NFBU2GH", "BF2FG",
- "BRNRGD4FRNR2U3NR2U3R2", "", "R4DG4DR4BU6BHHG", "", // 80-8F
+ "BRNRGD4FRNR2U3NR2U3R2", "", "R4DG4DR4BU8BLGH", "", // 80-8F
"", "BR3GD", "BR2DG", "BFNDEBFNED", "BD2EUBR2DG", "BD3BRRDLU", "BD3BRR2",
- "BD3R4", "BFEFE", "RND2RBRND2FNDED2", "BD6R3EHL2HENR3BU2FE", "BF2GF",
- "BD4NED2FRNR2U2R2UHLNLD2", "", "BD6NR4E4L4BUBEFE",
+ "BD3R4", "BFEFE", "RND2RBRND2FNDED2", "BD6R3EHL2HENR3BU3FE", "BF2GF",
+ "BD3NED2FRNR2U2R2UHLNLD2", "", "BD6NR4E4L4BU3BRFE",
"D2FRND3REU2BUBHD0BL2D0", // 90-9F
- "", "BR2D0BD2D4", "BR2DND6NLRFBL4NED3FR2E", "BD6NR4EU2NLNR2U2ERF",
+ "", "BR2D0BD2D4", "BR2DND6NLRFBL4NED3FR2E", "BD6RNR3U3NLNR2U2ERF",
"BDFEFNEFGNFGHNGHE", "F2NE2DNL2NR2D2NL2NR2D", "BR2D2BD2D2",
"BD6R3EHNL2EHL2GFBU2HER3", "BRD0BR2D0", "BD2ER2FD2GL2HU2BR3LGFR",
- "BF4U2NUG2LHU2ER2F", "BD3NFEBR3GF", "BD2R4D", "BD3BRR2",
+ "BF4U2NUG2LHU2ER2FBD5L4", "BD3NFEBR3GF", "BD2R4D", "BD3BRR2",
"BD2ER2FD2GL2HU2BRND2R2DLNLF", "BRR2", // A0-AF
"BR2FGHE", "BR2D2NL2NR2D2BG2R4", "BRR2DL2DR2", "BRR2DNLDL2", "BR3G",
@@ -162,15 +162,15 @@ CONST char *szTurtleCh2[256-32] = {
"BF4G2LHU2ER2FD3BU6BLH", "BF4G2LHU2ER2FD3BU6BL2E", "BF4G2LHU2ER2FD3BU6BLHG",
"BF4G2LHU2ER2FD3BU7GHG", "BF4G2LHU2ER2FD3BU6BLD0BL2D0",
"BF4G2LHU2ER2FD3BU6BL2D0", "BD2R3FDL3GDR2NR2U4", "BF4BUHL2GD2FR2EBG3RU2",
- "BD4R4UHL2GD2FR3BU5BL2H", "BD4R4UHL2GD2FR3BU6BLG", "BD4R4UHL2GD2FR3BU5BLHG",
- "BD4R4UHL2GD2FR3BU6BLD0BL2D0", "BRFBD2D3", "BR3GBD2D3", "BFENFBD3D3",
+ "BD4R4UHL2GD2FR3BU6BL2H", "BD4R4UHL2GD2FR3BU7BLG", "BD4R4UHL2GD2FR3BU6BLHG",
+ "BD4R4UHL2GD2FR3BU6BLD0BL2D0", "BEFBD2D4", "BR2NEBD2D4", "BRENFBD3D4",
"BRD0BR2D0BLBD2D4", // E0-EF
- "BR3DNLNRD4NDGLHUERF", "BD2DND3ER2FD3BU6GHG", "BD3D2FR2EU2HL2NGBEH",
- "BD3D2FR2EU2HL2NGBEE", "BD3D2FR2EU2HL2NGBUEF", "BD3D2FR2EU2HL2NGBUEFE",
+ "BR3DNLNRD2FDGL2HUER2", "BD2DND3ER2FD3BU7GHG", "BD3D2FR2EU2HL2NGBU3F",
+ "BD3D2FR2EU2HL2NGBUBEE", "BD3D2FR2EU2HL2NGBU2EF", "BD3D2FR2EU2HL2NGBU2EFE",
"BD3D2FR2EU2HL2NGBU2D0BR2D0", "BD3R4BH2D0BD4D0", "BD3D2FR2EU2HL2GD2BDE4",
- "BD2D3FRE2ND2U2BHBLH", "BD2D3FRE2ND2U2BHBLE", "BD2D3FRE2ND2U2BHHG",
- "BD2D3FRE2ND2U2BHBUD0BL2D0", "BD8R3EU2NU3GL2HU3BEBRE", "D5ND3FR2EU2HL2G",
+ "BD2D3FRE2ND2U2BH2H", "BD2D3FRE2ND2U2BH2E", "BD2D3FRE2ND2U2BUBHHG",
+ "BD2D3FRE2ND2U2BHBUD0BL2D0", "BD8R3EU2NU3GL2HU3BE2E", "D5ND3FR2EU2HL2G",
"BD8R3EU2NU3GL2HU3BEBUD0BR2D0"}; // F0-FF
// Turtle font for 8x13 unicursal characters.
@@ -225,6 +225,98 @@ CONST char *szTurtleCh3[128-32] = {
"RU2RURU2RU3LU2LULUR2DRD2RD2R2DL2D2LD2LDLDR5", "U10RURURDRDRURURD12",
"R3U8LULU2RUR3DRD2LDLD8R3"}; // Symbols
+// Turtle font for 8x14 characters.
+CONST char *szTurtleCh4[256-32] = {"",
+ "BR3D5BD3D", "BR2D3BR3U3", "BD3R6BD3L6BF2U7BR2D7",
+ "BR3D9BH2BLFR4EU2HL4HUER4F", "RDLNUBR6G6BR6DLUR", "BD3NF6U2ERFD2G3D2FR2E3",
+ "BR3DG", "BR4G3D3F3", "BR2F3D3G3", "BD2F2NG2RNU3ND3RNE2F2", "BD4R3NU3ND3R3",
+ "BR3BD8DG", "BD4R6", "BD9BR2RULD", "BD7E6", // Special Characters
+
+ "BD2D5NE5F2R2E2U5NLH2L2G2", "BR3NG2D9NL2R2", "BD2E2R2F2DG6R6",
+ "BD2E2R2F2G2NLF2DG2L2H2", "D5R4NU5ND4R2", "NR6D4R4F2DG2L2H2",
+ "BR4NF2L2G2D5F2R2E2UH2L2G2", "R6DG6D2", "BD2F2NR2G2DF2R2E2UH2E2H2L2G2",
+ "BD7F2R2E2U5H2L2G2DF2R2E2", // Numbers
+
+ "BR2BD2DRULBD4DRUL", "BR2BD2DRULBD4RDG", "BR4G4F4", "BD3R6BD3L6", "BRF4G4",
+ "BD2E2R2F2DG2LD2BD2D0", "BF3RDLNUDFREU3H2L2G2D5F2R3E", // Special Characters
+
+ "BD9U6E3F3D3NL6D3", "D9R4E2UH2NL4E2H2L4", "BR4NF2L2G2D5F2R2E2",
+ "D9R3E3U3H3L3", "NR6D4NR5D5R6", "NR6D5NR5D4", "BR4NF2L2G2D5F2R2E2U2L3",
+ "D4ND5R6NU4D5", "BRR2NR2D9NL2R2", "BD6DF2R2E2U7", "D4ND5R2NE4F4D", "D9R6",
+ "ND9F3ND2E3D9", "ND9F2DFDFDF2U9", "BD2D5F2R2E2U5H2L2G2", "ND9R4F2DG2L4",
+ "BD2D5F2R2ENFNH2EU5H2L2G2", "ND9R4F2DG2L2NL2F4", "BR4NF2L2G2F2R2F2DG2L2H2",
+ "R3NR3D9", "D7F2R2E2U7", "D3FDFDFNDEUEUEU3", "D9E3NU2F3U9",
+ "DF6D2BL6U2E6U", "D3F2RND4RE2U3", "R6DG6D2R6", // Upper Case Letters
+
+ "BR4L3D9R3", "BDF6", "BRR3D9L3", "BD3E3F3", "BD9R6", "BR3DF", // Symbols
+
+ "BF6G3LH2U2E2R3FD5", "D7ND2F2R2E2U2H2L2G2", "BR6BD4HL3G2D2F2R3E",
+ "BR6D7ND2G2L2H2U2E2R2F2", "BD6R6UH2L2G2D2F2R3E", "BD4R2NR4ND5U3ER2F",
+ "BD11FR3E2U5H2L2G2D2F2R2E2", "D5ND4E2R2F2D4", "BR3DBD3D5", "BR4DBD3D7GL2H",
+ "D6ND3REREREBD6HLHLH", "BR3D9", "BD3DND5ERFND2ERFD5", "BD3D2ND4E2R2F2D4",
+ "BD5D2F2R2E2U2H2L2G2", "BD3D2ND7E2R2F2D2G2L2H2",
+ "BR6BD12U7NU2H2L2G2D2F2R2E2", "BD3D2ND4E2R2F2", "BD8FR4EUHL4HUER4F",
+ "BR3D4NL3NR3D5", "BD3D4F2R2E2NU4D2", "BD3DFDFDFEUEUEU", "BD3D5FRENU2FREU5",
+ "BD3F3NG3NE3F3", "BD3D4F2R2E2NU4D3G2L4", "BD3R6G6R6", // Lower Case Letters
+
+ "BR4LGD2GFD2FR", "BR3D3BD3D3", "BRRFD2FGD2GL", "BFERFRE", "", // Symbols
+
+ "BR5NFL2G2DNR2NLD2NR2NLD2F2R2E", "BR3FGHE", "BR3BD8DG", "BR5LGD3NR2NL2D4GL",
+ "BD9BREBFE", "BD9BRD0BR2D0BR2D0", "BR3BDD2NL2NR2D5",
+ "BR3BDD2NL2NR2D3NL2NR2D2", "BR3NGF", "BRFGHNEBR6GLG2LGBD3EFGHBR4EFGH",
+ "BU3BR2FEBD3NF2L2G2F2R2F2DG2L2H2", "BR3BD2F2G2", "BR2NRG2D5F2RNR3U5NR2U4R3",
+ "", "R6DG6D2R6BU12BL2GH", "", // 80-8F
+
+ "", "BR4GD", "BR3DG", "BFNDEBR3GD", "BRBD2EUBR3DG", "BD4BR3RDLU", "BD4BRR4",
+ "BD4R6", "BRBFEFE", "RND2RBR2ND2FNDED2", "BD8FR4EUHL4HUER4FBH4FE",
+ "BR4BD2G2F2", "BD4NED4FREU4HLBR3NGRFD2L3BD2FRE", "", "BD3R6G6R6BU9BL2GH",
+ "D3F2RND4RE2U3BH2D0BL2D0", // 90-9F
+
+ "", "BR3DBD3D5", "BR3D2ND7NL2R2FBL6NED3FR4E", "BD9RNR5U4NLNR4U3E2R2F",
+ "DFER2FEUBD3NHD2BD3UHNEGL2HGDBU3NFU2E", "F3NE3D2NL2NR2D2NL2NR2D2",
+ "BR3D3BD3D3", "BD8FR4EUHNL4EUHL4GDFBU3HUER4F", "BR2D0BR2D0",
+ "BD3E2R2F2D2G2L2H2U2BR4LGFR", "BRBF4U2NUG2LHU2ER2FBD5L4", "BD4NF2E2BR4G2F2",
+ "BD4R6D2", "BD4BRR4", "BD2E2R2F2D2G2L2H2U2BR2ND2R2DLNLF", "BRR4", // A0-AF
+
+ "BR3FGHE", "BR3D3NL3NR3D3BG3R6", "BRR3FGL2GDR4", "BRR3FGNL3FGL3", "BR4G",
+ "BD3D4ND5F2RE2NU4DF", "BR6ND9L3ND9LG2D2F2R", "BR3BD4D0", "BR3BD8DL",
+ "BRR2D4NL2R2", "BR3GD2FR2EU2HL2BLBD6R4", "BD2F2G2BR4E2H2",
+ "RD3NLRBR4BU2G6BR6ND2NU2L2U2", "RD3NLRBR4BU2G6BR6BD2L2U2R2U2L2",
+ "R2D2NL2D2L2BR6BU2G6BDBR6UNU2L2U2", "BR3D0BD2D2LG2DF2R2E2", // B0-BF
+
+ "BD9U6E3F3D3NL6D3BU10BL2H", "BD9U6E3F3D3NL6D3BU10BL4E",
+ "BD9U6E3F3D3NL6D3BU10BL2HG", "BD9U6E3F3D3NL6D3BU11BLGHG",
+ "BD9U6E3F3D3NL6D3BU11BL2D0BL2D0", "BD9U6E3F3D3NL6D3BU11BL3D0",
+ "BD9U3NR3U3E3NR3D4NR3D5R3", "BR4NF2L2G2D5F2R2E2BG3DL",
+ "NR6D4NR5D5R6BU10BL3H", "NR6D4NR5D5R6BU10BL3E", "NR6D4NR5D5R6BU10BL2HG",
+ "NR6D4NR5D5R6BU11BL2D0BL2D0", "BRR2NR2D9NL2R2BU10BL2H",
+ "BRR2NR2D9NL2R2BU10BL2E", "BRR2NR2D9NL2R2BU10BLHG",
+ "BRR2NR2D9NL2R2BU11BLD0BL2D0", // C0-CF
+
+ "BD4RNRD5R2E3U3H3L2D4", "ND9F2DFDFDF2U9BU2BLGHG", "BR2G2D5F2R2E2U5H2L2BEH",
+ "BR2G2D5F2R2E2U5H2L2BEE", "BR2G2D5F2R2E2U5H2L2BUEF",
+ "BR2G2D5F2R2E2U5H2L2BUEFE", "BR2G2D5F2R2E2U5H2L2BU2D0BR2D0", "BDF3NE3NG3F3",
+ "BR2G2D5F2R2E2U5H2L2BR4G2DGDGDG2", "D7F2R2E2U7BL3BUH", "D7F2R2E2U7BL3BUE",
+ "D7F2R2E2U7BL2BUHG", "D7F2R2E2U7BH2D0BL2D0", "D3F2RND4RE2U3BL3BUE",
+ "D7ND2R4E2UH2L4", "BD9U7E2R2FDG2DFRFDGL3", // D0-DF
+
+ "BF6G3LH2U2E2R3FD5BU8BL3H", "BF6G3LH2U2E2R3FD5BU8BL3E",
+ "BF6G3LH2U2E2R3FD5BU8BL2HG", "BF6G3LH2U2E2R3FD5BU9BLGHG",
+ "BF6G3LH2U2E2R3FD5BU8BL2D0BL2D0", "BF6G3LH2U2E2R3FD5BU8BL3D0",
+ "BD4ERFD4GLHUER5U2HLGD4FRE", "BR6BD4HL3G2D2F2R3EBG2NUDL",
+ "BD6R6UH2L2G2D2F2R3EBU7BL3H", "BD6R6UH2L2G2D2F2R3EBU7BL3E",
+ "BD6R6UH2L2G2D2F2R3EBU7BL2HG", "BD6R6UH2L2G2D2F2R3EBU7BL2D0BL2D0",
+ "BR2FBD2D6", "BR4GBD2D6", "BR3NGNFBD3D6", "BR2BDD0BR2D0BLBD2D6", // E0-EF
+
+ "BR4DNLNRD3FD2G2L2H2U2E2R2F", "BD3D2ND4E2R2F2D4BU9BLGHG",
+ "BD5D2F2R2E2U2H2L2G2BE4BLH", "BD5D2F2R2E2U2H2L2G2BE4BLE",
+ "BD5D2F2R2E2U2H2L2G2BE4HG", "BD5D2F2R2E2U2H2L2G2BE4NEHG",
+ "BD5D2F2R2E2U2H2L2G2BE4D0BL2D0", "BD4R6BU3BL3D0BD6D0",
+ "BD5D2F2R2E2U2H2L2NG2BR4G6", "BD3D4F2R2E2ND2U4BH2H",
+ "BD3D4F2R2E2ND2U4BH2BUG", "BD3D4F2R2E2ND2U4BH2HG",
+ "BD3D4F2R2E2ND2U4BH2D0BL2D0", "BD3D4F2R2E2NU4D3G2L4BU11BR3E",
+ "D7ND5F2R2E2U2H2L2G2", "BD3D4F2R2E2NU4D3G2L4BU11BR2D0BR2D0"}; // F0-FF
+
GS gs = {
// Display settings
fFalse, fTrue, NULL,
@@ -390,7 +482,7 @@ void CMon::Block(int x1, int y1, int x2, int y2, KV o)
if (x1 == 0 && x2 == m_x-1) {
il1 = _Il(x1, y1);
il2 = _Il(x2, y2);
- l = o ? ~0 : 0;
+ l = o ? dwSet : 0;
while (il1 <= il2)
*_Pl(il1++) = l;
goto LDone;
@@ -403,7 +495,7 @@ void CMon::Block(int x1, int y1, int x2, int y2, KV o)
l2 = ((1L << (x2 & 31 ^ 7)) - 1 ^ (255L << (x2 & 24)));
for (y = y1; y <= y2; y++) {
for (il = il1; il <= il2; il++) {
- l = ~0;
+ l = dwSet;
if (il == il1 && (x1 & 31) > 0)
l &= l1;
if (il == il2)
@@ -538,7 +630,7 @@ void CMon::LineX(int x1, int x2, int y, KV o)
// Quickly draw the line, setting up to 32 pixels at a time.
il1 = _Il(x1, y); il2 = _Il(x2, y);
for (il = il1; il <= il2; il++) {
- l = ~0;
+ l = dwSet;
if (il == il1 && (x1 & 31) > 0)
l &= ~((1L << (x1-1 & 31 ^ 7)) - 1 ^ (255 << (x1-1 & 24)));
if (il == il2)
@@ -1289,7 +1381,7 @@ flag CMon::Turtle(CONST char *szCmd)
chT = szCmd[index++];
if (chT == chNull)
goto LDone;
- if (FBetween(chT, '0', '2')) {
+ if (FBetween(chT, '0', '3')) {
gs.turtlet = (chT - '0');
break;
}
@@ -1328,6 +1420,13 @@ flag CMon::Turtle(CONST char *szCmd)
Turtle(szTurtleCh3[ch - 32]);
Turtle("R2");
break;
+ case 3:
+ x = gs.turtlex; y = gs.turtley;
+ Turtle(szTurtleCh4[ch - 32]);
+ i = 9 * gs.turtles;
+ gs.turtlex = x + xoff[gs.turtlea ^ 3]*i; // 1, 0, -1, 0
+ gs.turtley = y + yoff[gs.turtlea ^ 3]*i; // 0, 1, 0, -1
+ break;
}
}
}
@@ -1538,7 +1637,7 @@ void CMon::BitmapSet(KV o)
dword l;
long clBitmap, il;
- l = o ? ~0 : 0;
+ l = o ? dwSet : 0;
clBitmap = CbBitmap(m_x, m_y) >> 2;
// Set 32 pixels at a time.
for (il = 0; il < clBitmap; il++)
@@ -1557,7 +1656,7 @@ void CMon::BitmapReverse()
clBitmap = CbBitmap(m_x, m_y) >> 2;
// Invert 32 pixels at a time.
for (il = 0; il < clBitmap; il++)
- *_Pl(il) ^= ~0;
+ *_Pl(il) ^= dwSet;
}
@@ -2911,7 +3010,7 @@ void CMon::WriteXbm(FILE *file, CONST char *szName, char mode) CONST
sprintf(S(sz), "%s", szName);
for (pchEnd = sz; *pchEnd != chNull; pchEnd++)
;
- for (pchStart = pchEnd; pchStart > szName && *pchStart != '\\'; pchStart--)
+ for (pchStart = pchEnd; pchStart > sz && *pchStart != '\\'; pchStart--)
;
if (*pchStart == '\\')
pchStart++;
diff --git a/graphics.h b/graphics.h
index d573cf4..0479abd 100644
--- a/graphics.h
+++ b/graphics.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: graphics.h
+** Daedalus (Version 3.4) File: graphics.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** on a monochrome bitmap, unrelated to Mazes.
**
** Created: 7/1/1993.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
/*
@@ -160,7 +160,7 @@ class CMap // Base bitmap independent of pixel type
INLINE void BitmapOff()
{ BitmapSet(0); }
INLINE void BitmapOn()
- { BitmapSet(~0); }
+ { BitmapSet(dwSet); }
INLINE void Edge(int x1, int y1, int x2, int y2, KV kv)
{ Box(x1, y1, x2, y2, 1, 1, kv); }
INLINE void BoxAll(int xsiz, int ysiz, KV kv)
diff --git a/inside.cpp b/inside.cpp
index e6cb05b..8afd204 100644
--- a/inside.cpp
+++ b/inside.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: inside.cpp
+** Daedalus (Version 3.4) File: inside.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** from inside a Maze's passages.
**
** Created: 6/2/2001.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -115,6 +115,8 @@ void LineYGradient(CMazK &c, int x, int y1, int y2, KV kv1, KV kv2)
yClip1 = 0;
if (yClip2 > c.m_y)
yClip2 = c.m_y;
+ if (yClip1 < dr.yElevMin)
+ yClip1 = dr.yElevMin;
if (yClip2 > dr.yElevMax)
yClip2 = dr.yElevMax;
if (yClip2 <= yClip1)
@@ -170,6 +172,8 @@ void LineYTrans(CMazK &c, int x, int y1, int y2, KV kv, int nTrans)
y1 = 0;
if (y2 > c.m_y)
y2 = c.m_y;
+ if (y1 < dr.yElevMin)
+ y1 = dr.yElevMin;
if (y2 > dr.yElevMax)
y2 = dr.yElevMax;
@@ -219,6 +223,8 @@ void LineYTexture(
y1 = 0;
if (y2 > cDst.m_y)
y2 = cDst.m_y;
+ if (y1 < dr.yElevMin)
+ y1 = dr.yElevMin;
if (y2 > dr.yElevMax)
y2 = dr.yElevMax;
@@ -405,6 +411,8 @@ void LineYMask(
y1 = 0;
if (y2 > cDst.m_y)
y2 = cDst.m_y;
+ if (y1 < dr.yElevMin)
+ y1 = dr.yElevMin;
if (y2 > dr.yElevMax)
y2 = dr.yElevMax;
@@ -486,6 +494,8 @@ void LineYFloor(CMazK &c, int x, int yb, int dy1, int dy2,
y1 = 0;
if (y2 > c.m_y)
y2 = c.m_y;
+ if (y1 < dr.yElevMin)
+ y1 = dr.yElevMin;
if (y2 > dr.yElevMax)
y2 = dr.yElevMax;
@@ -582,6 +592,8 @@ void LineYFloorTexture(CMazK &cDst, int x, int yb, int dy1, int dy2,
rdy1 = (real)dy1;
if (y2 > cDst.m_y)
y2 = cDst.m_y;
+ if (y1 < dr.yElevMin)
+ y1 = dr.yElevMin;
if (y2 > dr.yElevMax)
y2 = dr.yElevMax;
rddy = (real)(dy2 - dy1);
@@ -683,8 +695,9 @@ void LineYFloorTexture(CMazK &cDst, int x, int yb, int dy1, int dy2,
flag FCreateInsideStars(CMazK *c, real rd, int yAdd, flag fPerspective)
{
- int i, x, y;
+ int i, x, y, d;
real rx, dInside2 = dr.dInside*2.0, rT;
+ KV kv;
// If the list of stars hasn't been generated yet, do so first.
if (dr.rgstar == NULL) {
@@ -718,8 +731,14 @@ flag FCreateInsideStars(CMazK *c, real rd, int yAdd, flag fPerspective)
x = c->m_x-1 - (int)((real)c->m_x * rx);
y = yAdd + (int)((real)(c->m_y >> (int)!ds.fSkyAll) *
(real)dr.rgstar[i].y / 16384.0);
+ kv = dr.rgstar[i].kv;
if (fPerspective || c->Get(x, y) == dr.kvInSky)
- c->Set(x, y, dr.rgstar[i].kv);
+ c->Set(x, y, kv);
+ if (ds.nStarSize < 0 ? FOdd(i) :
+ RgbR(kv) + RgbG(kv) + RgbB(kv) >= ds.nStarSize)
+ for (d = 0; d < DIRS; d++)
+ if (fPerspective || c->Get(x+xoff[d], y+yoff[d]) == dr.kvInSky)
+ c->Set(x+xoff[d], y+yoff[d], kv);
}
}
return fTrue;
@@ -1521,8 +1540,10 @@ void ComputeTexture(int *piTexture, int *piMask, real *prTexture, int ic,
// Determine the color and monochrome texture to apply to this wall.
if (!dr.fTextureDual)
iTexture = ITextureWall(kv, k);
- else
+ else if (!dr.fTextureDual2)
iTexture = ITextureWall2(kv, k);
+ else
+ iTexture = ITextureWall3(kv, k);
if (iTexture > 0) {
if (iTexture < ws.cbMask && !ws.rgbMask[iTexture].FNull())
iMask = iTexture;
@@ -1731,6 +1752,7 @@ void DrawTransVar(CMazK &c, int x, int yb, int cTrans, TRANS *trans,
yLo1 = ptrans->yLo1; yHi1 = ptrans->yHi1;
yLo2 = ptrans->yLo2; yHi2 = ptrans->yHi2;
dr.yElevMax = yb+IO(ptrans->yElev);
+ dr.yElevMin = yb+IO(ptrans->yElev2);
fWall = !(dr.nTrans == nTransFast && ptrans->fTrans && i > 0 &&
trans[i-1].fTrans && ptrans->y == trans[i-1].y2 &&
yHi == trans[i-1].yHi && yLo == trans[i-1].yLo &&
@@ -1928,7 +1950,7 @@ flag RedrawInsidePerspective(CMazK &c)
fTrans = (dr.nTrans != nTransNone && !bm.b3.FNull()), fInTrans = fFalse;
int zEye = ((dr.zElev + (dr.zWall >> 1)) << iVarScale) / dr.zWall,
yExtra, yExtra2, yExtraK, yExtra2K,
- yElevMax, itransMac = 10, cTrans, kElev = 1, nFogT;
+ yElevMax, yElevMin, itransMac = 10, cTrans, kElev = 1, nFogT;
flag fMarkAll = dr.fMarkAll, fColorMark = !cMark->FNull(), fColorMark2,
fDoCompute = fFalse, fDoEnd = fFalse, fDoWall = fFalse,
fDoSeal = fFalse, fDoTrans = fFalse, fDoWallVar = fFalse,
@@ -1960,7 +1982,7 @@ flag RedrawInsidePerspective(CMazK &c)
// Prepare the bitmap for drawing.
rT = RTanD(dr.dInside); rd = (real)xc / rT;
- if (c.m_x > dr.ccalc || rd != dr.rdCalc) {
+ if (c.m_x != dr.xCalc || rd != dr.rdCalc) {
if (c.m_x > dr.ccalc) {
if (dr.rgcalc != NULL)
DeallocateP(dr.rgcalc);
@@ -1974,9 +1996,10 @@ flag RedrawInsidePerspective(CMazK &c)
dr.rgcalc[x].rAngleColumn = RAtnD((real)(x - xc) / rd);
dr.rgcalc[x].rDistCorrect = RCosD(dr.rgcalc[x].rAngleColumn);
}
+ dr.xCalc = c.m_x;
dr.rdCalc = rd;
}
- dr.yElevMax = ypWallMax;
+ dr.yElevMax = ypWallMax; dr.yElevMin = -ypWallMax;
// Initialize a bunch of variables.
if (f3D) {
@@ -2088,6 +2111,7 @@ flag RedrawInsidePerspective(CMazK &c)
// Loop over each column in the bitmap, to draw each column separately.
for (x = 0; x < c.m_x; x++) {
dr.yElevMax = yElevMax = ypWallMax;
+ dr.yElevMin = yElevMin = -ypWallMax;
// Figure out the angle of this ray, the corresponding horizontal and
// vertical increments to get from cell to cell, and the characteristics
@@ -2404,6 +2428,7 @@ flag RedrawInsidePerspective(CMazK &c)
}
yElevMax = yElev1;
dr.yElevMax = yb+IO(yElevMax);
+ dr.yElevMin = yb+IO(yElevMin);
}
}
fInMark = fDoExitMark = fFalse;
@@ -2427,6 +2452,8 @@ flag RedrawInsidePerspective(CMazK &c)
rx3, ry3, rx4, ry4,
FFogDirt(xo, yo), GetP(bTextureDirt, xo, yo), fFalse, rScale);
}
+ if (y > yElevMin)
+ yElevMin = -y;
fInMark2 = fDoExitMark2 = fFalse;
}
@@ -2579,6 +2606,7 @@ flag RedrawInsidePerspective(CMazK &c)
ptransCur->y = ptransCur->y2 = y;
ptransCur->yk = ptransCur->yk2 = yk;
ptransCur->yElev = yElevMax;
+ ptransCur->yElev2 = yElevMin;
ptransCur->fTrans = fDoTrans;
ptransCur->nFog = nFogT;
ptransCur->kvOrig = kvT;
@@ -2610,6 +2638,7 @@ flag RedrawInsidePerspective(CMazK &c)
if (fDoEnd) {
if (fDoSeal) {
dr.yElevMax = yb+IO(yElevMax);
+ dr.yElevMin = yb+IO(yElevMin);
LineI(yb+IO(y - (yk << 1)), yb+IO(y), dr.kvInEdge);
fDoSeal = fFalse;
}
@@ -2659,6 +2688,7 @@ flag RedrawInsidePerspective(CMazK &c)
// Actually draw the wall for the current column here.
dr.yElevMax = yb+IO(yElevMax);
+ dr.yElevMin = yb+IO(yElevMin);
LineYGradient(c, x, yb-IO(y), yb+IO(y), kv2, dr.kvInWall2);
// Do texture mapping on top of the drawn wall at the current column.
@@ -2684,32 +2714,44 @@ flag RedrawInsidePerspective(CMazK &c)
flag RedrawInsidePerspectiveStereo(CMazK &c, CMazK &cs)
{
- int x = c.m_x >> 1, f = FOdd(c.m_x), mSav = dr.nOffsetX, nSav = dr.nOffsetY,
- m, n, d;
+ int mSav = dr.nOffsetX, nSav = dr.nOffsetY, dSav = dr.nOffsetD,
+ x, f, m, n, d;
+ x = !ds.fStereo3D ? c.m_x >> 1 : c.m_x;
if (!cs.FBitmapSizeSet(x, c.m_y))
return fFalse;
+ f = FOdd(c.m_x) && !ds.fStereo3D;
d = 180 - (dr.dir*90 + dr.nOffsetD);
if (d >= nDegMax)
d -= nDegMax;
- m = NCosRD(dr.nStereo, d); n = NSinRD(dr.nStereo, d);
+ m = NCosRD(ds.nStereo, d); n = NSinRD(ds.nStereo, d);
// Draw left eye view of scene.
- dr.nOffsetX += m; dr.nOffsetY += n;
+ dr.nOffsetX += m; dr.nOffsetY += n; //dr.nOffsetD += 1;
if (!RedrawInsidePerspective(cs))
return fFalse;
- c.BlockMove(cs, 0, 0, x, c.m_y-1, 0, 0);
+ if (ds.fStereo3D) {
+ cs.ColmapGrayscale();
+ cs.ColmapOrAndKv(kvCyan, 0);
+ }
+ c.BlockMove(cs, 0, 0, x-1, c.m_y-1, 0, 0);
// Draw right eye view of scene.
- dr.nOffsetX -= m*2; dr.nOffsetY -= n*2;
+ dr.nOffsetX -= m*2; dr.nOffsetY -= n*2; //dr.nOffsetD -= 1*2;
if (!RedrawInsidePerspective(cs))
return fFalse;
- c.BlockMove(cs, 0, 0, x, c.m_y-1, x+f, 0);
+ if (!ds.fStereo3D)
+ c.BlockMove(cs, 0, 0, x-1, c.m_y-1, x+f, 0);
+ else {
+ cs.ColmapGrayscale();
+ cs.ColmapOrAndKv(kvRed, 0);
+ c.ColmapOrAnd(cs, 1);
+ }
// Draw line down middle if outer bitmap is odd sized.
if (f)
c.LineY(x, 0, c.m_y-1, dr.kvInEdge);
- dr.nOffsetX = mSav; dr.nOffsetY = nSav;
+ dr.nOffsetX = mSav; dr.nOffsetY = nSav; dr.nOffsetD = dSav;
return fTrue;
}
diff --git a/labyrnth.cpp b/labyrnth.cpp
index 869b1a3..cb3ce4c 100644
--- a/labyrnth.cpp
+++ b/labyrnth.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: labyrnth.cpp
+** Daedalus (Version 3.4) File: labyrnth.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -23,7 +23,7 @@
** This file contains unicursal Labyrinth creation algorithms.
**
** Created: 7/12/2009.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -153,6 +153,7 @@ flag CMaz::CreateMazeHilbert(flag f3D)
{
CMaz b2;
int i, w, x, y, z;
+ flag fMaze = ms.fFractalI;
if (!f3D) {
@@ -160,10 +161,17 @@ flag CMaz::CreateMazeHilbert(flag f3D)
if (!FBitmapSizeSet(5, 5))
return fFalse;
BitmapOn();
- for (x = 1; x <= 3; x += 2)
- for (y = 1; y <= 3; y++)
- Set0(x, y);
- Set0(2, 3);
+ if (!fMaze) {
+ for (x = 1; x <= 3; x += 2)
+ for (y = 1; y <= 3; y++)
+ Set0(x, y);
+ Set0(2, 3);
+ } else {
+ for (y = 1; y <= 3; y += 2)
+ for (x = 1; x <= 3; x++)
+ Set0(x, y);
+ Set0(1, 2);
+ }
// Create each new generation from four copies of the original
for (i = 1; i < ms.zFractal; i++) {
@@ -172,19 +180,32 @@ flag CMaz::CreateMazeHilbert(flag f3D)
if (!FBitmapSizeSet((m_x << 1) - 1, (m_y << 1) - 1))
return fFalse;
BitmapOn();
- for (y = 1; y < w; y++)
- for (x = 1; x < w; x++)
- if (!b2.Get(x, y)) {
- Set0(y, x); // 1 transpose
- Set0(x, w+y); // 2 normal
- Set0(w+x, w+y); // 3 normal
- Set0(m_x-1-y, x); // 4 transpose flipx
- }
- Set0(1, w); Set0(m_x-2, w);
- Set0(w, w+1);
+ if (!fMaze) {
+ for (y = 1; y < w; y++)
+ for (x = 1; x < w; x++)
+ if (!b2.Get(x, y)) {
+ Set0(y, x); // 1 transpose
+ Set0(x, w+y); // 2 normal
+ Set0(w+x, w+y); // 3 normal
+ Set0(m_x-1-y, x); // 4 transpose flipx
+ }
+ Set0(1, w); Set0(m_x-2, w);
+ Set0(w, w+1);
+ } else {
+ for (y = 1; y < w; y++)
+ for (x = 1; x < w; x++)
+ if (!b2.Get(x, y)) {
+ Set0(w-x, w-y); // 1 flipx flipy
+ Set0(y, m_y-1-x); // 2 transpose flipy
+ Set0(w+x, w+y); // 3 normal
+ Set0(m_x-1-y, x); // 4 transpose flipx
+ }
+ Set0(w, w-1); Set0(w, w+1);
+ Set0(1, w);
+ }
UpdateDisplay();
}
- Set0(1, 0); Set0(m_x-2, 0);
+ Set0(1, 0); Set0(m_x-2, !fMaze ? 0 : m_y-1);
} else {
// Create base case generation 1
@@ -335,6 +356,7 @@ void CMaz::LabyrinthHilbertPartial(int zFactor, int m1, int n1)
{
int rgd[iStackMax], id = 0, zs, m2, n2, x1, y1, x2, y2, x12, y12, d;
RC rgrc[iStackMax], rc;
+ flag fMaze = ms.fFractalI;
zs = 1 << zFactor;
m2 = m1 + (m_x >> 1); n2 = n1 + (m_y >> 1);
@@ -348,7 +370,7 @@ void CMaz::LabyrinthHilbertPartial(int zFactor, int m1, int n1)
if (FBetween(0, m1, m2)) LineY(VX2(0), VY2(0), VY2(zs), fOn);
if (FBetween(zs, n1, n2)) LineX(VX2(0), VX2(zs), VY2(zs), fOn);
if (FBetween(zs, m1, m2)) LineY(VX2(zs), VY2(0), VY2(zs), fOn);
- Set0(1-m1*2, -n1*2); Set0((zs-m1)*2-1, -n1*2);
+ Set0(1-m1*2, -n1*2); Set0((zs-m1)*2-1, !fMaze ? -n1*2 : (zs-n1)*2);
// Continue while there's at least one square on the stack.
while (id >= 0) {
@@ -367,29 +389,56 @@ void CMaz::LabyrinthHilbertPartial(int zFactor, int m1, int n1)
x1 = rc.x1; y1 = rc.y1; x2 = rc.x2; y2 = rc.y2;
d = rgd[id];
x12 = (x1 + x2) >> 1; y12 = (y1 + y2) >> 1;
- if (!FOdd(d)) {
- LineX(VX2(x1 + 1), VX2(x2 - 1), VY2(y12), fOn);
- LineY(VX2(x12), d < 1 ? VY2(y1) + 1 : VY2(y2) - 1, VY2(y12), fOn);
- if (y2 - y1 > 2)
- LineY(VX2(x12), VY2(y12 + (d < 1 ? 1 : -1)), d < 1 ? VY2(y2) : VY2(y1),
- fOn);
+ if (!fMaze) {
+ if (!FOdd(d)) {
+ LineX(VX2(x1 + 1), VX2(x2 - 1), VY2(y12), fOn);
+ LineY(VX2(x12), d < 1 ? VY2(y1) + 1 : VY2(y2) - 1, VY2(y12), fOn);
+ if (y2 - y1 > 2)
+ LineY(VX2(x12), VY2(y12 + (d < 1 ? 1 : -1)),
+ d < 1 ? VY2(y2) : VY2(y1), fOn);
+ } else {
+ LineY(VX2(x12), VY2(y1 + 1), VY2(y2 - 1), fOn);
+ LineX(d < 2 ? VX2(x1) + 1 : VX2(x2) - 1, VX2(x12), VY2(y12), fOn);
+ if (x2 - x1 > 2)
+ LineX(VX2(x12 + (d < 2 ? 1 : -1)), d < 2 ? VX2(x2) : VX2(x1),
+ VY2(y12), fOn);
+ }
} else {
- LineY(VX2(x12), VY2(y1 + 1), VY2(y2 - 1), fOn);
- LineX(d < 2 ? VX2(x1) + 1 : VX2(x2) - 1, VX2(x12), VY2(y12), fOn);
- if (x2 - x1 > 2)
- LineX(VX2(x12 + (d < 2 ? 1 : -1)), d < 2 ? VX2(x2) : VX2(x1), VY2(y12),
- fOn);
+ if (!FOdd(d)) {
+ LineX(VX2(x1 + 1) - (d > 1), VX2(x2 - 1) + (d < 1), VY2(y12), fOn);
+ if (y2 - y1 > 2) {
+ LineY(VX2(x12), VY2(y1) + 1, VY2(y12 - 1), fOn);
+ LineY(VX2(x12), VY2(y2) - 1, VY2(y12 + 1), fOn);
+ }
+ } else {
+ LineY(VX2(x12), VY2(y1 + 1) - (d < 2), VY2(y2 - 1) + (d > 2), fOn);
+ if (x2 - x1 > 2) {
+ LineX(VX2(x1) + 1, VX2(x12 - 1), VY2(y12), fOn);
+ LineX(VX2(x2) - 1, VX2(x12 + 1), VY2(y12), fOn);
+ }
+ }
}
// Divide current square's coordinates and push four subsquares on stack.
- SetRC2(x1, y1, x12, y12);
- rgd[id++] = d + (d <= 0) - (d == 1) & DIRS1;
- SetRC2(x12, y1, x2, y12);
- rgd[id++] = d + (d >= 3) - (d <= 0) & DIRS1;
- SetRC2(x1, y12, x12, y2);
- rgd[id++] = d + (d == 1) - (d == 2) & DIRS1;
- SetRC2(x12, y12, x2, y2);
- rgd[id] = d + (d == 2) - (d >= 3) & DIRS1;
+ if (!fMaze) {
+ SetRC2(x1, y1, x12, y12);
+ rgd[id++] = d + (d == 0) - (d == 1) & DIRS1;
+ SetRC2(x1, y12, x12, y2);
+ rgd[id++] = d + (d == 1) - (d == 2) & DIRS1;
+ SetRC2(x12, y12, x2, y2);
+ rgd[id++] = d + (d == 2) - (d == 3) & DIRS1;
+ SetRC2(x12, y1, x2, y12);
+ rgd[id] = d + (d == 3) - (d == 0) & DIRS1;
+ } else {
+ SetRC2(x1, y1, x12, y12);
+ rgd[id++] = d + (d == 3) - (d == 1) + (d == 0)*2 & DIRS1;
+ SetRC2(x1, y12, x12, y2);
+ rgd[id++] = d + (d == 0) - (d == 2) + (d == 1)*2 & DIRS1;
+ SetRC2(x12, y12, x2, y2);
+ rgd[id++] = d + (d == 1) - (d == 3) + (d == 2)*2 & DIRS1;
+ SetRC2(x12, y1, x2, y12);
+ rgd[id] = d + (d == 2) - (d == 0) + (d == 3)*2 & DIRS1;
+ }
}
}
diff --git a/maze.cpp b/maze.cpp
index 6901cd0..c63922a 100644
--- a/maze.cpp
+++ b/maze.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: maze.cpp
+** Daedalus (Version 3.4) File: maze.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** actual creation and solving.
**
** Created: 4/11/1991.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -1757,6 +1757,34 @@ long CMaz::DoMakeSymmetric(int nOp, flag fBraid)
}
+// Zoom an orthogonal Maze so passages and walls become 1 or 2 pixels wide,
+// based on the brightness of corresponding pixels in a color bitmap.
+
+flag CMaz::MazeZoomWithPicture(CONST CCol *c1)
+{
+ int x, y, n;
+ flag f1, f2;
+
+ if (!FBitmapBias(1, 2, 1, 2))
+ return fFalse;
+ for (y = 0; y < m_y; y += 3)
+ for (x = 0; x < m_x; x += 3) {
+ n = c1->Get(x/3, y/3);
+ n = (RgbR(n) + RgbG(n) + RgbB(n)) / 192;
+ f1 = Get(x, y+1); f2 = Get(x+1, y);
+ if (n > 0) {
+ Set1(x+1, y+1-(!f1 && !f2));
+ if (n > 1) {
+ Set1(x+f1, y+1+f1);
+ if (n > 2)
+ Set1(x+1+f2, y+f2);
+ }
+ }
+ }
+ return fTrue;
+}
+
+
// Render a section of Maze on a bitmap. Walls are always one pixel thick and
// it's assumed no cells are solid blocks, however passages can be of greater
// sizes and displayed in different orientations. Used in the rendering of
@@ -2131,7 +2159,7 @@ ulong MazeCountPossible(int x, int y)
t = RSin(((real)j*rPi) / (2.0*ry));
r *= (4.0 * (s*s + t*t));
if (r > rMax)
- return (ulong)~0L;
+ return dwSet;
}
}
return (ulong)(r / (rx*ry) + rRound);
diff --git a/maze.h b/maze.h
index 20aa24a..30bd3cd 100644
--- a/maze.h
+++ b/maze.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: maze.h
+** Daedalus (Version 3.4) File: maze.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** algorithms, and other Maze utilities.
**
** Created: 11/22/1996.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
@@ -319,6 +319,7 @@ class CMaz : public CMon3 // Monochrome bitmap Maze
long DoCrackIsland(int, int, flag);
long DoCrackIslands(flag);
long DoMakeSymmetric(int nOp, flag fBraid);
+ flag MazeZoomWithPicture(CONST CCol *);
void BlockMoveMaze(CONST CMaz &, int, int, int, int, int, int,
int, int, int, int);
void BlockMoveMaze3(CONST CMaz &, int, int, int, int, int, int,
@@ -411,6 +412,7 @@ class CMaz : public CMon3 // Monochrome bitmap Maze
flag CreateMazeSigma();
flag CreateMazeTheta();
flag CreateMazeUpsilon();
+ flag CreateMazeOmicron();
void FractalSet(CMazK *c, KV kv, int x, int y);
flag FFractalLine(CMaz *, CMazK *, KV, int, int, int, int);
int CreateMazeFractal2(CMazK *);
@@ -498,10 +500,12 @@ extern int RndDir(void);
extern ulong MazeCountPossible(int, int);
// Function hooks implemented elsewhere
-extern flag FInitCoordinates(int);
+extern int InitCoordinates(int);
extern flag FSetCoordinates(int, int, int, int, int, int, KV);
-extern flag FInitPatch(int);
+extern int InitPatch(int);
extern flag FSetPatch(int, int, int, int, int, int, KV);
+extern int InitCoorPatch(flag, int);
+extern flag FSetCoorPatch(flag, int, int, int, int, int, int, KV);
/*
diff --git a/resource.h b/resource.h
index 8341fed..248c518 100644
--- a/resource.h
+++ b/resource.h
@@ -6,6 +6,8 @@
#define icon2 102
#define icon3 103
#define icon4 104
+#define icon5 105
+#define icon6 106
#define menu 111
#define accelerator 121
#define dlgAbort 201
@@ -145,361 +147,363 @@
#define cmdCreateInfinite3 1110
#define cmdCreateKruskal 1111
#define cmdCreateLabyrinth 1112
-#define cmdCreatePatchOverview 1113
-#define cmdCreatePerfect 1114
-#define cmdCreatePlanair 1115
-#define cmdCreatePrim 1116
-#define cmdCreatePrim2 1117
-#define cmdCreateRandom 1118
-#define cmdCreateRecursive 1119
-#define cmdCreateSegment 1120
-#define cmdCreateSidewinder 1121
-#define cmdCreateSigma 1122
-#define cmdCreateSpiral 1123
-#define cmdCreateTheta 1124
-#define cmdCreateTilt 1125
-#define cmdCreateTree 1126
-#define cmdCreateUnicursal 1127
-#define cmdCreateUpsilon 1128
-#define cmdCreateWeave 1129
-#define cmdCreateWilson 1130
-#define cmdCreateWireOverview 1131
-#define cmdCreateZeta 1132
-#define cmdCubemapFlip 1133
-#define cmdDeletePole 1134
-#define cmdDelX 1135
-#define cmdDelX2 1136
-#define cmdDelY 1137
-#define cmdDelY2 1138
-#define cmdDlgColor 1139
-#define cmdDlgCreate 1140
-#define cmdDlgDisplay 1141
-#define cmdDlgDot 1142
-#define cmdDlgDraw 1143
-#define cmdDlgDraw2 1144
-#define cmdDlgEvent 1145
-#define cmdDlgFile 1146
-#define cmdDlgInside 1147
-#define cmdDlgLabyrinth 1148
-#define cmdDlgMaze 1149
-#define cmdDlgRandom 1150
-#define cmdDlgSize 1151
-#define cmdDlgSizeMaze 1152
-#define cmdDlgZoom 1153
-#define cmdDotBig 1154
-#define cmdDotBoth 1155
-#define cmdDotDrag 1156
-#define cmdDotOn 1157
-#define cmdDotSet 1158
-#define cmdDotShow 1159
-#define cmdDotTwo 1160
-#define cmdDotWall 1161
-#define cmdDotZap 1162
-#define cmdDotZapTrans 1163
-#define cmdDotZapUntrans 1164
-#define cmdDrawDel 1165
-#define cmdDrawGet 1166
-#define cmdDrawPut 1167
-#define cmdDrawSwap 1168
-#define cmdEraseCorner 1169
-#define cmdExit 1170
-#define cmdExpandSet 1171
-#define cmdFlipX 1172
-#define cmdFlipY 1173
-#define cmdFlipZ 1174
-#define cmdFloodDot 1175
-#define cmdFloodDot2 1176
-#define cmdFloodPassage 1177
-#define cmdFloodWallL 1178
-#define cmdFloodWallR 1179
-#define cmdGo2nd 1180
-#define cmdGoCorner1 1181
-#define cmdGoCorner3 1182
-#define cmdGoCorner7 1183
-#define cmdGoCorner9 1184
-#define cmdGoIn 1185
-#define cmdGoInY 1186
-#define cmdGoMiddle 1187
-#define cmdGoOut 1188
-#define cmdGoOutY 1189
-#define cmdGoRandom 1190
-#define cmdGroundVariable 1191
-#define cmdInsideMap 1192
-#define cmdInsideView 1193
-#define cmdJump1 1194
-#define cmdJump2 1195
-#define cmdJump3 1196
-#define cmdJump4 1197
-#define cmdJump6 1198
-#define cmdJump7 1199
-#define cmdJump8 1200
-#define cmdJump9 1201
-#define cmdLabyrinthChartres 1202
-#define cmdLabyrinthChartresF 1203
-#define cmdLabyrinthChartresR 1204
-#define cmdLabyrinthClassical 1205
-#define cmdLabyrinthClassicalF 1206
-#define cmdLabyrinthCretan 1207
-#define cmdLabyrinthCustom 1208
-#define cmdLabyrinthMan 1209
-#define cmdLife 1210
-#define cmdMacro01 1211
-#define cmdMacro02 1212
-#define cmdMacro03 1213
-#define cmdMacro04 1214
-#define cmdMacro05 1215
-#define cmdMacro06 1216
-#define cmdMacro07 1217
-#define cmdMacro08 1218
-#define cmdMacro09 1219
-#define cmdMacro10 1220
-#define cmdMacro11 1221
-#define cmdMacro12 1222
-#define cmdMacro13 1223
-#define cmdMacro14 1224
-#define cmdMacro15 1225
-#define cmdMacro16 1226
-#define cmdMacro17 1227
-#define cmdMacro18 1228
-#define cmdMacro19 1229
-#define cmdMacro20 1230
-#define cmdMacro21 1231
-#define cmdMacro22 1232
-#define cmdMacro23 1233
-#define cmdMacro24 1234
-#define cmdMacro25 1235
-#define cmdMacro26 1236
-#define cmdMacro27 1237
-#define cmdMacro28 1238
-#define cmdMacro29 1239
-#define cmdMacro30 1240
-#define cmdMacro31 1241
-#define cmdMacro32 1242
-#define cmdMacro33 1243
-#define cmdMacro34 1244
-#define cmdMacro35 1245
-#define cmdMacro36 1246
-#define cmdMacro37 1247
-#define cmdMacro38 1248
-#define cmdMacro39 1249
-#define cmdMacro40 1250
-#define cmdMacro41 1251
-#define cmdMacro42 1252
-#define cmdMacro43 1253
-#define cmdMacro44 1254
-#define cmdMacro45 1255
-#define cmdMacro46 1256
-#define cmdMacro47 1257
-#define cmdMacro48 1258
-#define cmdMark 1259
-#define cmdMarkBlindAlley 1260
-#define cmdMarkBlock 1261
-#define cmdMarkBlock2 1262
-#define cmdMarkCollision 1263
-#define cmdMarkCuldsac 1264
-#define cmdMessage 1265
-#define cmdMove1 1266
-#define cmdMove2 1267
-#define cmdMove3 1268
-#define cmdMove4 1269
-#define cmdMove6 1270
-#define cmdMove7 1271
-#define cmdMove8 1272
-#define cmdMove9 1273
-#define cmdMoveAround 1274
-#define cmdMoveBack 1275
-#define cmdMoveD 1276
-#define cmdMoveEast 1277
-#define cmdMoveForward 1278
-#define cmdMoveLeft 1279
-#define cmdMoveNorth 1280
-#define cmdMoveRandom 1281
-#define cmdMoveRight 1282
-#define cmdMoveSouth 1283
-#define cmdMoveU 1284
-#define cmdMoveWest 1285
-#define cmdNormalize 1286
-#define cmdNormalize2 1287
-#define cmdOpen 1288
-#define cmdOpen3D 1289
-#define cmdOpenBitmap 1290
-#define cmdOpenColmapTarga 1291
-#define cmdOpenPatch 1292
-#define cmdOpenScript 1293
-#define cmdOpenText 1294
-#define cmdOpenWire 1295
-#define cmdOpenXbm 1296
-#define cmdPartBraid 1297
-#define cmdPartCavern 1298
-#define cmdPartCrack 1299
-#define cmdPartKruskal 1300
-#define cmdPartPerfect 1301
-#define cmdPartPrim 1302
-#define cmdPartRecursive 1303
-#define cmdPartTree 1304
-#define cmdPartUnicursal 1305
-#define cmdPartWeave 1306
-#define cmdPartZeta 1307
-#define cmdPaste 1308
-#define cmdPatchToWire 1309
-#define cmdPolishMaze 1310
-#define cmdPrint 1311
-#define cmdPrintSetup 1312
-#define cmdRandomize 1313
-#define cmdRedrawNow 1314
-#define cmdRenderAerial 1315
-#define cmdRenderOverview 1316
-#define cmdRenderPatchPerspective 1317
-#define cmdRenderPyramid 1318
-#define cmdRenderWirePerspective 1319
-#define cmdRepaintNow 1320
-#define cmdRepeat 1321
-#define cmdRoomThin 1322
-#define cmdRotateA 1323
-#define cmdRotateL 1324
-#define cmdRotateR 1325
-#define cmdSave3DN 1326
-#define cmdSave3DS 1327
-#define cmdSaveBitmap 1328
-#define cmdSaveColmapTarga 1329
-#define cmdSaveDOS 1330
-#define cmdSaveDOS2 1331
-#define cmdSaveDOS3 1332
-#define cmdSavePatch 1333
-#define cmdSavePicture 1334
-#define cmdSaveText 1335
-#define cmdSaveVector 1336
-#define cmdSaveWallCenter 1337
-#define cmdSaveWallFill 1338
-#define cmdSaveWallFit 1339
-#define cmdSaveWallStretch 1340
-#define cmdSaveWallTile 1341
-#define cmdSaveWire 1342
-#define cmdSaveXbmC 1343
-#define cmdSaveXbmN 1344
-#define cmdSaveXbmS 1345
-#define cmdScript01 1346
-#define cmdScript02 1347
-#define cmdScript03 1348
-#define cmdScript04 1349
-#define cmdScript05 1350
-#define cmdScript06 1351
-#define cmdScript07 1352
-#define cmdScript08 1353
-#define cmdScript09 1354
-#define cmdScript10 1355
-#define cmdScript11 1356
-#define cmdScript12 1357
-#define cmdScript13 1358
-#define cmdScript14 1359
-#define cmdScript15 1360
-#define cmdScript16 1361
-#define cmdScript17 1362
-#define cmdScript18 1363
-#define cmdScript19 1364
-#define cmdScript21 1365
-#define cmdScript22 1366
-#define cmdScript23 1367
-#define cmdScript24 1368
-#define cmdScript25 1369
-#define cmdScript26 1370
-#define cmdScript27 1371
-#define cmdScript28 1372
-#define cmdScript29 1373
-#define cmdScrollDown 1374
-#define cmdScrollEnd 1375
-#define cmdScrollHome 1376
-#define cmdScrollUp 1377
-#define cmdSetupAll 1378
-#define cmdSetupDesktop 1379
-#define cmdSetupExtension 1380
-#define cmdSetupUser 1381
-#define cmdShellChange 1382
-#define cmdShellHelp 1383
-#define cmdShellLicense 1384
-#define cmdShellScript 1385
-#define cmdShellWeb 1386
-#define cmdShellWeb2 1387
-#define cmdShowBottleneck 1388
-#define cmdSize01 1389
-#define cmdSize02 1390
-#define cmdSize03 1391
-#define cmdSize04 1392
-#define cmdSize05 1393
-#define cmdSize06 1394
-#define cmdSize07 1395
-#define cmdSize08 1396
-#define cmdSize09 1397
-#define cmdSize10 1398
-#define cmdSize11 1399
-#define cmdSize12 1400
-#define cmdSize13 1401
-#define cmdSize14 1402
-#define cmdSize15 1403
-#define cmdSize16 1404
-#define cmdSize17 1405
-#define cmdSize18 1406
-#define cmdSize19 1407
-#define cmdSizeWindow 1408
-#define cmdSlide 1409
-#define cmdSmooth 1410
-#define cmdSolve4D 1411
-#define cmdSolveBlindAlley 1412
-#define cmdSolveBlock 1413
-#define cmdSolveChain 1414
-#define cmdSolveCollision 1415
-#define cmdSolveCuldsac 1416
-#define cmdSolveFollowL 1417
-#define cmdSolveFollowR 1418
-#define cmdSolveFractal2 1419
-#define cmdSolveHyper 1420
-#define cmdSolvePledgeL 1421
-#define cmdSolvePledgeR 1422
-#define cmdSolveRecursive 1423
-#define cmdSolveShortest 1424
-#define cmdSolveShortest2 1425
-#define cmdSolveTremaux 1426
-#define cmdSolveWeave 1427
-#define cmdSpree 1428
-#define cmdSymmetric 1429
-#define cmdTempAdd 1430
-#define cmdTempAlpha 1431
-#define cmdTempAnd 1432
-#define cmdTempBlend 1433
-#define cmdTempDel 1434
-#define cmdTempGet 1435
-#define cmdTempOr 1436
-#define cmdTempPut 1437
-#define cmdTempSub 1438
-#define cmdTempSwap 1439
-#define cmdTempTessellate 1440
-#define cmdTempXor 1441
-#define cmdTextureBackground 1442
-#define cmdTextureBlock1 1443
-#define cmdTextureBlock2 1444
-#define cmdTextureBlock3 1445
-#define cmdTextureCeiling 1446
-#define cmdTextureDel 1447
-#define cmdTextureGround1 1448
-#define cmdTextureGround2 1449
-#define cmdTextureGround3 1450
-#define cmdTextureWall1 1451
-#define cmdTextureWall2 1452
-#define cmdTextureWall3 1453
-#define cmdThicken 1454
-#define cmdThinner 1455
-#define cmdTimeGet 1456
-#define cmdTimePause 1457
-#define cmdTimeReset 1458
-#define cmdTweakEndpoint 1459
-#define cmdTweakPassage 1460
-#define cmdUnmark 1461
-#define cmdUnsetup 1462
-#define cmdWallVariable 1463
-#define cmdWeave3D 1464
-#define cmdWeaveInside 1465
-#define cmdWindowBitmap 1466
-#define cmdWindowFull 1467
+#define cmdCreateOmicron 1113
+#define cmdCreatePatchOverview 1114
+#define cmdCreatePerfect 1115
+#define cmdCreatePlanair 1116
+#define cmdCreatePrim 1117
+#define cmdCreatePrim2 1118
+#define cmdCreateRandom 1119
+#define cmdCreateRecursive 1120
+#define cmdCreateSegment 1121
+#define cmdCreateSidewinder 1122
+#define cmdCreateSigma 1123
+#define cmdCreateSpiral 1124
+#define cmdCreateTheta 1125
+#define cmdCreateTilt 1126
+#define cmdCreateTree 1127
+#define cmdCreateUnicursal 1128
+#define cmdCreateUpsilon 1129
+#define cmdCreateWeave 1130
+#define cmdCreateWilson 1131
+#define cmdCreateWireOverview 1132
+#define cmdCreateZeta 1133
+#define cmdCubemapFlip 1134
+#define cmdDeletePole 1135
+#define cmdDelX 1136
+#define cmdDelX2 1137
+#define cmdDelY 1138
+#define cmdDelY2 1139
+#define cmdDlgColor 1140
+#define cmdDlgCreate 1141
+#define cmdDlgDisplay 1142
+#define cmdDlgDot 1143
+#define cmdDlgDraw 1144
+#define cmdDlgDraw2 1145
+#define cmdDlgEvent 1146
+#define cmdDlgFile 1147
+#define cmdDlgInside 1148
+#define cmdDlgLabyrinth 1149
+#define cmdDlgMaze 1150
+#define cmdDlgRandom 1151
+#define cmdDlgSize 1152
+#define cmdDlgSizeMaze 1153
+#define cmdDlgZoom 1154
+#define cmdDotBig 1155
+#define cmdDotBoth 1156
+#define cmdDotDrag 1157
+#define cmdDotOn 1158
+#define cmdDotSet 1159
+#define cmdDotShow 1160
+#define cmdDotTwo 1161
+#define cmdDotWall 1162
+#define cmdDotZap 1163
+#define cmdDotZapTrans 1164
+#define cmdDotZapUntrans 1165
+#define cmdDrawDel 1166
+#define cmdDrawGet 1167
+#define cmdDrawPut 1168
+#define cmdDrawSwap 1169
+#define cmdEraseCorner 1170
+#define cmdExit 1171
+#define cmdExpandSet 1172
+#define cmdFlipX 1173
+#define cmdFlipY 1174
+#define cmdFlipZ 1175
+#define cmdFloodDot 1176
+#define cmdFloodDot2 1177
+#define cmdFloodPassage 1178
+#define cmdFloodWallL 1179
+#define cmdFloodWallR 1180
+#define cmdGo2nd 1181
+#define cmdGoCorner1 1182
+#define cmdGoCorner3 1183
+#define cmdGoCorner7 1184
+#define cmdGoCorner9 1185
+#define cmdGoIn 1186
+#define cmdGoInY 1187
+#define cmdGoMiddle 1188
+#define cmdGoOut 1189
+#define cmdGoOutY 1190
+#define cmdGoRandom 1191
+#define cmdGroundVariable 1192
+#define cmdInsideMap 1193
+#define cmdInsideView 1194
+#define cmdJump1 1195
+#define cmdJump2 1196
+#define cmdJump3 1197
+#define cmdJump4 1198
+#define cmdJump6 1199
+#define cmdJump7 1200
+#define cmdJump8 1201
+#define cmdJump9 1202
+#define cmdLabyrinthChartres 1203
+#define cmdLabyrinthChartresF 1204
+#define cmdLabyrinthChartresR 1205
+#define cmdLabyrinthClassical 1206
+#define cmdLabyrinthClassicalF 1207
+#define cmdLabyrinthCretan 1208
+#define cmdLabyrinthCustom 1209
+#define cmdLabyrinthMan 1210
+#define cmdLife 1211
+#define cmdMacro01 1212
+#define cmdMacro02 1213
+#define cmdMacro03 1214
+#define cmdMacro04 1215
+#define cmdMacro05 1216
+#define cmdMacro06 1217
+#define cmdMacro07 1218
+#define cmdMacro08 1219
+#define cmdMacro09 1220
+#define cmdMacro10 1221
+#define cmdMacro11 1222
+#define cmdMacro12 1223
+#define cmdMacro13 1224
+#define cmdMacro14 1225
+#define cmdMacro15 1226
+#define cmdMacro16 1227
+#define cmdMacro17 1228
+#define cmdMacro18 1229
+#define cmdMacro19 1230
+#define cmdMacro20 1231
+#define cmdMacro21 1232
+#define cmdMacro22 1233
+#define cmdMacro23 1234
+#define cmdMacro24 1235
+#define cmdMacro25 1236
+#define cmdMacro26 1237
+#define cmdMacro27 1238
+#define cmdMacro28 1239
+#define cmdMacro29 1240
+#define cmdMacro30 1241
+#define cmdMacro31 1242
+#define cmdMacro32 1243
+#define cmdMacro33 1244
+#define cmdMacro34 1245
+#define cmdMacro35 1246
+#define cmdMacro36 1247
+#define cmdMacro37 1248
+#define cmdMacro38 1249
+#define cmdMacro39 1250
+#define cmdMacro40 1251
+#define cmdMacro41 1252
+#define cmdMacro42 1253
+#define cmdMacro43 1254
+#define cmdMacro44 1255
+#define cmdMacro45 1256
+#define cmdMacro46 1257
+#define cmdMacro47 1258
+#define cmdMacro48 1259
+#define cmdMark 1260
+#define cmdMarkBlindAlley 1261
+#define cmdMarkBlock 1262
+#define cmdMarkBlock2 1263
+#define cmdMarkCollision 1264
+#define cmdMarkCuldsac 1265
+#define cmdMessage 1266
+#define cmdMove1 1267
+#define cmdMove2 1268
+#define cmdMove3 1269
+#define cmdMove4 1270
+#define cmdMove6 1271
+#define cmdMove7 1272
+#define cmdMove8 1273
+#define cmdMove9 1274
+#define cmdMoveAround 1275
+#define cmdMoveBack 1276
+#define cmdMoveD 1277
+#define cmdMoveEast 1278
+#define cmdMoveForward 1279
+#define cmdMoveLeft 1280
+#define cmdMoveNorth 1281
+#define cmdMoveRandom 1282
+#define cmdMoveRight 1283
+#define cmdMoveSouth 1284
+#define cmdMoveU 1285
+#define cmdMoveWest 1286
+#define cmdNormalize 1287
+#define cmdNormalize2 1288
+#define cmdOpen 1289
+#define cmdOpen3D 1290
+#define cmdOpenBitmap 1291
+#define cmdOpenColmapTarga 1292
+#define cmdOpenPatch 1293
+#define cmdOpenScript 1294
+#define cmdOpenText 1295
+#define cmdOpenWire 1296
+#define cmdOpenXbm 1297
+#define cmdPartBraid 1298
+#define cmdPartCavern 1299
+#define cmdPartCrack 1300
+#define cmdPartKruskal 1301
+#define cmdPartPerfect 1302
+#define cmdPartPrim 1303
+#define cmdPartRecursive 1304
+#define cmdPartTree 1305
+#define cmdPartUnicursal 1306
+#define cmdPartWeave 1307
+#define cmdPartZeta 1308
+#define cmdPaste 1309
+#define cmdPatchToWire 1310
+#define cmdPolishMaze 1311
+#define cmdPrint 1312
+#define cmdPrintSetup 1313
+#define cmdRandomize 1314
+#define cmdRedrawNow 1315
+#define cmdRenderAerial 1316
+#define cmdRenderOverview 1317
+#define cmdRenderPatchPerspective 1318
+#define cmdRenderPyramid 1319
+#define cmdRenderWirePerspective 1320
+#define cmdRepaintNow 1321
+#define cmdRepeat 1322
+#define cmdRoomThin 1323
+#define cmdRotateA 1324
+#define cmdRotateL 1325
+#define cmdRotateR 1326
+#define cmdSave3DN 1327
+#define cmdSave3DS 1328
+#define cmdSaveBitmap 1329
+#define cmdSaveColmapTarga 1330
+#define cmdSaveDOS 1331
+#define cmdSaveDOS2 1332
+#define cmdSaveDOS3 1333
+#define cmdSavePatch 1334
+#define cmdSavePicture 1335
+#define cmdSaveText 1336
+#define cmdSaveVector 1337
+#define cmdSaveWallCenter 1338
+#define cmdSaveWallFill 1339
+#define cmdSaveWallFit 1340
+#define cmdSaveWallStretch 1341
+#define cmdSaveWallTile 1342
+#define cmdSaveWire 1343
+#define cmdSaveXbmC 1344
+#define cmdSaveXbmN 1345
+#define cmdSaveXbmS 1346
+#define cmdScript01 1347
+#define cmdScript02 1348
+#define cmdScript03 1349
+#define cmdScript04 1350
+#define cmdScript05 1351
+#define cmdScript06 1352
+#define cmdScript07 1353
+#define cmdScript08 1354
+#define cmdScript09 1355
+#define cmdScript10 1356
+#define cmdScript11 1357
+#define cmdScript12 1358
+#define cmdScript13 1359
+#define cmdScript14 1360
+#define cmdScript15 1361
+#define cmdScript16 1362
+#define cmdScript17 1363
+#define cmdScript18 1364
+#define cmdScript19 1365
+#define cmdScript21 1366
+#define cmdScript22 1367
+#define cmdScript23 1368
+#define cmdScript24 1369
+#define cmdScript25 1370
+#define cmdScript26 1371
+#define cmdScript27 1372
+#define cmdScript28 1373
+#define cmdScript29 1374
+#define cmdScript30 1375
+#define cmdScrollDown 1376
+#define cmdScrollEnd 1377
+#define cmdScrollHome 1378
+#define cmdScrollUp 1379
+#define cmdSetupAll 1380
+#define cmdSetupDesktop 1381
+#define cmdSetupExtension 1382
+#define cmdSetupUser 1383
+#define cmdShellChange 1384
+#define cmdShellHelp 1385
+#define cmdShellLicense 1386
+#define cmdShellScript 1387
+#define cmdShellWeb 1388
+#define cmdShellWeb2 1389
+#define cmdShowBottleneck 1390
+#define cmdSize01 1391
+#define cmdSize02 1392
+#define cmdSize03 1393
+#define cmdSize04 1394
+#define cmdSize05 1395
+#define cmdSize06 1396
+#define cmdSize07 1397
+#define cmdSize08 1398
+#define cmdSize09 1399
+#define cmdSize10 1400
+#define cmdSize11 1401
+#define cmdSize12 1402
+#define cmdSize13 1403
+#define cmdSize14 1404
+#define cmdSize15 1405
+#define cmdSize16 1406
+#define cmdSize17 1407
+#define cmdSize18 1408
+#define cmdSize19 1409
+#define cmdSizeWindow 1410
+#define cmdSlide 1411
+#define cmdSmooth 1412
+#define cmdSolve4D 1413
+#define cmdSolveBlindAlley 1414
+#define cmdSolveBlock 1415
+#define cmdSolveChain 1416
+#define cmdSolveCollision 1417
+#define cmdSolveCuldsac 1418
+#define cmdSolveFollowL 1419
+#define cmdSolveFollowR 1420
+#define cmdSolveFractal2 1421
+#define cmdSolveHyper 1422
+#define cmdSolvePledgeL 1423
+#define cmdSolvePledgeR 1424
+#define cmdSolveRecursive 1425
+#define cmdSolveShortest 1426
+#define cmdSolveShortest2 1427
+#define cmdSolveTremaux 1428
+#define cmdSolveWeave 1429
+#define cmdSpree 1430
+#define cmdSymmetric 1431
+#define cmdTempAdd 1432
+#define cmdTempAlpha 1433
+#define cmdTempAnd 1434
+#define cmdTempBlend 1435
+#define cmdTempDel 1436
+#define cmdTempGet 1437
+#define cmdTempOr 1438
+#define cmdTempPut 1439
+#define cmdTempSub 1440
+#define cmdTempSwap 1441
+#define cmdTempTessellate 1442
+#define cmdTempXor 1443
+#define cmdTextureBackground 1444
+#define cmdTextureBlock1 1445
+#define cmdTextureBlock2 1446
+#define cmdTextureBlock3 1447
+#define cmdTextureCeiling 1448
+#define cmdTextureDel 1449
+#define cmdTextureGround1 1450
+#define cmdTextureGround2 1451
+#define cmdTextureGround3 1452
+#define cmdTextureWall1 1453
+#define cmdTextureWall2 1454
+#define cmdTextureWall3 1455
+#define cmdThicken 1456
+#define cmdThinner 1457
+#define cmdTimeGet 1458
+#define cmdTimePause 1459
+#define cmdTimeReset 1460
+#define cmdTweakEndpoint 1461
+#define cmdTweakPassage 1462
+#define cmdUnmark 1463
+#define cmdUnsetup 1464
+#define cmdWallVariable 1465
+#define cmdWeave3D 1466
+#define cmdWeaveInside 1467
+#define cmdWindowBitmap 1468
+#define cmdWindowFull 1469
#define dbCl_g 10001
#define dbCl_p 10002
#define dcDo_gch 10003
@@ -784,7 +788,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 301
-#define _APS_NEXT_COMMAND_VALUE 1468
+#define _APS_NEXT_COMMAND_VALUE 1470
#define _APS_NEXT_CONTROL_VALUE 10280
#define _APS_NEXT_SYMED_VALUE 301
#endif
diff --git a/script.doc b/script.doc
index d3a9617..5d6febc 100644
Binary files a/script.doc and b/script.doc differ
diff --git a/scrnsave.ds b/scrnsave.ds
index 0d62378..dc7bc29 100644
--- a/scrnsave.ds
+++ b/scrnsave.ds
@@ -1,8 +1,9 @@
DS
-// Daedalus Screensaver - A script file for Daedalus 3.3
+// Daedalus Screensaver - A script file for Daedalus 3.4
// By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
// Variable usage:
+// r: Day/night mode slowdown rate
// s: Day/night mode fraction/second
// t: Day/night current time/total
// u: Day/night time increment rate (constant)
@@ -10,7 +11,7 @@ DS
$1 "" // Password string
DefineMacro 1 "@z fScreenSaver If Not @z {Break} $0 '' GetString 'Enter password' 0 If @z {Break} @z True IfElse EquStr $0 $1 '@z False' 'Message (Bad password!)'" "Exit Event"
-DefineMacro 25 "fRedrawWhenBitmapEdited False @t Add @t @u If Gte @t 1536 {@t 0} @m Div @t 256 @s Mod @t 256 Macro Add 26 @m MoveCloud -1 18000 fRedrawWhenBitmapEdited True" "Inside Event"
+DefineMacro 25 "fRedrawWhenBitmapEdited False @t Add @t @u If Gte @t Mul 1536 @r {@t 0} @m Div @t Mul 256 @r @s Div Mod @t Mul 256 @r @r Macro Add 26 @m MoveCloud -1 18000 fRedrawWhenBitmapEdited True" "Inside Event"
DefineMacro 26 "If Equ @s 0 {kSky Aqua kCloud White kCloud2 Light LtGray kMountain Brown kMountain2 Gray nFogDistance 0 kGround2 -1 nSunMoonY 333}" "Midday"
DefineMacro 27 "kSky Rgb 0 Sub 255 @s 255 kCloud GrayN Sub 255 Div Mul @s 3 8 kCloud2 GrayN Sub 223 Div Mul @s 3 8 kMountain Rgb Sub 127 Div @s 8 Sub 63 Div @s 16 0 kMountain2 GrayN Sub 127 Div Mul @s 52 256 nFogDistance Sub 5290 Mul @s 20 kGround2 Rgb 0 Sub 128 Div @s 4 0 nSunMoonY Add 333 Div Mul @s 667 256" "Late Day"
DefineMacro 28 "If Equ @s 0 {fStars True} kSky Rgb 0 0 Sub 255 @s kCloud GrayN Sub 159 Div Mul @s 3 8 kCloud2 GrayN Sub 127 Div Mul @s 3 8 kMountain Rgb Sub 95 Div @s 8 Sub 47 Div @s 16 0 kMountain2 GrayN Sub 75 Div Mul @s 52 256 nStarCount Mul @s 3 nFogDistance Sub 170 Div @s 2 kGround2 Rgb 0 Sub 64 Div @s 4 0 nSunMoonY Sub 1000 Div Mul @s 667 256" "Early Night"
@@ -19,5 +20,5 @@ DefineMacro 30 "kSky Rgb 0 0 @s nStarCount Mul Sub 255 @s 3 kCloud GrayN Add 64
DefineMacro 31 "If Equ @s 0 {fStars False} kSky Rgb 0 @s 255 kCloud GrayN Add 160 Div Mul @s 3 8 kCloud2 GrayN Add 128 Div Mul @s 3 8 kMountain Rgb Add 95 Div @s 8 Add 47 Div @s 16 0 kMountain2 GrayN Add 76 Div Mul @s 52 256 nFogDistance Add 170 Mul @s 20 kGround2 Rgb 0 Add 64 Div @s 4 0 nSunMoonY Sub 1000 Div Mul @s 667 256" "Early Day"
fRedrawWhenBitmapEdited False ResetProgram Size 32 32 0 1 Turtle "BM0,0R15ND14RNR15D15R15D16L31U16R15DNL14R15" cDel Zoom 8 6 0 2 = cF TextureOverlay TempDelete
-kDot Orange kOverlay Purple kInsideWall Maroon kGround DkGreen fWallsImpassable True nEdgeBehavior 0 rLightFactor 30 nMotionFrames 90 nRotationFrames 90 nOnProgramExit 1 nOnRedrawInside 25 @t 9999 @u 1
+kDot Orange kOverlay Purple kInsideWall Maroon kGround DkGreen fWallsImpassable True nEdgeBehavior 0 rLightFactor 30 nMotionFrames 90 nRotationFrames 90 nOnProgramExit 1 nOnRedrawInside 25 @r 3 @t 999999 @u 1
: ] } an CollapseToSet c8 nY -1 fRedrawWhenBitmapEdited True 0 N
diff --git a/solids.cpp b/solids.cpp
index 58f1642..ec20643 100644
--- a/solids.cpp
+++ b/solids.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: solids.cpp
+** Daedalus (Version 3.4) File: solids.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** the solids.dp sample file of the Daedalus distribution.
**
** Created: 7/2/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
diff --git a/solve.cpp b/solve.cpp
index 81031fb..748c42b 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: solve.cpp
+** Daedalus (Version 3.4) File: solve.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -23,7 +23,7 @@
** This file contains Maze solving algorithms.
**
** Created: 9/4/2000.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
diff --git a/threed.cpp b/threed.cpp
index 8b4190d..f331d8a 100644
--- a/threed.cpp
+++ b/threed.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: threed.cpp
+** Daedalus (Version 3.4) File: threed.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** or color bitmap being treated as a 3D or 4D bitmap, unrelated to Mazes.
**
** Created: 3/12/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -320,20 +320,23 @@ flag CMap3::FCubeFlip2(int nAxis, int nOp)
{
CONST char *pch;
- Assert(FBetween(nAxis, 0, 2) && FBetween(nOp, 0, 3));
- switch (nAxis*4 + nOp) {
+ Assert(FBetween(nAxis, 0, 2) && FBetween(nOp, 0, 4));
+ switch (nAxis*5 + nOp) {
case 0: pch = "Xyz"; break; // X Flip
case 1: pch = "xzY"; break; // X Rotate right
case 2: pch = "xZy"; break; // X Rotate left
case 3: pch = "xYZ"; break; // X Rotate across
- case 4: pch = "xYz"; break; // Y Flip
- case 5: pch = "zyX"; break; // Y Rotate right
- case 6: pch = "Zyx"; break; // Y Rotate left
- case 7: pch = "XyZ"; break; // Y Rotate across
- case 8: pch = "xyZ"; break; // Z Flip
- case 9: pch = "Yxz"; break; // Z Rotate right
- case 10: pch = "yXz"; break; // Z Rotate left
- case 11: pch = "XYz"; break; // Z Rotate across
+ case 4: pch = "xzy"; break; // X Transpose
+ case 5: pch = "xYz"; break; // Y Flip
+ case 6: pch = "zyX"; break; // Y Rotate right
+ case 7: pch = "Zyx"; break; // Y Rotate left
+ case 8: pch = "XyZ"; break; // Y Rotate across
+ case 9: pch = "zyx"; break; // Y Transpose
+ case 10: pch = "xyZ"; break; // Z Flip
+ case 11: pch = "Yxz"; break; // Z Rotate right
+ case 12: pch = "yXz"; break; // Z Rotate left
+ case 13: pch = "XYz"; break; // Z Rotate across
+ case 14: pch = "yxz"; break; // Z Transpose
default: Assert(fFalse); return fFalse;
}
return FCubeFlip(pch);
diff --git a/threed.h b/threed.h
index 8bd3103..facdedd 100644
--- a/threed.h
+++ b/threed.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: threed.h
+** Daedalus (Version 3.4) File: threed.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** on a monochrome bitmap being treated as a 3D/4D bitmap, unrelated to Mazes.
**
** Created: 3/12/1990.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
/*
diff --git a/util.cpp b/util.cpp
index 7a356ee..b07ae6c 100644
--- a/util.cpp
+++ b/util.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: util.cpp
+** Daedalus (Version 3.4) File: util.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** or any other part of Daedalus.
**
** Created: 6/4/1993.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -58,7 +58,6 @@ void operator delete(void *pv)
DeallocateP(pv);
}
-#ifndef PC
void *operator new(size_t cb, void *pv)
{
return pv;
@@ -67,7 +66,6 @@ void *operator new(size_t cb, void *pv)
void operator delete(void *pv, void *pv2)
{
}
-#endif
// Change the size of a memory allocation, containing a list of cElem items of
@@ -82,7 +80,7 @@ void *ReallocateArray(void *rgElem, int cElem, int cbElem, int cElemNew)
return NULL;
ClearPb(rgElemNew, cElemNew * cbElem);
if (rgElem != NULL)
- CopyPb(rgElem, rgElemNew, cElem * cbElem);
+ CopyPb(rgElem, rgElemNew, Min(cElem, cElemNew) * cbElem);
return rgElemNew;
}
@@ -609,7 +607,7 @@ real CVector::Angle(CONST CVector &v2) CONST
return rPiHalf;
else if (angle <= -1.0)
return rPi;
- angle = RAtn(RSqr(1.0 - angle*angle)/angle);
+ angle = RAtn(RSqr(1.0 - Sq(angle)) / angle);
if (angle >= 0.0)
return angle;
else
@@ -1052,6 +1050,7 @@ int Rnd(int n1, int n2)
int d, r, n, nT;
if (n1 > n2) {
+ // Special parameters allow returning any 32 bit number.
if (n1 == lHighest && n2 == (int)0x80000000)
return LRnd();
SwapN(n1, n2);
diff --git a/util.h b/util.h
index 184be9d..caeaaba 100644
--- a/util.h
+++ b/util.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: util.h
+** Daedalus (Version 3.4) File: util.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** related to graphics or any other part of Daedalus.
**
** Created: 6/4/1993.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
// Compile options
@@ -34,6 +34,10 @@
#define PC
#define ASSERT
+// WIN: Comment out to produce command line version with no Windows interface.
+// PC: Comment out if not using a Microsoft Visual Studio compiler.
+// ASSERT: Comment out to avoid useful debugging checks and error messages.
+
#ifdef PC
#define SECURECRT
#define OVERRIDE override
@@ -101,6 +105,7 @@
#define chNull '\0'
#define chTab '\t'
#define chMost '\377'
+#define dwSet 0xFFFFFFFF
#define dwCanary 0x12345678
#define cchSzDef 80
@@ -155,9 +160,9 @@ enum _printmode {
#define RSinD(r) RSin(RFromD(r))
#define RCosD(r) RCos(RFromD(r))
#define RTanD(r) RTan(RFromD(r))
-#define RAtnD(r) DFromR(RAtn(r))
#define RAsinD(r) DFromR(RAsin(r))
#define RAcosD(r) DFromR(RAcos(r))
+#define RAtnD(r) DFromR(RAtn(r))
#define NSinRD(r, d) ((int)((r)*RSinD(d) + rRound))
#define NCosRD(r, d) ((int)((r)*RCosD(d) + rRound))
#define RFromD(r) ((r)/rDegRad)
diff --git a/virtual.ds b/virtual.ds
index 8ac0385..38fa8e7 100644
--- a/virtual.ds
+++ b/virtual.ds
@@ -1,5 +1,5 @@
DS
-// Daedalus Virtual Mazes - A script file for Daedalus 3.3
+// Daedalus Virtual Mazes - A script file for Daedalus 3.4
// By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
// Variable usage:
diff --git a/wdialog.cpp b/wdialog.cpp
index 65f7dff..1d3f8f0 100644
--- a/wdialog.cpp
+++ b/wdialog.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: wdialog.cpp
+** Daedalus (Version 3.4) File: wdialog.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** dialog utilities.
**
** Created: 2/11/2001.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -54,18 +54,21 @@ enum _extension {
iextDS = 8,
iextDW = 9,
iextDP = 10,
- iextAll = 11,
- iextMax = 12,
+ iextDB = 11,
+ iextAll = 12,
+ iextMax = 13,
};
CONST char *rgszOpen[iextMax] = {"Open Bitmap", "Open Text",
"Open X11 Bitmap", "Open Targa Bitmap", "Open Paint Bitmap",
"" /* Open Picture */, "" /* Open Vector */, "Open 3D Bitmap",
- "Open Script", "Open Wireframe", "Open Patches", "Open File"};
+ "Open Script", "Open Wireframe", "Open Patches",
+ "Open Daedalus Bitmap", "Open File"};
CONST char *rgszSave[iextMax] = {"Save Bitmap", "Save Text",
"Save X11 Bitmap", "Save Targa Bitmap", "" /* Save Paint Bitmap */,
"Save Picture", "Save Vector", "Save 3D Bitmap",
- "" /* Save Script */, "Save Wireframe", "Save Patches", "" /* Save File */};
+ "" /* Save Script */, "Save Wireframe", "Save Patches",
+ "Save Daedalus Bitmap", "" /* Save File */};
CONST char *rgszFilter[iextMax] = {
"Windows Bitmaps (*.bmp)\0*.bmp\0All Files (*.*)\0*.*\0",
"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0",
@@ -78,10 +81,11 @@ CONST char *rgszFilter[iextMax] = {
"Daedalus Scripts (*.ds)\0*.ds\0All Files (*.*)\0*.*\0",
"Wireframe Files (*.dw)\0*.dw\0All Files (*.*)\0*.*\0",
"Patch Files (*.dp)\0*.dp\0All Files (*.*)\0*.*\0",
+ "Daedalus Bitmaps (*.db)\0*.db\0All Files (*.*)\0*.*\0",
"All Daedalus Files\0*.bmp;*.txt;*.d?;*.pcx\0All Files (*.*)\0*.*\0"};
CONST char *rgszExt[iextMax] = {
- "bmp", "txt", "xbm", "tga", "pcx", "wmf", "svg", "d3", "ds", "dw", "dp",
- ""};
+ "bmp", "txt", "xbm", "tga", "pcx", "wmf", "svg",
+ "d3", "ds", "dw", "dp", "db", ""};
/*
@@ -248,7 +252,6 @@ flag FFileOpen(int wCmd, CONST char *szFile, FILE *fileIn)
switch (wCmd) {
case cmdOpen:
- case cmdOpenDB:
isz = iextAll;
break;
case cmdOpenBitmap:
@@ -278,6 +281,9 @@ flag FFileOpen(int wCmd, CONST char *szFile, FILE *fileIn)
case cmdOpenPatch:
isz = iextDP;
break;
+ case cmdOpenDB:
+ isz = iextDB;
+ break;
default:
Assert(fFalse);
}
@@ -1402,7 +1408,7 @@ flag API DlgInside(HWND hdlg, uint msg, WORD wParam, LONG lParam)
SetEditN(deIn_fd, dr.nFog);
SetEditN(deIn_cp, dr.nClip);
SetEditR(deIn_vs, dr.dInside);
- SetEditN(deIn_sw, dr.nStereo);
+ SetEditN(deIn_sw, ds.nStereo);
SetRadio(dr7 + dr.nTrans, dr7, dra);
SetEditN(deIn_fm, dr.nFrameXY);
SetEditN(deIn_fr, dr.nFrameD);
@@ -1483,7 +1489,7 @@ flag API DlgInside(HWND hdlg, uint msg, WORD wParam, LONG lParam)
dr.nFog = nfd;
dr.nClip = ncp;
dr.dInside = rvs;
- dr.nStereo = nsw;
+ ds.nStereo = nsw;
dr.nTrans = GetRadio(dr7, dra);
dr.nFrameXY = nfm;
dr.nFrameD = nfr;
@@ -1633,14 +1639,14 @@ flag API DlgCubeFlip(HWND hdlg, uint msg, WORD wParam, LONG lParam)
switch (msg) {
case WM_INITDIALOG:
SetRadio(dr1, dr1, dr3);
- SetRadio(dr4, dr4, dr7);
+ SetRadio(dr4, dr4, dr8);
SetFocus(GetDlgItem(hdlg, dr1));
return fFalse;
case WM_COMMAND:
if (wParam == IDOK || wParam == IDCANCEL) {
if (wParam == IDOK) {
i = GetRadio(dr1, dr3);
- j = GetRadio(dr4, dr7);
+ j = GetRadio(dr4, dr8);
PbFocus()->FCubeFlip2(i, j);
DirtyView();
}
diff --git a/wdriver.cpp b/wdriver.cpp
index 7b93a0b..934c20c 100644
--- a/wdriver.cpp
+++ b/wdriver.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: wdriver.cpp
+** Daedalus (Version 3.4) File: wdriver.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -24,7 +24,7 @@
** code to execute menu commands and Windows events.
**
** Created: 4/8/2013.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -472,6 +472,7 @@ int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance,
FBootExternal("daedalus.ds", fTrue);
ws.fQuitting = fTrue;
} else if (!FBootExternal("daedalus.ds", fTrue)) {
+ dr.nFrameXY = dr.nFrameD = dr.nFrameZ = 90;
DoCommand(cmdInsideView);
DoCommand(cmdGoMiddle);
DoCommand(cmdMoveRandom);
@@ -634,7 +635,8 @@ flag DoCommandW(int wCmd)
case cmdSetupAll:
case cmdSetupUser:
if (!FCreateProgramGroup(wCmd == cmdSetupAll))
- PrintSz_E("Failed to create program group.");
+ PrintSz_E("Failed to create program group.\nDaedalus "
+ "can still be run from other icons or directly from its folder.");
break;
case cmdSetupDesktop:
@@ -1248,7 +1250,13 @@ LRESULT WINAPI WndProc(HWND hwnd, uint wMsg, WPARAM wParam, LPARAM lParam)
case WM_HSCROLL:
if (ws.fSaverRun)
goto LClose;
- switch (wParam) {
+ switch (LOWORD(wParam)) {
+ case SB_LEFT:
+ ws.xScroll = 0;
+ break;
+ case SB_RIGHT:
+ ws.xScroll = nScrollDiv;
+ break;
case SB_LINEUP:
ws.xScroll = max(0, ws.xScroll - 1);
break;
@@ -1262,7 +1270,7 @@ LRESULT WINAPI WndProc(HWND hwnd, uint wMsg, WPARAM wParam, LPARAM lParam)
ws.xScroll = min(nScrollDiv, ws.xScroll + nScrollPage);
break;
case SB_THUMBPOSITION:
- ws.xScroll = LOWORD(lParam);
+ ws.xScroll = HIWORD(wParam);
break;
default:
return fFalse;
@@ -1276,7 +1284,13 @@ LRESULT WINAPI WndProc(HWND hwnd, uint wMsg, WPARAM wParam, LPARAM lParam)
case WM_VSCROLL:
if (ws.fSaverRun)
goto LClose;
- switch(wParam) {
+ switch (LOWORD(wParam)) {
+ case SB_TOP:
+ ws.yScroll = 0;
+ break;
+ case SB_BOTTOM:
+ ws.yScroll = nScrollDiv;
+ break;
case SB_LINEUP:
ws.yScroll = max(0, ws.yScroll - 1);
break;
@@ -1290,7 +1304,7 @@ LRESULT WINAPI WndProc(HWND hwnd, uint wMsg, WPARAM wParam, LPARAM lParam)
ws.yScroll = min(nScrollDiv, ws.yScroll + nScrollPage);
break;
case SB_THUMBPOSITION:
- ws.yScroll = LOWORD(lParam);
+ ws.yScroll = HIWORD(wParam);
break;
default:
return fFalse;
@@ -1381,7 +1395,7 @@ void Redraw(HWND hwnd)
goto LDone;
if (dr.nInside != nInsideSimple) {
- if (dr.nStereo == 0)
+ if (ds.nStereo == 0)
RedrawInsidePerspective(bm.kI);
else
RedrawInsidePerspectiveStereo(bm.kI, bm.kS);
diff --git a/wdriver.h b/wdriver.h
index 04290b5..a260e4c 100644
--- a/wdriver.h
+++ b/wdriver.h
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: wdriver.h
+** Daedalus (Version 3.4) File: wdriver.h
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -23,7 +23,7 @@
** This file contains Windows specific definitions for Daedalus as a whole.
**
** Created: 4/8/2013.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
@@ -58,9 +58,6 @@
// Dialog Macros
-#define HourglassOn \
- if (ws.fHourglass) hcurPrev = SetCursor(LoadCursor(NULL, IDC_WAIT))
-#define HourglassOff if (hcurPrev != NULL) SetCursor(hcurPrev)
#define CheckMenu(cmd, f) \
CheckMenuItem(wi.hmenu, cmd, f ? MF_CHECKED : MF_UNCHECKED);
#define SetCheck(id, f) CheckDlgButton(hdlg, id, f)
diff --git a/wutil.cpp b/wutil.cpp
index 29f6349..2f98287 100644
--- a/wutil.cpp
+++ b/wutil.cpp
@@ -1,9 +1,9 @@
/*
-** Daedalus (Version 3.3) File: wutil.cpp
+** Daedalus (Version 3.4) File: wutil.cpp
** By Walter D. Pullen, Astara@msn.com, http://www.astrolog.org/labyrnth.htm
**
** IMPORTANT NOTICE: Daedalus and all Maze generation and general
-** graphics routines used in this program are Copyright (C) 1998-2018 by
+** graphics routines used in this program are Copyright (C) 1998-2023 by
** Walter D. Pullen. Permission is granted to freely use, modify, and
** distribute these routines provided these credits and notices remain
** unmodified with any altered or distributed versions of the program.
@@ -23,7 +23,7 @@
** This file contains Windows specific utilities and operations for Daedalus.
**
** Created: 11/16/2002.
-** Last code change: 11/29/2018.
+** Last code change: 8/29/2023.
*/
#include
@@ -355,7 +355,7 @@ void DrawTextLine(HDC hdc, CONST char *sz, int cch, int y)
if (dr.kvOff == dr.kvOn)
nSav = SetBkMode(hdc, TRANSPARENT);
yp = size.cy*y + (y < 0)*ws.ypClient;
- if (dr.nStereo == 0) {
+ if (ds.nStereo == 0 || ds.fStereo3D) {
TextOut(hdc, (ws.xpClient >> 1) - (size.cx >> 1), yp, sz, cch);
} else {
TextOut(hdc, (ws.xpClient >> 2) - (size.cx >> 1), yp, sz, cch);
@@ -520,6 +520,7 @@ flag FCreateDesktopIcon()
DeleteShortcut(szDir, "Daedalus 3.0");
DeleteShortcut(szDir, "Daedalus 3.1");
DeleteShortcut(szDir, "Daedalus 3.2");
+ DeleteShortcut(szDir, "Daedalus 3.3");
// Check whether hunger subdirectory exists with texture in it.
GetModuleFileName(wi.hinst, szExe, cchSzMax);
@@ -567,7 +568,9 @@ flag FCreateProgramGroup(flag fAll)
DeleteShortcut(szDir, "Daedalus 3.0");
DeleteShortcut(szDir, "Daedalus 3.1");
DeleteShortcut(szDir, "Daedalus 3.2");
- DeleteShortcut(szDir, "Daedalus homepage");
+ DeleteShortcut(szDir, "Daedalus 3.3");
+ DeleteShortcut(szDir, "Daedalus homepage"); // Now Daedalus website
+ DeleteShortcut(szDir, "Carleton Farm Maze"); // Now Carleton Farm Maze #1
// Add main shortcuts in folder.
sprintf(S(szName), "%s %s", szDaedalus, szVersion);
@@ -593,15 +596,13 @@ flag FCreateProgramGroup(flag fAll)
return fFalse;
}
- // Delete old previous version script shortcuts from subfolder.
- DeleteShortcut(szDir, "Carleton Farm Maze"); // Now Carleton Farm Maze #1
-
// Add script shortcuts in subfolder
for (iScript = 0; iScript <= cmdScriptLast - cmdScript01; iScript++) {
if (!FCreateShortcut(szDir, rgszShortcut[iScript], rgszScript[iScript],
NULL, iScript != 5/*Dragonslayer*/ && iScript != 8/*Hunger*/ &&
iScript != 25/*Squares*/ && iScript != 26/*Mandelbrot*/ &&
- iScript != 27/*Pentris*/ ? 1 : 2))
+ iScript != 27/*Pentris*/ && iScript != 28/*Grippy*/ ? 1 :
+ (iScript != 28/*Grippy*/ ? 2 : 5)))
return fFalse;
}
return fTrue;