Skip to content

Commit

Permalink
Fix for an alpha check
Browse files Browse the repository at this point in the history
  • Loading branch information
VerMishelb committed Oct 27, 2022
1 parent 9554f20 commit e4e2996
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion UVE_Preload_splitter/Targa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void Targa::BlitRegionTransparent(const std::vector<PixelData>& _data, int x, in
if (!PixelIsTransparent(_data[(_x - x_from) + std::abs(_y - y_from) * w]))
SetPixel(_x, _y,
{
(a_ == -1) ? _data[(_x - x_from) + std::abs(_y - y_from) * w].a : a_,
(a_ == 255) ? _data[(_x - x_from) + std::abs(_y - y_from) * w].a : a_,
_data[(_x - x_from) + std::abs(_y - y_from) * w].r,
_data[(_x - x_from) + std::abs(_y - y_from) * w].g,
_data[(_x - x_from) + std::abs(_y - y_from) * w].b,
Expand Down
2 changes: 1 addition & 1 deletion UVE_Preload_splitter/Targa.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Targa {
//The resulting region is always upside down for consistence
std::vector<PixelData> GetRegion(int x, int y, int w, int h, bool bottom_to_top = true) const;
void BlitRegion(const std::vector<PixelData>& _data, int x, int y, int w, int h, bool bottom_to_top = true);
void BlitRegionTransparent(const std::vector<PixelData>& _data, int x, int y, int w, int h, bool bottom_to_top = true, uint8_t a_ = -1);//Do not place pixel if it's transparent
void BlitRegionTransparent(const std::vector<PixelData>& _data, int x, int y, int w, int h, bool bottom_to_top = true, uint8_t a_ = 255);//Do not place pixel if it's transparent
bool PixelIsTransparent(const PixelData& px, bool check_alpha_only = true);

std::vector<unsigned char> data{};
Expand Down
8 changes: 4 additions & 4 deletions UVE_Preload_splitter/UVE_Preload_splitter.rc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,1,3
PRODUCTVERSION 2,0,1,3
FILEVERSION 2,0,1,4
PRODUCTVERSION 2,0,1,4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "VerMishelb"
VALUE "FileDescription", "An application for extracting and packing texture atlases from Ultra VGA Engine games."
VALUE "FileVersion", "2.0.1.3 R2"
VALUE "FileVersion", "2.0.1.4"
VALUE "InternalName", "UVE_Prel.exe"
VALUE "LegalCopyright", "Copyright (C) 2022 VerMishelb"
VALUE "OriginalFilename", "UVE_Preload_splitter.exe"
VALUE "ProductName", "UVE Preload splitter"
VALUE "ProductVersion", "2.0.1.3"
VALUE "ProductVersion", "2.0.1.4"
END
END
BLOCK "VarFileInfo"
Expand Down
7 changes: 5 additions & 2 deletions UVE_Preload_splitter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "Debug.h"

/* Don't put 0 in the beginning. */
#define VERSION 2'00'01'03
#define VERSION_STR "2.0.1.3"
#define VERSION 2'00'01'04
#define VERSION_STR "2.0.1.4"
#define ERRMSG_NOT_ENOUGH_ARGS(x) "Incorrect " x " usage: not enough arguments.\nRun without parameters to see usage examples.\n"
#define ERRMSG_FILE(x) "An error occurred when trying to read/write " << x << ".\n"
#define HALF(x) ((float)(x)/2.f+1.f)
Expand All @@ -28,6 +28,9 @@ TODO
- Proper exe name arguments system.
- Rework pack entries to support them independantly
2.0.1.4
- Fixed alpha channel check for tranparent blitting.
2.0.1.3
- Added a colour bleeding padding option. See "--colour-padding".
- Added --greyscale option to convert 32 bit frames to 8 bit atlas.
Expand Down

0 comments on commit e4e2996

Please sign in to comment.