Skip to content

Commit

Permalink
Pushed v1.01 code
Browse files Browse the repository at this point in the history
- Hardware mouse ("HWMOUSE" in config) now has the same colors and shape
  as the original PT cursor. This mode is now the new config default.
- MacOS: Pass NDEBUG to clang preprocessor defines, to prevent debug code
  from being compiled in release mode.
  • Loading branch information
8bitbubsy committed Dec 19, 2019
1 parent e537ab6 commit 118366b
Show file tree
Hide file tree
Showing 28 changed files with 271 additions and 213 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ pt_pal_editor/vs2019_project/pt_pal_editor/Release/pt_pal_editor.vcxproj.FileLis
vs2019_project/.vs/pt2-clone/v16/.suo
*.cache
*.ipch
.DS_Store
vs2019_project/pt2-clone/Release/pt2-clone.vcxproj.FileListAbsolute.txt
vs2019_project/pt2-clone/x64/Debug/pt2-clone.vcxproj.FileListAbsolute.txt
2 changes: 1 addition & 1 deletion make-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
rm release/other/pt2-clone &> /dev/null

echo Compiling, please wait...
gcc src/gfx/*.c src/*.c -lSDL2 -lm -Wall -Wno-unused-result -Wc++-compat -Wshadow -Winit-self -Wextra -Wunused -Wunreachable-code -Wredundant-decls -Wswitch-default -march=native -mtune=native -O3 -o release/other/pt2-clone
gcc -DNDEBUG src/gfx/*.c src/*.c -lSDL2 -lm -Wall -Wno-unused-result -Wc++-compat -Wshadow -Winit-self -Wextra -Wunused -Wunreachable-code -Wredundant-decls -Wswitch-default -march=native -mtune=native -O3 -o release/other/pt2-clone
rm src/gfx/*.o src/*.o &> /dev/null

echo Done! The executable is in the folder named \'release/other\'.
2 changes: 1 addition & 1 deletion make-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else

rm release/macos/pt2-clone-macos.app/Contents/MacOS/pt2-clone &> /dev/null

clang -mmacosx-version-min=10.6 -arch x86_64 -mmmx -mfpmath=sse -msse2 -I/Library/Frameworks/SDL2.framework/Headers -F/Library/Frameworks src/gfx/*.c src/*.c -O3 -lm -Wall -Winit-self -Wextra -Wunused -Wredundant-decls -Wswitch-default -framework SDL2 -framework Cocoa -lm -o release/macos/pt2-clone-macos.app/Contents/MacOS/pt2-clone-macos
clang -mmacosx-version-min=10.6 -arch x86_64 -mmmx -mfpmath=sse -msse2 -I/Library/Frameworks/SDL2.framework/Headers -F/Library/Frameworks -g0 -DNDEBUG src/gfx/*.c src/*.c -O3 -lm -Wall -Winit-self -Wextra -Wunused -Wredundant-decls -Wswitch-default -framework SDL2 -framework Cocoa -lm -o release/macos/pt2-clone-macos.app/Contents/MacOS/pt2-clone-macos
strip release/macos/pt2-clone-macos.app/Contents/MacOS/pt2-clone-macos
install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 @executable_path/../Frameworks/SDL2.framework/Versions/A/SDL2 release/macos/pt2-clone-macos.app/Contents/MacOS/pt2-clone-macos

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
4 changes: 4 additions & 0 deletions pt_pal_editor/release/other/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
6 changes: 2 additions & 4 deletions release/macos/protracker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ VSYNCOFF=FALSE

; Use hardware mouse
; Syntax: TRUE or FALSE
; Default value: FALSE
; Default value: TRUE
; Comment: Disables software mouse and uses the mouse in your OS.
; This can feel more comfortable for some users because of less latency.
; However, the OS mouse cursor can be too small depending on VIDEOSCALE,
; and it will not be colored (which tells the current tracker state).
;
HWMOUSE=FALSE
HWMOUSE=TRUE

; Make fullscreen mode stretch out the image (will often look bad)
; Syntax: TRUE or FALSE
Expand Down
4 changes: 4 additions & 0 deletions release/macos/pt2-clone-macos.app/Contents/MacOS/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
6 changes: 2 additions & 4 deletions release/other/protracker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ VSYNCOFF=FALSE

; Use hardware mouse
; Syntax: TRUE or FALSE
; Default value: FALSE
; Default value: TRUE
; Comment: Disables software mouse and uses the mouse in your OS.
; This can feel more comfortable for some users because of less latency.
; However, the OS mouse cursor can be too small depending on VIDEOSCALE,
; and it will not be colored (which tells the current tracker state).
;
HWMOUSE=FALSE
HWMOUSE=TRUE

; Make fullscreen mode stretch out the image (will often look bad)
; Syntax: TRUE or FALSE
Expand Down
6 changes: 2 additions & 4 deletions release/win32/protracker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ VSYNCOFF=FALSE

; Use hardware mouse
; Syntax: TRUE or FALSE
; Default value: FALSE
; Default value: TRUE
; Comment: Disables software mouse and uses the mouse in your OS.
; This can feel more comfortable for some users because of less latency.
; However, the OS mouse cursor can be too small depending on VIDEOSCALE,
; and it will not be colored (which tells the current tracker state).
;
HWMOUSE=FALSE
HWMOUSE=TRUE

; Make fullscreen mode stretch out the image (will often look bad)
; Syntax: TRUE or FALSE
Expand Down
6 changes: 2 additions & 4 deletions release/win64/protracker.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ VSYNCOFF=FALSE

; Use hardware mouse
; Syntax: TRUE or FALSE
; Default value: FALSE
; Default value: TRUE
; Comment: Disables software mouse and uses the mouse in your OS.
; This can feel more comfortable for some users because of less latency.
; However, the OS mouse cursor can be too small depending on VIDEOSCALE,
; and it will not be colored (which tells the current tracker state).
;
HWMOUSE=FALSE
HWMOUSE=TRUE

; Make fullscreen mode stretch out the image (will often look bad)
; Syntax: TRUE or FALSE
Expand Down
6 changes: 3 additions & 3 deletions src/gfx/pt2_gfx_pointer.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <stdint.h>
#include "../pt2_palette.h"

// This graphical table has to be in the palette kind of data
// because it changes color according to status. Easier this
// way.
/* This graphical table has to be in the palette kind of data
* because it changes color according to status. Easier this
* way. */

const uint8_t mousePointerBMP[256] =
{
Expand Down
2 changes: 1 addition & 1 deletion src/pt2_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ bool renderToWav(char *fileName, bool checkIfFileExist)

editor.blockMarkFlag = false;

pointerSetMode(POINTER_MODE_READ_DIR, NO_CARRY);
pointerSetMode(POINTER_MODE_MSG2, NO_CARRY);
setStatusMessage("RENDERING MOD...", NO_CARRY);

editor.ui.disableVisualizer = true;
Expand Down
13 changes: 2 additions & 11 deletions src/pt2_diskop.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void handleEntryJumping(char jumpToChar) // SHIFT+character
editor.errorMsgBlock = true;
editor.errorMsgCounter = 0;

pointerErrorMode();
setErrPointer();
}

bool diskOpEntryIsEmpty(int32_t fileIndex)
Expand Down Expand Up @@ -644,9 +644,6 @@ static bool diskOpFillBuffer(void)

freeDiskOpEntryMem();

if (!editor.errorMsgActive)
pointerSetMode(POINTER_MODE_READ_DIR, NO_CARRY);

// fill disk op. buffer (type, size, path, file name, date changed)

// read first file
Expand Down Expand Up @@ -703,12 +700,6 @@ static bool diskOpFillBuffer(void)
statusOutOfMemory();
}

if (!editor.errorMsgActive)
{
pointerSetPreviousMode();
diskOpShowSelectText();
}

return true;
}

Expand Down Expand Up @@ -949,7 +940,7 @@ void diskOpLoadFile(uint32_t fileEntryRow, bool songModifiedCheck)
editor.errorMsgCounter = 0;

// status/error message is set in the mod loader
pointerErrorMode();
setErrPointer();
}
}
else if (editor.diskop.mode == DISKOP_MODE_SMP)
Expand Down
9 changes: 3 additions & 6 deletions src/pt2_edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,10 @@ void exitGetTextLine(bool updateValue)
modEntry->head.moduleTitle[i] = (char)tolower(modEntry->head.moduleTitle[i]);
}

if (editor.ui.editObject != PTB_DO_DATAPATH) // special case for disk op. right mouse button
{
pointerSetPreviousMode();
pointerSetPreviousMode();

if (!editor.mixFlag)
updateWindowTitle(MOD_IS_MODIFIED);
}
if (!editor.mixFlag)
updateWindowTitle(MOD_IS_MODIFIED);
}
else
{
Expand Down
7 changes: 4 additions & 3 deletions src/pt2_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <stdint.h>
#include "pt2_unicode.h"

#define PROG_VER_STR "1.00"
#define PROG_VER_STR "1.01"

#ifdef _WIN32
#define DIR_DELIMITER '\\'
Expand Down Expand Up @@ -399,7 +399,7 @@ struct editor_t
uint8_t numLen, numBits;

// render/update flags
bool refreshMousePointer, updateStatusText, updatePatternData;
bool updateStatusText, updatePatternData;
bool updateSongName, updateMod2WavDialog, mod2WavFinished;

// edit op. #2
Expand Down Expand Up @@ -438,7 +438,8 @@ struct editor_t
uint16_t *numPtr16, tmpDisp16, *dstOffset, dstPos, textLength, editTextPos;
uint16_t dstOffsetEnd, lastSampleOffset;
int32_t askTempData, renderX, renderY, renderW, renderH, displayW, displayH;
uint32_t xScaleMul, yScaleMul;
uint32_t xScale, yScale;
double dMouseXMul, dMouseYMul;
SDL_PixelFormat *pixelFormat;
#ifdef _WIN32
HWND hWnd;
Expand Down
4 changes: 2 additions & 2 deletions src/pt2_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -3670,7 +3670,7 @@ bool handleGeneralModes(SDL_Keycode keycode, SDL_Scancode scancode)

handleAskNo();

pointerSetMode(POINTER_MODE_READ_DIR, NO_CARRY);
pointerSetMode(POINTER_MODE_MSG2, NO_CARRY);
setStatusMessage("RENDERING MOD...", NO_CARRY);
}
}
Expand Down Expand Up @@ -3921,7 +3921,7 @@ bool handleGeneralModes(SDL_Keycode keycode, SDL_Scancode scancode)
editor.errorMsgBlock = true;
editor.errorMsgCounter = 0;

pointerErrorMode();
setErrPointer();
}
break;

Expand Down
10 changes: 4 additions & 6 deletions src/pt2_modloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "pt2_palette.h"
#include "pt2_mouse.h"
#include "pt2_header.h"
#include "pt2_sampler.h"
#include "pt2_textout.h"
Expand All @@ -26,7 +26,7 @@
#include "pt2_unicode.h"
#include "pt2_modloader.h"
#include "pt2_sampleloader.h"

#
typedef struct mem_t
{
bool _eof;
Expand Down Expand Up @@ -1161,7 +1161,7 @@ void loadModFromArg(char *arg)
editor.errorMsgCounter = 0;

// status/error message is set in the mod loader
pointerErrorMode();
setErrPointer();
}

free(filenameU);
Expand Down Expand Up @@ -1205,8 +1205,6 @@ void loadDroppedFile(char *fullPath, uint32_t fullPathLen, bool autoPlay, bool s

// don't allow drag n' drop if the tracker is busy
if (editor.ui.pointerMode == POINTER_MODE_MSG1 ||
editor.ui.pointerMode == POINTER_MODE_LOAD ||
editor.ui.pointerMode == POINTER_MODE_READ_DIR ||
editor.diskop.isFilling || editor.isWAVRendering ||
editor.ui.samplerFiltersBoxShown || editor.ui.samplerVolBoxShown)
{
Expand Down Expand Up @@ -1328,7 +1326,7 @@ void loadDroppedFile(char *fullPath, uint32_t fullPathLen, bool autoPlay, bool s
editor.errorMsgActive = true;
editor.errorMsgBlock = true;
editor.errorMsgCounter = 0;
pointerErrorMode(); // status/error message is set in the mod loader
setErrPointer(); // status/error message is set in the mod loader
}
}
else
Expand Down
Loading

0 comments on commit 118366b

Please sign in to comment.