07th-mod / 07th-mod/higurashi-assembly
Releasing the "windo_filter" texture, then using it again causes it to be replaced with a sprite displayed on screen
- Ngôn ngữ chính
- C#
- Star
- 12
- Fork
- 12
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Disclaimer: I haven't tested this on the stock game, so it could be some other of my changes which causes this to happen. Also, it's not possible? for this to happen on the base game, but it is more of a "annoying for developers" thing.
Currently, before we switch window filters (the background for the textbox), we call ReleaseTextures(); just before it:
https://github.com/07th-mod/higurashi-assembly/blob/2393805e12f5c4c8fd95140303228ec613ec701a/Assets.Scripts.UI/MainUIController.cs#L477-L480
When testing my own code, I found that if you call this twice with "windo_filter" as the image, it can result in this happening.

It only happens with "windo_filter" in particular, because there is a hardcoded cache for that particular image in: https://github.com/07th-mod/higurashi-assembly/blob/2393805e12f5c4c8fd95140303228ec613ec701a/Assets.Scripts.Core.AssetManagement/AssetManager.cs#L242-L245
However, if you remove the ReleaseTextures();, then the problem goes away.
I'm guessing that if you call releaseTextures on windo_filter, it doesn't invalidate (it doesn't set windo_filter to null), and when the game tries to use that texture, it ends up using some random texture instead.
~~I could either fix this by disabling the caching (currently you're not caching the ADV/NVLADV textures), or adding an extra condition check which disables the cache.~~ **Edit: If I just use a third type and switch ADV->NVL->OG->ADV... then the problem goes away so I guess it's not really an issue for now.**
I don't think this is related to #45 even though it looks similar, because the sprite appears slightly transparent (it draws it with the window opacity).
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Issue chỉ ra MainUIController.cs dòng 477-480 và AssetManager.cs dòng 242-245. Bắt đầu bằng cách kiểm tra lệnh gọi ReleaseTextures() và bộ nhớ cache cứng cho 'windo_filter'. Tái tạo lỗi bằng cách gọi ReleaseTextures hai lần với 'windo_filter' và quan sát việc thay thế texture. Kiểm tra xem bộ nhớ cache có được vô hiệu hóa đúng cách khi giải phóng không. Chạy game để xem sprite có xuất hiện làm nền cửa sổ không.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, unity
- Lĩnh vực
- computer-graphics, game-dev
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100