Skip to content

Commit

Permalink
View history
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoAiresCastello committed Jun 12, 2022
1 parent e44343b commit 7ca566b
Show file tree
Hide file tree
Showing 24 changed files with 21 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions PTM/PTM/PTM.vcxproj → PTM/PTM.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\..\Lib\SDL2-2.0.8\include;..\..\..\CppUtils\CppUtils;..\..\..\TileGameToolkit\TileGameLibC\TileGameLib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\..\..\Lib\SDL2-2.0.8\include;..\..\CppUtils\CppUtils;..\..\TileGameToolkit\TileGameLibC\TileGameLib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\..\Lib\SDL2-2.0.8\lib\x86;..\..\..\CppUtils\Debug;..\..\..\TileGameToolkit\TileGameLibC\Builds;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\..\..\Lib\SDL2-2.0.8\lib\x86;..\..\CppUtils\Debug;..\..\TileGameToolkit\TileGameLibC\Builds;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;CppUtils.lib;TileGameLib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions PTM/PTM/t_config.cpp → PTM/t_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ void t_config::load() {
rows = String::ToInt(values[1]);
pixel_w = String::ToInt(values[2]);
pixel_h = String::ToInt(values[3]);
} else if (name == "color") {
auto values = String::Split(value, ' ', true);
if (values.size() != 3) continue;
fg_color = String::ToInt(values[0]);
bg_color = String::ToInt(values[1]);
bdr_color = String::ToInt(values[2]);
}
}
}
5 changes: 4 additions & 1 deletion PTM/PTM/t_config.h → PTM/t_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ struct t_config {
string autorun;
int cols = 33;
int rows = 25;
int pixel_w = 3;
int pixel_w = 4;
int pixel_h = 3;
int fg_color = 0x0d;
int bg_color = 0x90;
int bdr_color = 0x92;
void load();
};
9 changes: 5 additions & 4 deletions PTM/PTM/t_editor_screen.cpp → PTM/t_editor_screen.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "t_editor_screen.h"
#include "t_config.h"

t_editor_screen::t_editor_screen(TBufferedWindow* wnd) {
t_editor_screen::t_editor_screen(TBufferedWindow* wnd, t_config* cfg) {
this->wnd = wnd;
wnd_buf = wnd->GetBuffer();
palette = wnd->GetPalette();
Expand All @@ -11,9 +12,9 @@ t_editor_screen::t_editor_screen(TBufferedWindow* wnd) {
last_row = rows - 1;
csr.x = 0;
csr.y = 0;
color.fg = 15;
color.bg = 0x52;
color.bdr = 0x56;
color.fg = cfg->fg_color;
color.bg = cfg->bg_color;
color.bdr = cfg->bdr_color;
first_line_ix = 0;
first_char_ix = 0;
max_visible_lines = rows - 2;
Expand Down
4 changes: 3 additions & 1 deletion PTM/PTM/t_editor_screen.h → PTM/t_editor_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
#include "common.h"
#include "t_editor_screen_line.h"

struct t_config;

struct t_editor_screen {
TBufferedWindow* wnd;
struct {
ixp fg;
ixp bg;
ixp bdr;
} color;
t_editor_screen(TBufferedWindow* wnd);
t_editor_screen(TBufferedWindow* wnd, t_config* cfg);
TPalette* palette;
TCharset* charset;
void clear_lines();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion PTM/PTM/t_program_editor.cpp → PTM/t_program_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ t_program_editor::t_program_editor(
TBufferedWindow* wnd, TSound* snd, t_config* cfg) {

exit_requested = false;
scr = new t_editor_screen(wnd);
scr = new t_editor_screen(wnd, cfg);
this->snd = snd;
print_intro();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7ca566b

Please sign in to comment.