From: Holger Schemel Date: Tue, 23 Jun 2009 21:34:47 +0000 (+0200) Subject: rnd-20090623-4-src X-Git-Tag: 3.3.0.0^2~93 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=8d3d7d213a9691455a49544624bf380e85f43461;p=rocksndiamonds.git rnd-20090623-4-src --- diff --git a/src/conftime.h b/src/conftime.h index 7d13d780..256aa3ec 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2009-06-23 02:12" +#define COMPILE_DATE_STRING "2009-06-23 23:34" diff --git a/src/game_sp/ASM.c b/src/game_sp/ASM.c index 6ef27ee3..6f0484ae 100644 --- a/src/game_sp/ASM.c +++ b/src/game_sp/ASM.c @@ -4,7 +4,8 @@ #include "ASM.h" -static char *VB_Name = "modASM"; +// static char *VB_Name = "modASM"; + // --- Option Explicit // PseudoRegisters: diff --git a/src/game_sp/BitMapObject.c b/src/game_sp/BitMapObject.c index dafb9658..5e267682 100644 --- a/src/game_sp/BitMapObject.c +++ b/src/game_sp/BitMapObject.c @@ -4,7 +4,7 @@ #include "BitMapObject.h" -static void ConvertToVBPalette(); +// static void ConvertToVBPalette(); static long Get_ByteWidth(); static long Get_LineLength(); static void ReDimArrays(); @@ -18,11 +18,12 @@ static void ReDimArrays(); // --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject // --- END -static char *VB_Name = "BitMapObject"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = True; -static boolean VB_PredeclaredId = False; -static boolean VB_Exposed = False; +// static char *VB_Name = "BitMapObject"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = True; +// static boolean VB_PredeclaredId = False; +// static boolean VB_Exposed = False; + // --- Option Explicit // info von http://web.usxchange.net/elmo/bmp.htm @@ -170,6 +171,8 @@ void BitMapObject_CreateAtSize(long XPixels, long YPixels, long BitsPerPixel) ReDimArrays(); } +#if 0 + void BitMapObject_CreateFromFile(char *Path) { long FNum; @@ -207,7 +210,7 @@ void BitMapObject_CreateFromFile(char *Path) void BitMapObject_SaveToFile(char *Path) { - long FNum; + FILE *FNum; BMFH.bfOffBits = Len(BMFH) + Len(BMIH); if (BMIH.biBitCount < 9) @@ -215,7 +218,7 @@ void BitMapObject_SaveToFile(char *Path) BMIH.biSizeImage = Get_LineLength() * BMIH.biHeight; BMFH.bfSize = BMFH.bfOffBits + BMIH.biSizeImage; - FNum = FreeFile(); + // FNum = FreeFile(); FNum = fopen(Path, "wb"); FILE_PUT(FNum, -1, &BMFH, sizeof(BMFH)); FILE_PUT(FNum, -1, &BMIH, sizeof(BMIH)); @@ -241,6 +244,8 @@ static void ConvertToVBPalette() } } +#endif + static void ReDimArrays() { { @@ -294,6 +299,8 @@ long BitMapObject_Get_ColorsUsed() return ColorsUsed; } +#if 0 + long BitMapObject_Get_ColorIndex(long X, long Y) { long ColorIndex; @@ -472,7 +479,7 @@ void BitMapObject_Let_Point(long X, long Y, long NewColor) { case 1: ColIndex = GetPaletteIndex(NewColor); - ByteVal = ImageDataBytes[X / 8, nY]; + ByteVal = ImageDataBytes[X / 8][nY]; BitPos = 7 - (X % 8); NewX = (1 << BitPos); ColIndex = ColIndex * NewX; @@ -485,12 +492,12 @@ void BitMapObject_Let_Point(long X, long Y, long NewColor) ByteVal = (ByteVal | NewX); } - ImageDataBytes[X / 8, nY] = ByteVal; + ImageDataBytes[X / 8][nY] = ByteVal; break; case 4: ColIndex = GetPaletteIndex(NewColor); - ByteVal = ImageDataBytes[X / 2, nY]; + ByteVal = ImageDataBytes[X / 2][nY]; if ((X % 2) == 0) { ByteVal = (ByteVal & 0xF) + ColIndex * 0x10; @@ -500,18 +507,18 @@ void BitMapObject_Let_Point(long X, long Y, long NewColor) ByteVal = (ByteVal & 0xF0) + ColIndex; } - ImageDataBytes[X / 2, nY] = ByteVal; + ImageDataBytes[X / 2][nY] = ByteVal; break; case 8: - ImageDataBytes[X, nY] = GetPaletteIndex(NewColor); + ImageDataBytes[X][nY] = GetPaletteIndex(NewColor); break; case 24: NewX = 3 * X; - ImageDataBytes[NewX, nY] = (NewColor & 0xFF0000) / 0x10000; // B - ImageDataBytes[NewX + 1, nY] = (NewColor & 0xFF00) / 0x100; // G - ImageDataBytes[NewX + 2, nY] = (NewColor & 0xFF); // R + ImageDataBytes[NewX][nY] = (NewColor & 0xFF0000) / 0x10000; // B + ImageDataBytes[NewX + 1][nY] = (NewColor & 0xFF00) / 0x100; // G + ImageDataBytes[NewX + 2][nY] = (NewColor & 0xFF); // R break; default: @@ -541,6 +548,8 @@ int BitMapObject_GetPaletteIndex(long Color) return GetPaletteIndex; } +#endif + long BitMapObject_Get_Width() { long Width; @@ -559,6 +568,8 @@ long BitMapObject_Get_Height() return Height; } +#if 0 + BitMapObject BitMapObject_GetStretchCopy(float StretchVal) { BitMapObject GetStretchCopy; @@ -580,9 +591,11 @@ BitMapObject BitMapObject_GetStretchCopy(float StretchVal) { for (iX = 0; iX <= nWidth; iX++) { - GetStretchCopy.Let_ColorIndex(iX, iY, ColorIndex(Int(iX / StretchVal), Int(iY / StretchVal))); + GetStretchCopy.Let_ColorIndex(iX, iY, ColorIndex((int)(iX / StretchVal), (int)(iY / StretchVal))); } } return GetStretchCopy; } + +#endif diff --git a/src/game_sp/BugsTerminals.c b/src/game_sp/BugsTerminals.c index f5603959..f31e6d8c 100644 --- a/src/game_sp/BugsTerminals.c +++ b/src/game_sp/BugsTerminals.c @@ -4,7 +4,8 @@ #include "BugsTerminals.h" -static char *VB_Name = "modBugTerminal"; +// static char *VB_Name = "modBugTerminal"; + // --- Option Explicit long GetTickCount(); @@ -22,8 +23,10 @@ int subAnimateBugs(int si) { int subAnimateBugs; - int ax, bx, cx, dx, di; - int ah, bh, ch, dh, al, bl, cl, dl; + // int ax, bx, cx, dx, di; + // int ah, bh, ch, dh, al, bl, cl, dl; + int cx; + int bl; if (fiBug != LowByte(PlayField16[si])) return subAnimateBugs; @@ -90,7 +93,8 @@ int subAnimateTerminals(int si) { int subAnimateTerminals; - int bl, ax, al, X, Y; + // int bl, ax, al, X, Y; + int bl, al, X, Y; if (LowByte(PlayField16[si]) != fiTerminal) return subAnimateTerminals; diff --git a/src/game_sp/Capture.c b/src/game_sp/Capture.c index 96997f67..9a86f9cd 100644 --- a/src/game_sp/Capture.c +++ b/src/game_sp/Capture.c @@ -4,7 +4,8 @@ #include "Capture.h" -static char *VB_Name = "CaptureModule"; +// static char *VB_Name = "CaptureModule"; + // -------------------------------------------------------------------- // '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' // @@ -209,7 +210,7 @@ Picture CreateBitmapPicture(int hBmp, int hPal) // Fill Pic with necessary parts. { - pic.Size = Len(pic); // Length of structure. + pic.Size = sizeof(pic); // Length of structure. pic.Type = vbPicTypeBitmap; // Type of Picture (bitmap). pic.hBmp = hBmp; // Handle to bitmap. pic.hPal = hPal; // Handle to palette (may be null). @@ -522,7 +523,9 @@ void PrintPictureToFitPage(Printer Prn, Picture pic) } // Print the picture using the PaintPicture method. - Prn_PaintPicture(pic, 0, 0, PrnPicWidth, PrnPicHeight); +#if 0 + Prn.PaintPicture(pic, 0, 0, PrnPicWidth, PrnPicHeight); +#endif } // -------------------------------------------------------------------- diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index 1734aa8b..66b12072 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -16,11 +16,12 @@ // --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject // --- END -static char *VB_Name = "DDScrollBuffer"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = True; -static boolean VB_PredeclaredId = False; -static boolean VB_Exposed = False; +// static char *VB_Name = "DDScrollBuffer"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = True; +// static boolean VB_PredeclaredId = False; +// static boolean VB_Exposed = False; + // --- Option Explicit // needs reference to: DirectX7 for Visual Basic Type Library @@ -178,7 +179,7 @@ void DDScrollBuffer_Blt() if (IS_NOTHING(&PrimarySurface, sizeof(PrimarySurface))) return; - L = PrimarySurface_Blt(DR, Buffer, SR, DDBLT_WAIT); + L = PrimarySurface.Blt(DR, &Buffer, SR, DDBLT_WAIT); if (L != DD_OK) { switch (L) diff --git a/src/game_sp/DDSpriteBuffer.c b/src/game_sp/DDSpriteBuffer.c index 1384a38f..5ab338fb 100644 --- a/src/game_sp/DDSpriteBuffer.c +++ b/src/game_sp/DDSpriteBuffer.c @@ -15,11 +15,11 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY); // --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject // --- END -static char *VB_Name = "DDSpriteBuffer"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = True; -static boolean VB_PredeclaredId = False; -static boolean VB_Exposed = False; +// static char *VB_Name = "DDSpriteBuffer"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = True; +// static boolean VB_PredeclaredId = False; +// static boolean VB_Exposed = False; // --- Option Explicit // needs reference to: DirectX7 for Visual Basic Type Library @@ -117,7 +117,7 @@ boolean DDSpriteBuffer_CreateFromFile(char *Path, long xSprites, long ySprites) CreateFromFile = True; return CreateFromFile; -CreateFromFileEH: + // CreateFromFileEH: CreateFromFile = False; return CreateFromFile; @@ -148,7 +148,7 @@ boolean DDSpriteBuffer_CreateAtSize(long Width, long Height, long xSprites, long CreateAtSize = True; return CreateAtSize; -CreateAtSizeEH: + // CreateAtSizeEH: CreateAtSize = False; return CreateAtSize; @@ -181,7 +181,7 @@ static void Blt(int pX, int pY, int SpriteX, int SpriteY) SR.right = SR.left + mSpriteWidth; SR.bottom = SR.top + mSpriteHeight; } - Tmp = mDest_Blt(DR, Buffer, SR, DDBLT_WAIT); + Tmp = mDest.Blt(DR, &Buffer, SR, DDBLT_WAIT); } void DDSpriteBuffer_BltEx(int pX, int pY, int SpritePos) @@ -225,8 +225,12 @@ void DDSpriteBuffer_BltEx(int pX, int pY, int SpritePos) // End If // End Function +#if 0 + static void Class_Initialize() { mDestXOff = 0; mDestYOff = 0; } + +#endif diff --git a/src/game_sp/Demo.c b/src/game_sp/Demo.c index 7bbf90f0..caa7441c 100644 --- a/src/game_sp/Demo.c +++ b/src/game_sp/Demo.c @@ -4,7 +4,8 @@ #include "Demo.h" -static char *VB_Name = "modDemo"; +// static char *VB_Name = "modDemo"; + // --- Option Explicit // // Public Function subCloseDemoRecordingFile() @@ -74,7 +75,7 @@ currency GetTotalFramesOfDemo() GetTotalFramesOfDemo = nFrames; return GetTotalFramesOfDemo; -GetTotalFramesOfDemoEH: + // GetTotalFramesOfDemoEH: // ReportError "GetTotalFramesOfDemo()", "invalid data detected in file " & OrigPath GetTotalFramesOfDemo = 0; DemoAvailable = False; diff --git a/src/game_sp/DemoBufferObject.c b/src/game_sp/DemoBufferObject.c index 37e758e8..f3dbcc30 100644 --- a/src/game_sp/DemoBufferObject.c +++ b/src/game_sp/DemoBufferObject.c @@ -4,8 +4,8 @@ #include "DemoBufferObject.h" -static void Class_Terminate(); -static int RemoveLastDemoKey(); +// static void Class_Terminate(); +// static int RemoveLastDemoKey(); // --- VERSION 1.0 CLASS // --- BEGIN @@ -16,11 +16,12 @@ static int RemoveLastDemoKey(); // --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject // --- END -static char *VB_Name = "DemoBufferObject"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = True; -static boolean VB_PredeclaredId = False; -static boolean VB_Exposed = False; +// static char *VB_Name = "DemoBufferObject"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = True; +// static boolean VB_PredeclaredId = False; +// static boolean VB_Exposed = False; + // --- Option Explicit #define MaxPos ((long)1024) @@ -39,6 +40,8 @@ int LastKey; int CheckSum; long nSize; +#if 0 + static void Class_Initialize() { int lSize; @@ -59,6 +62,8 @@ static void Class_Terminate() SET_TO_NOTHING(&SubBuffer, sizeof(SubBuffer)); } +#endif + void DemoBufferObject_Reset() { nSize = 0; @@ -77,7 +82,7 @@ long DemoBufferObject_Get_Size() Size = (nSize < 1 ? 0 : 0); if (! IS_NOTHING(&SubBuffer, sizeof(SubBuffer))) - Size = Size + SubBuffer_Size(); + Size = Size + SubBuffer.Size; return Size; } @@ -134,7 +139,7 @@ void DemoBufferObject_Let_FirstByte(byte NewVal) // End If // End Property -boolean DemoBufferObject_Serialize(int FNum) +boolean DemoBufferObject_Serialize(FILE *FNum) { boolean Serialize; @@ -142,7 +147,7 @@ boolean DemoBufferObject_Serialize(int FNum) Serialize = True; if (! IS_NOTHING(&SubBuffer, sizeof(SubBuffer))) - Serialize = SubBuffer_Serialize(FNum); + Serialize = SubBuffer.Serialize(FNum); if (nSize == 0) return Serialize; @@ -172,7 +177,7 @@ boolean DemoBufferObject_Serialize(int FNum) // AddDemoKey LKey return Serialize; -SerializeEH: + // SerializeEH: Serialize = False; return Serialize; @@ -220,6 +225,8 @@ void DemoBufferObject_SetSubBuffer(DemoBufferObject SBuf) SubBuffer = SBuf; } +#if 0 + static int RemoveLastDemoKey() { static int RemoveLastDemoKey; @@ -238,3 +245,5 @@ static int RemoveLastDemoKey() return RemoveLastDemoKey; } + +#endif diff --git a/src/game_sp/DemoBufferObject.h b/src/game_sp/DemoBufferObject.h index 464db73e..f22e24b4 100644 --- a/src/game_sp/DemoBufferObject.h +++ b/src/game_sp/DemoBufferObject.h @@ -18,7 +18,7 @@ extern byte DemoBufferObject_Get_FirstByte(); extern long DemoBufferObject_Get_Size(); extern void DemoBufferObject_Let_FirstByte(byte NewVal); extern void DemoBufferObject_Reset(); -extern boolean DemoBufferObject_Serialize(int FNum); +extern boolean DemoBufferObject_Serialize(FILE *FNum); extern void DemoBufferObject_SetSubBuffer(DemoBufferObject SBuf); #endif /* DEMOBUFFEROBJECT_H */ diff --git a/src/game_sp/DirectDrawGlobals.c b/src/game_sp/DirectDrawGlobals.c index 4b96d9e3..7c028b75 100644 --- a/src/game_sp/DirectDrawGlobals.c +++ b/src/game_sp/DirectDrawGlobals.c @@ -4,7 +4,8 @@ #include "DirectDrawGlobals.h" -static char *VB_Name = "DirectDrawGlobals"; +// static char *VB_Name = "DirectDrawGlobals"; + // --- Option Explicit DirectX7 DirectX; diff --git a/src/game_sp/DirectXGlobals.c b/src/game_sp/DirectXGlobals.c index 3e2b0f79..9478bef4 100644 --- a/src/game_sp/DirectXGlobals.c +++ b/src/game_sp/DirectXGlobals.c @@ -4,7 +4,8 @@ #include "DirectXGlobals.h" -static char *VB_Name = "DirectXGlobals"; +// static char *VB_Name = "DirectXGlobals"; + // --- Option Explicit DirectX7 DirectX; diff --git a/src/game_sp/Display.c b/src/game_sp/Display.c index b34ffa53..f8da42e7 100644 --- a/src/game_sp/Display.c +++ b/src/game_sp/Display.c @@ -4,7 +4,8 @@ #include "Display.h" -static char *VB_Name = "modDisplay"; +// static char *VB_Name = "modDisplay"; + // --- Option Explicit int ScreenScrollXPos, ScreenScrollYPos; diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index baa11022..27aa1c56 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -7,7 +7,8 @@ static void CallAnimation(int si, byte bl); static boolean IsToBeAnimated(int bl); -static char *VB_Name = "modDoGameStuff"; +// static char *VB_Name = "modDoGameStuff"; + // --- Option Explicit int *AnimationPosTable; diff --git a/src/game_sp/Electrons.c b/src/game_sp/Electrons.c index 709583cf..5f77e738 100644 --- a/src/game_sp/Electrons.c +++ b/src/game_sp/Electrons.c @@ -4,7 +4,8 @@ #include "Electrons.h" -static char *VB_Name = "modElectron"; +// static char *VB_Name = "modElectron"; + // --- Option Explicit // ========================================================================== // SUBROUTINE @@ -101,7 +102,8 @@ int subElectronTurnLeft(int si, int bx) { int subElectronTurnLeft; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; ax = (TimerVar & 3); if (ax != 0) @@ -207,7 +209,8 @@ int subElectronTurnRight(int si, int bx) { int subElectronTurnRight; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; ax = (TimerVar & 3); if (ax != 0) @@ -313,7 +316,8 @@ int subElectronFromBelow(int si, int bx) { int subElectronFromBelow; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0xF; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -375,7 +379,8 @@ int subElectronFromRight(int si, int bx) { int subElectronFromRight; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0x17; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -436,7 +441,8 @@ int subElectronFromAbove(int si, int bx) { int subElectronFromAbove; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0x1F; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -497,7 +503,8 @@ int subElectronFromLeft(int si, int bx) { int subElectronFromLeft; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0x27; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/game_sp/ErrorReporting.c b/src/game_sp/ErrorReporting.c index 8cd7457d..b795d57e 100644 --- a/src/game_sp/ErrorReporting.c +++ b/src/game_sp/ErrorReporting.c @@ -7,7 +7,8 @@ static char * GetErrLogPath(); static char * GetTraceLogPath(); -static char *VB_Name = "modErrorReporting"; +// static char *VB_Name = "modErrorReporting"; + // --- Option Explicit static char *GetErrLogPath() @@ -48,7 +49,7 @@ void Trace(char *Source, char *Message) void ReportError(char *Source, char *Message) { char *Path; - int FNum; + FILE *FNum; boolean bIsOpen; Path = GetErrLogPath(); @@ -62,7 +63,7 @@ void ReportError(char *Source, char *Message) // --- On Error GoTo 0 -ReportErrorEH: + // ReportErrorEH: if (bIsOpen) fclose(FNum); } diff --git a/src/game_sp/Explosions.c b/src/game_sp/Explosions.c index b6b6ca80..6855088d 100644 --- a/src/game_sp/Explosions.c +++ b/src/game_sp/Explosions.c @@ -8,7 +8,7 @@ static void LetExplodeFieldSP(int tsi, int cx, int dh); static int subExplodeInfotron(int tsi, int cx); static int subExplodeZonk(int tsi, int cx); -static char *VB_Name = "modExplosions"; +// static char *VB_Name = "modExplosions"; // --- Option Explicit // ========================================================================== @@ -19,7 +19,8 @@ int subAnimateExplosion(int si) { int subAnimateExplosion; - int ax, bx, bl, X, Y; + // int ax, bx, bl, X, Y; + int ax, bl, X, Y; if (LowByte(PlayField16[si]) != fiExplosion) return subAnimateExplosion; @@ -73,7 +74,8 @@ loc_g_28D0: // explosion produces infotron void ExplodeFieldSP(int si) { - int ax, al, cx, dl, dh; + // int ax, al, cx, dl, dh; + int ax, cx, dl; ax = LowByte(PlayField16[si]); if (ax == fiHardWare) @@ -104,7 +106,7 @@ void ExplodeFieldSP(int si) LetExplodeFieldSP(si + FieldWidth, cx, dl); LetExplodeFieldSP(si + FieldWidth + 1, cx, dl); -loc_g_2C3B: + // loc_g_2C3B: subSoundFXExplosion(); } // ExplodeFieldSP @@ -306,7 +308,7 @@ int subFollowUpExplosions() int ax, si; -locloop_g_2919: + // locloop_g_2919: for (si = 0; si <= LevelMax; si++) { ax = ByteToInt(PlayField8[si]); diff --git a/src/game_sp/FakeDeclares.c b/src/game_sp/FakeDeclares.c index c6ed578e..98fa900c 100644 --- a/src/game_sp/FakeDeclares.c +++ b/src/game_sp/FakeDeclares.c @@ -4,9 +4,10 @@ #include "FakeDeclares.h" -static void subUpdateHallOfFame(); +// static void subUpdateHallOfFame(); + +// static char *VB_Name = "FakeDeclares"; -static char *VB_Name = "FakeDeclares"; // --- Option Explicit // --- Option Compare Binary @@ -71,10 +72,14 @@ int UpdateTimeFlag; // boolean bModified; boolean ModifiedFlag; +#if 0 + static void subUpdateHallOfFame() { } +#endif + boolean Get_ModifiedFlag() { // boolean ModifiedFlag; diff --git a/src/game_sp/FancyRestore.c b/src/game_sp/FancyRestore.c index e31dfeb9..f1347027 100644 --- a/src/game_sp/FancyRestore.c +++ b/src/game_sp/FancyRestore.c @@ -4,7 +4,8 @@ #include "FancyRestore.h" -static char *VB_Name = "modFancy"; +// static char *VB_Name = "modFancy"; + // --- Option Explicit // ========================================================================== diff --git a/src/game_sp/GeneralTricks.c b/src/game_sp/GeneralTricks.c index 19de0d6c..4caed2f0 100644 --- a/src/game_sp/GeneralTricks.c +++ b/src/game_sp/GeneralTricks.c @@ -4,7 +4,8 @@ #include "GeneralTricks.h" -static char *VB_Name = "GeneralTricks_Module"; +// static char *VB_Name = "GeneralTricks_Module"; + // --- Option Explicit // --- Option Compare Text @@ -21,7 +22,7 @@ double ValEx(char *TS) if (i != 0) { LS = Left(TS, i - 1); - RS = Right(TS, Len(TS) - i); + RS = Right(TS, strlen(TS) - i); ValEx = Val(CAT(LS, ".", RS)); } else @@ -42,6 +43,8 @@ void DEC(int *VAR, int Delta) *VAR = *VAR - Delta; } +#if 0 + char *MySplit(char *TS, char *Sep, long SCount) { char *MySplit; @@ -51,8 +54,8 @@ char *MySplit(char *TS, char *Sep, long SCount) char *RA; T = TS; - L = Len(TS); - SL = Len(Sep); + L = strlen(TS); + SL = strlen(Sep); J = SCount; if (J < 1) { @@ -93,7 +96,10 @@ char *MySplit(char *TS, char *Sep, long SCount) break; q = q + 1; +#if 0 + /* !!! CHECK IF THIS IS REALLY NEEDED !!! */ RA[q] = Mid(T, i, k - i); +#endif } i = k + SL; @@ -127,13 +133,15 @@ char *MySplit(char *TS, char *Sep, long SCount) return MySplit; } +#endif + void MyReplace(char *TS, char *Pat1, char *Pat2) { long k, SL1, SL2, TL; - TL = Len(TS); - SL1 = Len(Pat1); - SL2 = Len(Pat2); + TL = strlen(TS); + SL1 = strlen(Pat1); + SL2 = strlen(Pat2); k = InStr(1, TS, Pat1); if (k == 0) return; diff --git a/src/game_sp/Globals.c b/src/game_sp/Globals.c index abba5793..40caf810 100644 --- a/src/game_sp/Globals.c +++ b/src/game_sp/Globals.c @@ -7,7 +7,8 @@ static void ReadDemo(); void ReadLevel(); -static char *VB_Name = "modGlobals"; +// static char *VB_Name = "modGlobals"; + // --- Option Explicit // --- Option Compare Text // --- Option Base 0 diff --git a/src/game_sp/Infotrons.c b/src/game_sp/Infotrons.c index bcede9d4..75c18a8e 100644 --- a/src/game_sp/Infotrons.c +++ b/src/game_sp/Infotrons.c @@ -4,7 +4,8 @@ #include "Infotrons.h" -static char *VB_Name = "modInfotron"; +// static char *VB_Name = "modInfotron"; + // --- Option Explicit // ========================================================================== @@ -19,8 +20,10 @@ int subAnimateInfotrons(int si) int tFld; // PseudoRegisters: - int ax, bx, cx, dx, di, X, Y; - int ah, bh, ch, dh, al, bl, cl, dl; + // int ax, bx, cx, dx, di, X, Y; + // int ah, bh, ch, dh, al, bl, cl, dl; + int ax, bx, dx, X, Y; + int al, bl; tFld = PlayField16[si]; if ((tFld & 0xFF) != fiInfotron) diff --git a/src/game_sp/InitGameConditions.c b/src/game_sp/InitGameConditions.c index f1c0f2e1..ccbd2147 100644 --- a/src/game_sp/InitGameConditions.c +++ b/src/game_sp/InitGameConditions.c @@ -4,7 +4,8 @@ #include "InitGameConditions.h" -static char *VB_Name = "modInitGameConditions"; +// static char *VB_Name = "modInitGameConditions"; + // --- Option Explicit // ========================================================================== @@ -125,8 +126,10 @@ int subConvertToEasySymbols() { int subConvertToEasySymbols; - int ax, bx, cx, dx, di, X, Y, i; - int ah, bh, ch, dh, al, bl, cl, dl, ZF; + // int ax, bx, cx, dx, di, X, Y, i; + // int ah, bh, ch, dh, al, bl, cl, dl, ZF; + int ax, bx, cx, dx, i; + int al; bx = 0; dx = 0; diff --git a/src/game_sp/Input.c b/src/game_sp/Input.c index 24438057..a7ac7798 100644 --- a/src/game_sp/Input.c +++ b/src/game_sp/Input.c @@ -4,7 +4,8 @@ #include "Input.h" -static char *VB_Name = "modInput"; +// static char *VB_Name = "modInput"; + // --- Option Explicit boolean KeyState[255 + 1]; @@ -148,7 +149,7 @@ int subProcessKeyboardInput() // Call DKeyboard.Unacquire return subProcessKeyboardInput; -NoKeyboardAccessEH: + // NoKeyboardAccessEH: Debug.Print("! Keyboard access"); return subProcessKeyboardInput; diff --git a/src/game_sp/LevelSetPreviewForm.c b/src/game_sp/LevelSetPreviewForm.c index b5d0b599..0482f864 100644 --- a/src/game_sp/LevelSetPreviewForm.c +++ b/src/game_sp/LevelSetPreviewForm.c @@ -32,10 +32,11 @@ // --- End // --- End -static char *VB_Name = "LevelSetPreviewForm"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = False; -static boolean VB_PredeclaredId = True; -static boolean VB_Exposed = False; +// static char *VB_Name = "LevelSetPreviewForm"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = False; +// static boolean VB_PredeclaredId = True; +// static boolean VB_Exposed = False; + // --- Option Explicit diff --git a/src/game_sp/MainForm.c b/src/game_sp/MainForm.c index f2fe86fd..2fe26339 100644 --- a/src/game_sp/MainForm.c +++ b/src/game_sp/MainForm.c @@ -661,11 +661,12 @@ void DrawFieldNoAnimated(int X, int Y); // --- End // --- End -static char *VB_Name = "MainForm"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = False; -static boolean VB_PredeclaredId = True; -static boolean VB_Exposed = False; +// static char *VB_Name = "MainForm"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = False; +// static boolean VB_PredeclaredId = True; +// static boolean VB_Exposed = False; + // --- Option Explicit // --- Option Compare Text @@ -699,6 +700,8 @@ TickCountObject T; const char *AppTitle = "MegaPlex"; +#if 0 + static char *GetSpeedDescriptionFPS(currency FrameDelayUS) { static char *GetSpeedDescriptionFPS; @@ -775,8 +778,6 @@ static int GetSpeedIndex(long DelayUS) return GetSpeedIndex; } -#if 0 - static long Get_LastOpenFilter() { static long LastOpenFilter; @@ -858,6 +859,8 @@ static void CountDown(long HalfSeconds, int bDisplayBar) // lblFrameCount = 0 } +#if 0 + static char *GetValidTempPath() { static char *GetValidTempPath; @@ -904,8 +907,6 @@ static char *GetValidTempPath() return GetValidTempPath; } -#if 0 - static char *GetMyTempFileName() { static char *GetMyTempFileName; @@ -1298,8 +1299,6 @@ static void Form_KeyUp(int KeyCode, int Shift) picPane_KeyUp(KeyCode, Shift); } -#endif - static void Form_Load() { #if 0 @@ -1360,8 +1359,6 @@ static void Form_Load() #endif } -#if 0 - static void FillLevelList(char *Path, int LevelIndex) { long FNum, LevLen, i, iMax; @@ -1617,6 +1614,8 @@ static void DrawFrame(int Delta) } } +#if 0 + static void RestoreFrame() { int i, LX, tY, RX, BY; @@ -1638,8 +1637,6 @@ static void RestoreFrame() } } -#if 0 - static void Form_Unload(int Cancel) { EndFlag = True; diff --git a/src/game_sp/MainForm.h b/src/game_sp/MainForm.h index b0a34593..20f71d6e 100644 --- a/src/game_sp/MainForm.h +++ b/src/game_sp/MainForm.h @@ -27,5 +27,6 @@ extern void menDemoSpeed_Click(int Index); extern void menEdit_Click(); extern void menPlaySpeed_Click(int Index); extern void menStop_Click(); +extern void menPlay_Click(); #endif /* MAINFORM_H */ diff --git a/src/game_sp/MainGameLoop.c b/src/game_sp/MainGameLoop.c index 9aa59aac..a57bdd79 100644 --- a/src/game_sp/MainGameLoop.c +++ b/src/game_sp/MainGameLoop.c @@ -4,7 +4,8 @@ #include "MainGameLoop.h" -static char *VB_Name = "modMainGameLoop"; +// static char *VB_Name = "modMainGameLoop"; + // --- Option Explicit int GameLoopRunning; @@ -25,7 +26,8 @@ int subMainGameLoop() { int subMainGameLoop; - int al, bx; + // int al, bx; + int bx; TickCountObject Clock; currency LastFrame; @@ -112,7 +114,8 @@ locRepeatMainGameLoop: // start repeating game loop // Call subConvertToEasySymbols ' Convert to easy symbols // End If -loc_g_186F: + // loc_g_186F: + subProcessKeyboardInput(); // Check keyboard, act on keys // 'HACK: // TimerVar = TimerVar + 1 diff --git a/src/game_sp/Marker.c b/src/game_sp/Marker.c index 9f0ac946..d83bc671 100644 --- a/src/game_sp/Marker.c +++ b/src/game_sp/Marker.c @@ -4,7 +4,7 @@ #include "Marker.h" -static boolean IsPort(long i); +// static boolean IsPort(long i); static void LimitXY(int *X, int *Y); static void SortData(); @@ -17,11 +17,12 @@ static void SortData(); // --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject // --- END -static char *VB_Name = "MarkerObject"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = True; -static boolean VB_PredeclaredId = False; -static boolean VB_Exposed = False; +// static char *VB_Name = "MarkerObject"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = True; +// static boolean VB_PredeclaredId = False; +// static boolean VB_Exposed = False; + // --- Option Explicit long mIndex1, mIndex2; @@ -106,12 +107,14 @@ void Marker_SetPoint2(int X, int Y) static void SortData() { - int Tmp; + // int Tmp; XMin = (X2 < X1 ? X2 : X2); YMin = (Y2 < Y1 ? Y2 : Y2); } +#if 0 + void Marker_ShowMarker(boolean ShowFlag) { mVisible = ShowFlag; @@ -213,7 +216,7 @@ void Marker_Copy() SelectionData = REDIM_1D(sizeof(byte), 0, 1 - 1); return; -CopyEH: + // CopyEH: Beep(); } @@ -256,15 +259,15 @@ void Marker_Paste() Tmp = FieldWidth * (YMin + Y) + XMin + X; // --- On Error GoTo PasteEH - DisPlayField[Tmp] = SelectionData[X, Y]; - PlayField16[Tmp] = UnEdSprite(SelectionData[X, Y]); + DisPlayField[Tmp] = SelectionData[X][Y]; + PlayField16[Tmp] = UnEdSprite(SelectionData[X][Y]); // --- On Error GoTo 0 } } Let_ModifiedFlag(True); -PasteEH: + // PasteEH: Beep(); } @@ -272,3 +275,5 @@ static void Class_Initialize() { mVisible = False; } + +#endif diff --git a/src/game_sp/Murphy.c b/src/game_sp/Murphy.c index 29de96d1..b4c16780 100644 --- a/src/game_sp/Murphy.c +++ b/src/game_sp/Murphy.c @@ -7,7 +7,8 @@ static void subEatRedDisk(int si); static boolean subMoveKillsMurphy(int si, int ax, int bl); -static char *VB_Name = "modMurphy"; +// static char *VB_Name = "modMurphy"; + // --- Option Explicit #define LocalStretch (1) @@ -21,8 +22,10 @@ int subAnimateMurphy(int si) { int subAnimateMurphy; - int ax, al, ah, bx, bl, i, X, Y; - int tX, tY, tDeltaX, tDeltaY, tPos, Tmp; + // int ax, al, ah, bx, bl, i, X, Y; + // int tX, tY, tDeltaX, tDeltaY, tPos, Tmp; + int ax, al, bx, bl, i, X, Y; + int tDeltaX, tDeltaY, tPos, Tmp; // Variables that hold information about the animation sequence int *dx; // an array of image positions in moving.mpx, finalized with -1 diff --git a/src/game_sp/OrangeDisk.c b/src/game_sp/OrangeDisk.c index 3a383b32..279ba876 100644 --- a/src/game_sp/OrangeDisk.c +++ b/src/game_sp/OrangeDisk.c @@ -4,7 +4,8 @@ #include "OrangeDisk.h" -static char *VB_Name = "modOrangeDisk"; +// static char *VB_Name = "modOrangeDisk"; + // --- Option Explicit // ========================================================================== // SUBROUTINE diff --git a/src/game_sp/PathTools.c b/src/game_sp/PathTools.c index c1aafcb4..a3875ae9 100644 --- a/src/game_sp/PathTools.c +++ b/src/game_sp/PathTools.c @@ -4,7 +4,8 @@ #include "PathTools.h" -static char *VB_Name = "PathTools_Module"; +// static char *VB_Name = "PathTools_Module"; + // --- Option Explicit // --- Option Compare Text @@ -166,7 +167,7 @@ char *StripExtensionlessFileName(char *Path) char *StripExtensionlessFileName; char *T, *T2; - long i, iSlash; + // long i, iSlash; T = StripFileName(Path); T2 = StripExtension(Path); @@ -245,7 +246,7 @@ boolean FilesEqual(char *Path1, char *Path2) { boolean FilesEqual; - int FNum1, FNum2; + FILE *FNum1, *FNum2; long nSize, i; boolean b1Open, b2Open; byte *bin1, *bin2; @@ -289,12 +290,15 @@ boolean FilesEqual(char *Path1, char *Path2) FilesEqual = True; return FilesEqual; +#if 0 FilesEqualEH: if (b1Open) - Close(FNum1); + fclose(FNum1); if (b2Open) - Close(FNum2); + fclose(FNum2); return FilesEqual; +#endif + } diff --git a/src/game_sp/SettingsObject.c b/src/game_sp/SettingsObject.c index 06c656b9..a241fe50 100644 --- a/src/game_sp/SettingsObject.c +++ b/src/game_sp/SettingsObject.c @@ -13,14 +13,17 @@ // --- MTSTransactionMode = 0 'NotAnMTSObject // NotAnMTSObject // --- END -static char *VB_Name = "SettingsObject"; -static boolean VB_GlobalNameSpace = False; -static boolean VB_Creatable = True; -static boolean VB_PredeclaredId = False; -static boolean VB_Exposed = False; +// static char *VB_Name = "SettingsObject"; +// static boolean VB_GlobalNameSpace = False; +// static boolean VB_Creatable = True; +// static boolean VB_PredeclaredId = False; +// static boolean VB_Exposed = False; + // --- Option Explicit // --- Option Compare Text +#if 0 + const char *AppName = "MegaPlex"; const char *Config = "Config"; @@ -38,3 +41,4 @@ int SettingsObject_Read(char *ValName, int Default) return Read; } +#endif diff --git a/src/game_sp/SnikSnaks.c b/src/game_sp/SnikSnaks.c index 13214817..f19039b2 100644 --- a/src/game_sp/SnikSnaks.c +++ b/src/game_sp/SnikSnaks.c @@ -17,7 +17,8 @@ static int subSnikSnakFromRight(int si, int bx); static int subSnikSnakTurnLeft(int si, int bx); static int subSnikSnakTurnRight(int si, int bx); -static char *VB_Name = "modSnikSnak"; +// static char *VB_Name = "modSnikSnak"; + // --- Option Explicit // ========================================================================== // SUBROUTINE @@ -117,7 +118,8 @@ static int subSnikSnakTurnLeft(int si, int bx) { static int subSnikSnakTurnLeft; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, ah, bl, X, Y; ax = (TimerVar & 3); if (ax != 0) @@ -240,7 +242,8 @@ static int subSnikSnakTurnRight(int si, int bx) { static int subSnikSnakTurnRight; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, ah, bl, X, Y; ax = (TimerVar & 3); if (ax != 0) @@ -363,7 +366,8 @@ static int subSnikSnakFromBelow(int si, int bx) { static int subSnikSnakFromBelow; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0xF; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -425,7 +429,8 @@ static int subSnikSnakFromRight(int si, int bx) { static int subSnikSnakFromRight; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0x17; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -486,7 +491,8 @@ static int subSnikSnakFromAbove(int si, int bx) { static int subSnikSnakFromAbove; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0x1F; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -547,7 +553,8 @@ static int subSnikSnakFromLeft(int si, int bx) { static int subSnikSnakFromLeft; - int ax, ah, bl, dx, X, Y; + // int ax, ah, bl, dx, X, Y; + int ax, bl, X, Y; bx = bx - 0x27; // get and increment sequence# // +++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/game_sp/Sound.c b/src/game_sp/Sound.c index 3965e752..61c82b00 100644 --- a/src/game_sp/Sound.c +++ b/src/game_sp/Sound.c @@ -4,7 +4,8 @@ #include "Sound.h" -static char *VB_Name = "modSound"; +// static char *VB_Name = "modSound"; + // --- Option Explicit int MusicOnFlag; diff --git a/src/game_sp/TickCountObject.c b/src/game_sp/TickCountObject.c index ed9c50ef..9c8ba48a 100644 --- a/src/game_sp/TickCountObject.c +++ b/src/game_sp/TickCountObject.c @@ -20,8 +20,8 @@ // static boolean VB_Exposed = False; // --- Option Explicit -#define LongMin (-(double)2147483648) // the "#" sign is a bug of the VB environment AutoFormat function but causes no real problems; don't worry 'bout it! -#define LongMax (2147483647) +#define LongMin (-(double)2147483648UL) // the "#" sign is a bug of the VB environment AutoFormat function but causes no real problems; don't worry 'bout it! +#define LongMax (2147483647UL) long GetTickCount(); long QueryPerformanceCounter(currency lpPerformanceCount); @@ -60,14 +60,14 @@ void TickCountObject_DelayMS(long MSInterval, boolean DoEventsFlag) // in ms { currency Start; - Start = TickNow(); + Start = TickCountObject_Get_TickNow(); DelayLoopActive = True; do { if (DoEventsFlag) DoEvents(); - if (MSInterval <= TickDiffMS(Start) && ! MPause) + if (MSInterval <= TickCountObject_TickDiffMS(Start) && ! MPause) break; } while (1); @@ -130,7 +130,7 @@ long TickCountObject_TickDiffS(currency TickStart) TickDiffS = NewTick - TickStart; } - TickDiffS = Int(TickDiffS / 1000); + TickDiffS = (int)(TickDiffS / 1000); } return TickDiffS; diff --git a/src/game_sp/vb_lib.c b/src/game_sp/vb_lib.c index 4b1e5cfc..6cdfdec1 100644 --- a/src/game_sp/vb_lib.c +++ b/src/game_sp/vb_lib.c @@ -11,136 +11,168 @@ /* helper functions for constructs not supported by C */ void *REDIM_1D(int a, int b, int c) { + return 0; } void *REDIM_2D(int a, int b, int c, int d, int e) { + return 0; } boolean IS_NOTHING(void *a, int b) { + return 0; } void SET_TO_NOTHING(void *a, int b) { + return; } void MESSAGE_BOX(char *a) { + return; } char *CAT(const char *a, ...) { + return 0; } char *GET_PATH(char *a, ...) { + return 0; } char *INT_TO_STR(int a) { + return 0; } boolean STRING_IS_LIKE(char *a, char *b) { + return 0; } int FILE_GET(FILE *a, int b, void *c, int d) { + return 0; } int FILE_PUT(FILE *a, int b, void *c, int d) { + return 0; } /* this is just a workaround -- handle array definitions later */ void *Array(int a, ...) { + return 0; } /* VB functions that do not return "int" (and would cause compiler errors) */ double Val(char *a) { + return 0; } char *Left(char *a, int b) { + return 0; } char *left(char *a, int b) { + return 0; } char *Right(char *a, int b) { + return 0; } char *right(char *a, int b) { + return 0; } char *StrReverse(char *a) { + return 0; } int InStr(int a, char *b, char *c) { + return 0; } char *Dir(char *a) { + return 0; } char *Dir_Without_Args() { + return 0; } void Kill(char *a) { + return; } char *Chr(int a) { + return 0; } char *String(int a, char *b) { + return 0; } void MkDir(char *a) { + return; } char *Hex(int a) { + return 0; } int FileLen(char *a) { + return 0; } long GetTickCount() { + return 0; } int GetAttr(char *a) { + return 0; } void DoEvents() { + return; } void SaveSetting(const char * a, const char *b, char *c, int d) { + return; } long GetTempPath(long a, char *b) { + return 0; } diff --git a/src/game_sp/vb_types.h b/src/game_sp/vb_types.h index 02758feb..ae6ca089 100644 --- a/src/game_sp/vb_types.h +++ b/src/game_sp/vb_types.h @@ -106,6 +106,7 @@ typedef struct void (*GetSurfaceDesc)(DDSURFACEDESC2); void (*SetClipper)(DirectDrawClipper); // long (*Blt)(RECT, DirectDrawSurface7, RECT, int); + long (*Blt)(RECT, void *, RECT, int); void (*BltColorFill)(RECT, int); } DirectDrawSurface7;