X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?a=blobdiff_plain;f=drawgrp%2Fdrawgrp.cpp;h=6ddab08a7d12bc188357c2b2f3aef4c7e9248caf;hb=20bc40c88eee9f6da2ba739ecd3f681334862491;hp=8d617368347469bfb7ba4c143c131dcb36879600;hpb=d1874f14b0ef294d396244b8d2e8da5a9079c365;p=grpapi.git diff --git a/drawgrp/drawgrp.cpp b/drawgrp/drawgrp.cpp index 8d61736..6ddab08 100644 --- a/drawgrp/drawgrp.cpp +++ b/drawgrp/drawgrp.cpp @@ -40,7 +40,10 @@ void WINAPI WritePixelToBuffer(BufferInfo *pBI, int X, int Y, COLORREF clrColor) if (pBI->nFrame == 0xFFFF) pBI->pBuffer[(Y * pBI->nWidth) + X] = (signed short)clrColor; else - pBI->pBuffer[(pBI->nFrame * pBI->nWidth * pBI->nHeight) + (Y * pBI->nWidth) + X] = (signed short)clrColor; + //if (clrColor < 1 || clrColor > 13) + // pBI->pBuffer[(pBI->nFrame * pBI->nWidth * pBI->nHeight) + (Y * pBI->nWidth) + X] = (signed short)((BYTE)-clrColor); + //else + pBI->pBuffer[(pBI->nFrame * pBI->nWidth * pBI->nHeight) + (Y * pBI->nWidth) + X] = (signed short)clrColor; } int main(int argc, char* argv[]) @@ -60,17 +63,19 @@ int main(int argc, char* argv[]) SFileOpenArchive(buffer,3000,0,&hMPQ3); } BufferInfo BI; - LoadPalette("tileset\\Jungle.wpe",dwPalette); + LoadPalette("tileset\\Platform.wpe",dwPalette); HANDLE hGrp, hGrp2; if (argc>1) hGrp = LoadGrp(argv[1]); else - hGrp = LoadGrp("unit\\zerg\\ultra.grp"); + hGrp = LoadGrp("unit\\zerg\\zergling.grp"); HDC hDC = GetDC(0); GRPHEADER GrpInfo; if (GetGrpInfo(hGrp,&GrpInfo)==0) {GrpInfo.nFrames=0;GrpInfo.wMaxWidth=0;GrpInfo.wMaxHeight=0;} BI.nWidth = GrpInfo.wMaxWidth; BI.nHeight = GrpInfo.wMaxHeight; + //BI.nWidth = 255; + //BI.nHeight = 255; BI.pBuffer = (signed short *)malloc(GrpInfo.nFrames * BI.nWidth * BI.nHeight * sizeof(short)); WORD i,x,y; DWORD j, nGrpSize; @@ -83,36 +88,39 @@ int main(int argc, char* argv[]) signed short clrPixel; RECT rect; for (i=0;i