Index: buildtool/buildtool.cpp |
— | — | @@ -28,7 +28,6 @@ |
29 | 29 | char pathbase[FILENAME_MAX+1];
|
30 | 30 | char pathin[FILENAME_MAX+1];
|
31 | 31 | char pathout[FILENAME_MAX+1];
|
32 | | - char command[1024];
|
33 | 32 | strncpy(pathbase,path,FILENAME_MAX);
|
34 | 33 | strncpy(pathin,path,FILENAME_MAX);
|
35 | 34 | strncpy(pathout,path,FILENAME_MAX);
|
— | — | @@ -35,33 +34,49 @@ |
36 | 35 | pathbase[strlen(pathbase)-7] = 0;
|
37 | 36 | strncat(pathin,"\\rev.in",FILENAME_MAX-strlen(pathin));
|
38 | 37 | strncat(pathout,"\\rev",FILENAME_MAX-strlen(pathin));
|
39 | | - strcpy(command,"subwcrev ");
|
40 | | - strcat(command,pathbase);
|
41 | | - strcat(command," ");
|
42 | | - strcat(command,pathin);
|
43 | | - strcat(command," ");
|
44 | | - strcat(command,pathout);
|
45 | | - STARTUPINFOA startinfo;
|
46 | | - ZeroMemory(&startinfo,sizeof(STARTUPINFOA));
|
47 | | - startinfo.cb = sizeof(STARTUPINFO);
|
48 | | - PROCESS_INFORMATION process;
|
49 | | - if(CreateProcessA(NULL,command,NULL,NULL,FALSE,0,NULL,NULL,&startinfo,&process))
|
| 38 | + HKEY hKey;
|
| 39 | + char svnpath[(MAX_PATH+1)*4];
|
| 40 | + bool foundsvn = false;
|
| 41 | + DWORD buffersize = MAX_PATH+1;
|
| 42 | + if(RegOpenKeyExA(HKEY_LOCAL_MACHINE,"Software\\TortoiseSVN",0,KEY_READ,&hKey) == ERROR_SUCCESS)
|
50 | 43 | {
|
51 | | - WaitForSingleObject(process.hProcess,INFINITE);
|
52 | | - CloseHandle(process.hProcess);
|
53 | | - CloseHandle(process.hThread);
|
54 | | - FILE *revfile = fopen(pathout,"r");
|
55 | | - if(!revfile)
|
| 44 | + if(RegQueryValueExA(hKey,"Directory",NULL,NULL,(LPBYTE)svnpath,&buffersize) == ERROR_SUCCESS)
|
56 | 45 | {
|
57 | | - cout << "WARNING: Failed to create revision file" << endl;
|
58 | | - return 0;
|
| 46 | + foundsvn = true;
|
| 47 | + strcat(svnpath,"bin\\subwcrev.exe ");
|
| 48 | + strcat(svnpath,pathbase);
|
| 49 | + strcat(svnpath," ");
|
| 50 | + strcat(svnpath,pathin);
|
| 51 | + strcat(svnpath," ");
|
| 52 | + strcat(svnpath,pathout);
|
| 53 | + STARTUPINFOA startinfo;
|
| 54 | + ZeroMemory(&startinfo,sizeof(STARTUPINFOA));
|
| 55 | + startinfo.cb = sizeof(STARTUPINFO);
|
| 56 | + PROCESS_INFORMATION process;
|
| 57 | + cout << svnpath << endl;
|
| 58 | + if(CreateProcessA(NULL,svnpath,NULL,NULL,FALSE,0,NULL,NULL,&startinfo,&process))
|
| 59 | + {
|
| 60 | + WaitForSingleObject(process.hProcess,INFINITE);
|
| 61 | + CloseHandle(process.hProcess);
|
| 62 | + CloseHandle(process.hThread);
|
| 63 | + FILE *revfile = fopen(pathout,"r");
|
| 64 | + if(!revfile)
|
| 65 | + {
|
| 66 | + cout << "WARNING: Failed to create revision file" << endl;
|
| 67 | + RegCloseKey(hKey);
|
| 68 | + return 0;
|
| 69 | + }
|
| 70 | + char revstring[32];
|
| 71 | + fgets(revstring,32,revfile);
|
| 72 | + fclose(revfile);
|
| 73 | + RegCloseKey(hKey);
|
| 74 | + return atoi(revstring);
|
| 75 | + }
|
| 76 | + else foundsvn = false;
|
59 | 77 | }
|
60 | | - char revstring[32];
|
61 | | - fgets(revstring,32,revfile);
|
62 | | - fclose(revfile);
|
63 | | - return atoi(revstring);
|
| 78 | + RegCloseKey(hKey);
|
64 | 79 | }
|
65 | | - else
|
| 80 | + if(!foundsvn)
|
66 | 81 | {
|
67 | 82 | int result = MessageBoxA(NULL,"Could not find subwcrev.exe, would you like to download TortoiseSVN?","TortoiseSVN not found",
|
68 | 83 | MB_YESNO|MB_ICONWARNING);
|
— | — | @@ -73,6 +88,7 @@ |
74 | 89 | }
|
75 | 90 | else return 0;
|
76 | 91 | }
|
| 92 | + return 0;
|
77 | 93 | }
|
78 | 94 |
|
79 | 95 | int ProcessHeaders(char *path)
|
— | — | @@ -212,7 +228,9 @@ |
213 | 229 | {
|
214 | 230 | int result = MessageBoxA(NULL,"Could not find HTML Help Workshop, would you like to download it?","HTML Help Workshop not found",
|
215 | 231 | MB_YESNO|MB_ICONERROR);
|
216 | | - if(result == IDYES) ShellExecuteA(NULL,"open","http://www.microsoft.com/en-us/download/details.aspx?id=21138",NULL,NULL,SW_SHOWNORMAL);
|
| 232 | + if(result == IDYES) ShellExecuteA(NULL,"open",
|
| 233 | + "http://web.archive.org/web/20070216084201/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe"
|
| 234 | + ,NULL,NULL,SW_SHOWNORMAL);
|
217 | 235 | cout << "ERROR: HTML Help Compiler not found." << endl;
|
218 | 236 | return -1;
|
219 | 237 | }
|
Index: ddraw/shadergen.cpp |
— | — | @@ -605,8 +605,8 @@ |
606 | 606 | string arg1,arg2;
|
607 | 607 | int args[4];
|
608 | 608 | bool texfail;
|
609 | | - const string blendargs[] = {"color.rgb","gl_Color","texture2DProj(texX,gl_TexCoord[Y]).rgb",
|
610 | | - "texture2DProj(texX,gl_TexCoord[Y]).a","texfactor","gl_SecondaryColor","vec3(1,1,1)","1",".rgb",".a","color.a"};
|
| 609 | + const string blendargs[] = {"color","gl_Color","texture2DProj(texX,gl_TexCoord[Y])",
|
| 610 | + "","texfactor","gl_SecondaryColor","vec3(1,1,1)","1",".rgb",".a",".aaa"};
|
611 | 611 | for(i = 0; i < 8; i++)
|
612 | 612 | {
|
613 | 613 | if((texstate[i].shaderid & 31) == D3DTOP_DISABLE)break;
|
— | — | @@ -620,7 +620,7 @@ |
621 | 621 | arg1 = blendargs[0];
|
622 | 622 | break;
|
623 | 623 | case D3DTA_DIFFUSE:
|
624 | | - arg1 = blendargs[1]+blendargs[8];
|
| 624 | + arg1 = blendargs[1];
|
625 | 625 | break;
|
626 | 626 | case D3DTA_TEXTURE:
|
627 | 627 | if((texstate[i].shaderid >> 59)&1)
|
— | — | @@ -636,11 +636,12 @@ |
637 | 637 | arg1 = blendargs[4];
|
638 | 638 | break;
|
639 | 639 | case D3DTA_SPECULAR:
|
640 | | - arg1 = blendargs[5]+blendargs[8];
|
| 640 | + arg1 = blendargs[5];
|
641 | 641 | break;
|
642 | 642 | }
|
643 | | - if(args[0] & D3DTA_COMPLEMENT)
|
644 | | - arg1 = "(1.0 - " + arg1 + ")";
|
| 643 | + if(args[0] & D3DTA_COMPLEMENT) arg1 = "(1.0 - " + arg1 + ")";
|
| 644 | + if(args[0] & D3DTA_ALPHAREPLICATE) arg1.append(blendargs[10]);
|
| 645 | + else arg1.append(blendargs[8]);
|
645 | 646 | args[1] = (texstate[i].shaderid>>11)&63;
|
646 | 647 | switch(args[1]&7) //arg2
|
647 | 648 | {
|
— | — | @@ -649,7 +650,7 @@ |
650 | 651 | arg2 = blendargs[0];
|
651 | 652 | break;
|
652 | 653 | case D3DTA_DIFFUSE:
|
653 | | - arg2 = blendargs[1]+blendargs[8];
|
| 654 | + arg2 = blendargs[1];
|
654 | 655 | break;
|
655 | 656 | case D3DTA_TEXTURE:
|
656 | 657 | if((texstate[i].shaderid >> 59)&1)
|
— | — | @@ -662,14 +663,15 @@ |
663 | 664 | break;
|
664 | 665 | case D3DTA_TFACTOR:
|
665 | 666 | FIXME("Support texture factor value");
|
666 | | - arg2 = blendargs[4]+blendargs[8];
|
| 667 | + arg2 = blendargs[4];
|
667 | 668 | break;
|
668 | 669 | case D3DTA_SPECULAR:
|
669 | | - arg2 = blendargs[5]+blendargs[8];
|
| 670 | + arg2 = blendargs[5];
|
670 | 671 | break;
|
671 | 672 | }
|
672 | | - if(args[1] & D3DTA_COMPLEMENT)
|
673 | | - arg2 = "(1.0 - " + arg2 + ")";
|
| 673 | + if(args[1] & D3DTA_COMPLEMENT) arg2 = "(1.0 - " + arg2 + ")";
|
| 674 | + if(args[1] & D3DTA_ALPHAREPLICATE) arg2.append(blendargs[10]);
|
| 675 | + else arg2.append(blendargs[8]);
|
674 | 676 | if(!texfail) switch(texstate[i].shaderid & 31)
|
675 | 677 | {
|
676 | 678 | case D3DTOP_DISABLE:
|
— | — | @@ -714,7 +716,7 @@ |
715 | 717 | {
|
716 | 718 | case D3DTA_CURRENT:
|
717 | 719 | default:
|
718 | | - arg1 = blendargs[10];
|
| 720 | + arg1 = blendargs[0]+blendargs[9];
|
719 | 721 | break;
|
720 | 722 | case D3DTA_DIFFUSE:
|
721 | 723 | arg1 = blendargs[1]+blendargs[9];
|
— | — | @@ -722,7 +724,7 @@ |
723 | 725 | case D3DTA_TEXTURE:
|
724 | 726 | if((texstate[i].shaderid >> 59)&1)
|
725 | 727 | {
|
726 | | - arg1 = blendargs[3];
|
| 728 | + arg1 = blendargs[2]+blendargs[9];
|
727 | 729 | arg1.replace(17,1,_itoa(i,idstring,10));
|
728 | 730 | arg1.replace(31,1,_itoa((texstate[i].shaderid>>54)&7,idstring,10));
|
729 | 731 | }
|
— | — | @@ -743,7 +745,7 @@ |
744 | 746 | {
|
745 | 747 | case D3DTA_CURRENT:
|
746 | 748 | default:
|
747 | | - arg2 = blendargs[10];
|
| 749 | + arg2 = blendargs[1]+blendargs[9];
|
748 | 750 | break;
|
749 | 751 | case D3DTA_DIFFUSE:
|
750 | 752 | arg2 = blendargs[1]+blendargs[9];
|
— | — | @@ -751,7 +753,7 @@ |
752 | 754 | case D3DTA_TEXTURE:
|
753 | 755 | if((texstate[i].shaderid >> 59)&1)
|
754 | 756 | {
|
755 | | - arg2 = blendargs[3];
|
| 757 | + arg2 = blendargs[2]+blendargs[9];
|
756 | 758 | arg2.replace(17,1,_itoa(i,idstring,10));
|
757 | 759 | arg2.replace(31,1,_itoa((texstate[i].shaderid>>54)&7,idstring,10));
|
758 | 760 | }
|