X-Git-Url: https://sfsrealm.hopto.org/projects/gitweb.cgi?a=blobdiff_plain;f=drawgrp%2Fdrawgrp.cpp;h=8521822492bd01b09de6c903673afef3d5ac30fd;hb=5dfa00a32cd188d483ee1a49ec24cbcf3eb74b17;hp=06af64f5f3936aefad6a010e4ae507606f713d05;hpb=58a8b78cdc107c2e6136f562e9453723c7322949;p=grpapi.git diff --git a/drawgrp/drawgrp.cpp b/drawgrp/drawgrp.cpp index 06af64f..8521822 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; @@ -82,37 +87,40 @@ int main(int argc, char* argv[]) }*/ signed short clrPixel; RECT rect; - for (i=0;i