From: ShadowFlare Date: Tue, 1 Sep 2009 11:27:13 +0000 (-0600) Subject: Disable Git line ending conversions for some files. X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?a=commitdiff_plain;p=grpapi.git Disable Git line ending conversions for some files. --- diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cfa5ec2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.bas -crlf +*.sln -crlf +*.vcproj -crlf diff --git a/drawgrp/drawgrp.vcproj b/drawgrp/drawgrp.vcproj index a5b64e7..6a46890 100644 --- a/drawgrp/drawgrp.vcproj +++ b/drawgrp/drawgrp.vcproj @@ -1,329 +1,329 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grpapi/GrpApi.bas b/grpapi/GrpApi.bas index eeb709c..1df2086 100644 --- a/grpapi/GrpApi.bas +++ b/grpapi/GrpApi.bas @@ -1,106 +1,106 @@ -Attribute VB_Name = "GrpApi" -Option Explicit - -' ShadowFlare GRP Library. (c) ShadowFlare Software 2002-2008 -' License information for this code is in license.txt - -' Any comments or suggestions are accepted at blakflare@hotmail.com (ShadowFlare) - -Type GRPHEADER - nFrames As Integer - wMaxWidth As Integer - wMaxHeight As Integer -End Type - -Public Const HORIZONTAL_FLIP As Long = &H1& ' Flips the graphic horizontally -Public Const VERTICAL_FLIP As Long = &H2& ' Flips the graphic vertically -Public Const SHADOW_COLOR As Long = &H4& ' Causes the graphic to be drawn in one color - ' Second byte of flags is the red component of - ' the shadow's color, third byte is green, - ' fourth byte is blue; like this: - ' 'SHADOW_COLOR Or &HBBGGRR00' -Public Const ALPHA_BLEND As Long = &H8& ' Blends the graphic with what it is being drawn over. - ' The dwAlpha parameter will only be used when this - ' flag is specified. dwAlpha is an RGB value - ' (&HBBGGRR). - ' Note: Because of the extra calculations required, - ' alpha blended graphics take longer to draw -Public Const USE_INDEX As Long = &H10& ' Only valid when used with a custom SetPixel function. - ' This flag cannot be used in combination with - ' ALPHA_BLEND or SHADOW_COLOR - ' When this flag is used, the index to a color in the - ' palette will be passed to your custom SetPixel - ' function instead of the actual color. - -' Palette is an array of 256 Longs. Pass the first element of the array to these functions, -' rather than the actual array -' For LoadPalette and LoadGrp, lpFileName may be a file in an open mpq archive -' or a file not in an archive -Declare Function LoadPalette Lib "Grpapi.dll" (ByVal lpFileName As String, dwPalette As Long) As Boolean -Declare Function LoadGrp Lib "Grpapi.dll" (ByVal lpFileName As String) As Long -Declare Function DestroyGrp Lib "Grpapi.dll" (ByVal hGrp As Long) As Boolean -Declare Function DrawGrp Lib "Grpapi.dll" (ByVal hGrp As Long, ByVal hdcDest As Long, ByVal nXDest As Long, ByVal nYDest As Long, ByVal nFrame As Integer, dwPalette As Long, ByVal dwFlags As Long, ByVal dwAlpha As Long) As Boolean -Declare Function GetGrpInfo Lib "Grpapi.dll" (ByVal hGrp As Long, GrpInfo As GRPHEADER) As Boolean -Declare Function GetGrpFrameInfo Lib "Grpapi.dll" (ByVal hGrp As Long, ByVal nFrame As Integer, ByRef nLeft As Long, ByRef nTop As Long, ByRef nWidth As Long, ByRef nHeight As Long) As Boolean - -Declare Function GetDC Lib "User32.dll" (ByVal hWnd As Long) As Long -Declare Function ReleaseDC Lib "User32.dll" (ByVal hWnd As Long, ByVal hDC As Long) As Long - -' An array of the raw image data to encode should be passed to lpImageData. To do this, -' pass the first byte of the array to the function. The size of the buffer containing -' the data should be nFrames * wMaxWidth * wMaxHeight * 2 -' and the values should be arranged row by row of the frame, with the top row first. -' After all the rows of a frame have been put into the buffer, the rows of the next frame -' go after it. For transparent pixels, they should be set to -1. All other pixels should -' have the high order byte set to zero, meaning that they should not be negative and the -' values should not exceed 255 (&HFF). The values used for the colors are indexes into the -' color palette. -' Pass True to bNoCompress if you need an uncompressed GRP. -' Pass a variable to nGrpSize to receive the size in bytes of the resulting encoded GRP. -' The return value of this function is actually a pointer to the GRP data. This is what your -' program should save to a file. The size of this buffer is the value received by nGrpSize. -' When your program is done with the returned buffer, it should call DestroyGrp on the -' buffer that was returned by this function to free up the memory from it. -' The pointer returned by this function can also be directly used by DrawGrp or GetGrpInfo. -Declare Function CreateGrp Lib "Grpapi.dll" (ByRef lpImageData As Integer, ByVal nFrames As Integer, ByVal wMaxWidth As Integer, ByVal wMaxHeight As Integer, ByVal bNoCompress As Boolean, ByRef nGrpSize As Long) As Long - -' Use this function to make a copy the memory at the location returned by CreateGrp. -' Pass the address ByVal to Source. Pass either a byte array or a string to Destination. -' The size of the array or string must be at least the size of the GRP data before -' attempting to copy it to the array or string. -' To pass a byte array, pass the first byte of the array ByRef. To pass a string, -' pass the string ByVal. -Declare Sub CopyMemory Lib "Kernel32.dll" _ - Alias "RtlMoveMemory" ( _ - ByRef Destination As Any, _ - ByRef Source As Any, _ - ByVal Length As Long) - -' Call these to have DrawGrp use custom functions for reading and drawing pixels -' so that you can have it read from and write to a buffer, for example. -' Requires Visual Basic 5 or higher -' -' The functions must be in this form: -' -' Function GetPixelProc (ByRef value As any_type, ByVal X As Long, ByVal Y As Long) As Long -' Sub SetPixelProc (ByRef value As any_type, ByVal X As Long, ByVal Y As Long, ByVal clrColor As Long) -' -' or -' -' Function GetPixelProc (ByVal value As any_type, ByVal X As Long, ByVal Y As Long) As Long -' Sub SetPixelProc (ByVal value As any_type, ByVal X As Long, ByVal Y As Long, ByVal clrColor As Long) -' -' Replace "any_type" with whatever type you want (but must be 4 bytes long if ByVal). -' This parameter gets the data from DrawGrp's hdcDest parameter. You can either pass -' a number to DrawGrp and use the "ByVal" versions of the above functions, or you can -' use AddressOf to get a reference to a variable and use it for the "ByRef" versions. -' GetPixelProc should return an RGB color value. -Declare Sub SetFunctionGetPixel Lib "Grpapi.dll" (lpGetPixelProc As Long) -Declare Sub SetFunctionSetPixel Lib "Grpapi.dll" (lpSetPixelProc As Long) - -' Call this to make a different Storm.dll-compatible MPQ library be used (like SFMPQ). -Declare Function SetMpqDll Lib "Grpapi.dll" (ByVal lpDllFileName As String) As Boolean - -' These no longer need to be called -Declare Function LoadGrpApi Lib "Grpapi.dll" () As Boolean -Declare Sub FreeGrpApi Lib "Grpapi.dll" () +Attribute VB_Name = "GrpApi" +Option Explicit + +' ShadowFlare GRP Library. (c) ShadowFlare Software 2002-2008 +' License information for this code is in license.txt + +' Any comments or suggestions are accepted at blakflare@hotmail.com (ShadowFlare) + +Type GRPHEADER + nFrames As Integer + wMaxWidth As Integer + wMaxHeight As Integer +End Type + +Public Const HORIZONTAL_FLIP As Long = &H1& ' Flips the graphic horizontally +Public Const VERTICAL_FLIP As Long = &H2& ' Flips the graphic vertically +Public Const SHADOW_COLOR As Long = &H4& ' Causes the graphic to be drawn in one color + ' Second byte of flags is the red component of + ' the shadow's color, third byte is green, + ' fourth byte is blue; like this: + ' 'SHADOW_COLOR Or &HBBGGRR00' +Public Const ALPHA_BLEND As Long = &H8& ' Blends the graphic with what it is being drawn over. + ' The dwAlpha parameter will only be used when this + ' flag is specified. dwAlpha is an RGB value + ' (&HBBGGRR). + ' Note: Because of the extra calculations required, + ' alpha blended graphics take longer to draw +Public Const USE_INDEX As Long = &H10& ' Only valid when used with a custom SetPixel function. + ' This flag cannot be used in combination with + ' ALPHA_BLEND or SHADOW_COLOR + ' When this flag is used, the index to a color in the + ' palette will be passed to your custom SetPixel + ' function instead of the actual color. + +' Palette is an array of 256 Longs. Pass the first element of the array to these functions, +' rather than the actual array +' For LoadPalette and LoadGrp, lpFileName may be a file in an open mpq archive +' or a file not in an archive +Declare Function LoadPalette Lib "Grpapi.dll" (ByVal lpFileName As String, dwPalette As Long) As Boolean +Declare Function LoadGrp Lib "Grpapi.dll" (ByVal lpFileName As String) As Long +Declare Function DestroyGrp Lib "Grpapi.dll" (ByVal hGrp As Long) As Boolean +Declare Function DrawGrp Lib "Grpapi.dll" (ByVal hGrp As Long, ByVal hdcDest As Long, ByVal nXDest As Long, ByVal nYDest As Long, ByVal nFrame As Integer, dwPalette As Long, ByVal dwFlags As Long, ByVal dwAlpha As Long) As Boolean +Declare Function GetGrpInfo Lib "Grpapi.dll" (ByVal hGrp As Long, GrpInfo As GRPHEADER) As Boolean +Declare Function GetGrpFrameInfo Lib "Grpapi.dll" (ByVal hGrp As Long, ByVal nFrame As Integer, ByRef nLeft As Long, ByRef nTop As Long, ByRef nWidth As Long, ByRef nHeight As Long) As Boolean + +Declare Function GetDC Lib "User32.dll" (ByVal hWnd As Long) As Long +Declare Function ReleaseDC Lib "User32.dll" (ByVal hWnd As Long, ByVal hDC As Long) As Long + +' An array of the raw image data to encode should be passed to lpImageData. To do this, +' pass the first byte of the array to the function. The size of the buffer containing +' the data should be nFrames * wMaxWidth * wMaxHeight * 2 +' and the values should be arranged row by row of the frame, with the top row first. +' After all the rows of a frame have been put into the buffer, the rows of the next frame +' go after it. For transparent pixels, they should be set to -1. All other pixels should +' have the high order byte set to zero, meaning that they should not be negative and the +' values should not exceed 255 (&HFF). The values used for the colors are indexes into the +' color palette. +' Pass True to bNoCompress if you need an uncompressed GRP. +' Pass a variable to nGrpSize to receive the size in bytes of the resulting encoded GRP. +' The return value of this function is actually a pointer to the GRP data. This is what your +' program should save to a file. The size of this buffer is the value received by nGrpSize. +' When your program is done with the returned buffer, it should call DestroyGrp on the +' buffer that was returned by this function to free up the memory from it. +' The pointer returned by this function can also be directly used by DrawGrp or GetGrpInfo. +Declare Function CreateGrp Lib "Grpapi.dll" (ByRef lpImageData As Integer, ByVal nFrames As Integer, ByVal wMaxWidth As Integer, ByVal wMaxHeight As Integer, ByVal bNoCompress As Boolean, ByRef nGrpSize As Long) As Long + +' Use this function to make a copy the memory at the location returned by CreateGrp. +' Pass the address ByVal to Source. Pass either a byte array or a string to Destination. +' The size of the array or string must be at least the size of the GRP data before +' attempting to copy it to the array or string. +' To pass a byte array, pass the first byte of the array ByRef. To pass a string, +' pass the string ByVal. +Declare Sub CopyMemory Lib "Kernel32.dll" _ + Alias "RtlMoveMemory" ( _ + ByRef Destination As Any, _ + ByRef Source As Any, _ + ByVal Length As Long) + +' Call these to have DrawGrp use custom functions for reading and drawing pixels +' so that you can have it read from and write to a buffer, for example. +' Requires Visual Basic 5 or higher +' +' The functions must be in this form: +' +' Function GetPixelProc (ByRef value As any_type, ByVal X As Long, ByVal Y As Long) As Long +' Sub SetPixelProc (ByRef value As any_type, ByVal X As Long, ByVal Y As Long, ByVal clrColor As Long) +' +' or +' +' Function GetPixelProc (ByVal value As any_type, ByVal X As Long, ByVal Y As Long) As Long +' Sub SetPixelProc (ByVal value As any_type, ByVal X As Long, ByVal Y As Long, ByVal clrColor As Long) +' +' Replace "any_type" with whatever type you want (but must be 4 bytes long if ByVal). +' This parameter gets the data from DrawGrp's hdcDest parameter. You can either pass +' a number to DrawGrp and use the "ByVal" versions of the above functions, or you can +' use AddressOf to get a reference to a variable and use it for the "ByRef" versions. +' GetPixelProc should return an RGB color value. +Declare Sub SetFunctionGetPixel Lib "Grpapi.dll" (lpGetPixelProc As Long) +Declare Sub SetFunctionSetPixel Lib "Grpapi.dll" (lpSetPixelProc As Long) + +' Call this to make a different Storm.dll-compatible MPQ library be used (like SFMPQ). +Declare Function SetMpqDll Lib "Grpapi.dll" (ByVal lpDllFileName As String) As Boolean + +' These no longer need to be called +Declare Function LoadGrpApi Lib "Grpapi.dll" () As Boolean +Declare Sub FreeGrpApi Lib "Grpapi.dll" () diff --git a/grpapi/grpapi.sln b/grpapi/grpapi.sln index 4a887c1..aa06ccc 100644 --- a/grpapi/grpapi.sln +++ b/grpapi/grpapi.sln @@ -1,43 +1,43 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drawgrp", "..\drawgrp\drawgrp.vcproj", "{10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpapi", "grpapi.vcproj", "{08812E9C-7F03-4DCB-8828-F3BDB0728EC7}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grplib", "grplib.vcproj", "{66127C6F-39DA-4B7A-9856-789ED0139DCB}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Debug|Win32.ActiveCfg = Debug|Win32 - {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Debug|Win32.Build.0 = Debug|Win32 - {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Release|Win32.ActiveCfg = Release|Win32 - {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Release|Win32.Build.0 = Release|Win32 - {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Debug|Win32.ActiveCfg = Debug|Win32 - {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Debug|Win32.Build.0 = Debug|Win32 - {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Release|Win32.ActiveCfg = Release|Win32 - {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Release|Win32.Build.0 = Release|Win32 - {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Debug|Win32.ActiveCfg = Debug|Win32 - {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Debug|Win32.Build.0 = Debug|Win32 - {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Release|Win32.ActiveCfg = Release|Win32 - {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drawgrp", "..\drawgrp\drawgrp.vcproj", "{10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpapi", "grpapi.vcproj", "{08812E9C-7F03-4DCB-8828-F3BDB0728EC7}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grplib", "grplib.vcproj", "{66127C6F-39DA-4B7A-9856-789ED0139DCB}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Debug|Win32.ActiveCfg = Debug|Win32 + {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Debug|Win32.Build.0 = Debug|Win32 + {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Release|Win32.ActiveCfg = Release|Win32 + {10729DB2-5CEA-41BA-9C6F-B47BE5A3C242}.Release|Win32.Build.0 = Release|Win32 + {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Debug|Win32.ActiveCfg = Debug|Win32 + {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Debug|Win32.Build.0 = Debug|Win32 + {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Release|Win32.ActiveCfg = Release|Win32 + {08812E9C-7F03-4DCB-8828-F3BDB0728EC7}.Release|Win32.Build.0 = Release|Win32 + {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Debug|Win32.ActiveCfg = Debug|Win32 + {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Debug|Win32.Build.0 = Debug|Win32 + {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Release|Win32.ActiveCfg = Release|Win32 + {66127C6F-39DA-4B7A-9856-789ED0139DCB}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/grpapi/grpapi.vcproj b/grpapi/grpapi.vcproj index 063f310..2432a16 100644 --- a/grpapi/grpapi.vcproj +++ b/grpapi/grpapi.vcproj @@ -1,296 +1,296 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grpapi/grplib.vcproj b/grpapi/grplib.vcproj index d1d837d..56ca958 100644 --- a/grpapi/grplib.vcproj +++ b/grpapi/grplib.vcproj @@ -1,236 +1,236 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +