Xbox: Get resource downloading to work at least

Also tidyup misc folder
This commit is contained in:
UnknownShadow200 2023-08-28 21:53:34 +10:00
parent 3ea04335b9
commit 922f860a7d
21 changed files with 28 additions and 37 deletions

View File

@ -1 +0,0 @@
1 ICON "CCicon.ico"

View File

@ -33,7 +33,7 @@ WIN64_FLAGS="-mwindows -nostartfiles -Wl,-emain_real -DCC_NOMAIN"
build_win32() { build_win32() {
echo "Building win32.." echo "Building win32.."
cp $ROOT_DIR/misc/CCicon_32.res $ROOT_DIR/src/CCicon_32.res cp $ROOT_DIR/misc/windows/CCicon_32.res $ROOT_DIR/src/CCicon_32.res
$WIN32_CC *.c $ALL_FLAGS $WIN32_FLAGS -o cc-w32-d3d.exe CCicon_32.res -DCC_COMMIT_SHA=\"$LATEST\" -lwinmm -limagehlp $WIN32_CC *.c $ALL_FLAGS $WIN32_FLAGS -o cc-w32-d3d.exe CCicon_32.res -DCC_COMMIT_SHA=\"$LATEST\" -lwinmm -limagehlp
if [ $? -ne 0 ]; then echo "Failed to compile Windows 32 bit" >> "$ERRS_FILE"; fi if [ $? -ne 0 ]; then echo "Failed to compile Windows 32 bit" >> "$ERRS_FILE"; fi
@ -49,7 +49,7 @@ build_win32() {
build_win64() { build_win64() {
echo "Building win64.." echo "Building win64.."
cp $ROOT_DIR/misc/CCicon_64.res $ROOT_DIR/src/CCicon_64.res cp $ROOT_DIR/misc/windows/CCicon_64.res $ROOT_DIR/src/CCicon_64.res
$WIN64_CC *.c $ALL_FLAGS $WIN64_FLAGS -o cc-w64-d3d.exe CCicon_64.res -DCC_COMMIT_SHA=\"$LATEST\" -lwinmm -limagehlp $WIN64_CC *.c $ALL_FLAGS $WIN64_FLAGS -o cc-w64-d3d.exe CCicon_64.res -DCC_COMMIT_SHA=\"$LATEST\" -lwinmm -limagehlp
if [ $? -ne 0 ]; then echo "Failed to compile Windows 64 bit" >> "$ERRS_FILE"; fi if [ $? -ne 0 ]; then echo "Failed to compile Windows 64 bit" >> "$ERRS_FILE"; fi

View File

@ -0,0 +1,9 @@
This folder contains build scripts for automatically compiling ClassiCube
|File|Description|
|--------|-------|
|buildbot.sh | Compiles the game to optimised executables (with icons) |
|buildbot_plugin.sh | Compiles specified plugin for various platforms |
|buildtestplugin.sh | Example script for how to use buildbot_plugin.sh |
|makerelease.sh | Packages the executables to produce files for a release |
|notify.py | Notifies a user on Discord if buildbot fails |

View File

@ -1,23 +1,19 @@
This folder contains addtitional information and resources for the game This folder contains additional files and resources for ClassiCube
## Icons ## Icons
CCicon.ico is the basis icon for the other icon files CCicon.ico is the basis icon for the other icon files
mac_icon_gen.cs/linux_icon_gen.cs use CCIcon.ico to generate icon files for macOS/Linux Generating icons that can be embedded in the executable is operating system and compiler specific - see the relevant operating system folder for more details
TODO: Explain how to compile your own icon for all the platforms TODO: Explain how to compile your own icon for all the platforms
## Build scripts ## Folder meanings
|File|Description| |File|Description|
|--------|-------| |--------|-------|
|buildbot.sh | Compiles the game to optimised executables (with icons) | |windows | Contains icons |
|buildbot_plugin.sh | Compiles specified plugin for various platforms | |macOS | Contains icons, Info.plist for generating macOS Application Bundle |
|buildtestplugin.sh | Example script for how to use buildbot_plugin.sh | |linux | Contains icons, script for generating a Desktop Entry |
|makerelease.sh | Packages the executables to produce files for a release | |xbox | Contains Xbox shaders |
|notify.py | Notifies a user on Discord if buildbot fails | |build_scripts | Contains scripts for compiling plugins and optimised ClassiCube executables|
## Other files
Info.plist is the Info.plist you would use when creating an Application Bundle for macOS.

1
misc/windows/CCicon.rc Normal file
View File

@ -0,0 +1 @@
1 ICON "../CCicon.ico"

View File

@ -553,7 +553,7 @@
<ClCompile Include="_type1.c" /> <ClCompile Include="_type1.c" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="..\misc\CCicon.rc" /> <ResourceCompile Include="..\misc\windows\CCicon.rc" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

View File

@ -41,12 +41,12 @@ static void LoadFragmentShader(void) {
uint32_t* p; uint32_t* p;
p = pb_begin(); p = pb_begin();
#include "ps.inl" #include "../misc/xbox/ps_colored.inl"
pb_end(p); pb_end(p);
} }
static uint32_t vs_program[] = { static uint32_t vs_program[] = {
#include "vs.inl" #include "../misc/xbox/vs_colored.inl"
}; };
static void SetupShaders(void) { static void SetupShaders(void) {
@ -368,22 +368,7 @@ void Gfx_CalcPerspectiveMatrix(struct Matrix* matrix, float fov, float aspect, f
matrix->row4.W = 0.0f; matrix->row4.W = 0.0f;
} }
/* Construct a viewport transformation matrix */ void Gfx_OnWindowResize(void) { }
static void CalcViewportTransform(struct Matrix* m, float width, float height, float z_min, float z_max) {
*m = Matrix_Identity;
m->row1.X = width / 2.0f;
m->row2.Y = -height / 2.0f;
m->row3.Z = z_max - z_min;
m->row4.X = width / 2.0f;
m->row4.Y = height / 2.0f;
m->row4.Z = z_min;
m->row4.W = 1.0f;
}
struct Matrix viewport;
void Gfx_OnWindowResize(void) {
CalcViewportTransform(&viewport, WindowInfo.Width, WindowInfo.Height, 0, 65536.0f);
}
static struct Matrix _view, _proj, _mvp; static struct Matrix _view, _proj, _mvp;

View File

@ -2,7 +2,8 @@ XBE_TITLE = ClassiCube
GEN_XISO = $(XBE_TITLE).iso GEN_XISO = $(XBE_TITLE).iso
SRCS = $(wildcard src/*.c) SRCS = $(wildcard src/*.c)
NXDK_DIR = /home/test/Downloads/nxdk NXDK_DIR = /home/test/Downloads/nxdk
SHADER_OBJS = misc/xbox/ps.inl misc/xbox/vs.inl SHADER_OBJS = misc/xbox/vs_colored.inl misc/xbox/ps_colored.inl
NXDK_STACKSIZE = 131072 NXDK_NET = y
NXDK_LDFLAGS = -stack:131072
include $(NXDK_DIR)/Makefile include $(NXDK_DIR)/Makefile

View File

@ -424,7 +424,7 @@ static void InitHDD(void) {
Platform_LogConst("Failed to mount E:\ from Data partition"); Platform_LogConst("Failed to mount E:\ from Data partition");
return; return;
} }
Directory_Create(&String_Empty); Directory_Create(&String_Empty); // create root ClassiCube folder
} }
void Platform_Init(void) { void Platform_Init(void) {