Skip to content

Commit

Permalink
[export/uwp] Fix DX11 rendering slowness since 2023.5
Browse files Browse the repository at this point in the history
[gfx/opengl] Disable line smoothing
[gfx/sprite] Disable world alignment when in perspective projection
[gfx/texturepack] Avoid returning weird part when image name isn't found in atlas
[plugin/require] Fill Android OpenUrl in manifest
[export/mac] Don't send a keyChar when modifiers are presents beside shift
  • Loading branch information
hgy29 committed Jun 12, 2023
1 parent 22bebc3 commit 75b3be4
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 16 deletions.
1 change: 1 addition & 0 deletions 2dsg/gfxbackends/dx11/dx11ShaderProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ ID3D11Buffer *dx11ShaderProgram::getCachedVBO(ShaderBufferCache **cache, bool in
D3D11_BIND_VERTEX_BUFFER : D3D11_BIND_INDEX_BUFFER; // use as a vertex buffer
g_dev->CreateBuffer(&bd, NULL, &(dc->VBO));
dc->VBOcapacity = count;
dc->cachedMult = mult;
modified = true;
}
return dc->VBO;
Expand Down
3 changes: 0 additions & 3 deletions 2dsg/gfxbackends/gl2/gl2ShaderEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@ void ogl2ShaderEngine::reset(bool reinit) {
#ifdef GL_MULTISAMPLE
GLCALL glEnable(GL_MULTISAMPLE);
#endif
#ifdef GL_LINE_SMOOTH
GLCALL glEnable(GL_LINE_SMOOTH);
#endif

#ifndef PREMULTIPLIED_ALPHA
#error PREMULTIPLIED_ALPHA is not defined
Expand Down
2 changes: 1 addition & 1 deletion 2dsg/sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ void Sprite::draw(const CurrentTransform& transform, float sx, float sy,
else
sprite->renderTransform_ = transform * localTransform_.matrix();

if (sprite->worldAlign_) { //Adjust to integer world coordinates
if (sprite->worldAlign_&&(sprite->renderTransform_.type!=Matrix4::FULL)) { //Adjust to integer world coordinates
float dx,dy;
/*sprite->getDimensions(dx,dy);
sprite->worldTransform_.transformPoint(dx,dy,&dx,&dy);
Expand Down
7 changes: 3 additions & 4 deletions 2dsg/texturepack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ bool TexturePack::location(const char* filename, int* x, int* y, int* width, int
if (iter == filenameMap_.end())
return false;

location(iter->second, x, y, width, height, dx1, dy1, dx2, dy2);

return true;
return location(iter->second, x, y, width, height, dx1, dy1, dx2, dy2);
}

std::vector<std::string> TexturePack::getRegionsNames() {
Expand Down Expand Up @@ -388,7 +386,8 @@ void TexturePackFont::drawText(std::vector<GraphicsBase> * vGraphicsBase, const

int left,top,width,height;
int dx1,dy1,dx2,dy2;
pack_->location(name.c_str(),&left,&top,&width,&height,&dx1,&dy1,&dx2,&dy2);
if (!pack_->location(name.c_str(),&left,&top,&width,&height,&dx1,&dy1,&dx2,&dy2))
continue;

float x0 = x;
float y0 = y - height*anchory_;
Expand Down
15 changes: 15 additions & 0 deletions plugins/require/require.gplugin
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,21 @@
</replacelist>
</template>]])

local urls = Export.getProperty("plugin.reqCanOpenUrl")
if urls and string.len(urls)>0 then
local t,pattern = {},urls.format("([^%s]+)", ",")
urls:gsub(pattern, function(s) t[#t+1] = s end)
if #t>0 then
local IFT=[[<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="%s" />
</intent>]]
local IFE="<template name=\"AndroidManifest\" path=\"\"><replacelist wildcards=\"AndroidManifest.xml\"><append><orig><![CDATA[<!-- TAG:MANIFEST-EXTRA -->]".."]></orig><by><![CDATA[%s]".."]></by></append></replacelist></template>"
local ifs=""
for i,v in ipairs(t) do ifs=ifs..IFT:format(v) end
if #ifs>0 then Export.callXml(IFE:format("<queries>"..ifs.."</queries>")) end
end
end
local urls = Export.getProperty("plugin.reqCanRespondUrl")
if urls and string.len(urls)>0 then
local t,pattern = {},urls.format("([^%s]+)", ",")
Expand Down
5 changes: 3 additions & 2 deletions ui/Templates/Xcode4/iOS Template/Mac/EAGLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,10 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(NSEvent *)event

- (void)keyDown:(NSEvent *)event
{
gdr_keyDown(event.keyCode, keyMods(event.modifierFlags), [event isARepeat]?1:0);
int mods=keyMods(event.modifierFlags);
gdr_keyDown(event.keyCode, mods, [event isARepeat]?1:0);
NSString *c=event.characters;
if (c!=NULL) {
if ((c!=NULL)&&((mods&~1)==0)) {
unichar uni=[c characterAtIndex:0];
if ((uni<0xE000)||(uni>=0xF800)) {
gdr_keyChar(c);
Expand Down
12 changes: 6 additions & 6 deletions winrt_xaml/giderosgame.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.329
# Visual Studio Version 17
VisualStudioVersion = 17.4.33110.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "giderosgame", "giderosgame", "{92DE354A-925E-4E9B-A756-822C3E095827}"
EndProject
Expand All @@ -10,10 +10,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "giderosgame.Windows", "giderosgame\giderosgame.Windows\giderosgame.Windows.vcxproj", "{1F1102C1-DAF7-47A5-8ADF-D2EC2CA795D0}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
giderosgame\giderosgame.Shared\giderosgame.Shared.vcxitems*{1f1102c1-daf7-47a5-8adf-d2ec2ca795d0}*SharedItemsImports = 4
giderosgame\giderosgame.Shared\giderosgame.Shared.vcxitems*{f9d2c644-9c0b-41e9-b66f-8f48fd1e7bb7}*SharedItemsImports = 9
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -52,4 +48,8 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {98F881F5-D30A-45E8-83D7-388485FD1FDF}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
giderosgame\giderosgame.Shared\giderosgame.Shared.vcxitems*{1f1102c1-daf7-47a5-8adf-d2ec2ca795d0}*SharedItemsImports = 4
giderosgame\giderosgame.Shared\giderosgame.Shared.vcxitems*{f9d2c644-9c0b-41e9-b66f-8f48fd1e7bb7}*SharedItemsImports = 9
EndGlobalSection
EndGlobal

0 comments on commit 75b3be4

Please sign in to comment.