Commit Graph

56 Commits

Author SHA1 Message Date
N.E.C c3a57bbad5 Video: Clearly separate Texture and EFB Copy formats
Improve bookkeeping around formats. Hopefully make code less confusing.

- Rename TlutFormat -> TLUTFormat to follow conventions.
- Use enum classes to prevent using a Texture format where an EFB Copy format
  is expected or vice-versa.
- Use common EFBCopyFormat names regardless of depth and YUV configurations.
2017-08-03 18:35:29 -07:00
Shawn Hoffman c5fa470ad8 replace DoFileSearch with optimized version 2017-06-23 17:25:53 -07:00
shuffle2 e63c337830 Merge pull request #5305 from iwubcode/abstract_texture
Abstract Texture
2017-06-18 12:57:05 -07:00
JosJuice f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
iwubcode e4896d39bd Video Backends: Move and rename HostTextureFormat to AbstractTextureFormat 2017-06-13 00:41:56 -05:00
MerryMage f5f45855f0 GameConfigLoader: Add GFX Game INI translations 2017-06-03 18:13:02 +01:00
Stenzek 20cbef8e9f HiresTextures: Move the maximum mip level check from DDS to main loader
This way that the mip count check occurs on .png and uncombined DDS
textures as well.
2017-04-29 13:46:43 +10:00
Stenzek 8761c8244d HiresTextures: Load full mipmap chain from DDS files
This removes the need for multiple texture files to store the mipmap
chain for a texture. As many mipmaps will be loaded as are present in
the DDS file, and any remaining mipmaps will fall back to the old
behavior.
2017-04-29 13:46:43 +10:00
Stenzek bc8a96d713 HiresTextures: Support parsing DDS files directly
This leaves DDS textures using DXT1/3/5 compressed in-memory, which can
be passed directly to the backend.
2017-04-29 00:14:23 +10:00
Lioncash f7a2f6ad01 FileSearch: Namespace functions under the Common namespace 2017-04-07 01:02:14 -04:00
JosJuice ced1614cac Unify the way of setting game ID, title ID, revision
The existing code from ConfigManager, ES and MIOS is merged
into a new set of functions called SetRunningGameMetadata.
2017-03-09 15:34:14 +01:00
Lioncash 552c0d8404 Common: Move byte swapping utilities into their own header
This moves all the byte swapping utilities into a header named Swap.h.

A dedicated header is much more preferable here due to the size of the
code itself. In general usage throughout the codebase, CommonFuncs.h was
generally only included for these functions anyway. These being in their
own header avoids dumping the lesser used utilities into scope. As well
as providing a localized area for more utilities related to byte
swapping in the future (should they be needed). This also makes it nicer
to identify which files depend on the byte swapping utilities in
particular.

Since this is a completely new header, moving the code uncovered a few
indirect includes, as well as making some other inclusions unnecessary.
2017-03-03 17:18:18 -05:00
JosJuice 1081497cad DiscIO/SConfig: Rename GetUniqueID to GetGameID
We call this "game ID" everywhere else, and it's not
actually completely unique.
2016-10-29 15:24:02 +02:00
Lioncash e01c143379 Common: namespace MemoryUtil 2016-08-07 13:03:07 -04:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
degasus 1544e4049d CustomTextures: Fix loading of the last mipmaps.
Non-square textures still have mipmaps down to 1x1.
2016-03-02 23:25:04 +01:00
Lioncash d9fec92628 VideoCommon: Header cleanup
Also remedies places where the video backends and core rely on things
being indirectly included.
2016-01-17 20:11:45 -05:00
JosJuice 03091ce180 HiresTextures: Refactor getting directory 2016-01-06 19:35:16 +01:00
JosJuice a2b45a4b82 HiresTextures: Also look for directories with 3-character IDs
People who make texture packs usually release them using a specific ID
(for instance SX4E01). Users who have a different version of the game
(like the PAL version SX4P01) then need to rename the custom texture
folder to match. This is a lot simpler than renaming every texture file,
as was required with the old texture format, but it's still something
that users can forget to do. To make that unnecessary, this change makes
it possible to use three-character region-free IDs for custom texture
folders, similarly to how game INIs can use three-character IDs. Once
most people have updated to Dolphin versions that include this change,
those who make texture packs will be able to name them with
three-character IDs, removing the need for users to rename anything.
2016-01-06 14:33:36 +01:00
Lioncash e082ebad1a HiresTextures: Remove the need to explicitly free SOIL allocated data 2015-12-29 08:40:17 -05:00
Lioncash 1d01fbd217 HiresTextures: Make Load return a unique_ptr 2015-12-29 08:40:15 -05:00
Lioncash 6a9e4511b5 HiresTextures: Remove unnecessary header includes 2015-12-29 08:40:07 -05:00
waddlesplash 5643fe5d1f FileSearch: Don't use RegExs, just do string comparisons.
Nothing used the RegEx feature of FileSearch, and GCC < 4.9
doesn't support C++11 RegEx properly, so get rid of it.
2015-09-27 13:25:51 -04:00
Lioncash 19459e827f Partially revert "General: Toss out PRI macro usage" 2015-09-11 09:49:00 -04:00
Lioncash 8fdb013d54 General: Toss out PRI macro usage
Now that VS supports more printf specifiers, these aren't necessary
2015-09-05 16:02:35 -04:00
Bartosz Telesiński a52aaf22ba VideoCommon: Allow more Ram for HiresTexture if system memory is over 4GB 2015-08-19 23:13:09 +02:00
Lioncash 4c79aa8216 HiresTextures: Remove unused variable 2015-06-19 17:31:04 -04:00
degasus c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
comex 830a4e4f8f Undo accidental screwup of some HiresTextures code from project-moration.
This is why I should wait for people to review, even if I get annoyed
that nobody seems to care. :duncecap:
2015-06-04 02:52:41 -04:00
comex a3b3f0522b Merge pull request #1556 from comex/project-moration
Rudimentary version of Wii IPC determinism.  Ported from my old udpnet branch.
2015-06-02 18:38:19 -04:00
degasus c69cc91f00 HiresTexture: Fix prefetching with broken textures 2015-05-29 07:31:11 +02:00
comex a225426510 Rewrite FileSearch and improve ScanDirectoryTree.
- FileSearch is now just one function, and it converts the original glob
  into a regex on all platforms rather than relying on native Windows
  pattern matching on there and a complete hack elsewhere.  It now
  supports recursion out of the box rather than manually expanding
  into a full list of directories in multiple call sites.

  - This adds a GCC >= 4.9 dependency due to older versions having
  outright broken <regex>.  MSVC is fine with it.

- ScanDirectoryTree returns the parent entry rather than filling parts
  of it in via reference.  The count is now stored in the entry like it
  was for subdirectories.

- .glsl file search is now done with DoFileSearch.

- IOCTLV_READ_DIR now uses ScanDirectoryTree directly and sorts the
  results after replacements for better determinism.
2015-05-28 19:14:42 -04:00
Markus Wick a6412fb41e Merge pull request #2162 from degasus/prefetch_tex
CustomTexture: prefetch all available textures
2015-05-26 13:30:26 +02:00
Tillmann Karras 30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
degasus 562b9d4a9f VideoCommon: Abort texture prefetching on low RAM
There is no nice way to correctly "detect" the "used" memory, so we just say
we're fine to use 50% of the physical memory for custom textures.

This will fix out-of-memory crashes, but we still might run into swapping issues.
2015-05-16 15:39:36 +02:00
degasus 242f7d964d CustomTexture: prefetch all available textures 2015-05-16 15:12:07 +02:00
degasus 7cf4dd63e4 CustomTexture: fix texture format 2015-01-21 23:33:42 +01:00
degasus 1d0557a5e6 CustomTexture: use xxhash 2015-01-21 21:47:18 +01:00
degasus 84c8645d22 CustomTexture: Convert old format automatically 2015-01-21 21:22:55 +01:00
degasus f9ced4eb13 CustomTexture: also support the legacy format 2015-01-21 21:22:55 +01:00
degasus 62402efa6c CustomTexture: Mark textures with mipmaps 2015-01-21 21:22:55 +01:00
degasus ee9d05d67f CustomTexture: Use another file name with wildcards 2015-01-21 21:22:55 +01:00
degasus a353ead3cb CustomTexture: Use always safe texture hash 2015-01-21 21:22:55 +01:00
degasus eeaad06a07 CustomTexture: check for min/max index on paletted textures 2015-01-21 21:22:55 +01:00
degasus f8184858da VideoCommon: Merge code to generate texture names on dumping 2014-12-29 10:24:27 +01:00
degasus 51bfc4c52a VideoCommon: rewrite custom textures 2014-12-29 10:24:21 +01:00
Rachel Bryk 4ed9b561bd Allow custom textures to load from unicode paths. 2014-09-22 12:51:30 -04:00
Shawn Hoffman 4bf031c064 msvc: resolve all warnings in VideoCommon. 2014-08-19 22:33:46 -07:00
degasus 6d3f249dcc mark all local variables as static 2014-07-11 16:10:20 +02:00