Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/thpatch/thcrap

Touhou Community Reliant Automatic Patcher
https://github.com/thpatch/thcrap

Advanced image patching, part 6: Take sprite wrapping into account.

... yeah, you don't notice it until you try th14's ascii/pause_1280.png and notice that the Manu...

cdd1bab5b79a32f9d9d5e941e3b34529e02ced2f authored almost 11 years ago by nmlgc <[email protected]>
Fix a logic flaw in ANM sprite boundary resizing.

45d0944b36d5a4f973c76067c4edff530827d7f1 authored almost 11 years ago by nmlgc <[email protected]>
Set a sufficiently large console screen buffer to hold the patch list on Wine.

151e17676847d7730e6900c3ba99d75b335b4adf authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Don't optimize the cls() call in the patch selection.

Causes all kinds of problems in wineconsole, and isn't really visible under normal circumstances...

dec593ad1c3e1fbc9caa183d086ac37165c13935 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Don't maximize the console window on Wine.

It doesn't matter if Wine is running on a terminal, and it only causes weird screen buffer error...

0a90aa2a590b197a9bc1cbe9db8dda39bfef652a authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Print errors if writing failed, and ask the user to continue.

2ffe0a84f47c1722cac95784cf925bddd9e05de8 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_init(): Don't log exported functions.

I've thought long about this, but in the end, it really doesn't have too much use to dump this l...

e7595733a56de507b3d710ad7ed86595f91f1b5a authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Reword the patch selection.

107095f931f03ea6d111674c0388e49f4fb9e693 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Require the selection of at least one patch.

Sure, running without any patches might be a valid use case - thcrap behaves effectively like Ap...

392f75be78972471795080a7e22e968830c00721 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_tsa: Additionally look up window title translations in the string table.

c4225b2bb3464b2b7febadc43626be487b2fbce0 authored almost 11 years ago by nmlgc <[email protected]>
strings_get(): Return a JSON object, and add a new function returning a char*.

Improves the code in certain places.

However, due to an oversight in earlier Jansson versions, ...

bbc470390b3fdbd56b4bdce1b9814b437aa2ce6f authored almost 11 years ago by nmlgc <[email protected]>
Simplify sz_or_ord_size().

Turns out that we don't actually need the replacement string there.

6d406cba24ea335f09c5e00af3c9e9de940d1717 authored almost 11 years ago by nmlgc <[email protected]>
Use LoadLibraryEx() in the injection payload to guarantee the correct DLL path.

No more issues with older thcrap proxy DLLs... or rather, users extracting thcrap to a game dire...

f4b1db75e905a443b814b5dddd1e28f49233f6c9 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Use file_write() to write JSON files.

Necessary since we allow user input that may contain non-ASCII characters, which get converted b...

80aac66956ded4ae08ca8b367acd8035c4674dbe authored almost 11 years ago by nmlgc <[email protected]>
dir_create_for_fn(): Don't create a directory if [fn] contains no slash.

Duh! Wasn't that exactly why we needed that function in the first place? file_write(), the only ...

4aa47911c3bc7953d134e7595fb53dca92b07d85 authored almost 11 years ago by nmlgc <[email protected]>
Add json_decref_safe() to guard against double frees.

3a86052f8d52b316740371c9e0f457e492fddba4 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Update locally stored but undiscovered repositories.

6893df06a0fa41037a074d9a0750da390760d353 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Improve the URL caching logic.

This allows the program to actually keep the caches outside of RepoDiscover().

f70f3b2600d240a0ceb22f8d7b45014f8698ec74 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Ask if existing run configuration files should be overwritten.

3a9630d89cdb440668e2da49879c0689bfcd4886 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Ask for a custom run configuration file name.

ed2bb604e394c55d0f45970822b1b79f2e4d2d77 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Use a new method for naming run configurations.

I bet that people aren't particularly enthused about seeing all dependencies necessary for their...

d55dc72066b9ccffba9ce910a1e7478a2f6027e6 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Refactor console input into its own function.

885f9c7528a44dc8c31758748a29a08145899836 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Resolve absolute dependencies.

That should, hopefully, be everything as far as patch selection is concerned.

6a8afe6332c001432ae9c795a158e726c2c329d3 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Print the repository of each selected patch.

cb79f578c9134f8e8a72b2157cd416a53433d322 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Truncate long patch IDs.

3ee71c79d00aca5af225c9ec2b14ede12d5078d2 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Use persistent string storage where possible.

95d1c055d441e1b88336df186cc24358a338ce21 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Move the list of selected patches to the bottom.

Makes sense to put it closer to where the user is actually looking.

8def1198fb86e2675ad605e9ca401524d8b19eb6 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Refactor output of selected patches into its own function.

392173c54f1cb43824d7e589df70936192d5956c authored almost 11 years ago by nmlgc <[email protected]>
Take dependencies into account when adding and removing patches.

Finally, that's it! This basically implements everything we wanted to have in #18.

f9f7b98180eefe7b746e02741522d12dc63b2a03 authored almost 11 years ago by nmlgc <[email protected]>
Initialize patches during selection in a separate internal run configuration.

c9d83f517f19b0935ced0404173faeac6a1a5273 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Split patch bootstrapping into two functions.

One for building the patch object with the archive, another for downloading patch.js.

6335b2c744e27b0da564f1a31ab6f739dbd68e88 authored almost 11 years ago by nmlgc <[email protected]>
Refactor patch stack updating into its own function.

Because hey, we're going to use this more than once, too.

d0a032480a2ec1976186e009b10c127a0bd3e29e authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Display all repositories in the patch selection.

23c6c3d2d9a74b62e1c3140f10f1f9cc166d7a3a authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Refactor the repository patch list into its own function.

I don't see a way to nicely integrate the info page into that output...

f91a97cb6756e13fc09e30fb3032973ae6a8cbe2 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Load all local repositories into a list.

This way, everybody will be able to configure a patch stack using any patch of any repository th...

148a995b2fd6561d5974ffb01126737c8a3db20e authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Remove the special treatment of base_tsa.

... which will be handled by the dependency system in the future.

6c966893bb89bf56b04a9bbc8d5e473378dfcb6c authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Include the repository ID in the patch selection object.

Also introducing more variable naming consistency.

474230737a638ce5ec4c4c45dc5ddb8571588f46 authored almost 11 years ago by nmlgc <[email protected]>
TSA layout engine: Use json_string_nocheck() instead of converting to or expecting UTF-8.

Since we just abuse Jansson to give us a freely resizable array in memory, the encoding doesn't ...

2e7c8ac8869a63c22bc5fd2c4b4fd1927a04ea46 authored almost 11 years ago by nmlgc <[email protected]>
TSA layout engine: Fix reference counting / memory leak issues.

5ca8f089697f05af57365cf9cd8693d37e935511 authored almost 11 years ago by nmlgc <[email protected]>
Add json_array_set_new_expand().

This is what we actually wanted to use in the TSA layout engine (which also has been the only us...

d6aa3f52a7471f35a9eeb8e70fc0a7b1b671f3b9 authored almost 11 years ago by nmlgc <[email protected]>
Add some missing error checks.

2f9a2a66ff7182f1ddbb762cebf0781beab7b2d9 authored almost 11 years ago by nmlgc <[email protected]>
Move font loading out of thcrap_init().

That one call was so easy to overlook. Much better from a consistency standpoint, too.

ba5820e6f46517dae98e651cb7dcd486d0af32ad authored almost 11 years ago by nmlgc <[email protected]>
Move patch updating out of the patch bootstrapping function.

3482d2d4ca061f2fcd7e31e313eb98589d9a121c authored almost 11 years ago by nmlgc <[email protected]>
Permanently keep patch.js in a patch object.

Of course, this comes with the disadvantage that update server changes won't be applied until th...

868caad898c0ebb4c1a8dd3d52c360a332ea9cb2 authored almost 11 years ago by nmlgc <[email protected]>
Move patch stack evaluators to their own file.

7bea0897b891f76e0c26bfb8d386ac8337a65753 authored almost 11 years ago by nmlgc <[email protected]>
Move the message box showing missing patches into its own function.

ef419a59e1a3815883f621c4cf546a47fa0bb903 authored almost 11 years ago by nmlgc <[email protected]>
Add recursive patch repository discovery.

No visible effects on the configuration yet.

5e96e598b4652803c52f0a3ae5d1478b863ef04d authored almost 11 years ago by nmlgc <[email protected]>
Rename the patch list "server" concept to "repository".

Client-side counterpart of nmlgc/TouhouPatchCenter/a766c5f0d0c79b7ee5ab28efb6007188712fce06.

Pr...

74874eda993989f4dbf4f07e93740af333660622 authored almost 11 years ago by nmlgc <[email protected]>
Ensure that _CrtDumpMemoryLeaks() prints to stdout.

This suddenly stopped working for no apparent reason. Bisecting the code turned out that it appa...

de96215d1e81ef0786491bdff29c5b50ccc6426a authored almost 11 years ago by nmlgc <[email protected]>
Initialize formats after patches.

Wouldn't have worked if a run configuration with relative patch directories was not in the same ...

19250c52601043bc845c18b8408bf2ef6a308f0d authored almost 11 years ago by nmlgc <[email protected]>
Hardcode srv.thpatch.net as the default patch server.

Well, we gotta start this dependency madness somewhere.

Of course, this setting can still be ov...

f0a8642335b11581f493d67360797cc7bc18cc86 authored almost 11 years ago by nmlgc <[email protected]>
Advanced image patching, part 5: Walk the patch stack.

I don't really see any way to optimize this - with overlays, we always have to walk through the ...

240cf4c54e65b5b5cc4161bc563c58e606cdabf5 authored almost 11 years ago by nmlgc <[email protected]>
Use interlocked increments and decrements in the game search thread.

Hey, maybe we do want to use multithreaded game searching after all.

1ed78c89272948d816448b888474aedd5a96c8c3 authored almost 11 years ago by nmlgc <[email protected]>
Remove the deletion of the "files" object when bootstrapping a new patch.

This doesn't make sense anymore, now that we store the update information in files.js.

f6ea9d87dbe0727dd6d9fbf44231784de6ab8f46 authored almost 11 years ago by nmlgc <[email protected]>
Add ServerBuild().

Wow, I should use json_pack more often!

5a89b887f2a5512d9968bfd63dcf649c7b51b578 authored almost 11 years ago by nmlgc <[email protected]>
Refactor the file writing from patch_file_store into its own function.

afd146be8b7603199f43649d15dbef5f16bf0a79 authored almost 11 years ago by nmlgc <[email protected]>
ServerInit: Remove the old and broken JSON conversion code.

Hah, this didn't even work.

95c197591cd9ee5fdafff8bd514f2abd09bdb4f9 authored almost 11 years ago by nmlgc <[email protected]>
Refactor relative archive path conversion into its own function.

3ac3feaa7897a966d85c56541b0a1c6ce3a8f6e5 authored almost 11 years ago by nmlgc <[email protected]>
Refactor the text layout parser to operate on JSON strings.

Whoa! This gets completely rid of the native GetTextExtentPoint32() function, any strlen() calls...

9d886955e687f7170456a28054dae52fcbc03908 authored almost 11 years ago by nmlgc <[email protected]>
Use the new json_string_length() function wherever it makes sense.

954472f71d824372465d7c4aa50ceb8bd9c37087 authored almost 11 years ago by nmlgc <[email protected]>
Move sprite-level patching to patch_thtx().

de7fab7b1f9ea65137c48c17d1b5447f9ba02db8 authored almost 11 years ago by nmlgc <[email protected]>
Refactor the sprite patching functions into a single blitting function.

456feb2046b8d614f1a732574cca60e19d337625 authored almost 11 years ago by nmlgc <[email protected]>
Use the WCHAR_T_CONV_VLA macro wherever it makes sense.

68a5e183d63b4edafca79a091bc58744809b83de authored almost 11 years ago by nmlgc <[email protected]>
Simplify the STRUCT_GET macro.

Right, the size is already implied.

b417f2c1af7c0a67a2f72877b438547cc012c3a8 authored almost 11 years ago by nmlgc <[email protected]>
Keep ANM patching variables in a structure.

After a while, it becomes annoying to explicitly pass everything as an individual parameter.

b71471ac172c07f6f2e486bb6dbaeb95bfd45938 authored almost 11 years ago by nmlgc <[email protected]>
Turn patch_print_fn() into a public function.

Other stack resolving functions used by plug-ins would also like to have this functionality.

9b831b7236b7875db2ad2b449e4db4f9ec52020f authored almost 11 years ago by nmlgc <[email protected]>
format_blend(): Add alpha values instead of blending them.

This avoids a flaw in the blending algorithm, which may decrease the alpha value even if both ta...

f8afd4681773312386ba5da41f496ee7a62ed12f authored almost 11 years ago by nmlgc <[email protected]>
Add inject_LoadLibraryW().

... hey, we've got to duplicate *something* here.

dfef694fe31a3d7f29661c61cb421162fc154544 authored almost 11 years ago by nmlgc <[email protected]>
inject_CreateRemoteThread(): Catch and detour LoadLibraryW().

Required to work on top of Adonis.

800f89f7b938dc7b8cca04b32ba2e68160e5946d authored almost 11 years ago by nmlgc <[email protected]>
Calculate sprite pointers in advance.

2ed2700ab71448116198a978a340c341f011e98e authored almost 11 years ago by nmlgc <[email protected]>
Add runconfig_format_get().

More abstraction, yay.

c311f3534da43b8284452254295e9a9a96217e3f authored almost 11 years ago by nmlgc <[email protected]>
Advanced image patching, part 4: Perform alpha blending for opaque originals.

4c7a0a9d830ab8c6a09ce2d6f46c5ed08595c949 authored almost 11 years ago by nmlgc <[email protected]>
Advanced image patching, part 3: Optimize alpha analysis by summing up rows.

This gets rid of a large number of comparisons, and performs about 250% to 400% faster than the ...

9cc414666b303cf1d1b91ed29ef35c23eb622607 authored almost 11 years ago by nmlgc <[email protected]>
Advanced image patching, part 2: Alpha-based patching on sprite level.

By classifying an alpha channel into one of three states ("empty" if all alpha values are 0, "op...

57e36819d4c46930df9ddf68c33bf4bd81a5f732 authored almost 11 years ago by nmlgc <[email protected]>
Generate local PDB files for both Debug and Release builds.

By specifying /PDBALTPATH:%_PDB% in the linker command line, we can avoid these annoying full PD...

a9420227a43b9af8d2b3841458bea25774962ad0 authored almost 11 years ago by nmlgc <[email protected]>
json_object_merge(): Return the target object for convenience.

7f76cbcb271e75877d38dd68dfc8dd1d53ca6488 authored almost 11 years ago by nmlgc <[email protected]>
Advanced image patching, part 1: Calculate coordinates for sprite-level patching.

No visible differences yet, but it's the foundation of what's to come.

95b032adaf0983dcc0ec03bd0ee93f5ba996d9c0 authored almost 11 years ago by nmlgc <[email protected]>
Fix some memory leaks.

b3c5b419af19ff4a6a06a3b414a86f6a54f8da3b authored almost 11 years ago by nmlgc <[email protected]>
Project file cleanup.

Oops.

96d3df96537773b4c4fe1150866141c60141d2e2 authored almost 11 years ago by nmlgc <[email protected]>
General cleanup.

All the rest that doesn't really fit into the previous cleanup commits.

43ba3e77fbaca39a040841d7b2e7077ac0fc1d12 authored almost 11 years ago by nmlgc <[email protected]>
Reorder function definitions to match their order in the header file.

This is driving me ma~d.

5f8ffa4e2cecfa0da976575a7620bc12a6de7b00 authored almost 11 years ago by nmlgc <[email protected]>
Use the format_t type for the ANM format function parameters.

0eb0ccfe94d1be7a116ea31460b840876e1c2d11 authored almost 11 years ago by nmlgc <[email protected]>
Remove redundant conditional branches.

facbf7a2665553a2448c9091d4673967c89f8227 authored almost 11 years ago by nmlgc <[email protected]>
Use a single conditional branch to guard against null parameters.

07485ab7c2872456bceeef97c45d9793c01a3a69 authored almost 11 years ago by nmlgc <[email protected]>
Initialize variables upon declaration.

Saves lines at virtually no cost.

807f18b2c6664a203f3e4d1a5081f915f3bb507b authored almost 11 years ago by nmlgc <[email protected]>
Fix some function parameter consistency errors.

2b1de064072570c7406acda29ed209a7420be02b authored almost 11 years ago by nmlgc <[email protected]>
Use the WCHAR_T_FREE macro where appropriate.

937c56e5e2a5efa6072f4f7a728a001ec567a498 authored almost 11 years ago by nmlgc <[email protected]>
Fix some comments.

7943e42a01316f1be90a49acdd0ae9997fa7ce09 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_tsa: Set window title to translated game title and identified build.

af4059b5af8bdc4d4a24be25940cfdfed0f47783 authored almost 11 years ago by nmlgc <[email protected]>
Fix intermediate build directories.

This should also get rid of the the race conditions during compiling.

448b725f1606648413decdf0fa71ba3bc53e2d0a authored almost 11 years ago by nmlgc <[email protected]>
runconfig_set(): Increment the run configuration's reference counter.

Fixes bug #41 (https://bitbucket.org/nmlgc/thpatch-bugs/issue/41).

9796e4cc76c93344578a8fbed88feb6c552d7ba4 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Write relative paths.

Closes #7.

590c76794cce48deb3ce584e365550f98382befc authored almost 11 years ago by nmlgc <[email protected]>
thcrap_init(): Turn relative archive paths into absolute ones.

Wow. I have dreaded relative paths for so long, and then it turned out to be so easy.

2e97df7e5f687b16b0ccc4ba723b09e4d676c5bf authored almost 11 years ago by nmlgc <[email protected]>
Load dialog resource replacements from external binary files.

When translating resources using a tool like Resource Hacker, the location of a resource inside ...

791f7804b9687aa88249d879841916d7470d3582 authored almost 11 years ago by nmlgc <[email protected]>
layout_match(): Correctly parse nested layout markup.

6a04d41b5826299954cedaa2f0cadd57097dfad3 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_init(): Write the "game" key in any case.

Turns out that we not only can have games with no dedicated main JSON file, but also games that ...

8164c88b57288867f507b5fc4cb87b1c1b1a0188 authored almost 11 years ago by nmlgc <[email protected]>
Add strings_strcat().

0aff3660a01d0ee4b9a6fc8d5af03ace589c0fb2 authored almost 11 years ago by nmlgc <[email protected]>
Add strings_strclr().

777e68461f18c2d181edbcbac1a0d42c2a4b7f93 authored almost 11 years ago by nmlgc <[email protected]>
Use length-prefixed strings for persistent string storage.

It doesn't really give any significant boost in performance, but hey, it makes for a much cleane...

e3e0bdb46cceff84f03507cb3b4ddc2956ea0d4d authored almost 11 years ago by nmlgc <[email protected]>
Refactor persistent string allocation into its own function.

There will be more than just sprintf.

fd5a231f1753b26aca1e57430d571d69ea195b4a authored almost 11 years ago by nmlgc <[email protected]>