mirror of
https://github.com/zeldaret/oot.git
synced 2025-06-07 17:11:50 +00:00
[assets] Explicit size for textures and dlists (#2534)
* Add `conf.EXPLICIT_SIZES = True` for making some array resources declare and define with explicit length * EXPLICIT_DL_AND_TEX_SIZES = True * revert rm line
This commit is contained in:
parent
f456bc6bf8
commit
4eceb77128
1 changed files with 8 additions and 5 deletions
|
@ -42,6 +42,8 @@ BEST_EFFORT = True
|
|||
VERBOSE_ColorIndexedTexturesManager = False
|
||||
VERBOSE_BEST_EFFORT_TLUT_NO_REAL_USER = True
|
||||
|
||||
EXPLICIT_DL_AND_TEX_SIZES = True
|
||||
|
||||
|
||||
class MtxResource(CDataResource):
|
||||
braces_in_source = False
|
||||
|
@ -274,10 +276,11 @@ class TextureResource(Resource):
|
|||
self.height_name = f"{self.symbol_name}_HEIGHT"
|
||||
|
||||
def get_c_declaration_base(self):
|
||||
if hasattr(self, "HACK_IS_STATIC_ON"):
|
||||
if self.is_tlut():
|
||||
raise NotImplementedError
|
||||
return f"{self.elem_type} {self.symbol_name}[{self.height_name}*{self.width_name}*{self.siz.bpp}/8/sizeof({self.elem_type})]"
|
||||
if hasattr(self, "HACK_IS_STATIC_ON") and self.is_tlut():
|
||||
raise NotImplementedError
|
||||
if hasattr(self, "HACK_IS_STATIC_ON") or EXPLICIT_DL_AND_TEX_SIZES:
|
||||
if not self.is_tlut():
|
||||
return f"{self.elem_type} {self.symbol_name}[{self.height_name} * {self.width_name} * {self.siz.bpp} / 8 / sizeof({self.elem_type})]"
|
||||
return f"{self.elem_type} {self.symbol_name}[]"
|
||||
|
||||
def get_c_reference(self, resource_offset: int):
|
||||
|
@ -1335,7 +1338,7 @@ class DListResource(Resource, can_size_be_unknown=True):
|
|||
return RESOURCE_PARSE_SUCCESS
|
||||
|
||||
def get_c_declaration_base(self):
|
||||
if hasattr(self, "HACK_IS_STATIC_ON"):
|
||||
if hasattr(self, "HACK_IS_STATIC_ON") or EXPLICIT_DL_AND_TEX_SIZES:
|
||||
length = (self.range_end - self.range_start) // 8
|
||||
return f"Gfx {self.symbol_name}[{length}]"
|
||||
return f"Gfx {self.symbol_name}[]"
|
||||
|
|
Loading…
Add table
Reference in a new issue