<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Little Fighter Empire - Forums - Programming]]></title>
		<link>https://lf-empire.de/forum/</link>
		<description><![CDATA[Little Fighter Empire - Forums - https://lf-empire.de/forum]]></description>
		<pubDate>Mon, 16 Nov 2026 16:11:55 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[[WIP] 1:1 C++ Decompilation & Source Lift of lf2.exe]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=11732</link>
			<pubDate>Sat, 31 Oct 2026 16:59:33 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=8272">rev-eng</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=11732</guid>
			<description><![CDATA[<img src="https://github.com/0xd34db8/LF2-decomp/raw/main/assets/hero-compressed.png" loading="lazy"  alt="[Image: hero-compressed.png]" class="mycode_img" /><br />
<br />
<span style="font-weight: bold;" class="mycode_b">GitHub Repo:</span> <a href="https://github.com/0xd34db8/LF2-decomp" target="_blank" rel="noopener" class="mycode_url">https://github.com/0xd34db8/LF2-decomp</a><br />
<br />
Over the past 20+ years, this community has seen countless incredible fan projects: AngelScript dynamic memory hooks (LF2-Enchanted), DirectDraw ddraw wrappers, clean-room modern engine clones (OpenLF2, OriVered's rebuild), and Unity/Godot reimplementations. <br />
<br />
While those projects are awesome, they all share one thing in common: <span style="font-weight: bold;" class="mycode_b">they are approximations, external wrappers, or clean-room interpretations of how LF2 <span style="font-style: italic;" class="mycode_i">might</span> work.</span> <br />
<br />
To date, <span style="font-weight: bold;" class="mycode_b">nobody has ever completed a REAL, 1:1 binary decompilation of <span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span>.</span><br />
<br />
The only person who came close was <span style="font-family: 'Courier New';" class="mycode_font">xsoameix</span> roughly 12 years ago when they began painstakingly mapping out assembly instructions into Ruby (<span style="font-family: 'Courier New';" class="mycode_font">xsoameix/lf2</span>). But that project was abandoned before a working, compilable game engine could be finished.<br />
<br />
We are actively working to finish that mission.<br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">What Makes This Project Different?</span><br />
<br />
We are not building an engine from scratch, and we are not guessing. <br />
<br />
Using <span style="font-weight: bold;" class="mycode_b">Ghidra</span> and modern binary analysis, we are disassembling and decompiling the original compiled x86-32 MSVC++ executable (<span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span> v1.9c / v2.0a) and lifting the <span style="font-weight: bold;" class="mycode_b">exact, authentic C++ code</span> directly from the binary.<br />
<br />
<ol type="1" class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Zero Guesswork / 100% Math Fidelity:</span> Hitbox collision formulas (<span style="font-family: 'Courier New';" class="mycode_font">itr_t</span> / <span style="font-family: 'Courier New';" class="mycode_font">bdy_t</span>), 3D velocity integration, gravity steps, frame wait timers, and damage calculations are mathematically identical to the original assembly.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Pristine Ground Truth:</span> We maintain an untouched archive of raw Ghidra decompiler exports (<span style="font-family: 'Courier New';" class="mycode_font">decompiled/RAW/</span>) alongside a syntactically valid legacy C suite (<span style="font-family: 'Courier New';" class="mycode_font">decompiled/Compilable/</span>).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Liberation, Not Emulation:</span> We extract that pure game logic into a modern, portable C++20 engine (<span style="font-family: 'Courier New';" class="mycode_font">src/</span>), replacing deprecated Win32 message pumps and DirectDraw 6 surfaces with SDL2 so it compiles natively on modern 32-bit and 64-bit platforms.<br />
</li>
</ol>
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">Wild Secrets &amp; Mysteries Uncovered Inside <span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span></span><br />
<br />
Decompiling the binary instruction-by-instruction has finally answered questions and mysteries LF2 players and modders have debated for over two decades:<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">The Anatomy of the Infamous "Synchronisation Error!" (<span style="font-family: 'Courier New';" class="mycode_font">0x0041C5F0</span>):</span><br />
  LF2 network play runs on a compact 22-byte lockstep packet. Every tick, the host calculates a cumulative checksum of all active characters' HP (Σ HPᵢ). If client and host HP checksums differ by <span style="font-weight: bold;" class="mycode_b">even 1 HP</span> (due to a single floating-point jitter or projectile spawn timing deviation), the binary immediately aborts execution and shows the dreaded <span style="font-style: italic;" class="mycode_i">"Synchronisation Error!"</span> modal dialog!<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Why Stage 5 Crashes to Desktop (<span style="font-family: 'Courier New';" class="mycode_font">g_objects[100]</span>):</span><br />
  <span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span> manages all world entities through a fixed, hardcoded array capped at <span style="font-weight: bold;" class="mycode_b">exactly 100 slots</span> (<span style="font-family: 'Courier New';" class="mycode_font">0x00450BE0</span>). Davis, bandits, dropped baseball bats, flying energy balls, and transient blood splatter particles all compete for these same 100 slots. In chaotic Stage 5 battles, slot 101 returns <span style="font-family: 'Courier New';" class="mycode_font">NULL</span>—which the game promptly attempts to dereference, causing an instant CTD.<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">The No-Vtable Architecture:</span><br />
  Clean-room rebuilds often assume an object-oriented hierarchy (<span style="font-family: 'Courier New';" class="mycode_font">Character -&gt; Entity -&gt; Weapon</span>). In the real binary, Marti Wong wrote a single, monolithic 880-byte <span style="font-family: 'Courier New';" class="mycode_font">object_t</span> struct without a single virtual method or vtable pointer! Everything from Julian to a falling rock runs through the exact same struct layout and massive procedural state machines (like the 4,000-line combat dispatcher at <span style="font-family: 'Courier New';" class="mycode_font">0x0042E100</span>).<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Why Usernames in <span style="font-family: 'Courier New';" class="mycode_font">control.txt</span> Had Backticks (<span style="font-family: 'Courier New';" class="mycode_font">`</span>):</span><br />
  LF2 serialized <span style="font-family: 'Courier New';" class="mycode_font">control.txt</span> with <span style="font-family: 'Courier New';" class="mycode_font">fscanf("%s")</span>, which normally splits on spaces. Marti’s clever workaround in assembly (<span style="font-family: 'Courier New';" class="mycode_font">0x004233E0</span>) was a loop that replaced every space character with a grave accent (<span style="font-family: 'Courier New';" class="mycode_font">`</span>) before saving, and reverted them back on load!<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">The Rudolf Void Glitch (<span style="font-family: 'Courier New';" class="mycode_font">0x00403270</span>):</span><br />
  When Rudolf grabs an opponent at the edge of the screen, the game computes x₍dest₎ = x₍target₎ ± 40. The assembly completely forgot to clamp this destination against the stage boundaries—meaning grabbing someone near the edge of the screen teleports Rudolf into negative coordinates outside the map.<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Hardcoded Cheats &amp; Secrets:</span><br />
  Looking at <span style="font-family: 'Courier New';" class="mycode_font">WindowProc</span> (<span style="font-family: 'Courier New';" class="mycode_font">0x0043b3d0</span>), keystroke state machines listen for:<br />
 <ul class="mycode_list"><li><span style="font-family: 'Courier New';" class="mycode_font">"lf2.net"</span>: Unlocks Julian, Firzen, LouisEX, and other enemy henchmen characters.<br />
</li>
<li><span style="font-family: 'Courier New';" class="mycode_font">"herofighter.com"</span>: A secret shoutout Marti added to LF2 v2.0 for his next game, which unlocks function keys in stage mode<br />
</li>
<li><span style="font-family: 'Courier New';" class="mycode_font">"ABC"</span>: Switches on the developer's internal frame/hitbox inspector.<br />
  </li>
</ul>
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">The 3,000-Byte PRNG Table:</span><br />
  LF2 doesn't use the C standard library <span style="font-family: 'Courier New';" class="mycode_font">rand()</span> because CRT implementations differ across compilers and desync multiplayer. Instead, embedded at <span style="font-family: 'Courier New';" class="mycode_font">0x0044FF90</span> is a precomputed 3,000-byte lookup table that the engine simply cycles through circularly.<br />
</li>
</ul>
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">Project Status (Work in Progress!)</span><br />
<br />
This is an active, ongoing effort. Here is what has been lifted, verified, and running so far:<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">[x] Core Memory Maps:</span> Struct layouts for <span style="font-family: 'Courier New';" class="mycode_font">bdy</span>, <span style="font-family: 'Courier New';" class="mycode_font">itr</span>, <span style="font-family: 'Courier New';" class="mycode_font">wpoint</span>, <span style="font-family: 'Courier New';" class="mycode_font">cpoint</span>, <span style="font-family: 'Courier New';" class="mycode_font">opoint</span>, <span style="font-family: 'Courier New';" class="mycode_font">frame</span>, <span style="font-family: 'Courier New';" class="mycode_font">file</span>, and <span style="font-family: 'Courier New';" class="mycode_font">object</span> verified with compile-time assertions.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Cipher &amp; Data Loader:</span> 100% authentic Vigenère decryptor (123-byte header skip + <span style="font-family: 'Courier New';" class="mycode_font">"SiuHungIsAGoodBearBecauseHeIsVeryGood"</span> key) and full parser for <span style="font-family: 'Courier New';" class="mycode_font">data.txt</span> and <span style="font-family: 'Courier New';" class="mycode_font">.dat</span> character files.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Entity Physics &amp; Movement:</span> 3D velocity integration, gravity, jumping arcs, ground friction, and wait-counter state machines.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Combat &amp; Collision Dispatcher:</span> Full 1:1 lift of <span style="font-family: 'Courier New';" class="mycode_font">0x0042E100</span> (damage calculations, flinch states, knockdown fall thresholds, rest timers).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Weapons &amp; Grappling:</span> Catch/throw anchoring (<span style="font-family: 'Courier New';" class="mycode_font">cpoint</span>) and 3D weapon pickups/drops/throws (<span style="font-family: 'Courier New';" class="mycode_font">wpoint</span>).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] AI Decision Tree:</span> Autonomous enemy threat targeting, approach synthesis, and combo execution (<span style="font-family: 'Courier New';" class="mycode_font">0x00406BA0</span>).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Graphics &amp; Audio:</span> Software clipping, sprite sheet slicing (including the 1-pixel separator gutter), multi-layer parallax backgrounds, and zero-dependency SDL2 audio.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Automated Test Harnesses:</span> Test suites ensuring mathematical parity against the raw disassembly.<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">What's Next?</span><br />
We are continuing to lift the remaining high-level scene management, menu flows, stage phase progression, and modernizing the network layer so we can finally have a completely liberated, authentic LF2 engine that plays exactly like the 1999–2002 original.<br />
<br />
If you are an LF2 veteran, modder, or reverse engineering enthusiast, we'd love to hear your thoughts, answer questions about the binary internals, and share findings with the community]]></description>
			<content:encoded><![CDATA[<img src="https://github.com/0xd34db8/LF2-decomp/raw/main/assets/hero-compressed.png" loading="lazy"  alt="[Image: hero-compressed.png]" class="mycode_img" /><br />
<br />
<span style="font-weight: bold;" class="mycode_b">GitHub Repo:</span> <a href="https://github.com/0xd34db8/LF2-decomp" target="_blank" rel="noopener" class="mycode_url">https://github.com/0xd34db8/LF2-decomp</a><br />
<br />
Over the past 20+ years, this community has seen countless incredible fan projects: AngelScript dynamic memory hooks (LF2-Enchanted), DirectDraw ddraw wrappers, clean-room modern engine clones (OpenLF2, OriVered's rebuild), and Unity/Godot reimplementations. <br />
<br />
While those projects are awesome, they all share one thing in common: <span style="font-weight: bold;" class="mycode_b">they are approximations, external wrappers, or clean-room interpretations of how LF2 <span style="font-style: italic;" class="mycode_i">might</span> work.</span> <br />
<br />
To date, <span style="font-weight: bold;" class="mycode_b">nobody has ever completed a REAL, 1:1 binary decompilation of <span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span>.</span><br />
<br />
The only person who came close was <span style="font-family: 'Courier New';" class="mycode_font">xsoameix</span> roughly 12 years ago when they began painstakingly mapping out assembly instructions into Ruby (<span style="font-family: 'Courier New';" class="mycode_font">xsoameix/lf2</span>). But that project was abandoned before a working, compilable game engine could be finished.<br />
<br />
We are actively working to finish that mission.<br />
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">What Makes This Project Different?</span><br />
<br />
We are not building an engine from scratch, and we are not guessing. <br />
<br />
Using <span style="font-weight: bold;" class="mycode_b">Ghidra</span> and modern binary analysis, we are disassembling and decompiling the original compiled x86-32 MSVC++ executable (<span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span> v1.9c / v2.0a) and lifting the <span style="font-weight: bold;" class="mycode_b">exact, authentic C++ code</span> directly from the binary.<br />
<br />
<ol type="1" class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">Zero Guesswork / 100% Math Fidelity:</span> Hitbox collision formulas (<span style="font-family: 'Courier New';" class="mycode_font">itr_t</span> / <span style="font-family: 'Courier New';" class="mycode_font">bdy_t</span>), 3D velocity integration, gravity steps, frame wait timers, and damage calculations are mathematically identical to the original assembly.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Pristine Ground Truth:</span> We maintain an untouched archive of raw Ghidra decompiler exports (<span style="font-family: 'Courier New';" class="mycode_font">decompiled/RAW/</span>) alongside a syntactically valid legacy C suite (<span style="font-family: 'Courier New';" class="mycode_font">decompiled/Compilable/</span>).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Liberation, Not Emulation:</span> We extract that pure game logic into a modern, portable C++20 engine (<span style="font-family: 'Courier New';" class="mycode_font">src/</span>), replacing deprecated Win32 message pumps and DirectDraw 6 surfaces with SDL2 so it compiles natively on modern 32-bit and 64-bit platforms.<br />
</li>
</ol>
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">Wild Secrets &amp; Mysteries Uncovered Inside <span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span></span><br />
<br />
Decompiling the binary instruction-by-instruction has finally answered questions and mysteries LF2 players and modders have debated for over two decades:<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">The Anatomy of the Infamous "Synchronisation Error!" (<span style="font-family: 'Courier New';" class="mycode_font">0x0041C5F0</span>):</span><br />
  LF2 network play runs on a compact 22-byte lockstep packet. Every tick, the host calculates a cumulative checksum of all active characters' HP (Σ HPᵢ). If client and host HP checksums differ by <span style="font-weight: bold;" class="mycode_b">even 1 HP</span> (due to a single floating-point jitter or projectile spawn timing deviation), the binary immediately aborts execution and shows the dreaded <span style="font-style: italic;" class="mycode_i">"Synchronisation Error!"</span> modal dialog!<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Why Stage 5 Crashes to Desktop (<span style="font-family: 'Courier New';" class="mycode_font">g_objects[100]</span>):</span><br />
  <span style="font-family: 'Courier New';" class="mycode_font">lf2.exe</span> manages all world entities through a fixed, hardcoded array capped at <span style="font-weight: bold;" class="mycode_b">exactly 100 slots</span> (<span style="font-family: 'Courier New';" class="mycode_font">0x00450BE0</span>). Davis, bandits, dropped baseball bats, flying energy balls, and transient blood splatter particles all compete for these same 100 slots. In chaotic Stage 5 battles, slot 101 returns <span style="font-family: 'Courier New';" class="mycode_font">NULL</span>—which the game promptly attempts to dereference, causing an instant CTD.<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">The No-Vtable Architecture:</span><br />
  Clean-room rebuilds often assume an object-oriented hierarchy (<span style="font-family: 'Courier New';" class="mycode_font">Character -&gt; Entity -&gt; Weapon</span>). In the real binary, Marti Wong wrote a single, monolithic 880-byte <span style="font-family: 'Courier New';" class="mycode_font">object_t</span> struct without a single virtual method or vtable pointer! Everything from Julian to a falling rock runs through the exact same struct layout and massive procedural state machines (like the 4,000-line combat dispatcher at <span style="font-family: 'Courier New';" class="mycode_font">0x0042E100</span>).<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Why Usernames in <span style="font-family: 'Courier New';" class="mycode_font">control.txt</span> Had Backticks (<span style="font-family: 'Courier New';" class="mycode_font">`</span>):</span><br />
  LF2 serialized <span style="font-family: 'Courier New';" class="mycode_font">control.txt</span> with <span style="font-family: 'Courier New';" class="mycode_font">fscanf("%s")</span>, which normally splits on spaces. Marti’s clever workaround in assembly (<span style="font-family: 'Courier New';" class="mycode_font">0x004233E0</span>) was a loop that replaced every space character with a grave accent (<span style="font-family: 'Courier New';" class="mycode_font">`</span>) before saving, and reverted them back on load!<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">The Rudolf Void Glitch (<span style="font-family: 'Courier New';" class="mycode_font">0x00403270</span>):</span><br />
  When Rudolf grabs an opponent at the edge of the screen, the game computes x₍dest₎ = x₍target₎ ± 40. The assembly completely forgot to clamp this destination against the stage boundaries—meaning grabbing someone near the edge of the screen teleports Rudolf into negative coordinates outside the map.<br />
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">Hardcoded Cheats &amp; Secrets:</span><br />
  Looking at <span style="font-family: 'Courier New';" class="mycode_font">WindowProc</span> (<span style="font-family: 'Courier New';" class="mycode_font">0x0043b3d0</span>), keystroke state machines listen for:<br />
 <ul class="mycode_list"><li><span style="font-family: 'Courier New';" class="mycode_font">"lf2.net"</span>: Unlocks Julian, Firzen, LouisEX, and other enemy henchmen characters.<br />
</li>
<li><span style="font-family: 'Courier New';" class="mycode_font">"herofighter.com"</span>: A secret shoutout Marti added to LF2 v2.0 for his next game, which unlocks function keys in stage mode<br />
</li>
<li><span style="font-family: 'Courier New';" class="mycode_font">"ABC"</span>: Switches on the developer's internal frame/hitbox inspector.<br />
  </li>
</ul>
<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">The 3,000-Byte PRNG Table:</span><br />
  LF2 doesn't use the C standard library <span style="font-family: 'Courier New';" class="mycode_font">rand()</span> because CRT implementations differ across compilers and desync multiplayer. Instead, embedded at <span style="font-family: 'Courier New';" class="mycode_font">0x0044FF90</span> is a precomputed 3,000-byte lookup table that the engine simply cycles through circularly.<br />
</li>
</ul>
<br />
<hr class="mycode_hr" />
<br />
<span style="font-weight: bold;" class="mycode_b">Project Status (Work in Progress!)</span><br />
<br />
This is an active, ongoing effort. Here is what has been lifted, verified, and running so far:<br />
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">[x] Core Memory Maps:</span> Struct layouts for <span style="font-family: 'Courier New';" class="mycode_font">bdy</span>, <span style="font-family: 'Courier New';" class="mycode_font">itr</span>, <span style="font-family: 'Courier New';" class="mycode_font">wpoint</span>, <span style="font-family: 'Courier New';" class="mycode_font">cpoint</span>, <span style="font-family: 'Courier New';" class="mycode_font">opoint</span>, <span style="font-family: 'Courier New';" class="mycode_font">frame</span>, <span style="font-family: 'Courier New';" class="mycode_font">file</span>, and <span style="font-family: 'Courier New';" class="mycode_font">object</span> verified with compile-time assertions.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Cipher &amp; Data Loader:</span> 100% authentic Vigenère decryptor (123-byte header skip + <span style="font-family: 'Courier New';" class="mycode_font">"SiuHungIsAGoodBearBecauseHeIsVeryGood"</span> key) and full parser for <span style="font-family: 'Courier New';" class="mycode_font">data.txt</span> and <span style="font-family: 'Courier New';" class="mycode_font">.dat</span> character files.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Entity Physics &amp; Movement:</span> 3D velocity integration, gravity, jumping arcs, ground friction, and wait-counter state machines.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Combat &amp; Collision Dispatcher:</span> Full 1:1 lift of <span style="font-family: 'Courier New';" class="mycode_font">0x0042E100</span> (damage calculations, flinch states, knockdown fall thresholds, rest timers).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Weapons &amp; Grappling:</span> Catch/throw anchoring (<span style="font-family: 'Courier New';" class="mycode_font">cpoint</span>) and 3D weapon pickups/drops/throws (<span style="font-family: 'Courier New';" class="mycode_font">wpoint</span>).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] AI Decision Tree:</span> Autonomous enemy threat targeting, approach synthesis, and combo execution (<span style="font-family: 'Courier New';" class="mycode_font">0x00406BA0</span>).<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Graphics &amp; Audio:</span> Software clipping, sprite sheet slicing (including the 1-pixel separator gutter), multi-layer parallax backgrounds, and zero-dependency SDL2 audio.<br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">[x] Automated Test Harnesses:</span> Test suites ensuring mathematical parity against the raw disassembly.<br />
</li>
</ul>
<br />
<span style="font-weight: bold;" class="mycode_b">What's Next?</span><br />
We are continuing to lift the remaining high-level scene management, menu flows, stage phase progression, and modernizing the network layer so we can finally have a completely liberated, authentic LF2 engine that plays exactly like the 1999–2002 original.<br />
<br />
If you are an LF2 veteran, modder, or reverse engineering enthusiast, we'd love to hear your thoughts, answer questions about the binary internals, and share findings with the community]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[VioletScript]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=11294</link>
			<pubDate>Tue, 03 Jan 2023 20:00:28 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=5443">Hydroper</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=11294</guid>
			<description><![CDATA[Hey, a long time I've been off this forum! Happy new year! I'm coming to announce a project I started in 2017, a scripting language that is an EcmaScript dialect.<br />
<br />
The compiler is not yet ready, sadly. But I want to show the available overview and reference for the language: <br />
<br />
<a href="https://violetscript.github.io" target="_blank" rel="noopener" class="mycode_url">website</a><br />
<br />
Here are particular features I like:<br />
<br />
<a href="https://violetscript.github.io/docs/language_reference/types/enumeration_types.html" target="_blank" rel="noopener" class="mycode_url">enumerations</a><br />
<a href="https://violetscript.github.io/docs/language_reference/types/record_types.html" target="_blank" rel="noopener" class="mycode_url">record types</a><br />
<a href="https://violetscript.github.io/docs/language_reference/exp/markup.html" target="_blank" rel="noopener" class="mycode_url">markup</a>]]></description>
			<content:encoded><![CDATA[Hey, a long time I've been off this forum! Happy new year! I'm coming to announce a project I started in 2017, a scripting language that is an EcmaScript dialect.<br />
<br />
The compiler is not yet ready, sadly. But I want to show the available overview and reference for the language: <br />
<br />
<a href="https://violetscript.github.io" target="_blank" rel="noopener" class="mycode_url">website</a><br />
<br />
Here are particular features I like:<br />
<br />
<a href="https://violetscript.github.io/docs/language_reference/types/enumeration_types.html" target="_blank" rel="noopener" class="mycode_url">enumerations</a><br />
<a href="https://violetscript.github.io/docs/language_reference/types/record_types.html" target="_blank" rel="noopener" class="mycode_url">record types</a><br />
<a href="https://violetscript.github.io/docs/language_reference/exp/markup.html" target="_blank" rel="noopener" class="mycode_url">markup</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Fixing Grammar]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=11073</link>
			<pubDate>Sat, 13 Jun 2020 01:50:38 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=1603">LutiChris</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=11073</guid>
			<description><![CDATA[My Goal is to take the words in the dictionary &amp; attribute them to x amount of groups. Each of the groups has its own words &amp; sub-groups based on a shared characteristic<br />
<br />
The problem that I'm having is when a specific group is chosen &amp; the contents (i.e. the other sub-groups) are chosen the output reveals poor grammar. I have to manually adjust the word so it fits correctly and this is annoying. Is there a way I can get proper grammar structure from a randomly generated combination of words? Is it possible to organize these words in a proper sentence based on "Parts of Speech" (i.e Adjectives, Adverbs, Conjunctions, Determiners, Nouns, Prepositions, Pronouns &amp; Verbs)<br />
<br />
Here's an Example:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>BAD SENTENCE STRUCTURE
Group 1		Group 3				Group 8
I AM			Extremist (noun)		Annoy (verb)


GOOD SENTENCE STRUCTURE
Group 1		Group 3					Group 8
I AM			Extremely (adjective)		Annoying (adjective)</code></div></div><br />
"I AM + Annoying (adj) + Extremely (adj)" wouldn't make much sense unless it was<br />
"I AM + Annoying (adj) + Extremists (plural noun)" <br />
<br />
These were some neat ideas I found on youtube regarding Predictive Text<br />
<div class="tborder spoiler"><div class="spoiler_header">Videos <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;">
Some of the parts aren't included because I didn't find them to be particularly interesting but they're up on the guys channel.<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/nzWwWXdeweg" frameborder="0" allowfullscreen="true"></iframe><br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/bFrjlRDyWQM" frameborder="0" allowfullscreen="true"></iframe><br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/5Vf-p7FiQqY" frameborder="0" allowfullscreen="true"></iframe><br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/s509p6inP0E" frameborder="0" allowfullscreen="true"></iframe></div></div>
Any suggestions?]]></description>
			<content:encoded><![CDATA[My Goal is to take the words in the dictionary &amp; attribute them to x amount of groups. Each of the groups has its own words &amp; sub-groups based on a shared characteristic<br />
<br />
The problem that I'm having is when a specific group is chosen &amp; the contents (i.e. the other sub-groups) are chosen the output reveals poor grammar. I have to manually adjust the word so it fits correctly and this is annoying. Is there a way I can get proper grammar structure from a randomly generated combination of words? Is it possible to organize these words in a proper sentence based on "Parts of Speech" (i.e Adjectives, Adverbs, Conjunctions, Determiners, Nouns, Prepositions, Pronouns &amp; Verbs)<br />
<br />
Here's an Example:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>BAD SENTENCE STRUCTURE
Group 1		Group 3				Group 8
I AM			Extremist (noun)		Annoy (verb)


GOOD SENTENCE STRUCTURE
Group 1		Group 3					Group 8
I AM			Extremely (adjective)		Annoying (adjective)</code></div></div><br />
"I AM + Annoying (adj) + Extremely (adj)" wouldn't make much sense unless it was<br />
"I AM + Annoying (adj) + Extremists (plural noun)" <br />
<br />
These were some neat ideas I found on youtube regarding Predictive Text<br />
<div class="tborder spoiler"><div class="spoiler_header">Videos <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;">
Some of the parts aren't included because I didn't find them to be particularly interesting but they're up on the guys channel.<br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/nzWwWXdeweg" frameborder="0" allowfullscreen="true"></iframe><br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/bFrjlRDyWQM" frameborder="0" allowfullscreen="true"></iframe><br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/5Vf-p7FiQqY" frameborder="0" allowfullscreen="true"></iframe><br />
<iframe width="560" height="315" src="//www.youtube-nocookie.com/embed/s509p6inP0E" frameborder="0" allowfullscreen="true"></iframe></div></div>
Any suggestions?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[LF on Linux]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10943</link>
			<pubDate>Mon, 19 Nov 2018 05:42:43 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=6294">JohnGURPS</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10943</guid>
			<description><![CDATA[I use Lubuntu, a Ubuntu-based Linux OS. Would anyone know where I can find a version of the guide and 4 games which work for me?]]></description>
			<content:encoded><![CDATA[I use Lubuntu, a Ubuntu-based Linux OS. Would anyone know where I can find a version of the guide and 4 games which work for me?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Magica - A template for integrated online game platform]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10857</link>
			<pubDate>Thu, 24 May 2018 16:16:35 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=4488">rewlf2</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10857</guid>
			<description><![CDATA[Hello.<br />
<br />
I recently decided to work slowly (I mean really slowly) on making an incremental online game that features 2D acolytes using spells to go adventuring, and I chose Phaser.io for the platform.<br />
<br />
After some amount of tackling I made a simple but rigid template that uses Websocket and reads MySQL database. This can be used to develop offline game (if you leave out MySQL) or literally any 2D game you can imagine. However the more complex logic including keystrokes, mouse actions and physics are not implemented. I focused on the tricky Text fields and Sockets, if someone wants to develop a game out of it, he/she should find it more straightforward to do.<br />
<br />
Mind that Magica is built upon ES6 Javascript and requires Node.js installed in your computer to properly build and run.<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/rewlf2/magica_phaser_template" target="_blank" rel="noopener" class="mycode_url">https://github.com/rewlf2/magica_phaser_template</a></span><br />
<br />
<img src="https://i.imgur.com/62YqvLk.png" loading="lazy"  alt="[Image: 62YqvLk.png]" class="mycode_img" /><br />
<br />
If you wish to develop a game starting from this template, feel free to contact me by Discord and I suggest you go learn about how <a href="http://phaser.io" target="_blank" rel="noopener" class="mycode_url">Phaser.io</a> works and also read about how WebSocket works.<br />
<br />
For websockets, <a href="http://www.gojasonyang.com/" target="_blank" rel="noopener" class="mycode_url">http://www.gojasonyang.com/</a> is definitely a great help.]]></description>
			<content:encoded><![CDATA[Hello.<br />
<br />
I recently decided to work slowly (I mean really slowly) on making an incremental online game that features 2D acolytes using spells to go adventuring, and I chose Phaser.io for the platform.<br />
<br />
After some amount of tackling I made a simple but rigid template that uses Websocket and reads MySQL database. This can be used to develop offline game (if you leave out MySQL) or literally any 2D game you can imagine. However the more complex logic including keystrokes, mouse actions and physics are not implemented. I focused on the tricky Text fields and Sockets, if someone wants to develop a game out of it, he/she should find it more straightforward to do.<br />
<br />
Mind that Magica is built upon ES6 Javascript and requires Node.js installed in your computer to properly build and run.<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><a href="https://github.com/rewlf2/magica_phaser_template" target="_blank" rel="noopener" class="mycode_url">https://github.com/rewlf2/magica_phaser_template</a></span><br />
<br />
<img src="https://i.imgur.com/62YqvLk.png" loading="lazy"  alt="[Image: 62YqvLk.png]" class="mycode_img" /><br />
<br />
If you wish to develop a game starting from this template, feel free to contact me by Discord and I suggest you go learn about how <a href="http://phaser.io" target="_blank" rel="noopener" class="mycode_url">Phaser.io</a> works and also read about how WebSocket works.<br />
<br />
For websockets, <a href="http://www.gojasonyang.com/" target="_blank" rel="noopener" class="mycode_url">http://www.gojasonyang.com/</a> is definitely a great help.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[C# (C sharp)]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10779</link>
			<pubDate>Fri, 01 Dec 2017 18:07:45 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=5612">Hate</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10779</guid>
			<description><![CDATA[We have started Oriented Objects programming this semester, and I need help getting started on C#.<br />
<br />
1- how to build a constructor that builds an object of a class that has constant attributes. (pls write code)<br />
2- is there any good C# compilers (other than visual studio) out there? heard there's a plugin for Eclipse to do that. please tell me how to install it.<br />
3- Anything to tell me.<br />
4-thanks.<br />
<br />
<br />
<br />
<br />
Also, Hi everyone!]]></description>
			<content:encoded><![CDATA[We have started Oriented Objects programming this semester, and I need help getting started on C#.<br />
<br />
1- how to build a constructor that builds an object of a class that has constant attributes. (pls write code)<br />
2- is there any good C# compilers (other than visual studio) out there? heard there's a plugin for Eclipse to do that. please tell me how to install it.<br />
3- Anything to tell me.<br />
4-thanks.<br />
<br />
<br />
<br />
<br />
Also, Hi everyone!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Help in simple file input output program]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10584</link>
			<pubDate>Thu, 08 Dec 2016 14:43:33 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=4523">InPhiKnight</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10584</guid>
			<description><![CDATA[The program adds, display, edit aand deletes records from a binary file.<br />
Well the compiler shuts down as soon as I run the program <a href="https://www.sendspace.com/file/nfy3h9" target="_blank" rel="noopener" class="mycode_url">https://www.sendspace.com/file/nfy3h9</a><br />
<br />
Can someone tell me why it ain't working and fix the error?  Need for school assignment. Yelp! asap]]></description>
			<content:encoded><![CDATA[The program adds, display, edit aand deletes records from a binary file.<br />
Well the compiler shuts down as soon as I run the program <a href="https://www.sendspace.com/file/nfy3h9" target="_blank" rel="noopener" class="mycode_url">https://www.sendspace.com/file/nfy3h9</a><br />
<br />
Can someone tell me why it ain't working and fix the error?  Need for school assignment. Yelp! asap]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Arya - Roguelite Platformer basis]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10532</link>
			<pubDate>Wed, 21 Sep 2016 22:10:40 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=1084">Gad</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10532</guid>
			<description><![CDATA[-- content removed --]]></description>
			<content:encoded><![CDATA[-- content removed --]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[kairu's junkyard]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10525</link>
			<pubDate>Tue, 13 Sep 2016 08:40:14 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=5884">kairunotabi</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10525</guid>
			<description><![CDATA[deleted]]></description>
			<content:encoded><![CDATA[deleted]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Batch Processing Images: Conversion between RGB and Indexed]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10521</link>
			<pubDate>Sat, 10 Sep 2016 14:50:20 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=4900">NightmareX1337</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10521</guid>
			<description><![CDATA[So I had to convert a lot of files from RGB to Indexed pixel format (in order to make them compressed) and doing this by hand is way too tedious. I gathered some python scripts and made few trivial yet useful plugins for Gimp 2 out of it.<br />
In order to use them you need to save these into a file (ex: "batch-convert-indexed.py") and then copy it to Gimp's plugin directory. Plugin path will probably vary between systems but it should be similar to "C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins" or so.<br />
The last one is a standalone script for erasing color space information on bmp files, it may come in handy at times -since LF2 can't read sprites if color space info is present, sigh...<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align">
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">Screenshots</span></span><br />
<img src="http://i51.photobucket.com/albums/f358/NightmareX1337/2016-09-10%2015_27_58-Greenshot_zpsdcnzuyrc.png" loading="lazy"  alt="[Image: 2016-09-10%2015_27_58-Greenshot_zpsdcnzuyrc.png]" class="mycode_img" /><br />
<img src="http://i51.photobucket.com/albums/f358/NightmareX1337/2016-09-10%2015_25_56-python-fu-batch_convert_indexed_zps6tfdiwgg.png" loading="lazy"  alt="[Image: 2016-09-10%2015_25_56-python-fu-batch_co...fdiwgg.png]" class="mycode_img" /></div>
<br />
<br />
<span style="color: #ff0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">Warning</span></span></span><br />
Gimp automatically creates best color palette for images but it may change absolute black areas' color code of some images (particularly pixel based transparent images) which makes LF2 render sprites including black areas. It's highy recommended to <span style="font-weight: bold;" class="mycode_b">back up your sprite folder before proceeding</span>.<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">batch-convert-indexed.py</span><br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;PYTHON-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="python" style="font-family&#58;monospace;"><span style="color&#58; #808080; font-style&#58; italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #dc143c;">math</span>, <span style="color&#58; #dc143c;">glob</span>, <span style="color&#58; #dc143c;">struct</span>
<span style="color&#58; #ff7700;font-weight&#58;bold;">from</span> gimpfu <span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #66cc66;">*</span>
&nbsp;
<span style="color&#58; #dc143c;">gettext</span>&#46;<span style="color&#58; black;">install</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;gimp20-python&quot;</span>, gimp&#46;<span style="color&#58; black;">locale&#95;directory</span>, <span style="color&#58; #008000;">unicode</span>=<span style="color&#58; #008000;">True</span><span style="color&#58; black;">&#41;</span>
&nbsp;
V4&#95;HEADER&#95;SIZE = <span style="color&#58; #ff4500;">108</span>
COLOR&#95;INFO&#95;SIZE = <span style="color&#58; #ff4500;">68</span>
HEADER&#95;OFF = <span style="color&#58; #ff4500;">14</span>
DATA&#95;OFF&#95;FIELD = <span style="color&#58; #ff4500;">10</span>
SIZE&#95;OFF = <span style="color&#58; #ff4500;">2</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, new&#95;bmp&#95;name=<span style="color&#58; #008000;">None</span><span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> new&#95;bmp&#95;name <span style="color&#58; #ff7700;font-weight&#58;bold;">is</span> <span style="color&#58; #008000;">None</span>&#58;
		new&#95;bmp&#95;name = old&#95;bmp&#95;name
	data = bytearray<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;rb&quot;</span><span style="color&#58; black;">&#41;</span>&#46;<span style="color&#58; black;">read</span><span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	header&#95;size = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span>
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> header&#95;size == <span style="color&#58; #ff4500;">108</span>&#58;
		<span style="color&#58; #808080; font-style&#58; italic;"># Remove 68	 - the size for the extra data-chunk from both headers</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, V4&#95;HEADER&#95;SIZE - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,
			<span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span> - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #808080; font-style&#58; italic;"># Offset image data&#58;</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size - COLOR&#95;INFO&#95;SIZE&#58;<span style="color&#58; black;">&#93;</span> = data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size&#58;<span style="color&#58; black;">&#93;</span>
		data<span style="color&#58; black;">&#91;</span>SIZE&#95;OFF&#58; SIZE&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, <span style="color&#58; #008000;">len</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	with <span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>new&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;wb&quot;</span><span style="color&#58; black;">&#41;</span> as output&#95;file&#58;
		output&#95;file&#46;<span style="color&#58; black;">write</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> batch&#95;convert&#95;indexed<span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">for</span> <span style="color&#58; #008000;">file</span> <span style="color&#58; #ff7700;font-weight&#58;bold;">in</span> <span style="color&#58; #dc143c;">glob</span>&#46;<span style="color&#58; #dc143c;">glob</span><span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
		image = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;load</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span>, RUN&#95;NONINTERACTIVE<span style="color&#58; black;">&#41;</span>
		drawable = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;get&#95;active&#95;layer</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;base&#95;type</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span> <span style="color&#58; #66cc66;">!</span>= INDEXED&#58;
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;convert&#95;indexed</span><span style="color&#58; black;">&#40;</span>image, NO&#95;DITHER, MAKE&#95;PALETTE, <span style="color&#58; #ff4500;">256</span>, <span style="color&#58; #008000;">False</span>, <span style="color&#58; #008000;">True</span>, <span style="color&#58; #483d8b;">&quot;&quot;</span><span style="color&#58; black;">&#41;</span>
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;save</span><span style="color&#58; black;">&#40;</span>image, drawable, <span style="color&#58; #008000;">file</span>, <span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;delete</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
&nbsp;
register<span style="color&#58; black;">&#40;</span>
        <span style="color&#58; #483d8b;">&quot;batch&#95;convert&#95;indexed&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and convert to indexed color palette&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and convert to indexed color palette&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;2016&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;&lt;Toolbox&gt;/LF2 Tools/Batch Convert &#95;Indexed&#46;&#46;&#46;&quot;</span>,
        <span style="color&#58; #008000;">None</span>,
        <span style="color&#58; black;">&#91;</span>
                <span style="color&#58; black;">&#40;</span>PF&#95;STRING, <span style="color&#58; #483d8b;">&quot;pattern&quot;</span>, <span style="color&#58; #483d8b;">&quot;File Glob&quot;</span>, <span style="color&#58; #483d8b;">&quot;*&#46;bmp&quot;</span><span style="color&#58; black;">&#41;</span>
        <span style="color&#58; black;">&#93;</span>,
        <span style="color&#58; black;">&#91;</span><span style="color&#58; black;">&#93;</span>,
        batch&#95;convert&#95;indexed<span style="color&#58; black;">&#41;</span>
&nbsp;
main<span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span></pre></div></div>
		</td></tr></table><br />
<br />
<span style="font-weight: bold;" class="mycode_b">batch-convert-rgb.py</span><br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;PYTHON-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="python" style="font-family&#58;monospace;"><span style="color&#58; #808080; font-style&#58; italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #dc143c;">math</span>, <span style="color&#58; #dc143c;">glob</span>, <span style="color&#58; #dc143c;">struct</span>
<span style="color&#58; #ff7700;font-weight&#58;bold;">from</span> gimpfu <span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #66cc66;">*</span>
&nbsp;
<span style="color&#58; #dc143c;">gettext</span>&#46;<span style="color&#58; black;">install</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;gimp20-python&quot;</span>, gimp&#46;<span style="color&#58; black;">locale&#95;directory</span>, <span style="color&#58; #008000;">unicode</span>=<span style="color&#58; #008000;">True</span><span style="color&#58; black;">&#41;</span>
&nbsp;
V4&#95;HEADER&#95;SIZE = <span style="color&#58; #ff4500;">108</span>
COLOR&#95;INFO&#95;SIZE = <span style="color&#58; #ff4500;">68</span>
HEADER&#95;OFF = <span style="color&#58; #ff4500;">14</span>
DATA&#95;OFF&#95;FIELD = <span style="color&#58; #ff4500;">10</span>
SIZE&#95;OFF = <span style="color&#58; #ff4500;">2</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, new&#95;bmp&#95;name=<span style="color&#58; #008000;">None</span><span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> new&#95;bmp&#95;name <span style="color&#58; #ff7700;font-weight&#58;bold;">is</span> <span style="color&#58; #008000;">None</span>&#58;
		new&#95;bmp&#95;name = old&#95;bmp&#95;name
	data = bytearray<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;rb&quot;</span><span style="color&#58; black;">&#41;</span>&#46;<span style="color&#58; black;">read</span><span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	header&#95;size = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span>
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> header&#95;size == <span style="color&#58; #ff4500;">108</span>&#58;
		<span style="color&#58; #808080; font-style&#58; italic;"># Remove 68	 - the size for the extra data-chunk from both headers</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, V4&#95;HEADER&#95;SIZE - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,
			<span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span> - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #808080; font-style&#58; italic;"># Offset image data&#58;</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size - COLOR&#95;INFO&#95;SIZE&#58;<span style="color&#58; black;">&#93;</span> = data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size&#58;<span style="color&#58; black;">&#93;</span>
		data<span style="color&#58; black;">&#91;</span>SIZE&#95;OFF&#58; SIZE&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, <span style="color&#58; #008000;">len</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	with <span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>new&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;wb&quot;</span><span style="color&#58; black;">&#41;</span> as output&#95;file&#58;
		output&#95;file&#46;<span style="color&#58; black;">write</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> batch&#95;convert&#95;rgb<span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">for</span> <span style="color&#58; #008000;">file</span> <span style="color&#58; #ff7700;font-weight&#58;bold;">in</span> <span style="color&#58; #dc143c;">glob</span>&#46;<span style="color&#58; #dc143c;">glob</span><span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
		image = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;load</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span>, RUN&#95;NONINTERACTIVE<span style="color&#58; black;">&#41;</span>
		drawable = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;get&#95;active&#95;layer</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;base&#95;type</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span> <span style="color&#58; #66cc66;">!</span>= RGB&#58;
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;convert&#95;rgb</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;save</span><span style="color&#58; black;">&#40;</span>image, drawable, <span style="color&#58; #008000;">file</span>, <span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;delete</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
&nbsp;
register<span style="color&#58; black;">&#40;</span>
		<span style="color&#58; #483d8b;">&quot;batch&#95;convert&#95;rgb&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;Batch process files and convert to RGB color palette&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;Batch process files and convert to RGB color palette&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;2016&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;&lt;Toolbox&gt;/LF2 Tools/Batch Convert &#95;RGB&#46;&#46;&#46;&quot;</span>,
		<span style="color&#58; #008000;">None</span>,
		<span style="color&#58; black;">&#91;</span>
				<span style="color&#58; black;">&#40;</span>PF&#95;STRING, <span style="color&#58; #483d8b;">&quot;pattern&quot;</span>, <span style="color&#58; #483d8b;">&quot;File Glob&quot;</span>, <span style="color&#58; #483d8b;">&quot;*&#46;bmp&quot;</span><span style="color&#58; black;">&#41;</span>
		<span style="color&#58; black;">&#93;</span>,
		<span style="color&#58; black;">&#91;</span><span style="color&#58; black;">&#93;</span>,
		batch&#95;convert&#95;rgb<span style="color&#58; black;">&#41;</span>
&nbsp;
main<span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span></pre></div></div>
		</td></tr></table><br />
<br />
<span style="font-weight: bold;" class="mycode_b">batch-strip-color-space-info.py</span><br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;PYTHON-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="python" style="font-family&#58;monospace;"><span style="color&#58; #808080; font-style&#58; italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #dc143c;">math</span>, <span style="color&#58; #dc143c;">glob</span>, <span style="color&#58; #dc143c;">struct</span>
<span style="color&#58; #ff7700;font-weight&#58;bold;">from</span> gimpfu <span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #66cc66;">*</span>
&nbsp;
<span style="color&#58; #dc143c;">gettext</span>&#46;<span style="color&#58; black;">install</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;gimp20-python&quot;</span>, gimp&#46;<span style="color&#58; black;">locale&#95;directory</span>, <span style="color&#58; #008000;">unicode</span>=<span style="color&#58; #008000;">True</span><span style="color&#58; black;">&#41;</span>
&nbsp;
V4&#95;HEADER&#95;SIZE = <span style="color&#58; #ff4500;">108</span>
COLOR&#95;INFO&#95;SIZE = <span style="color&#58; #ff4500;">68</span>
HEADER&#95;OFF = <span style="color&#58; #ff4500;">14</span>
DATA&#95;OFF&#95;FIELD = <span style="color&#58; #ff4500;">10</span>
SIZE&#95;OFF = <span style="color&#58; #ff4500;">2</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, new&#95;bmp&#95;name=<span style="color&#58; #008000;">None</span><span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> new&#95;bmp&#95;name <span style="color&#58; #ff7700;font-weight&#58;bold;">is</span> <span style="color&#58; #008000;">None</span>&#58;
		new&#95;bmp&#95;name = old&#95;bmp&#95;name
	data = bytearray<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;rb&quot;</span><span style="color&#58; black;">&#41;</span>&#46;<span style="color&#58; black;">read</span><span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	header&#95;size = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span>
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> header&#95;size == <span style="color&#58; #ff4500;">108</span>&#58;
		<span style="color&#58; #808080; font-style&#58; italic;"># Remove 68	 - the size for the extra data-chunk from both headers</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, V4&#95;HEADER&#95;SIZE - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,
			<span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span> - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #808080; font-style&#58; italic;"># Offset image data&#58;</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size - COLOR&#95;INFO&#95;SIZE&#58;<span style="color&#58; black;">&#93;</span> = data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size&#58;<span style="color&#58; black;">&#93;</span>
		data<span style="color&#58; black;">&#91;</span>SIZE&#95;OFF&#58; SIZE&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, <span style="color&#58; #008000;">len</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	with <span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>new&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;wb&quot;</span><span style="color&#58; black;">&#41;</span> as output&#95;file&#58;
		output&#95;file&#46;<span style="color&#58; black;">write</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> batch&#95;strip&#95;color&#95;space&#95;info<span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">for</span> <span style="color&#58; #008000;">file</span> <span style="color&#58; #ff7700;font-weight&#58;bold;">in</span> <span style="color&#58; #dc143c;">glob</span>&#46;<span style="color&#58; #dc143c;">glob</span><span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
		strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
&nbsp;
register<span style="color&#58; black;">&#40;</span>
        <span style="color&#58; #483d8b;">&quot;batch&#95;strip&#95;color&#95;space&#95;info&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and strip color space informations&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and strip color space informations&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;2016&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;&lt;Toolbox&gt;/LF2 Tools/Batch &#95;Strip Color Space Info&#46;&#46;&#46;&quot;</span>,
        <span style="color&#58; #008000;">None</span>,
        <span style="color&#58; black;">&#91;</span>
                <span style="color&#58; black;">&#40;</span>PF&#95;STRING, <span style="color&#58; #483d8b;">&quot;pattern&quot;</span>, <span style="color&#58; #483d8b;">&quot;File Glob&quot;</span>, <span style="color&#58; #483d8b;">&quot;*&#46;bmp&quot;</span><span style="color&#58; black;">&#41;</span>
        <span style="color&#58; black;">&#93;</span>,
        <span style="color&#58; black;">&#91;</span><span style="color&#58; black;">&#93;</span>,
        batch&#95;strip&#95;color&#95;space&#95;info<span style="color&#58; black;">&#41;</span>
&nbsp;
main<span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span></pre></div></div>
		</td></tr></table><br />
<br />
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br />
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br />
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br />
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br />
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br />
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br />
SOFTWARE.]]></description>
			<content:encoded><![CDATA[So I had to convert a lot of files from RGB to Indexed pixel format (in order to make them compressed) and doing this by hand is way too tedious. I gathered some python scripts and made few trivial yet useful plugins for Gimp 2 out of it.<br />
In order to use them you need to save these into a file (ex: "batch-convert-indexed.py") and then copy it to Gimp's plugin directory. Plugin path will probably vary between systems but it should be similar to "C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins" or so.<br />
The last one is a standalone script for erasing color space information on bmp files, it may come in handy at times -since LF2 can't read sprites if color space info is present, sigh...<br />
<br />
<br />
<div style="text-align: center;" class="mycode_align">
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">Screenshots</span></span><br />
<img src="http://i51.photobucket.com/albums/f358/NightmareX1337/2016-09-10%2015_27_58-Greenshot_zpsdcnzuyrc.png" loading="lazy"  alt="[Image: 2016-09-10%2015_27_58-Greenshot_zpsdcnzuyrc.png]" class="mycode_img" /><br />
<img src="http://i51.photobucket.com/albums/f358/NightmareX1337/2016-09-10%2015_25_56-python-fu-batch_convert_indexed_zps6tfdiwgg.png" loading="lazy"  alt="[Image: 2016-09-10%2015_25_56-python-fu-batch_co...fdiwgg.png]" class="mycode_img" /></div>
<br />
<br />
<span style="color: #ff0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">Warning</span></span></span><br />
Gimp automatically creates best color palette for images but it may change absolute black areas' color code of some images (particularly pixel based transparent images) which makes LF2 render sprites including black areas. It's highy recommended to <span style="font-weight: bold;" class="mycode_b">back up your sprite folder before proceeding</span>.<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b">batch-convert-indexed.py</span><br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;PYTHON-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="python" style="font-family&#58;monospace;"><span style="color&#58; #808080; font-style&#58; italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #dc143c;">math</span>, <span style="color&#58; #dc143c;">glob</span>, <span style="color&#58; #dc143c;">struct</span>
<span style="color&#58; #ff7700;font-weight&#58;bold;">from</span> gimpfu <span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #66cc66;">*</span>
&nbsp;
<span style="color&#58; #dc143c;">gettext</span>&#46;<span style="color&#58; black;">install</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;gimp20-python&quot;</span>, gimp&#46;<span style="color&#58; black;">locale&#95;directory</span>, <span style="color&#58; #008000;">unicode</span>=<span style="color&#58; #008000;">True</span><span style="color&#58; black;">&#41;</span>
&nbsp;
V4&#95;HEADER&#95;SIZE = <span style="color&#58; #ff4500;">108</span>
COLOR&#95;INFO&#95;SIZE = <span style="color&#58; #ff4500;">68</span>
HEADER&#95;OFF = <span style="color&#58; #ff4500;">14</span>
DATA&#95;OFF&#95;FIELD = <span style="color&#58; #ff4500;">10</span>
SIZE&#95;OFF = <span style="color&#58; #ff4500;">2</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, new&#95;bmp&#95;name=<span style="color&#58; #008000;">None</span><span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> new&#95;bmp&#95;name <span style="color&#58; #ff7700;font-weight&#58;bold;">is</span> <span style="color&#58; #008000;">None</span>&#58;
		new&#95;bmp&#95;name = old&#95;bmp&#95;name
	data = bytearray<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;rb&quot;</span><span style="color&#58; black;">&#41;</span>&#46;<span style="color&#58; black;">read</span><span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	header&#95;size = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span>
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> header&#95;size == <span style="color&#58; #ff4500;">108</span>&#58;
		<span style="color&#58; #808080; font-style&#58; italic;"># Remove 68	 - the size for the extra data-chunk from both headers</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, V4&#95;HEADER&#95;SIZE - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,
			<span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span> - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #808080; font-style&#58; italic;"># Offset image data&#58;</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size - COLOR&#95;INFO&#95;SIZE&#58;<span style="color&#58; black;">&#93;</span> = data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size&#58;<span style="color&#58; black;">&#93;</span>
		data<span style="color&#58; black;">&#91;</span>SIZE&#95;OFF&#58; SIZE&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, <span style="color&#58; #008000;">len</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	with <span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>new&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;wb&quot;</span><span style="color&#58; black;">&#41;</span> as output&#95;file&#58;
		output&#95;file&#46;<span style="color&#58; black;">write</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> batch&#95;convert&#95;indexed<span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">for</span> <span style="color&#58; #008000;">file</span> <span style="color&#58; #ff7700;font-weight&#58;bold;">in</span> <span style="color&#58; #dc143c;">glob</span>&#46;<span style="color&#58; #dc143c;">glob</span><span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
		image = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;load</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span>, RUN&#95;NONINTERACTIVE<span style="color&#58; black;">&#41;</span>
		drawable = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;get&#95;active&#95;layer</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;base&#95;type</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span> <span style="color&#58; #66cc66;">!</span>= INDEXED&#58;
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;convert&#95;indexed</span><span style="color&#58; black;">&#40;</span>image, NO&#95;DITHER, MAKE&#95;PALETTE, <span style="color&#58; #ff4500;">256</span>, <span style="color&#58; #008000;">False</span>, <span style="color&#58; #008000;">True</span>, <span style="color&#58; #483d8b;">&quot;&quot;</span><span style="color&#58; black;">&#41;</span>
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;save</span><span style="color&#58; black;">&#40;</span>image, drawable, <span style="color&#58; #008000;">file</span>, <span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;delete</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
&nbsp;
register<span style="color&#58; black;">&#40;</span>
        <span style="color&#58; #483d8b;">&quot;batch&#95;convert&#95;indexed&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and convert to indexed color palette&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and convert to indexed color palette&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;2016&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;&lt;Toolbox&gt;/LF2 Tools/Batch Convert &#95;Indexed&#46;&#46;&#46;&quot;</span>,
        <span style="color&#58; #008000;">None</span>,
        <span style="color&#58; black;">&#91;</span>
                <span style="color&#58; black;">&#40;</span>PF&#95;STRING, <span style="color&#58; #483d8b;">&quot;pattern&quot;</span>, <span style="color&#58; #483d8b;">&quot;File Glob&quot;</span>, <span style="color&#58; #483d8b;">&quot;*&#46;bmp&quot;</span><span style="color&#58; black;">&#41;</span>
        <span style="color&#58; black;">&#93;</span>,
        <span style="color&#58; black;">&#91;</span><span style="color&#58; black;">&#93;</span>,
        batch&#95;convert&#95;indexed<span style="color&#58; black;">&#41;</span>
&nbsp;
main<span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span></pre></div></div>
		</td></tr></table><br />
<br />
<span style="font-weight: bold;" class="mycode_b">batch-convert-rgb.py</span><br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;PYTHON-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="python" style="font-family&#58;monospace;"><span style="color&#58; #808080; font-style&#58; italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #dc143c;">math</span>, <span style="color&#58; #dc143c;">glob</span>, <span style="color&#58; #dc143c;">struct</span>
<span style="color&#58; #ff7700;font-weight&#58;bold;">from</span> gimpfu <span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #66cc66;">*</span>
&nbsp;
<span style="color&#58; #dc143c;">gettext</span>&#46;<span style="color&#58; black;">install</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;gimp20-python&quot;</span>, gimp&#46;<span style="color&#58; black;">locale&#95;directory</span>, <span style="color&#58; #008000;">unicode</span>=<span style="color&#58; #008000;">True</span><span style="color&#58; black;">&#41;</span>
&nbsp;
V4&#95;HEADER&#95;SIZE = <span style="color&#58; #ff4500;">108</span>
COLOR&#95;INFO&#95;SIZE = <span style="color&#58; #ff4500;">68</span>
HEADER&#95;OFF = <span style="color&#58; #ff4500;">14</span>
DATA&#95;OFF&#95;FIELD = <span style="color&#58; #ff4500;">10</span>
SIZE&#95;OFF = <span style="color&#58; #ff4500;">2</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, new&#95;bmp&#95;name=<span style="color&#58; #008000;">None</span><span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> new&#95;bmp&#95;name <span style="color&#58; #ff7700;font-weight&#58;bold;">is</span> <span style="color&#58; #008000;">None</span>&#58;
		new&#95;bmp&#95;name = old&#95;bmp&#95;name
	data = bytearray<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;rb&quot;</span><span style="color&#58; black;">&#41;</span>&#46;<span style="color&#58; black;">read</span><span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	header&#95;size = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span>
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> header&#95;size == <span style="color&#58; #ff4500;">108</span>&#58;
		<span style="color&#58; #808080; font-style&#58; italic;"># Remove 68	 - the size for the extra data-chunk from both headers</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, V4&#95;HEADER&#95;SIZE - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,
			<span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span> - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #808080; font-style&#58; italic;"># Offset image data&#58;</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size - COLOR&#95;INFO&#95;SIZE&#58;<span style="color&#58; black;">&#93;</span> = data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size&#58;<span style="color&#58; black;">&#93;</span>
		data<span style="color&#58; black;">&#91;</span>SIZE&#95;OFF&#58; SIZE&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, <span style="color&#58; #008000;">len</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	with <span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>new&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;wb&quot;</span><span style="color&#58; black;">&#41;</span> as output&#95;file&#58;
		output&#95;file&#46;<span style="color&#58; black;">write</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> batch&#95;convert&#95;rgb<span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">for</span> <span style="color&#58; #008000;">file</span> <span style="color&#58; #ff7700;font-weight&#58;bold;">in</span> <span style="color&#58; #dc143c;">glob</span>&#46;<span style="color&#58; #dc143c;">glob</span><span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
		image = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;load</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span>, RUN&#95;NONINTERACTIVE<span style="color&#58; black;">&#41;</span>
		drawable = <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;get&#95;active&#95;layer</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> <span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;base&#95;type</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span> <span style="color&#58; #66cc66;">!</span>= RGB&#58;
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;convert&#95;rgb</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
			<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;file&#95;save</span><span style="color&#58; black;">&#40;</span>image, drawable, <span style="color&#58; #008000;">file</span>, <span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #dc143c;">pdb</span>&#46;<span style="color&#58; black;">gimp&#95;image&#95;delete</span><span style="color&#58; black;">&#40;</span>image<span style="color&#58; black;">&#41;</span>
		strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
&nbsp;
register<span style="color&#58; black;">&#40;</span>
		<span style="color&#58; #483d8b;">&quot;batch&#95;convert&#95;rgb&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;Batch process files and convert to RGB color palette&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;Batch process files and convert to RGB color palette&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;2016&quot;</span>,
		<span style="color&#58; #483d8b;">&quot;&lt;Toolbox&gt;/LF2 Tools/Batch Convert &#95;RGB&#46;&#46;&#46;&quot;</span>,
		<span style="color&#58; #008000;">None</span>,
		<span style="color&#58; black;">&#91;</span>
				<span style="color&#58; black;">&#40;</span>PF&#95;STRING, <span style="color&#58; #483d8b;">&quot;pattern&quot;</span>, <span style="color&#58; #483d8b;">&quot;File Glob&quot;</span>, <span style="color&#58; #483d8b;">&quot;*&#46;bmp&quot;</span><span style="color&#58; black;">&#41;</span>
		<span style="color&#58; black;">&#93;</span>,
		<span style="color&#58; black;">&#91;</span><span style="color&#58; black;">&#93;</span>,
		batch&#95;convert&#95;rgb<span style="color&#58; black;">&#41;</span>
&nbsp;
main<span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span></pre></div></div>
		</td></tr></table><br />
<br />
<span style="font-weight: bold;" class="mycode_b">batch-strip-color-space-info.py</span><br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;PYTHON-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="python" style="font-family&#58;monospace;"><span style="color&#58; #808080; font-style&#58; italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #dc143c;">math</span>, <span style="color&#58; #dc143c;">glob</span>, <span style="color&#58; #dc143c;">struct</span>
<span style="color&#58; #ff7700;font-weight&#58;bold;">from</span> gimpfu <span style="color&#58; #ff7700;font-weight&#58;bold;">import</span> <span style="color&#58; #66cc66;">*</span>
&nbsp;
<span style="color&#58; #dc143c;">gettext</span>&#46;<span style="color&#58; black;">install</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;gimp20-python&quot;</span>, gimp&#46;<span style="color&#58; black;">locale&#95;directory</span>, <span style="color&#58; #008000;">unicode</span>=<span style="color&#58; #008000;">True</span><span style="color&#58; black;">&#41;</span>
&nbsp;
V4&#95;HEADER&#95;SIZE = <span style="color&#58; #ff4500;">108</span>
COLOR&#95;INFO&#95;SIZE = <span style="color&#58; #ff4500;">68</span>
HEADER&#95;OFF = <span style="color&#58; #ff4500;">14</span>
DATA&#95;OFF&#95;FIELD = <span style="color&#58; #ff4500;">10</span>
SIZE&#95;OFF = <span style="color&#58; #ff4500;">2</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, new&#95;bmp&#95;name=<span style="color&#58; #008000;">None</span><span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> new&#95;bmp&#95;name <span style="color&#58; #ff7700;font-weight&#58;bold;">is</span> <span style="color&#58; #008000;">None</span>&#58;
		new&#95;bmp&#95;name = old&#95;bmp&#95;name
	data = bytearray<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>old&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;rb&quot;</span><span style="color&#58; black;">&#41;</span>&#46;<span style="color&#58; black;">read</span><span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	header&#95;size = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span>
	<span style="color&#58; #ff7700;font-weight&#58;bold;">if</span> header&#95;size == <span style="color&#58; #ff4500;">108</span>&#58;
		<span style="color&#58; #808080; font-style&#58; italic;"># Remove 68	 - the size for the extra data-chunk from both headers</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF&#58; HEADER&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, V4&#95;HEADER&#95;SIZE - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,
			<span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">unpack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>,data<span style="color&#58; black;">&#91;</span>DATA&#95;OFF&#95;FIELD&#58; DATA&#95;OFF&#95;FIELD + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span><span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#91;</span><span style="color&#58; #ff4500;">0</span><span style="color&#58; black;">&#93;</span> - COLOR&#95;INFO&#95;SIZE<span style="color&#58; black;">&#41;</span>
		<span style="color&#58; #808080; font-style&#58; italic;"># Offset image data&#58;</span>
		data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size - COLOR&#95;INFO&#95;SIZE&#58;<span style="color&#58; black;">&#93;</span> = data<span style="color&#58; black;">&#91;</span>HEADER&#95;OFF + header&#95;size&#58;<span style="color&#58; black;">&#93;</span>
		data<span style="color&#58; black;">&#91;</span>SIZE&#95;OFF&#58; SIZE&#95;OFF + <span style="color&#58; #ff4500;">4</span><span style="color&#58; black;">&#93;</span> = <span style="color&#58; #dc143c;">struct</span>&#46;<span style="color&#58; black;">pack</span><span style="color&#58; black;">&#40;</span><span style="color&#58; #483d8b;">&quot;I&quot;</span>, <span style="color&#58; #008000;">len</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span><span style="color&#58; black;">&#41;</span>
	with <span style="color&#58; #008000;">open</span><span style="color&#58; black;">&#40;</span>new&#95;bmp&#95;name, <span style="color&#58; #483d8b;">&quot;wb&quot;</span><span style="color&#58; black;">&#41;</span> as output&#95;file&#58;
		output&#95;file&#46;<span style="color&#58; black;">write</span><span style="color&#58; black;">&#40;</span>data<span style="color&#58; black;">&#41;</span>
&nbsp;
<span style="color&#58; #ff7700;font-weight&#58;bold;">def</span> batch&#95;strip&#95;color&#95;space&#95;info<span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
	<span style="color&#58; #ff7700;font-weight&#58;bold;">for</span> <span style="color&#58; #008000;">file</span> <span style="color&#58; #ff7700;font-weight&#58;bold;">in</span> <span style="color&#58; #dc143c;">glob</span>&#46;<span style="color&#58; #dc143c;">glob</span><span style="color&#58; black;">&#40;</span>pattern<span style="color&#58; black;">&#41;</span>&#58;
		strip&#95;color&#95;info<span style="color&#58; black;">&#40;</span><span style="color&#58; #008000;">file</span><span style="color&#58; black;">&#41;</span>
&nbsp;
register<span style="color&#58; black;">&#40;</span>
        <span style="color&#58; #483d8b;">&quot;batch&#95;strip&#95;color&#95;space&#95;info&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and strip color space informations&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;Batch process files and strip color space informations&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;NightmareX1337&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;2016&quot;</span>,
        <span style="color&#58; #483d8b;">&quot;&lt;Toolbox&gt;/LF2 Tools/Batch &#95;Strip Color Space Info&#46;&#46;&#46;&quot;</span>,
        <span style="color&#58; #008000;">None</span>,
        <span style="color&#58; black;">&#91;</span>
                <span style="color&#58; black;">&#40;</span>PF&#95;STRING, <span style="color&#58; #483d8b;">&quot;pattern&quot;</span>, <span style="color&#58; #483d8b;">&quot;File Glob&quot;</span>, <span style="color&#58; #483d8b;">&quot;*&#46;bmp&quot;</span><span style="color&#58; black;">&#41;</span>
        <span style="color&#58; black;">&#93;</span>,
        <span style="color&#58; black;">&#91;</span><span style="color&#58; black;">&#93;</span>,
        batch&#95;strip&#95;color&#95;space&#95;info<span style="color&#58; black;">&#41;</span>
&nbsp;
main<span style="color&#58; black;">&#40;</span><span style="color&#58; black;">&#41;</span></pre></div></div>
		</td></tr></table><br />
<br />
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br />
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br />
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br />
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br />
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br />
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br />
SOFTWARE.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[solving problems in C program]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10369</link>
			<pubDate>Mon, 18 Jul 2016 03:55:57 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=3756">MnM</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10369</guid>
			<description><![CDATA[Hi guys, It must be weird to see me post in this section of the forum but anyways, I have studied both c program and c++ in my second and third semester respectively. I'm having campus placements now and most of the companies need people with strong problem solving capability. So, I'm wondering if there is a website you personally have used for learning C for example: Find out whether the string having the following characters '[',']','{','}','(',')' is balanced or not {[]()} etc, etc. I am looking for a website that gives me problem statements and also the solution. I might google and get some but I'm hoping the lot of you have personally tried out some. So yeah I'm waiting for your reply!]]></description>
			<content:encoded><![CDATA[Hi guys, It must be weird to see me post in this section of the forum but anyways, I have studied both c program and c++ in my second and third semester respectively. I'm having campus placements now and most of the companies need people with strong problem solving capability. So, I'm wondering if there is a website you personally have used for learning C for example: Find out whether the string having the following characters '[',']','{','}','(',')' is balanced or not {[]()} etc, etc. I am looking for a website that gives me problem statements and also the solution. I might google and get some but I'm hoping the lot of you have personally tried out some. So yeah I'm waiting for your reply!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[DC Algorithm in JavaScript (decrypt)]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10301</link>
			<pubDate>Fri, 15 Apr 2016 21:22:27 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=5400">MangaD</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10301</guid>
			<description><![CDATA[In response to someone's attempt to read a LF2 data file in JavaScript, I made a simple HTML page for this purpose.<br />
<br />
I based myself on <!--DVZ_ME#0-->'s explanation for the DC algorithm:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">DC Algorithm <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;">
<blockquote class="mycode_quote"><cite><span> (11-21-2015, 12:09 PM)</span>A-Man Wrote: <a href="https://lf-empire.de/forum/showthread.php?pid=198669#pid198669" class="quick_jump">&nbsp;</a></cite>1-Open the file for reading and store what's inside into a variable (or stream it, whatever you prefer/have available). The content of the file is gibberish (because it's encrypted).<br />
<br />
2-Skip over the first one hundred and twenty three characters and start going through all characters in the file. Since counting in computers starts from 0, this means you will start from the 124rd letter character (index 123).<br />
<br />
3-For every character you go through, convert it to its <a href="https://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart" target="_blank" rel="noopener" class="mycode_url">ASCII code</a>, subtract from it the ASCII code of the <span style="text-decoration: underline;" class="mycode_u">N</span>th character in the key "odBearBecauseHeIsVeryGoodSiuHungIsAGo" (yes, the letters are shifted because there is a <a href="https://en.wikipedia.org/wiki/Caesar_cipher" target="_blank" rel="noopener" class="mycode_url">caeser cipher</a> step we can skip with using this shifted key).<br />
<br />
4- <span style="text-decoration: underline;" class="mycode_u">N</span> is an index in the key which keeps increasing for every character and restarts back to 0 when it reaches the end of the key.</blockquote></div></div>
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&lt;!DOCTYPE html&gt;

&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;LF2 - Data Reader&lt;/title&gt;
		&lt;meta charset="UTF-8" /&gt;
		&lt;meta name="description" content="LF2 data files reader."&gt;
		&lt;meta name="keywords" content="LF2, DC , data, algorithm, file, files, decypher"&gt;
		&lt;meta name="author" content="MangaD"&gt;

		&lt;link rel="shortcut icon" href="http://www.lf-empire.de/favicon.ico" type="image/x-icon"&gt;
		
		&lt;style type="text/css"&gt;
			html, body {
				height:100%;
				width:100%;
				border:0;
				margin:0;
				padding: 0;
				text-align:center;
			}
			#main {
				margin-top:30px;
				text-align:initial;
				display:inline-block;
			}
			#DCode {
				width:600px;
				height:400px;
			}
		&lt;/style&gt;

		&lt;script type="text/javascript"&gt;

			var file;

			function fileSupport() {// Check for the various File API support.
				if (window.File &amp;&amp; window.FileReader &amp;&amp; window.FileList &amp;&amp; window.Blob) {
					// Great success! All the File APIs are supported.
				} else {
					alert('The File APIs are not fully supported in this browser.');
				}
			}

			function openFile() {
				file = document.getElementById("fileInput").files[0];
				var fileName = escape(file.name);
				var fileType = (file.type ? file.type : 'n/a');
				var fileSize = file.size;
				var lastModified = file.lastModifiedDate ? file.lastModifiedDate.toLocaleDateString() : 'n/a';
				
				if(file.name.substring(file.name.lastIndexOf(".")) != ".dat" ) {
					alert('LF2 data file only.');
					return false;
				}
				else {
					fileType = "LF2/data";
				}
				document.getElementById('details').innerHTML = 
					'&lt;strong&gt;' + fileName + '&lt;/strong&gt; (' + fileType + ') - ' +
					fileSize + ' bytes, last modified: ' + lastModified;
				return true;
			}
			
			function decrypt() {
				var key = "odBearBecauseHeIsVeryGoodSiuHungIsAGo";
				var reader = new FileReader();
				
				reader.onload = function(){
					var data = reader.result;
					var text = "";
					
					for (var i = 123, j = 0; i &lt; data.length; i++, j++)
						text += String.fromCharCode(data.charCodeAt(i) - key.charCodeAt(j%key.length));
					
					document.getElementById('DCode').innerHTML = text;
				};
				
				reader.readAsBinaryString(file);
			}
		&lt;/script&gt;
	&lt;/head&gt;
	
	&lt;body onload="fileSupport();"&gt;
		&lt;div id="main"&gt;
			&lt;label for="fileInput"&gt;Open .dat file:&lt;/label&gt;
			&lt;br&gt;
			&lt;input id="fileInput" type="file" onchange="if(openFile()) decrypt();"&gt;
			&lt;br&gt;
			&lt;output id="details"&gt;&lt;/output&gt;
			&lt;br&gt;
			&lt;textarea id="DCode" wrap='off'&gt;&lt;/textarea&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;</code></div></div><br />
Download file <a href="http://www.mediafire.com/download/hy5vocv3w71m637/dc.html" target="_blank" rel="noopener" class="mycode_url">here</a>.]]></description>
			<content:encoded><![CDATA[In response to someone's attempt to read a LF2 data file in JavaScript, I made a simple HTML page for this purpose.<br />
<br />
I based myself on <!--DVZ_ME#0-->'s explanation for the DC algorithm:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">DC Algorithm <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;">
<blockquote class="mycode_quote"><cite><span> (11-21-2015, 12:09 PM)</span>A-Man Wrote: <a href="https://lf-empire.de/forum/showthread.php?pid=198669#pid198669" class="quick_jump">&nbsp;</a></cite>1-Open the file for reading and store what's inside into a variable (or stream it, whatever you prefer/have available). The content of the file is gibberish (because it's encrypted).<br />
<br />
2-Skip over the first one hundred and twenty three characters and start going through all characters in the file. Since counting in computers starts from 0, this means you will start from the 124rd letter character (index 123).<br />
<br />
3-For every character you go through, convert it to its <a href="https://en.wikipedia.org/wiki/ASCII#ASCII_printable_code_chart" target="_blank" rel="noopener" class="mycode_url">ASCII code</a>, subtract from it the ASCII code of the <span style="text-decoration: underline;" class="mycode_u">N</span>th character in the key "odBearBecauseHeIsVeryGoodSiuHungIsAGo" (yes, the letters are shifted because there is a <a href="https://en.wikipedia.org/wiki/Caesar_cipher" target="_blank" rel="noopener" class="mycode_url">caeser cipher</a> step we can skip with using this shifted key).<br />
<br />
4- <span style="text-decoration: underline;" class="mycode_u">N</span> is an index in the key which keeps increasing for every character and restarts back to 0 when it reaches the end of the key.</blockquote></div></div>
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>&lt;!DOCTYPE html&gt;

&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;LF2 - Data Reader&lt;/title&gt;
		&lt;meta charset="UTF-8" /&gt;
		&lt;meta name="description" content="LF2 data files reader."&gt;
		&lt;meta name="keywords" content="LF2, DC , data, algorithm, file, files, decypher"&gt;
		&lt;meta name="author" content="MangaD"&gt;

		&lt;link rel="shortcut icon" href="http://www.lf-empire.de/favicon.ico" type="image/x-icon"&gt;
		
		&lt;style type="text/css"&gt;
			html, body {
				height:100%;
				width:100%;
				border:0;
				margin:0;
				padding: 0;
				text-align:center;
			}
			#main {
				margin-top:30px;
				text-align:initial;
				display:inline-block;
			}
			#DCode {
				width:600px;
				height:400px;
			}
		&lt;/style&gt;

		&lt;script type="text/javascript"&gt;

			var file;

			function fileSupport() {// Check for the various File API support.
				if (window.File &amp;&amp; window.FileReader &amp;&amp; window.FileList &amp;&amp; window.Blob) {
					// Great success! All the File APIs are supported.
				} else {
					alert('The File APIs are not fully supported in this browser.');
				}
			}

			function openFile() {
				file = document.getElementById("fileInput").files[0];
				var fileName = escape(file.name);
				var fileType = (file.type ? file.type : 'n/a');
				var fileSize = file.size;
				var lastModified = file.lastModifiedDate ? file.lastModifiedDate.toLocaleDateString() : 'n/a';
				
				if(file.name.substring(file.name.lastIndexOf(".")) != ".dat" ) {
					alert('LF2 data file only.');
					return false;
				}
				else {
					fileType = "LF2/data";
				}
				document.getElementById('details').innerHTML = 
					'&lt;strong&gt;' + fileName + '&lt;/strong&gt; (' + fileType + ') - ' +
					fileSize + ' bytes, last modified: ' + lastModified;
				return true;
			}
			
			function decrypt() {
				var key = "odBearBecauseHeIsVeryGoodSiuHungIsAGo";
				var reader = new FileReader();
				
				reader.onload = function(){
					var data = reader.result;
					var text = "";
					
					for (var i = 123, j = 0; i &lt; data.length; i++, j++)
						text += String.fromCharCode(data.charCodeAt(i) - key.charCodeAt(j%key.length));
					
					document.getElementById('DCode').innerHTML = text;
				};
				
				reader.readAsBinaryString(file);
			}
		&lt;/script&gt;
	&lt;/head&gt;
	
	&lt;body onload="fileSupport();"&gt;
		&lt;div id="main"&gt;
			&lt;label for="fileInput"&gt;Open .dat file:&lt;/label&gt;
			&lt;br&gt;
			&lt;input id="fileInput" type="file" onchange="if(openFile()) decrypt();"&gt;
			&lt;br&gt;
			&lt;output id="details"&gt;&lt;/output&gt;
			&lt;br&gt;
			&lt;textarea id="DCode" wrap='off'&gt;&lt;/textarea&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;</code></div></div><br />
Download file <a href="http://www.mediafire.com/download/hy5vocv3w71m637/dc.html" target="_blank" rel="noopener" class="mycode_url">here</a>.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[C++1z and Header Files]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10298</link>
			<pubDate>Wed, 06 Apr 2016 21:56:42 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=3949">A-Man</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10298</guid>
			<description><![CDATA[So there's been rumors C++1z will get a module system in a plan to silently kill the header file mechanism. Some say it won't make it in C++1z, but that there are plans to get it sooner or later into the standard. I like header files personally, despite the problems they cause (maybe just because I got used to them). What I fear is the leap happening so suddenly, and I get left behind with my projects following the then-old header file mechanism.<br />
<br />
From the looks of it, it seems people have somewhat began moving already; with how I see template generic types being implemented in .h(pp) files only. I still follow the trend of the .h(pp) .cpp pair since that feels "healthier" for the current standards, but I'm always burdened with having to declare the class for every (combination of) template argument(s).<br />
<br />
I don't know, I'm confused. How should I be doing it, and where's all of this going? What are some best practices of using .h(pp) files nowadays, and have anyone here got an idea on how this module system will likely work?]]></description>
			<content:encoded><![CDATA[So there's been rumors C++1z will get a module system in a plan to silently kill the header file mechanism. Some say it won't make it in C++1z, but that there are plans to get it sooner or later into the standard. I like header files personally, despite the problems they cause (maybe just because I got used to them). What I fear is the leap happening so suddenly, and I get left behind with my projects following the then-old header file mechanism.<br />
<br />
From the looks of it, it seems people have somewhat began moving already; with how I see template generic types being implemented in .h(pp) files only. I still follow the trend of the .h(pp) .cpp pair since that feels "healthier" for the current standards, but I'm always burdened with having to declare the class for every (combination of) template argument(s).<br />
<br />
I don't know, I'm confused. How should I be doing it, and where's all of this going? What are some best practices of using .h(pp) files nowadays, and have anyone here got an idea on how this module system will likely work?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[*TRUE* OOP and Other Paradigms]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10293</link>
			<pubDate>Thu, 31 Mar 2016 20:51:53 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=3949">A-Man</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10293</guid>
			<description><![CDATA[I'm not sure if it's just me being oblivious of this for so long until now, but lately, it seems there has been a greater number of people bashing the OOP style. I don't often involve myself into such discussion, but this one time I did say that OOP works better for games (I know because I've tried imperative for games, and things get messy rather quickly). So the discussion went on for a couple of posts, until one came up and said "but that's only because what you use is not "TRUE" OOP. That was when I thought that maybe I'd be talking out of turn if I continue arguing any further. <br />
<br />
So yes, what is true OOP anyway? What do you think of OOP in general, and what do you say of the "single responsibility principle"? The latter, in my opinion, might be sort of extreme and not practical. Would not strictly following it mean that you're not doing OOP?<br />
<br />
What are your thoughts on functional programming, also? I like it, even though I don't see how one can write an entire program with that if the program isn't a one-liner. I'm quite surprised to see people trying to enforce sticking to one style throughout. Why not mix as necessary?]]></description>
			<content:encoded><![CDATA[I'm not sure if it's just me being oblivious of this for so long until now, but lately, it seems there has been a greater number of people bashing the OOP style. I don't often involve myself into such discussion, but this one time I did say that OOP works better for games (I know because I've tried imperative for games, and things get messy rather quickly). So the discussion went on for a couple of posts, until one came up and said "but that's only because what you use is not "TRUE" OOP. That was when I thought that maybe I'd be talking out of turn if I continue arguing any further. <br />
<br />
So yes, what is true OOP anyway? What do you think of OOP in general, and what do you say of the "single responsibility principle"? The latter, in my opinion, might be sort of extreme and not practical. Would not strictly following it mean that you're not doing OOP?<br />
<br />
What are your thoughts on functional programming, also? I like it, even though I don't see how one can write an entire program with that if the program isn't a one-liner. I'm quite surprised to see people trying to enforce sticking to one style throughout. Why not mix as necessary?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[openMP not working]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=10272</link>
			<pubDate>Tue, 08 Mar 2016 16:38:46 +0100</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=3056">empirefantasy</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=10272</guid>
			<description><![CDATA[Hi guys!<br />
<br />
So what i am trying to do is using some directives from openMP in C programs. <br />
But he problem is that whenever i try to run the program it says:<br />
<br />
undefined reference to `omp_get_thread_num'<br />
<br />
I have been using various examples from internet and all of them have the same problem. It runs OK when there is not any 'omp_get_thread_num' or omp_get_wtime'. But of course i need these two in my programs.<br />
<br />
I have MinGW (2 versions: one about the end of 2013 and the other one downloaded less then 1 month ago). I have tried in eclipse, codeblock and commandline. when i try it to cmd it says "can't find -lpthread"<br />
<br />
i have tried in 2 different machines both Windows10 64bit<br />
<br />
i have been trying to find anything in internet for about one week but no result  <img src="https://lf-empire.de/forum/images/smilies/confused.gif" alt=":s" title=":s" class="smilie smilie_10" /> <br />
<br />
idk what i am missing here.]]></description>
			<content:encoded><![CDATA[Hi guys!<br />
<br />
So what i am trying to do is using some directives from openMP in C programs. <br />
But he problem is that whenever i try to run the program it says:<br />
<br />
undefined reference to `omp_get_thread_num'<br />
<br />
I have been using various examples from internet and all of them have the same problem. It runs OK when there is not any 'omp_get_thread_num' or omp_get_wtime'. But of course i need these two in my programs.<br />
<br />
I have MinGW (2 versions: one about the end of 2013 and the other one downloaded less then 1 month ago). I have tried in eclipse, codeblock and commandline. when i try it to cmd it says "can't find -lpthread"<br />
<br />
i have tried in 2 different machines both Windows10 64bit<br />
<br />
i have been trying to find anything in internet for about one week but no result  <img src="https://lf-empire.de/forum/images/smilies/confused.gif" alt=":s" title=":s" class="smilie smilie_10" /> <br />
<br />
idk what i am missing here.]]></content:encoded>
		</item>
	</channel>
</rss>