thunderchero wrote: ↑Tue Jun 24, 2025 7:28 am
as for 1024 x 1024 the more I thought about it, it would be counter productive.
larger textures would need a larger color palette to keep best colors for the texture.
No, detail is more important than the color count. It would still be great when there were larger ones suported.
Regarding the texture image formats..
jigalypuff wrote: ↑Mon Apr 28, 2008 10:43 am
nope can`t be done, also tried useing .bmp and .tga instaed of gif but that failed as well
Spocks-cuddly-tribble wrote: ↑Wed Sep 06, 2023 3:07 pm
thunderchero wrote: ↑Tue Sep 05, 2023 7:23 pmI converted all the gif's to bmp's changed texture.lst gif -> bmp
added bmp's and texture.lst and Game did not crash
loc_538D4E list GIF, BMP, APL and TGA as valid texture types to load from stbof.res.
thunderchero wrote: ↑Sun Sep 10, 2023 3:16 pm
Spocks-cuddly-tribble wrote: ↑Sun Sep 10, 2023 3:03 pm
If possible, wouldn't it be the best solution to just disable this limiting feature? I.e. allow any color to be rendered from any texture.
I would not care if it was limited to gif -> bmp
I wouldn't be surprised when by some other code location in trek.exe, the expected image format is very much hardcoded, and forcefully expects to load GIF palettes. But did anyone actually try to alter the MPR render calls?
Relevant to the rendering are the MPRNewTexture and the MPRLoadTexture calls:
0053904E push eax -> pixel height
00539055 push eax -> pixel width
00539056 push 8 -> 8bit
00539058 push 0E0h -> MPR_TI_PALETTE flag
0053905D push edi -> the render context
0053905E call MPRNewTexture
005390C5 push ebx -> texture buffer
005390C9 push ebp -> chroma key
005390CD push ecx -> texture ID
005390D1 push eax -> texture width bytes = width * 1 byte for 8bit textures
005390D8 push eax -> height
005390DF push eax -> width
005390E0 push 0 -> mipmaps?
005390E2 push 8 -> 8bit
005390E4 push edi -> the render context
005390E5 call MPRLoadTexture
for the palettes there is also:
00538FA9 push 100h -> 256 color entries
00538FAE push 20h -> 32bit
00538FB0 push esi -> the render context
00538FB1 call MPRNewTexturePalette
00538FC3 push ebp -> palette buffer
00538FC4 push 100h -> 256 color entries
00538FC9 push 0 -> start index
00538FCB push 20h -> 32bit
00538FCD push 80h -> MPR_TI_PALETTE
00538FD2 push edi -> palette ID
00538FD3 push esi -> the render context
00538FD4 call MPRLoadTexturePalette
refer mpr.h
Code: Select all
UInt __stdcall
MPRNewTexture (MPRHandle_t hRC,
UInt16 info,
UInt16 bits,
UInt16 width,
UInt16 height);
UInt __stdcall
MPRLoadTexture (MPRHandle_t hRC,
UInt16 bitsPixel,
UInt16 mip,
UInt16 width,
UInt16 rows,
Int16 TexWidthBytes,
UInt ID,
UInt chroma,
UInt8* TexBuffer);
UInt __stdcall
MPRNewTexturePalette (MPRHandle_t hRC,
UInt16 PalBitsPerEntry,
UInt16 PalNumEntries);
UInt __stdcall
MPRLoadTexturePalette (MPRHandle_t hRC,
UInt ID,
UInt16 info,
UInt16 PalBitsPerEntry,
UInt16 index,
UInt16 entries,
UInt8* PalBuffer);
width and height by the way are read from the global texture list:
00538920 mov eax, ds:GlobalTextureList_48h_72_dec_entries
00538925 shl esi, 3
00538928 add eax, esi
00538934 lea ecx, [eax+2Ch]
005389C8 mov edx, ecx
005389CA call texture_cpp_MPRNewTexture