Compare commits
2 Commits
47d2629610
...
7278368b4c
Author | SHA1 | Date | |
---|---|---|---|
7278368b4c | |||
a2f12c2e77 |
@ -2,9 +2,17 @@
|
|||||||
# DR game/DR rs 更新日志
|
# DR game/DR rs 更新日志
|
||||||
|
|
||||||
- 最新版本号
|
- 最新版本号
|
||||||
- DR game: 0.3.2.0
|
- DR game: 0.3.2.1
|
||||||
- DR rs: 0.2.21.0
|
- DR rs: 0.2.21.0
|
||||||
|
|
||||||
|
## 20230809 DR game 0.3.2.1
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- 因为把部件加载图片的数据源改成从 `SR1PartType_rs` 里取
|
||||||
|
- 所以修改了 `SR1Textures` 的加载逻辑
|
||||||
|
- 可以自动忽略文件名最后的 `.png`
|
||||||
|
|
||||||
## 20230808 DR rs 0.2.21.0
|
## 20230808 DR rs 0.2.21.0
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
@ -68,12 +68,12 @@ class Win32Config(Config):
|
|||||||
if pf:
|
if pf:
|
||||||
return [Win32CanvasConfig(canvas, pf, self)]
|
return [Win32CanvasConfig(canvas, pf, self)]
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def _get_arb_pixel_format_matching_configs(self, canvas):
|
def _get_arb_pixel_format_matching_configs(self, canvas):
|
||||||
"""Get configs using the WGL_ARB_pixel_format extension.
|
"""Get configs using the WGL_ARB_pixel_format extension.
|
||||||
This method assumes a (dummy) GL context is already created."""
|
This method assumes a (dummy) GL context is already created."""
|
||||||
|
|
||||||
# Check for required extensions
|
# Check for required extensions
|
||||||
if self.sample_buffers or self.samples:
|
if self.sample_buffers or self.samples:
|
||||||
if not gl_info.have_extension('GL_ARB_multisample'):
|
if not gl_info.have_extension('GL_ARB_multisample'):
|
||||||
@ -85,7 +85,7 @@ class Win32Config(Config):
|
|||||||
attr = Win32CanvasConfigARB.attribute_ids.get(name, None)
|
attr = Win32CanvasConfigARB.attribute_ids.get(name, None)
|
||||||
if attr and value is not None:
|
if attr and value is not None:
|
||||||
attrs.extend([attr, int(value)])
|
attrs.extend([attr, int(value)])
|
||||||
attrs.append(0)
|
attrs.append(0)
|
||||||
attrs = (c_int * len(attrs))(*attrs)
|
attrs = (c_int * len(attrs))(*attrs)
|
||||||
|
|
||||||
pformats = (c_int * 16)()
|
pformats = (c_int * 16)()
|
||||||
@ -98,7 +98,7 @@ class Win32Config(Config):
|
|||||||
|
|
||||||
class Win32CanvasConfig(CanvasConfig):
|
class Win32CanvasConfig(CanvasConfig):
|
||||||
def __init__(self, canvas, pf, config):
|
def __init__(self, canvas, pf, config):
|
||||||
super(Win32CanvasConfig, self).__init__(canvas, config)
|
super().__init__(canvas, config)
|
||||||
self._pf = pf
|
self._pf = pf
|
||||||
self._pfd = PIXELFORMATDESCRIPTOR()
|
self._pfd = PIXELFORMATDESCRIPTOR()
|
||||||
|
|
||||||
@ -153,14 +153,14 @@ class Win32CanvasConfigARB(CanvasConfig):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, canvas, pf, config):
|
def __init__(self, canvas, pf, config):
|
||||||
super(Win32CanvasConfigARB, self).__init__(canvas, config)
|
super().__init__(canvas, config)
|
||||||
self._pf = pf
|
self._pf = pf
|
||||||
|
|
||||||
names = list(self.attribute_ids.keys())
|
names = list(self.attribute_ids.keys())
|
||||||
attrs = list(self.attribute_ids.values())
|
attrs = list(self.attribute_ids.values())
|
||||||
attrs = (c_int * len(attrs))(*attrs)
|
attrs = (c_int * len(attrs))(*attrs)
|
||||||
values = (c_int * len(attrs))()
|
values = (c_int * len(attrs))()
|
||||||
|
|
||||||
wglext_arb.wglGetPixelFormatAttribivARB(canvas.hdc, pf, 0, len(attrs), attrs, values)
|
wglext_arb.wglGetPixelFormatAttribivARB(canvas.hdc, pf, 0, len(attrs), attrs, values)
|
||||||
|
|
||||||
for name, value in zip(names, values):
|
for name, value in zip(names, values):
|
||||||
@ -182,35 +182,21 @@ class Win32CanvasConfigARB(CanvasConfig):
|
|||||||
_gdi32.SetPixelFormat(canvas.hdc, self._pf, None)
|
_gdi32.SetPixelFormat(canvas.hdc, self._pf, None)
|
||||||
|
|
||||||
|
|
||||||
class Win32Context(Context):
|
class _BaseWin32Context(Context):
|
||||||
def __init__(self, config, share):
|
def __init__(self, config, share):
|
||||||
super(Win32Context, self).__init__(config, share)
|
super().__init__(config, share)
|
||||||
self._context = None
|
self._context = None
|
||||||
|
|
||||||
def attach(self, canvas):
|
|
||||||
super(Win32Context, self).attach(canvas)
|
|
||||||
|
|
||||||
if not self._context:
|
|
||||||
self.config._set_pixel_format(canvas)
|
|
||||||
self._context = wgl.wglCreateContext(canvas.hdc)
|
|
||||||
|
|
||||||
share = self.context_share
|
|
||||||
if share:
|
|
||||||
if not share.canvas:
|
|
||||||
raise RuntimeError('Share context has no canvas.')
|
|
||||||
if not wgl.wglShareLists(share._context, self._context):
|
|
||||||
raise gl.ContextException('Unable to share contexts.')
|
|
||||||
|
|
||||||
def set_current(self):
|
def set_current(self):
|
||||||
if self._context is not None and self != gl.current_context:
|
if self._context is not None and self != gl.current_context:
|
||||||
wgl.wglMakeCurrent(self.canvas.hdc, self._context)
|
wgl.wglMakeCurrent(self.canvas.hdc, self._context)
|
||||||
super(Win32Context, self).set_current()
|
super().set_current()
|
||||||
|
|
||||||
def detach(self):
|
def detach(self):
|
||||||
if self.canvas:
|
if self.canvas:
|
||||||
wgl.wglDeleteContext(self._context)
|
wgl.wglDeleteContext(self._context)
|
||||||
self._context = None
|
self._context = None
|
||||||
super(Win32Context, self).detach()
|
super().detach()
|
||||||
|
|
||||||
def flip(self):
|
def flip(self):
|
||||||
_gdi32.SwapBuffers(self.canvas.hdc)
|
_gdi32.SwapBuffers(self.canvas.hdc)
|
||||||
@ -224,9 +210,23 @@ class Win32Context(Context):
|
|||||||
wglext_arb.wglSwapIntervalEXT(int(vsync))
|
wglext_arb.wglSwapIntervalEXT(int(vsync))
|
||||||
|
|
||||||
|
|
||||||
class Win32ARBContext(Win32Context):
|
class Win32Context(_BaseWin32Context):
|
||||||
def __init__(self, config, share):
|
def attach(self, canvas):
|
||||||
super(Win32ARBContext, self).__init__(config, share)
|
super().attach(canvas)
|
||||||
|
|
||||||
|
if not self._context:
|
||||||
|
self.config._set_pixel_format(canvas)
|
||||||
|
self._context = wgl.wglCreateContext(canvas.hdc)
|
||||||
|
|
||||||
|
share = self.context_share
|
||||||
|
if share:
|
||||||
|
if not share.canvas:
|
||||||
|
raise RuntimeError('Share context has no canvas.')
|
||||||
|
if not wgl.wglShareLists(share._context, self._context):
|
||||||
|
raise gl.ContextException('Unable to share contexts.')
|
||||||
|
|
||||||
|
|
||||||
|
class Win32ARBContext(_BaseWin32Context):
|
||||||
|
|
||||||
def attach(self, canvas):
|
def attach(self, canvas):
|
||||||
share = self.context_share
|
share = self.context_share
|
||||||
@ -252,4 +252,4 @@ class Win32ARBContext(Win32Context):
|
|||||||
|
|
||||||
self.config._set_pixel_format(canvas)
|
self.config._set_pixel_format(canvas)
|
||||||
self._context = wglext_arb.wglCreateContextAttribsARB(canvas.hdc, share, attribs)
|
self._context = wglext_arb.wglCreateContextAttribsARB(canvas.hdc, share, attribs)
|
||||||
super(Win32ARBContext, self).attach(canvas)
|
super().attach(canvas)
|
||||||
|
@ -53,7 +53,7 @@ DR_mod_runtime = _DR_mod_runtime()
|
|||||||
class DR_mod(ModInfo): # NOQA
|
class DR_mod(ModInfo): # NOQA
|
||||||
mod_id = "difficult_rocket_mod"
|
mod_id = "difficult_rocket_mod"
|
||||||
name = "Difficult Rocket mod"
|
name = "Difficult Rocket mod"
|
||||||
version = Version("0.3.2.0")
|
version = Version("0.3.2.1")
|
||||||
|
|
||||||
writer = "shenjackyuanjie"
|
writer = "shenjackyuanjie"
|
||||||
link = "shenjack.top"
|
link = "shenjack.top"
|
||||||
|
@ -33,8 +33,10 @@ class SR1Textures(Options):
|
|||||||
"""
|
"""
|
||||||
if name in self.cached_options:
|
if name in self.cached_options:
|
||||||
return self.cached_options.get(name)
|
return self.cached_options.get(name)
|
||||||
|
elif name.split('.')[0] in self.cached_options:
|
||||||
|
return self.cached_options.get(name.split('.')[0])
|
||||||
else:
|
else:
|
||||||
img = load(f'assets/textures/parts/{name}.png')
|
img = load(f'assets/textures/parts/{name}')
|
||||||
img.anchor_x = img.width // 2
|
img.anchor_x = img.width // 2
|
||||||
img.anchor_y = img.height // 2
|
img.anchor_y = img.height // 2
|
||||||
setattr(self, name, img)
|
setattr(self, name, img)
|
||||||
|
Loading…
Reference in New Issue
Block a user