Skip to content

Commit e49ee35

Browse files
authored
Merge pull request #13 from mcayland/feature/linux-platform-part4
Fix kauai tests, followed by various fixes for Linux to enable 3dmovie to build and launch
2 parents b92f466 + ce570f9 commit e49ee35

23 files changed

Lines changed: 258 additions & 55 deletions

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,38 @@ jobs:
151151
name: 3DMMEx Windows x64
152152
path: |
153153
dist/x64-clangcl-relwithdebinfo
154+
155+
compile-gcc-x86_64-linux-release:
156+
name: Linux gcc x86_64 Debug
157+
runs-on: ubuntu-latest
158+
steps:
159+
- name: Install Packages
160+
run: |
161+
sudo apt-get update &&
162+
sudo apt-get install -y g++ cmake libsdl2-dev libsdl2-ttf-dev libgtk-3-dev zenity ninja-build
163+
- name: Check out repository code
164+
uses: actions/checkout@v4
165+
- name: CMake Generate
166+
run: |
167+
cmake --preset sdl-x86_64-gcc-linux-debug
168+
- name: CMake Build
169+
run: |
170+
cmake --build build/sdl-x86_64-gcc-linux-debug --target tools studio tests
171+
- name: Run tests
172+
run: |
173+
ctest --test-dir build/sdl-x86_64-gcc-linux-debug --output-on-failure --timeout 60
174+
- name: CMake Install
175+
run: |
176+
cmake --install build/sdl-x86_64-gcc-linux-debug --prefix dist/sdl-x86_64-gcc-linux-debug
177+
- name: Upload debug files
178+
uses: actions/upload-artifact@v4
179+
with:
180+
name: 3DMMEx Linux gcc x86_64 debug files
181+
path: |
182+
build/sdl-x86_64-gcc-linux-debug/src/chomp/studio/*.i
183+
- name: Upload Debug
184+
uses: actions/upload-artifact@v4
185+
with:
186+
name: 3DMMEx Linux gcc x86_64 Debug
187+
path: |
188+
dist/sdl-x86_64-gcc-linux-debug

CMakePresets.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,24 @@
184184
"CMAKE_BUILD_TYPE": "Debug",
185185
"3DMM_GUI": "SDL"
186186
}
187+
},
188+
{
189+
"displayName": "SDL Linux gcc x64_64 Debug",
190+
"name": "sdl-x86_64-gcc-linux-debug",
191+
"inherits": "base",
192+
"cacheVariables": {
193+
"CMAKE_BUILD_TYPE": "Debug",
194+
"3DMM_GUI": "SDL"
195+
}
196+
},
197+
{
198+
"displayName": "SDL Linux gcc x64_64 Release",
199+
"name": "sdl-x86_64-gcc-linux-release",
200+
"inherits": "base",
201+
"cacheVariables": {
202+
"CMAKE_BUILD_TYPE": "Release",
203+
"3DMM_GUI": "SDL"
204+
}
187205
}
188206
]
189-
}
207+
}
File renamed without changes.

bren/tmap.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ bool TMAP::FWrite(PBLCK pblck)
158158
return fTrue;
159159
}
160160

161-
#ifdef WIN
161+
#ifndef MAC
162162

163163
#define CALCDIST(bRed1, bGreen1, bBlue1, bRed2, bGreen2, bBlue2) \
164164
(((bRed1) - (bRed2)) * ((bRed1) - (bRed2)) + ((bGreen1) - (bGreen2)) * ((bGreen1) - (bGreen2)) + \
@@ -255,7 +255,7 @@ PTMAP TMAP::PtmapReadNative(FNI *pfni, PGL pglclr)
255255
pglCache->Put(prgb[iprgb], &iclrBest);
256256
}
257257

258-
prgb[iprgb] = (BYTE)iclrBest;
258+
prgb[iprgb] = (uint8_t)iclrBest;
259259
}
260260
}
261261

@@ -269,9 +269,7 @@ PTMAP TMAP::PtmapReadNative(FNI *pfni, PGL pglclr)
269269

270270
return ptmap;
271271
}
272-
#endif // WIN
273-
274-
#ifdef MAC
272+
#else // !MAC
275273
PTMAP TMAP::PtmapReadNative(FNI *pfni)
276274
{
277275
RawRtn(); // REVIEW peted: NYI

inc/soc.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,19 @@
9393
#define khidMsqClock khidLimKidFrame + 4
9494
// khidStudio khidLimKidFrame + 5 Defined in stdiodef.h
9595

96-
#define kftgChunky MacWin(KLCONST4('c', 'h', 'n', 'k'), KLCONST3('c', 'h', 'k'))
97-
#define kftgContent MacWin(KLCONST4('3', 'c', 'o', 'n'), KLCONST3('3', 'c', 'n'))
98-
#define kftgThumbDesc MacWin(KLCONST4('3', 't', 'h', 'd'), KLCONST3('3', 't', 'h'))
99-
#define kftg3mm MacWin(KLCONST3('3', 'm', 'm'), KLCONST3('3', 'm', 'm'))
100-
#define kftgSocTemp MacWin(KLCONST4('3', 't', 'm', 'p'), KLCONST3('3', 't', 'p'))
96+
#ifdef MAC
97+
#define kftgChunky KLCONST4('c', 'h', 'n', 'k')
98+
#define kftgContent KLCONST4('3', 'c', 'o', 'n')
99+
#define kftgThumbDesc KLCONST4('3', 't', 'h', 'd')
100+
#define kftg3mm KLCONST3('3', 'm', 'm')
101+
#define kftgSocTemp KLCONST4('3', 't', 'm', 'p')
102+
#else
103+
#define kftgChunky KLCONST3('c', 'h', 'k')
104+
#define kftgContent KLCONST3('3', 'c', 'n')
105+
#define kftgThumbDesc KLCONST3('3', 't', 'h')
106+
#define kftg3mm KLCONST3('3', 'm', 'm')
107+
#define kftgSocTemp KLCONST3('3', 't', 'p')
108+
#endif
101109

102110
#define ksz3mm PszLit("3mm")
103111

inc/utest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class APP : public APP_PAR
213213
bool _FInitBuilding(void);
214214
bool _FInitStudio(PFNI pfniUserDoc, bool fFailIfDocOpenFailed = fTrue);
215215
bool _FInitAcceleratorTable(void);
216-
void _GetWindowProps(int32_t *pxp, int32_t *pyp, int32_t *pdxp, int32_t *pdyp, DWORD *pdwStyle);
216+
void _GetWindowProps(int32_t *pxp, int32_t *pyp, int32_t *pdxp, int32_t *pdyp, uint32_t *pdwStyle);
217217
void _RebuildMainWindow(void);
218218
bool _FSwitch640480(bool fTo640480);
219219
bool _FDisplayIs640480(void);

kauai/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,10 @@ if (BUILD_TESTS)
617617
target_link_libraries(
618618
KauaiGuiTest
619619
PUBLIC
620+
KauaiBase
621+
KauaiFile
620622
KauaiTestLib
623+
KauaiGroup
621624
KauaiGui
622625
KauaiRichText
623626
GTest::gtest_main

kauai/src/appbsdl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "frame.h"
1111
#include "fcntl.h"
1212
#include "stdio.h"
13-
#include "io.h"
1413

1514
ASSERTNAME
1615

@@ -837,4 +836,4 @@ int32_t APPB::Win32VkFromVk(int32_t vk)
837836
}
838837

839838
return vk;
840-
}
839+
}

kauai/src/fni.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class FNI : public FNI_PAR
127127

128128
tribool TExists(void);
129129
bool FDelete(void);
130+
bool FIsReadOnly(void);
130131
bool FRename(PFNI pfniNew);
131132
bool FEqual(PFNI pfni);
132133

kauai/src/fniposix.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,17 +429,28 @@ bool FNI::FDelete(void)
429429
return fFalse;
430430
}
431431

432+
/***************************************************************************
433+
Return whether the fni is read-only.
434+
***************************************************************************/
435+
bool FNI::FIsReadOnly(void)
436+
{
437+
AssertThis(ffniFile);
438+
fs::perms perms;
439+
440+
perms = fs::status(_stnFile.Psz()).permissions();
441+
442+
return ((perms & fs::perms::owner_write) == fs::perms::none);
443+
}
444+
432445
/***************************************************************************
433446
Renames the file indicated by this to *pfni.
434447
***************************************************************************/
435448
bool FNI::FRename(FNI *pfni)
436449
{
437450
AssertThis(ffniFile);
438451
AssertPo(pfni, ffniFile);
439-
fs::perms perms;
440452

441-
perms = fs::status(_stnFile.Psz()).permissions();
442-
if (!((perms & fs::perms::owner_write) == fs::perms::none))
453+
if (!FIsReadOnly())
443454
{
444455
fs::path src = fs::path(_stnFile.Psz());
445456
fs::path dst = fs::path(pfni->_stnFile.Psz());

0 commit comments

Comments
 (0)