Allegro 4.2.4 在 Windows7 上的调色板模式下损坏

发布于 2024-12-06 06:07:24 字数 957 浏览 0 评论 0原文

我在 Windows 7 中运行调色板模式(256 色)的 Allegro 4.2.4 时遇到问题。我通过互联网找到了杀死资源管理器的解决方案,它确实有效,但是期望最终用户在尝试玩游戏时杀死资源管理器是荒谬的。

然后我找到了用黑客版本替换 DDraw.dll 的解决方案,但它也不起作用 - DDHack 只会导致应用程序启动后根本不显示任何屏幕。

然后我找到了添加注册表破解的解决方案:

Windows Registry Editor Version 5.00
;This file has been created with DirectDraw Compatibility Tool (http://crappybitter.livejournal.com/tag/ddc_tool)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectDraw\Compatibility\MyApp]
"Name"="MyApp.exe"
"ID"=dword:4E7B8A88
"Flags"=hex:00,08,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DirectDraw\Compatibility\MyApp]
"Name"="MyApp.exe"
"ID"=dword:4E7B8A88
"Flags"=hex:00,08,00,00

但遗憾的是它也不起作用,调色板一直闪烁着所有彩虹色。

除了将整个应用程序移植到不同的编程库之外,我还有其他解决方案吗?是否可以在不触及调色板的情况下修复 Vista/W7 上的 DDraw 问题?如果没有,什么库可以给我调色板编程(我正在做需要调色板的游戏)而不会在 Vista/W7 上出现此类问题?

我知道另一种解决方案 - 我可以将 Allegro 4.2.4 应用程序编译为 DOS 应用程序并在 DosBox 中运行。可悲的是,但这就是我现在能想到的......

提前感谢其他解决方案!

I have problem with Allegro 4.2.4 running palette mode (256 colors) in Windows 7. I found over Internet solution of killing explorer and it's working indeed, however it would be ridiculous to expect that end user will kill explorer when trying to play game.

Then I found solution to replace DDraw.dll with hacked version, but it doesn't work either - DDHack just results in no screen being shown at all after application launch.

Then I found solution of adding registry hack:

Windows Registry Editor Version 5.00
;This file has been created with DirectDraw Compatibility Tool (http://crappybitter.livejournal.com/tag/ddc_tool)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectDraw\Compatibility\MyApp]
"Name"="MyApp.exe"
"ID"=dword:4E7B8A88
"Flags"=hex:00,08,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DirectDraw\Compatibility\MyApp]
"Name"="MyApp.exe"
"ID"=dword:4E7B8A88
"Flags"=hex:00,08,00,00

But sadly it won't work either, the palette keeps flickering with all rainbow colors.

Do I have any other solution other than porting entire application to different programming lib? Is it possible to fix DDraw problem on Vista/W7 without touching palettes? If not, what library will give me palette programming (I am doing game that requires palettes) without such problems on Vista/W7?

I know of one more solution - I can compile Allegro 4.2.4 application as DOS application and run in DosBox. Sadly, but that's all I can think of now...

Thanks in advance for other solutions!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瞳孔里扚悲伤 2024-12-13 06:07:24

首先,4.2.4 没有这样的版本。我假设你的意思是4.4.2。

真正的调色板正在消亡。现代操作系统并不能很好地支持设置 8 位颜色深度。对于 Allegro 4.4,您可以这样做:

set_color_depth(8);
set_gfx_mode(GFX_GDI, w, h, 0, 0);

它将为您提供窗口模式,以及 Allegro 4.4 提供的 Windows 上最兼容的调色板支持。如果你确实必须使用全屏模式,你可以尝试这个补丁:

它修复了游戏中调色板损坏的问题。它可能有助于解决您所描述的问题。

或者您可以尝试在屏幕上使用 32 位颜色深度,并为精灵和缓冲区使用 8 位位图:

set_color_depth(desktop_color_depth());
set_gfx_mode(GFX_AUTODETECT, w, h, 0, 0);
BITMAP *buffer = create_bitmap_ex(8, w, h);

当然,在更改调色板后,您必须再次将位图传输到屏幕,所以如果您需要非常快的速度实时效果,它可能不起作用。

或者,Allegro 5.1(即未发布的 SVN 版本)有一个通过着色器工作的调色板插件。它可能没有记录并且可能会改变。 (请注意,5 系列与 4 系列的源代码不兼容。)

First off, there's no such version 4.2.4. I assume you mean 4.4.2.

True palettes are a dying thing. Setting 8-bit color depths just isn't supported very well on modern operating systems. Regarding Allegro 4.4, you could do this:

set_color_depth(8);
set_gfx_mode(GFX_GDI, w, h, 0, 0);

It will give you a windowed mode, and the most compatible palette support on Windows that Allegro 4.4 offers. If you really must have full screen mode, you could try this patch:

It fixes a problem with corrupted palettes while in the game. It may help with the issue you describe.

Or you could try using 32-bit color depth for the screen, and use an 8-bit bitmaps for sprites and buffers:

set_color_depth(desktop_color_depth());
set_gfx_mode(GFX_AUTODETECT, w, h, 0, 0);
BITMAP *buffer = create_bitmap_ex(8, w, h);

Of course you would have to blit the bitmap to the screen again after changing the palette, so if you need very fast real time effects, it might not work.

Alternatively, Allegro 5.1 (i.e., unreleased SVN version) has a palette addon that works via shaders. It's probably undocumented and likely to change. (Note that the 5 series is not source compatible with the 4 series.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文