Current News Archived News Search News Discussion Forum Old Forum Install Programs More Downloads... Troubleshooting Source Code Format Specs. Misc. Information Non-SF Stuff Links Small banner for links to this site: |
diff --git a/drawgrp/drawgrp.cpp b/drawgrp/drawgrp.cpp
--- a/drawgrp/drawgrp.cpp
+++ b/drawgrp/drawgrp.cpp
if (pBI->nFrame == 0xFFFF)\r
pBI->pBuffer[(Y * pBI->nWidth) + X] = (signed short)clrColor;\r
else\r
- pBI->pBuffer[(pBI->nFrame * pBI->nWidth * pBI->nHeight) + (Y * pBI->nWidth) + X] = (signed short)clrColor;\r
+ //if (clrColor < 1 || clrColor > 13)\r
+ // pBI->pBuffer[(pBI->nFrame * pBI->nWidth * pBI->nHeight) + (Y * pBI->nWidth) + X] = (signed short)((BYTE)-clrColor);\r
+ //else\r
+ pBI->pBuffer[(pBI->nFrame * pBI->nWidth * pBI->nHeight) + (Y * pBI->nWidth) + X] = (signed short)clrColor;\r
}\r
\r
int main(int argc, char* argv[])\r
SFileOpenArchive(buffer,3000,0,&hMPQ3);\r
}\r
BufferInfo BI;\r
- LoadPalette("tileset\\Jungle.wpe",dwPalette);\r
+ LoadPalette("tileset\\Platform.wpe",dwPalette);\r
HANDLE hGrp, hGrp2;\r
if (argc>1)\r
hGrp = LoadGrp(argv[1]);\r
else\r
- hGrp = LoadGrp("unit\\zerg\\ultra.grp");\r
+ hGrp = LoadGrp("unit\\zerg\\zergling.grp");\r
HDC hDC = GetDC(0);\r
GRPHEADER GrpInfo;\r
if (GetGrpInfo(hGrp,&GrpInfo)==0) {GrpInfo.nFrames=0;GrpInfo.wMaxWidth=0;GrpInfo.wMaxHeight=0;}\r
BI.nWidth = GrpInfo.wMaxWidth;\r
BI.nHeight = GrpInfo.wMaxHeight;\r
+ //BI.nWidth = 255;\r
+ //BI.nHeight = 255;\r
BI.pBuffer = (signed short *)malloc(GrpInfo.nFrames * BI.nWidth * BI.nHeight * sizeof(short));\r
WORD i,x,y;\r
DWORD j, nGrpSize;\r
signed short clrPixel;\r
RECT rect;\r
for (i=0;i<GrpInfo.nFrames;i++) {\r
- for (j=0;j<8;j++)\r
+ for (j=0;j<16;j++)\r
{\r
rand_s(&u);\r
rand_s(&v);\r
u = u % 800;\r
v = v % 600;\r
- //DrawGrp(hGrp,hDC,u,v,i,dwPalette,ALPHA_BLEND,0x404040);\r
+ DrawGrp(hGrp,hDC,u,v,i,dwPalette,ALPHA_BLEND,0x404040);\r
}\r
}\r
SetFunctionGetPixel((GETPIXELPROC)ReadPixelFromBuffer);\r
SetFunctionSetPixel((SETPIXELPROC)WritePixelToBuffer);\r
for (i=0;i<GrpInfo.nFrames;i++) {\r
BI.nFrame = i;\r
- DrawGrp(hGrp,(HDC)&BI,0,0,i,0,USE_INDEX,0);\r
+ u = (BI.nWidth - GrpInfo.wMaxWidth) / 2;\r
+ v = (BI.nHeight - GrpInfo.wMaxHeight) / 2;\r
+ for (y = 0; y < BI.nHeight; y++) {\r
+ for (x = 0; x < BI.nWidth; x++) {\r
+ WritePixelToBuffer(&BI, x, y, -1);\r
+ }\r
+ }\r
+ DrawGrp(hGrp,(HDC)&BI,u,v,i,0,USE_INDEX,0);\r
}\r
hGrp2 = hGrp;\r
- hGrp = CreateGrp(BI.pBuffer, GrpInfo.nFrames, GrpInfo.wMaxWidth, GrpInfo.wMaxHeight, &nGrpSize);\r
+ hGrp = CreateGrp(BI.pBuffer, GrpInfo.nFrames, BI.nWidth, BI.nHeight, FALSE, &nGrpSize);\r
/*HANDLE hFile;\r
- hFile = CreateFile("generated ultralisk.grp", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);\r
+ hFile = CreateFile("generated zergling.grp", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);\r
if (hFile != INVALID_HANDLE_VALUE) {\r
WriteFile(hFile, hGrp, nGrpSize, &j, 0);\r
CloseHandle(hFile);\r
}*/\r
BI.nFrame = 0xFFFF;\r
j=0;\r
+ \r
for (i=0;i<GrpInfo.nFrames;i+=1) {\r
rect.left = rect.top = 0;\r
rect.right = rect.left + BI.nWidth;\r
if (clrPixel != -1) SetPixelV(hDC, 400 + i, 300 + j, dwPalette[clrPixel]);\r
}\r
//}\r
+ \r
ReleaseDC(0,hDC);\r
free(BI.pBuffer);\r
DestroyGrp(hGrp);\r
|