This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program min_ogl; | |
uses | |
Windows, OpenGL; | |
var | |
pfd : TPixelFormatDescriptor; | |
DC : HDC; | |
begin | |
// Creating window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Calc(const CalcStr: string): string; | |
var | |
v : Variant; | |
begin | |
v := CreateOleObject('MSScriptControl.ScriptControl'); | |
v.Language := 'JScript'; | |
Result := v.Eval(CalcStr); | |
v := Unassigned; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lzo_compress(const Data; Size: LongInt; var CData; var CSize: LongInt; var WorkBuf): LongInt; cdecl; | |
asm | |
{$IFDEF WIN32} | |
jmp lzo_compress + $2F0 + 8 + 3 | |
{$ELSE} | |
pop ebp | |
lea eax, @dest + $2F0 | |
jmp eax | |
@dest: | |
{$ENDIF} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 24 to 16 | |
unsigned short color = (r & 0xF8) << 8 | (g & 0xFC) << 3 | b >> 3; | |
// 16 to 24 | |
unsigned int color = (c & 0xF800) << 8 | (c & 0x07E0) << 5 | (c & 0x001F) << 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TSHA1Digest = array [0..4] of LongWord; | |
TSHA1Block = array [0..63] of Byte; | |
TSHA1Context = record | |
State : TSHA1Digest; | |
Block : TSHA1Block; | |
Len : Int64; | |
Pos : LongInt; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type | |
TMD5Digest = array [0..3] of LongWord; | |
TMD5Block = array [0..63] of Byte; | |
TMD5Context = record | |
State : TMD5Digest; | |
Block : TMD5Block; | |
Len : Int64; | |
Pos : LongInt; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit unzip; | |
// based on C++ core "tiny inflate" by Joergen Ibsen / Jibz | |
// http://www.ibsensoftware.com/ | |
interface | |
type | |
TByteArray = array [Word] of Byte; | |
TWordArray = array [Word] of Word; | |
PByteArray = ^TByteArray; | |
PWordArray = ^TWordArray; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit xml; | |
interface | |
type | |
TXMLParam = record | |
Name : WideString; | |
Value : WideString; | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure Resample(const Data: PByteArray; const Width, Height: LongInt; out OutData: PByteArray; const OutWidth, OutHeight: LongInt); | |
var | |
i, j : LongInt; | |
f : array [0..1] of LongWord; | |
Row : array [0..1] of PByteArray; | |
Pix : array [0..3] of PByteArray; | |
p : array [0..1] of PLongArray; | |
Step : LongInt; | |
Buf : PByteArray; | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LoadGIF(const Stream: TStream; out Data: PByteArray; out Width, Height: LongInt): Boolean; | |
procedure DecompressLZW(InitCodeSize: Byte; Source, Dest: Pointer; PackedSize, UnpackedSize: LongInt); | |
const | |
NoLZWCode = 4096; | |
var | |
I: LongInt; | |
Data, Bits, Code : LongWord; | |
SourcePtr : ^Byte; | |
InCode : LongWord; |
OlderNewer