Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
9ac88031
Commit
9ac88031
authored
1 year ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Add 'Invert' translation
parent
f8d75ee0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!2355
fix newer versions of mixerx
,
!2190
ZDoom translations
Pipeline
#1967
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/r_translation.c
+24
-0
24 additions, 0 deletions
src/r_translation.c
with
24 additions
and
0 deletions
src/r_translation.c
+
24
−
0
View file @
9ac88031
...
...
@@ -33,6 +33,7 @@ static boolean PaletteRemap_AddColorRange(remaptable_t *tr, int start, int end,
static
boolean
PaletteRemap_AddDesaturation
(
remaptable_t
*
tr
,
int
start
,
int
end
,
double
r1
,
double
g1
,
double
b1
,
double
r2
,
double
g2
,
double
b2
);
static
boolean
PaletteRemap_AddColourisation
(
remaptable_t
*
tr
,
int
start
,
int
end
,
int
r
,
int
g
,
int
b
);
static
boolean
PaletteRemap_AddTint
(
remaptable_t
*
tr
,
int
start
,
int
end
,
int
r
,
int
g
,
int
b
,
int
amount
);
static
boolean
PaletteRemap_AddInvert
(
remaptable_t
*
tr
,
int
start
,
int
end
);
enum
PaletteRemapType
{
...
...
@@ -101,6 +102,12 @@ void PaletteRemap_Init(void)
memset
(
allBlack
->
remap
,
31
,
NUM_PALETTE_ENTRIES
*
sizeof
(
UINT8
));
R_AddCustomTranslation
(
"AllBlack"
,
PaletteRemap_Add
(
allBlack
));
// Invert
remaptable_t
*
invertRemap
=
PaletteRemap_New
();
PaletteRemap_SetIdentity
(
invertRemap
);
PaletteRemap_AddInvert
(
invertRemap
,
0
,
255
);
R_AddCustomTranslation
(
"Invert"
,
PaletteRemap_Add
(
invertRemap
));
// Dash mode (TC_DASHMODE)
MakeDashModeRemap
();
}
...
...
@@ -417,6 +424,23 @@ static boolean PaletteRemap_AddTint(remaptable_t *tr, int start, int end, int r,
return
true
;
}
static
boolean
PaletteRemap_AddInvert
(
remaptable_t
*
tr
,
int
start
,
int
end
)
{
if
(
IndicesOutOfRange
(
start
,
end
))
return
false
;
for
(
int
i
=
start
;
i
<
end
;
++
i
)
{
tr
->
remap
[
i
]
=
NearestColor
(
255
-
tr
->
remap
[
pMasterPalette
[
i
].
s
.
red
],
255
-
tr
->
remap
[
pMasterPalette
[
i
].
s
.
green
],
255
-
tr
->
remap
[
pMasterPalette
[
i
].
s
.
blue
]
);
}
return
true
;
}
struct
ParsedTranslation
{
struct
ParsedTranslation
*
next
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment