Skip to content

Commit

Permalink
Upgrading engine for new path managing system
Browse files Browse the repository at this point in the history
  • Loading branch information
ZILtoid1991 committed Jan 31, 2024
1 parent 359bc77 commit c6df86b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import dimage;
import collections.treemap;
import collections.sortedlist;
static import std.stdio;
import std.path : dirSeparator;
/**
* Stores the letters and all the data associated with the font, also has functions related to text lenght and line formatting. Supports variable letter width.
* TODO: Add ability to load from dpk files through the use of vfiles.
Expand Down Expand Up @@ -70,7 +71,7 @@ public class Fontset(T)
_size = fontinfo.info.fontSize;
name = fontinfo.info.fontName;
foreach (path; fontinfo.pages) {
std.stdio.File pageload = std.stdio.File(basepath ~ path);
std.stdio.File pageload = std.stdio.File(basepath ~ dirSeparator ~ path);
switch (extension(path)) {
case ".tga", ".TGA":
TGA fontPage = TGA.load(pageload);
Expand Down
11 changes: 6 additions & 5 deletions pixelperfectengine/src/pixelperfectengine/system/systemutility.d
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ public void INIT_CONCRETE() {
import pixelperfectengine.graphics.fontsets;
import pixelperfectengine.graphics.bitmap;
import std.stdio;
const string sysPath = getPathToAsset("/system/");
Fontset!Bitmap8Bit defaultFont = new Fontset!Bitmap8Bit(File(sysPath ~ "/OpenSans-reg-14.fnt"), sysPath);
Fontset!Bitmap8Bit fixedWidthFont = new Fontset!Bitmap8Bit(File(sysPath ~ "../system/scp-14-reg.fnt"), sysPath);
import std.path : dirSeparator;
const string sysPath = getPathToAsset(dirSeparator ~ "system");
Fontset!Bitmap8Bit defaultFont = new Fontset!Bitmap8Bit(File(sysPath ~ dirSeparator ~ "OpenSans-reg-14.fnt"), sysPath);
Fontset!Bitmap8Bit fixedWidthFont = new Fontset!Bitmap8Bit(File(sysPath ~ dirSeparator ~ "scp-14-reg.fnt"), sysPath);
alias ChrFormat = CharacterFormattingInfo!Bitmap8Bit;
Bitmap8Bit[] ssOrigin = loadBitmapSheetFromFile!Bitmap8Bit("../system/concreteGUIE0.tga", 16, 16);
Bitmap8Bit[] ssOrigin = loadBitmapSheetFromFile!Bitmap8Bit(sysPath ~ dirSeparator ~ "concreteGUIE0.tga", 16, 16);
StyleSheet ss = new StyleSheet();
ss.setImage(ssOrigin[0],"closeButtonA");
ss.setImage(ssOrigin[1],"closeButtonB");
Expand All @@ -78,7 +79,7 @@ public void INIT_CONCRETE() {
ss.setImage(ssOrigin[13],"leftArrowB");
ss.setImage(ssOrigin[14],"rightArrowA");
ss.setImage(ssOrigin[15],"rightArrowB");
ss.setImage(loadBitmapFromFile!Bitmap8Bit(sysPath ~ "/concreteGUIDisable.tga"), "ElementDisabledPtrn");
ss.setImage(loadBitmapFromFile!Bitmap8Bit(sysPath ~ dirSeparator ~ "concreteGUIDisable.tga"), "ElementDisabledPtrn");
ss.addFontset(defaultFont, "default");
ss.addFontset(fixedWidthFont, "fixedWidth");
ss.addChrFormatting(new ChrFormat(defaultFont, 0x1f, FormattingFlags.leftJustify, 0, 15, 2),"default");
Expand Down

0 comments on commit c6df86b

Please sign in to comment.