Index: ddraw/glRenderer.cpp |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | * @return
|
140 | 140 | * Return value specific to command, DD_OK if succeeded.
|
141 | 141 | */
|
142 | | -HRESULT glRenderer_AddCommand(glRenderer *This, BYTE *command)
|
| 142 | +HRESULT glRenderer_AddCommand(glRenderer *This, BYTE *command, BOOL inner)
|
143 | 143 | {
|
144 | 144 | DWORD opcode = (DWORD)*command;
|
145 | 145 | DWORD cmdsize = (DWORD)*((unsigned char*)command + 4);
|
— | — | @@ -149,7 +149,8 @@ |
150 | 150 | RECT wndrect;
|
151 | 151 | int screenx, screeny;
|
152 | 152 | LONG_PTR winstyle, winstyleex;
|
153 | | - EnterCriticalSection(&This->cs);
|
| 153 | + BOOL restart_cmd = FALSE;
|
| 154 | + if (!inner) EnterCriticalSection(&This->cs);
|
154 | 155 | switch (opcode)
|
155 | 156 | {
|
156 | 157 | case OP_NULL:
|
— | — | @@ -202,6 +203,14 @@ |
203 | 204 | break;
|
204 | 205 | case OP_BLT: // Perform a Blt() operation, issuing necessary commands to set it
|
205 | 206 | // up.
|
| 207 | + if (This->state.last_cmd == OP_BLT)
|
| 208 | + {
|
| 209 | +
|
| 210 | + }
|
| 211 | + if(restart_cmd)
|
| 212 | + {
|
| 213 | +
|
| 214 | + }
|
206 | 215 | error = DDERR_CURRENTLYNOTAVAIL;
|
207 | 216 | break;
|
208 | 217 | case OP_DRAWSCREEN: // Draws the screen. Flip command buffer after executing.
|
— | — | @@ -264,7 +273,8 @@ |
265 | 274 | error = DDERR_INVALIDPARAMS;
|
266 | 275 | break;
|
267 | 276 | }
|
268 | | - LeaveCriticalSection(&This->cs);
|
| 277 | + This->state.last_cmd = opcode;
|
| 278 | + if (!inner) LeaveCriticalSection(&This->cs);
|
269 | 279 | return error;
|
270 | 280 | }
|
271 | 281 |
|
— | — | @@ -1713,7 +1723,7 @@ |
1714 | 1724 | if (cmd->flags & 0x20000000) SetColorKeyUniform(cmd->src->levels[cmd->srclevel].ddsd.ddckCKSrcBlt.dwColorSpaceHighValue, cmd->src->colorsizes,
|
1715 | 1725 | cmd->src->colororder, shader->shader.uniforms[7], cmd->src->colorbits, This->ext);
|
1716 | 1726 | }
|
1717 | | - if (!(cmd->flags & DDBLT_COLORFILL)) This->ext->glUniform1i(shader->shader.uniforms[1], 0);
|
| 1727 | + if (!(cmd->flags & DDBLT_COLORFILL)) This->ext->glUniform1i(shader->shader.uniforms[1], 8);
|
1718 | 1728 | if ((cmd->flags & DDBLT_KEYDEST) && (This && (cmd->dest->levels[cmd->destlevel].ddsd.dwFlags & DDSD_CKDESTBLT)))
|
1719 | 1729 | {
|
1720 | 1730 | SetColorKeyUniform(cmd->dest->levels[cmd->destlevel].ddsd.ddckCKDestBlt.dwColorSpaceLowValue, cmd->dest->colorsizes,
|
— | — | @@ -1723,27 +1733,27 @@ |
1724 | 1734 | }
|
1725 | 1735 | if (usedest && (shader->shader.uniforms[2] != -1))
|
1726 | 1736 | {
|
1727 | | - glUtil_SetTexture(This->util, 1, This->backbuffer);
|
1728 | | - This->ext->glUniform1i(shader->shader.uniforms[2], 1);
|
| 1737 | + glUtil_SetTexture(This->util, 9, This->backbuffer);
|
| 1738 | + This->ext->glUniform1i(shader->shader.uniforms[2], 9);
|
1729 | 1739 | }
|
1730 | 1740 | if (usepattern && (shader->shader.uniforms[3] != -1))
|
1731 | 1741 | {
|
1732 | 1742 | if (cmd->pattern->levels[cmd->patternlevel].dirty & 1) glTexture__Upload(cmd->pattern, cmd->patternlevel);
|
1733 | | - glUtil_SetTexture(This->util, 2, cmd->pattern);
|
1734 | | - This->ext->glUniform1i(shader->shader.uniforms[3], 2);
|
| 1743 | + glUtil_SetTexture(This->util, 10, cmd->pattern);
|
| 1744 | + This->ext->glUniform1i(shader->shader.uniforms[3], 10);
|
1735 | 1745 | This->ext->glUniform2i(shader->shader.uniforms[9],
|
1736 | 1746 | cmd->pattern->levels[cmd->patternlevel].ddsd.dwWidth, cmd->pattern->levels[cmd->patternlevel].ddsd.dwHeight);
|
1737 | 1747 | }
|
1738 | 1748 | if (cmd->flags & 0x10000000) // Use clipper
|
1739 | 1749 | {
|
1740 | | - glUtil_SetTexture(This->util, 3, cmd->dest->stencil);
|
1741 | | - This->ext->glUniform1i(shader->shader.uniforms[4],3);
|
| 1750 | + glUtil_SetTexture(This->util, 11, cmd->dest->stencil);
|
| 1751 | + This->ext->glUniform1i(shader->shader.uniforms[4],11);
|
1742 | 1752 | glUtil_EnableArray(This->util, shader->shader.attribs[5], TRUE);
|
1743 | 1753 | This->ext->glVertexAttribPointer(shader->shader.attribs[5], 2, GL_FLOAT, GL_FALSE, sizeof(BltVertex), &This->bltvertices[0].stencils);
|
1744 | 1754 | }
|
1745 | 1755 | if (cmd->src)
|
1746 | 1756 | {
|
1747 | | - glUtil_SetTexture(This->util, 0, cmd->src);
|
| 1757 | + glUtil_SetTexture(This->util, 8, cmd->src);
|
1748 | 1758 | if(This->ext->GLEXT_ARB_sampler_objects)
|
1749 | 1759 | {
|
1750 | 1760 | if((dxglcfg.scalingfilter == 0) || (This->ddInterface->GetBPP() == 8))\
|
— | — | @@ -1751,7 +1761,7 @@ |
1752 | 1762 | else glTexture__SetFilter(cmd->src, 0, GL_LINEAR, GL_LINEAR, This);
|
1753 | 1763 | }
|
1754 | 1764 | }
|
1755 | | - else glUtil_SetTexture(This->util,0,NULL);
|
| 1765 | + else glUtil_SetTexture(This->util,8,NULL);
|
1756 | 1766 | This->ext->glUniform4f(shader->shader.uniforms[0], 0,
|
1757 | 1767 | (GLfloat)cmd->dest->levels[cmd->destlevel].ddsd.dwWidth, 0, (GLfloat)cmd->dest->levels[cmd->destlevel].ddsd.dwHeight);
|
1758 | 1768 | if (cmd->src) This->ext->glUniform4i(shader->shader.uniforms[10], cmd->src->colorsizes[0], cmd->src->colorsizes[1],
|
Index: ddraw/glRenderer.h |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | size_t scenesize, scenesizevertex, scenesizeindex;
|
164 | 164 | } glRenderer;
|
165 | 165 |
|
166 | | -HRESULT glRenderer_AddCommand(glRenderer *This, BYTE *command);
|
| 166 | +HRESULT glRenderer_AddCommand(glRenderer *This, BYTE *command, BOOL inner);
|
167 | 167 | void glRenderer_Init(glRenderer *This, int width, int height, int bpp, BOOL fullscreen, unsigned int frequency, HWND hwnd, glDirectDraw7 *glDD7, BOOL devwnd);
|
168 | 168 | void glRenderer_Delete(glRenderer *This);
|
169 | 169 | DWORD glRenderer_GetBPP(glRenderer *This);
|
Index: ddraw/struct.h |
— | — | @@ -450,6 +450,9 @@ |
451 | 451 | typedef struct RenderState
|
452 | 452 | {
|
453 | 453 | CommandBuffer *cmd;
|
| 454 | + DWORD last_cmd;
|
| 455 | + BYTE *last_cmd_start;
|
| 456 | + BltCommand last_blt;
|
454 | 457 | } RenderState;
|
455 | 458 |
|
456 | 459 | #endif //__STRUCT_H |
\ No newline at end of file |
Index: ddraw/struct_command.h |
— | — | @@ -48,10 +48,13 @@ |
49 | 49 | DWORD size;
|
50 | 50 | glTexture *texture;
|
51 | 51 | } DeleteTextureCmd;
|
52 | | -typedef struct BltCmd // Frontend command structure for Blt command.
|
| 52 | +typedef struct BltCmd
|
53 | 53 | {
|
54 | 54 | DWORD opcode;
|
55 | 55 | DWORD size;
|
56 | 56 | BltCommand cmd;
|
| 57 | + DWORD count;
|
| 58 | + GLsizeiptr vertex_start;
|
| 59 | + GLsizeiptr index_start;
|
57 | 60 | } BltCmd;
|
58 | 61 | #endif //__STRUCT_COMMAND_H |
\ No newline at end of file |
Index: dxglcfg/dxglcfg.c |
— | — | @@ -926,8 +926,7 @@ |
927 | 927 | case IDC_APPS:
|
928 | 928 | OldTextColor = GetTextColor(drawitem->hDC);
|
929 | 929 | OldBackColor = GetBkColor(drawitem->hDC);
|
930 | | - if((drawitem->itemAction & ODA_SELECT) && (drawitem->itemState & ODS_SELECTED) &&
|
931 | | - !(drawitem->itemState & ODS_COMBOBOXEDIT))
|
| 930 | + if((drawitem->itemState & ODS_SELECTED) && !(drawitem->itemState & ODS_COMBOBOXEDIT))
|
932 | 931 | {
|
933 | 932 | SetTextColor(drawitem->hDC,GetSysColor(COLOR_HIGHLIGHTTEXT));
|
934 | 933 | SetBkColor(drawitem->hDC,GetSysColor(COLOR_HIGHLIGHT));
|
— | — | @@ -942,6 +941,8 @@ |
943 | 942 | DT_LEFT|DT_SINGLELINE|DT_VCENTER);
|
944 | 943 | SetTextColor(drawitem->hDC,OldTextColor);
|
945 | 944 | SetBkColor(drawitem->hDC,OldBackColor);
|
| 945 | + drawitem->rcItem.left -= GetSystemMetrics(SM_CXSMICON) + 5;
|
| 946 | + if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
|
946 | 947 | DefWindowProc(hWnd,Msg,wParam,lParam);
|
947 | 948 | break;
|
948 | 949 | default:
|
Index: dxglcfg2/dxglcfg2.c |
— | — | @@ -506,8 +506,7 @@ |
507 | 507 | case IDC_EXTRAMODES:
|
508 | 508 | OldTextColor = GetTextColor(drawitem->hDC);
|
509 | 509 | OldBackColor = GetBkColor(drawitem->hDC);
|
510 | | - if ((drawitem->itemAction | ODA_SELECT) && (drawitem->itemState & ODS_SELECTED) &&
|
511 | | - !(drawitem->itemState & ODS_COMBOBOXEDIT))
|
| 510 | + if ((drawitem->itemState & ODS_SELECTED) && !(drawitem->itemState & ODS_COMBOBOXEDIT))
|
512 | 511 | {
|
513 | 512 | SetTextColor(drawitem->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
|
514 | 513 | SetBkColor(drawitem->hDC, GetSysColor(COLOR_HIGHLIGHT));
|
— | — | @@ -527,6 +526,8 @@ |
528 | 527 | DT_LEFT | DT_SINGLELINE | DT_VCENTER);
|
529 | 528 | SetTextColor(drawitem->hDC, OldTextColor);
|
530 | 529 | SetBkColor(drawitem->hDC, OldBackColor);
|
| 530 | + drawitem->rcItem.left -= GetSystemMetrics(SM_CXMENUCHECK) + 5;
|
| 531 | + if (drawitem->itemState & ODS_FOCUS) DrawFocusRect(drawitem->hDC, &drawitem->rcItem);
|
531 | 532 | DefWindowProc(hWnd, Msg, wParam, lParam);
|
532 | 533 | break;
|
533 | 534 | default:
|