Graham
a52d58e8b5
Use Clikt to implement the command-line interface
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
462ae7cb9c
Improve PrettyPrinterConfiguration
...
Both of these settings are closer to IDEA's code style.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
b9c707782c
Place @Pc annotations on the same line as variable declarations
...
This is much more readable than placing them on a separate line.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
caed5cebce
Remove gl-dri from AstDeobfuscator
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
dae73b667a
Replace !Optional.isPresent() with Optional.isEmpty()
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
2e1c6c22ff
Rename GlConstantTransformer to GlTransformer
...
It transforms more than just constants now.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
c9a3580e11
Allow GlRegistry to be overriden
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
ace76fe9e4
Transform GL_FRAMEBUFFER_COMPLETE literals
...
This is a special case, so I've just hard-coded the GlEnum name and
value. Luckily its value is only used in the client in an OpenGL
context.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
9db5025c41
Output hex literals in upper case
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
59a78bea39
Fix GL_POINT_SIZE_{MIN,MAX} groups
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
784ad9900e
Always use GL_ constants without vendor suffixes where possible
...
It's actually hard to determine whether to use a vendor suffix or not.
For example, the client sometimes uses a bunch of *ARB functions with
_ARB constants. However, it uses the non-_ARB constant with glGetFloat.
It's very hard to fix this inconsistency while still using vendor
suffixes. It seems much easier to just use the constants without the
suffixes all the time.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
a704cf28ef
Add missing PixelType groups for glDrawPixels() calls
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
4fd330a8ac
Transform OpenGL constants inside binary/ternary expressions too
...
We don't make this more general, as we don't want to translate them
inside method call expressions.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
e06e70bc1f
Rename gl* method argument names
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
f4933a2b59
Add support for translating gl calls on the jaggl.opengl object
...
This picks up a glGetString(GL_EXTENSIONS) constant.
Don't translate gl calls within the jaggl.opengl class itself. This
causes failures as there are native methods with 0 and 1 suffixes. These
methods don't exist in the OpenGL registry, causing the transformer to
throw an exception.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
0564bc29b0
Add missing ProgramPropertyARB groups
...
This fixes a GL_OBJECT_COMPILE_STATUS_ARB constant, but I'm doing
everything else in the same set of enums for consistency.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
133e2fac77
Set glGetObjectParameterivARB's pname group to ProgramPropertyARB
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
530af7628b
Add EnableCap group to GL_TEXTURE_3D
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
1a2f0bd9e5
Add MaterialFace group to GL_FRONT, GL_BACK and GL_FRONT_AND_BACK
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
aaaa0c0c68
Fix appending fields to javax.media.opengl.GL
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
ae9dccf9dd
Add CheckedInt32 group to most enums
...
This is a hacky way to fix the parameter value constants in calls to
methods like glTexEnvi().
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
7e66c024b4
Propagate groups from <enums> to each individual <enum>
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
9b5d4221b1
Fix GL_COORD_REPLACE group
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Major
5fa9e9a621
Remove spurious toCollection calls
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Major
424a2d7a31
Fix compilation errors
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Graham
b38da58bd5
Add missing groups to the OpenGL registry
5 years ago
Graham
7db0c971ee
Use OpenGL registry to replace magic numbers with constants
5 years ago
Graham
597aa2018e
Add support for whole program AST transforms
5 years ago
Graham
25a6953644
Fix use of deprecated JavaParser methods
5 years ago
Graham
0a988584b7
Convert some deob-ast methods to extension methods
5 years ago
Graham
5487a74eb8
Remove traversal argument from walk extension method
5 years ago
Graham
54aec42f90
Format .kts files
5 years ago
Graham
ccbbf873af
Switch from Maven to Gradle
5 years ago
Graham
8df0907118
Replace IllegalStateException with error() in BitMaskTransformer
5 years ago
Graham
abf803f017
Replace contains() calls with the in operator
...
These are artifacts of the Java port.
5 years ago
Graham
64abe46971
Replace forEach calls with for loops
...
These are artifacts of the Java port.
5 years ago
Graham
4314aededd
Simplify hasSideEffects() calls in AddSubTransformer
5 years ago
Graham
784b14b66b
Improve safety of ForLoopConditionTransformer
...
Desetude noticed that there are some cases where this transformation is
unsafe - for example: `i > i++`. Skipping the transform if _either_ side
of the comparison has a side effect, rather than _both_ sides, makes it
safe.
5 years ago
Graham
ab75a2f0c9
Add IdentityTransformer
5 years ago
Graham
2e1db9f0b1
Don't swap for loop conditions where both sides have a side effect
5 years ago
Desetude
d8c3f4e31c
Flip > and >= in for loop conditions to < and <= respectively
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
d9762d65bc
Fix Kotlin inspections
5 years ago
Graham
575632413a
Add missing private modifier
5 years ago
Graham
7d1dc59d6a
Convert pre-increments to post-increments where possible
5 years ago
Graham
e9a9a8f962
Format with ktlint
5 years ago
Graham
4df5754dac
Include generics in Function cast
...
The Kotlin compiler was happy with the old code, but IDEA wasn't.
Including the generics explicitly in the cast makes both happy.
5 years ago
Graham
77e8b0cdc0
Use top-level Kotlin main() functions
5 years ago
Graham
01ec848d49
Remove blocks in NegativeLiteralTransformer when statement
...
Each case is very simple so I don't think we need to bother with the blocks.
5 years ago
Graham
130a05956e
Convert ExprUtils to Kotlin
5 years ago
Graham
fc00d69539
Convert TypeUtils to Kotlin
5 years ago