Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textures Manager #729

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
09093ae
resman: Implement texture methods stubs
vklachkov Jan 13, 2022
28bd6b9
resman: Minimal implementation of texture loading
vklachkov Jan 13, 2022
406dbe2
resman: Pass ref_interface_t to resource manager, save texture in mem
vklachkov Jan 13, 2022
f25ae90
resman: Check texture name
vklachkov Jan 13, 2022
b55c92a
resman: Implement cache
vklachkov Jan 13, 2022
bcbfb7c
resman: Generate stub entries for internal textures
vklachkov Jan 13, 2022
378aa88
resman: Implement RM_FindTexture
vklachkov Jan 13, 2022
067c534
resman: Set correct names for first six textures
vklachkov Jan 13, 2022
812af16
resman: Restore strange flags code
vklachkov Jan 13, 2022
697f3b3
resman: Stab more methods
vklachkov Jan 13, 2022
c0e7394
refgl: Dirty hack for get backtrace at texture n 121
vklachkov Jan 14, 2022
5074761
Checkout mainui t master branch
vklachkov Jan 14, 2022
1edd2f7
ref_gl: Remove dirty debug hack
vklachkov Jan 15, 2022
ee6669b
ref: Add RM_LoadTexture to ref_api_t
vklachkov Jan 15, 2022
6a1e1c3
ref_gl: Load some textures via engine, fix sprite glitches
vklachkov Jan 15, 2022
3c65550
resman: Implement RM_LoadTextureFromBuffer, fix more glitches
vklachkov Jan 15, 2022
54fc8a0
ref_gl: Load texture for sky via engine
vklachkov Jan 16, 2022
eea92a4
ref_api: Remove part of texture's methods, pass RM_* to RenderAPI
vklachkov Jan 16, 2022
d50edac
ref_soft: Load all textures via engine
vklachkov Jan 16, 2022
bde20c5
engine: Use remaining RM_* methods in render api
vklachkov Jan 16, 2022
61aa8e2
ref_api: Remove remaining texture tools from ref_interface_t
vklachkov Jan 16, 2022
e47c902
ref_gl: Use engine's RM_FreeTexture
vklachkov Jan 18, 2022
bbbc3e0
ref_gl: Remove unused methods
vklachkov Jan 18, 2022
8b2e6f3
Totally rework memory layout everywhere
vklachkov Apr 23, 2022
b14d5d7
resman: Subtract from textures_count on texture remove
vklachkov Apr 23, 2022
f3af112
resman: Restore internal textures
vklachkov Apr 25, 2022
4177fab
resman: Disable very noisy logs in RM_LoadTexture
vklachkov Apr 25, 2022
8648ce6
client: fix random crashes
vklachkov Apr 25, 2022
f72164d
resman: Implement ReuploadTextures, move CreateInternalTextures into …
vklachkov May 3, 2022
35ca0a4
ref_gl: Minor patch
vklachkov May 3, 2022
14bbe5c
ref_gl: Found standard textures in engine during initialization
vklachkov May 3, 2022
01eed00
resman: Rewrite FakeImage without static buffer
vklachkov May 3, 2022
e91d8db
resman: Create dlight textures, fix a lot of glitches
vklachkov May 4, 2022
3e6ade4
Fix ref_soft for new api
vklachkov May 5, 2022
3bb872b
resman: Minor clean up
vklachkov May 5, 2022
2c55163
Merge branch 'master' into resman_texture
vklachkov Jul 12, 2022
57de05c
resman: Implement RM_TextureName
vklachkov Jul 12, 2022
d7f2c47
resman: Minor changes
vklachkov Jul 12, 2022
d515c8a
resman: Implement RM_TextureData
vklachkov Jul 13, 2022
bcdb8b1
resman: Implement RM_CreateTexture and RM_CreateTextureArray
vklachkov Jul 13, 2022
cf5f074
resman: Implement ProcessFlags, replacement for GL_ProcessImage
vklachkov Jul 13, 2022
6aab155
resman: Implement RM_LoadTextureArray
vklachkov Jul 13, 2022
f78d7b3
Rename resman to texturelib and move to common
vklachkov Aug 7, 2022
f466496
texturelib: Code style fixes
vklachkov Aug 7, 2022
7bbc1da
texturelib: Use engine's Mem_Malloc instead of libc's malloc
vklachkov Aug 7, 2022
24c9474
texturelib: Set MAX_TEXTURES to 1024 when XASH_LOW_MEMORY
vklachkov Aug 7, 2022
d564c92
texturelib: Minor methods renames
vklachkov Aug 7, 2022
fd4d218
client: Remove useless macroses GL_*TextureInternal
vklachkov Aug 8, 2022
783538f
texturelib: Use string type from xash instead of chars array
vklachkov Aug 8, 2022
b94a08e
texturelib: Remove noisy logs
vklachkov Aug 8, 2022
269685d
reg_gl: Implement R_ShutdownImages
vklachkov Aug 8, 2022
374fc98
ref_gl: Restore comments
vklachkov Aug 8, 2022
5553d8a
ref_gl: Remove gl_numTextures
vklachkov Aug 8, 2022
1a23dac
ref_gl: Restore R_TextureList_f
vklachkov Aug 8, 2022
8b4562d
ref_gl: Restore some changes after bad merge
vklachkov Aug 8, 2022
d15ab39
texturelib: Remove texture after freeing in render
vklachkov Aug 8, 2022
d981fe7
ref_soft: Minor changes, restore most of comments
vklachkov Aug 8, 2022
4ce3d59
ref_soft: Restore R_TextureList_f
vklachkov Aug 8, 2022
b2d1283
ref_soft: Find standard textures in the engine
vklachkov Aug 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resman: Restore strange flags code
  • Loading branch information
vklachkov committed Jan 13, 2022
commit 812af16050fe6ad802163cac73f3e3723ff04738
19 changes: 10 additions & 9 deletions engine/resman/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ void RM_ReuploadTextures()

int RM_LoadTexture( const char *name, const byte *buf, size_t size, int flags )
{
rgbdata_t *picture;
rm_texture_t *texture;
rgbdata_t * picture;
rm_texture_t* texture;
uint picFlags;

Con_Reportf( "RM_LoadTexture. Name %s, size %d\n", name, size );

Expand All @@ -128,15 +129,15 @@ int RM_LoadTexture( const char *name, const byte *buf, size_t size, int flags )
return texture->number;
}

// TODO: Bit magic
//if( FBitSet( flags, TF_NOFLIP_TGA ))
// SetBits( picFlags, IL_DONTFLIP_TGA );
// Bit magic
if( FBitSet( flags, TF_NOFLIP_TGA ))
SetBits( picFlags, IL_DONTFLIP_TGA );

//if( FBitSet( flags, TF_KEEP_SOURCE ) && !FBitSet( flags, TF_EXPAND_SOURCE ))
// SetBits( picFlags, IL_KEEP_8BIT );
if( FBitSet( flags, TF_KEEP_SOURCE ) && !FBitSet( flags, TF_EXPAND_SOURCE ))
SetBits( picFlags, IL_KEEP_8BIT );

// TODO: Flags magic
//Image_SetForceFlags( picFlags );
// Flags magic
Image_SetForceFlags( picFlags );

// Load image using engine
picture = FS_LoadImage( name, buf, size );
Expand Down