Merge remote-tracking branch 'origin/master' into cmake_mingw
This commit is contained in:
commit
c4e920901e
@ -1,12 +1,12 @@
|
|||||||
image: Visual Studio 2017
|
image: Visual Studio 2017
|
||||||
configuration: Release
|
configuration: Release
|
||||||
environment:
|
environment:
|
||||||
GLFW_BASE: glfw-3.2.1.bin.WIN64
|
GLFW_BASE: glfw-3.3.4.bin.WIN64
|
||||||
GLFW_URL: https://github.com/glfw/glfw/releases/download/3.2.1/%GLFW_BASE%.zip
|
GLFW_URL: https://github.com/glfw/glfw/releases/download/3.3.4/%GLFW_BASE%.zip
|
||||||
SDL2_BASE: SDL2-devel-2.0.8-VC
|
SDL2_BASE: SDL2-devel-2.0.14-VC
|
||||||
SDL2_URL: https://www.libsdl.org/release/%SDL2_BASE%.zip
|
SDL2_URL: https://www.libsdl.org/release/%SDL2_BASE%.zip
|
||||||
SDL2_DIRAME: SDL2-2.0.8
|
SDL2_DIRAME: SDL2-2.0.14
|
||||||
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-windows.zip
|
PREMAKE5_URL: https://github.com/premake/premake-core/releases/download/v5.0.0-alpha16/premake-5.0.0-alpha16-windows.zip
|
||||||
matrix:
|
matrix:
|
||||||
- PLATFORM: win-amd64-null
|
- PLATFORM: win-amd64-null
|
||||||
- PLATFORM: win-amd64-gl3
|
- PLATFORM: win-amd64-gl3
|
||||||
|
29
.github/workflows/build-cmake-conan.yml
vendored
29
.github/workflows/build-cmake-conan.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Build using conan+cmake
|
name: Conan
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
@ -9,11 +9,9 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||||
platform: ['null', 'gl3', 'd3d9', 'ps2']
|
platform: ['null', 'gl3', 'd3d9']
|
||||||
gl3_gfxlib: ['glfw', 'sdl2']
|
gl3_gfxlib: ['glfw', 'sdl2']
|
||||||
exclude:
|
exclude:
|
||||||
- os: windows-latest
|
|
||||||
platform: ps2
|
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
platform: d3d9
|
platform: d3d9
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
@ -22,10 +20,7 @@ jobs:
|
|||||||
gl3_gfxlib: sdl2
|
gl3_gfxlib: sdl2
|
||||||
- platform: d3d9
|
- platform: d3d9
|
||||||
gl3_gfxlib: sdl2
|
gl3_gfxlib: sdl2
|
||||||
- platform: ps2
|
|
||||||
gl3_gfxlib: sdl2
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
continue-on-error: ${{ matrix.platform == 'ps2' }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
@ -38,28 +33,10 @@ jobs:
|
|||||||
conan config set log.print_run_commands=True
|
conan config set log.print_run_commands=True
|
||||||
conan config set general.revisions_enabled=1
|
conan config set general.revisions_enabled=1
|
||||||
conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan
|
conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan
|
||||||
- name: "Add os=Playstation2 + gcc.version=3.2 to .conan/settings.yml"
|
|
||||||
if: ${{ matrix.platform == 'ps2' }}
|
|
||||||
shell: python
|
|
||||||
run: |
|
|
||||||
import os, yaml
|
|
||||||
settings_path = os.path.expanduser("~/.conan/settings.yml")
|
|
||||||
yml = yaml.safe_load(open(settings_path))
|
|
||||||
yml["os"]["Playstation2"] = None
|
|
||||||
yml["compiler"]["gcc"]["version"].append("3.2")
|
|
||||||
yml["compiler"]["gcc"]["version"].sort()
|
|
||||||
yaml.safe_dump(yml, open(settings_path, "w"))
|
|
||||||
- name: "Create host profile"
|
- name: "Create host profile"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if test "${{ matrix.platform }}" = "ps2"; then
|
cp ~/.conan/profiles/default host_profile
|
||||||
cp conan/playstation2 host_profile
|
|
||||||
else
|
|
||||||
cp ~/.conan/profiles/default host_profile
|
|
||||||
fi
|
|
||||||
- name: "Export Playstation 2 CMake toolchain conan recipe"
|
|
||||||
run: |
|
|
||||||
conan export cmake/ps2/cmaketoolchain ps2dev-cmaketoolchain/master@
|
|
||||||
- name: "Download/build dependencies (conan install)"
|
- name: "Download/build dependencies (conan install)"
|
||||||
run: |
|
run: |
|
||||||
conan install ${{ github.workspace }} librw/master@ -if build -o librw:platform=${{ matrix.platform }} -o librw:gl3_gfxlib=${{ matrix.gl3_gfxlib }} --build missing -pr:h ./host_profile -pr:b default
|
conan install ${{ github.workspace }} librw/master@ -if build -o librw:platform=${{ matrix.platform }} -o librw:gl3_gfxlib=${{ matrix.gl3_gfxlib }} --build missing -pr:h ./host_profile -pr:b default
|
||||||
|
29
.github/workflows/build-ps2.yml
vendored
Normal file
29
.github/workflows/build-ps2.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Playstation 2 (by ps2dev)
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
release:
|
||||||
|
types: published
|
||||||
|
jobs:
|
||||||
|
build-playstation-2:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ps2dev/ps2dev
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: "Install dependencies"
|
||||||
|
run: |
|
||||||
|
apk add build-base cmake
|
||||||
|
- name: "Build files"
|
||||||
|
run: |
|
||||||
|
cmake -S. -Bbuild -DLIBRW_INSTALL=ON -DLIBRW_PLATFORM=PS2 -DCMAKE_TOOLCHAIN_FILE=cmake/ps2/cmaketoolchain/toolchain_ps2_ee.cmake
|
||||||
|
cmake --build build --parallel
|
||||||
|
- name: "Create binary package (cpack)"
|
||||||
|
working-directory: ./build
|
||||||
|
run: |
|
||||||
|
cpack
|
||||||
|
- name: "Archive binary package (github artifacts)"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: "ps2"
|
||||||
|
path: build/*.tar.xz
|
||||||
|
if-no-files-found: error
|
2
.github/workflows/build-switch.yml
vendored
2
.github/workflows/build-switch.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Build for Nintendo Switch using CMake provided by devkitPro
|
name: Nintendo Switch (by devkitPro)
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
|
@ -31,7 +31,8 @@ elseif(PS2)
|
|||||||
else()
|
else()
|
||||||
set(LIBRW_PLATFORMS "NULL" "GL3")
|
set(LIBRW_PLATFORMS "NULL" "GL3")
|
||||||
endif()
|
endif()
|
||||||
set(LIBRW_PLATFORM "NULL" CACHE STRING "Platform")
|
list(GET LIBRW_PLATFORMS 0 LIBRW_PLATFORM_DEFAULT)
|
||||||
|
set(LIBRW_PLATFORM "${LIBRW_PLATFORM_DEFAULT}" CACHE STRING "Platform")
|
||||||
set_property(CACHE LIBRW_PLATFORM PROPERTY STRINGS ${LIBRW_PLATFORMS})
|
set_property(CACHE LIBRW_PLATFORM PROPERTY STRINGS ${LIBRW_PLATFORMS})
|
||||||
message(STATUS "LIBRW_PLATFORM = ${LIBRW_PLATFORM} (choices=${LIBRW_PLATFORMS})")
|
message(STATUS "LIBRW_PLATFORM = ${LIBRW_PLATFORM} (choices=${LIBRW_PLATFORMS})")
|
||||||
set("LIBRW_PLATFORM_${LIBRW_PLATFORM}" ON)
|
set("LIBRW_PLATFORM_${LIBRW_PLATFORM}" ON)
|
||||||
|
@ -3,11 +3,9 @@ cmake_minimum_required(VERSION 3.7)
|
|||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
|
||||||
set(CMAKE_SYSTEM_NAME "PlayStation2")
|
set(CMAKE_SYSTEM_NAME "PlayStation2")
|
||||||
set(CMAKE_SYSTEM_PROCESSOR "mipsel")
|
set(CMAKE_SYSTEM_PROCESSOR "mips64r5900el")
|
||||||
set(CMAKE_SYSTEM_VERSION 1)
|
set(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
set(CMAKE_NO_SYSTEM_FROM_IMPORTED ON)
|
set(CMAKE_NO_SYSTEM_FROM_IMPORTED ON)
|
||||||
|
|
||||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
@ -18,37 +16,47 @@ endif()
|
|||||||
if(NOT DEFINED ENV{PS2SDK})
|
if(NOT DEFINED ENV{PS2SDK})
|
||||||
message(FATAL_ERROR "Need environment variable PS2SDK set")
|
message(FATAL_ERROR "Need environment variable PS2SDK set")
|
||||||
endif()
|
endif()
|
||||||
|
if(NOT DEFINED ENV{GSKIT})
|
||||||
|
message(FATAL_ERROR "Need environment variable PS2SDK set")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(PS2DEV "$ENV{PS2DEV}")
|
set(PS2DEV "$ENV{PS2DEV}")
|
||||||
set(PS2SDK "$ENV{PS2SDK}")
|
set(PS2SDK "$ENV{PS2SDK}")
|
||||||
|
set(GSKIT "$ENV{GSKIT}")
|
||||||
|
|
||||||
if(NOT IS_DIRECTORY "${PS2DEV}")
|
if(NOT IS_DIRECTORY "${PS2DEV}")
|
||||||
message(FATAL_ERROR "PS2DEV must contain a folder path (${PS2DEV})")
|
message(FATAL_ERROR "PS2DEV must be a folder path (${PS2DEV})")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT IS_DIRECTORY "${PS2SDK}")
|
if(NOT IS_DIRECTORY "${PS2SDK}")
|
||||||
message(FATAL_ERROR "PS2SDK must contain a folder path (${PS2SDK})")
|
message(FATAL_ERROR "PS2SDK must be a folder path (${PS2SDK})")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT IS_DIRECTORY "${GSKIT}")
|
||||||
|
message(FATAL_ERROR "GSKIT must be a folder path (${GSKIT})")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_DSM_SOURCE_FILE_EXTENSIONS "dsm")
|
set(CMAKE_DSM_SOURCE_FILE_EXTENSIONS "dsm")
|
||||||
|
|
||||||
set(CMAKE_C_COMPILER "${PS2DEV}/ee/bin/ee-gcc")
|
set(CMAKE_C_COMPILER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-gcc" CACHE FILEPATH "C compiler")
|
||||||
set(CMAKE_CXX_COMPILER "${PS2DEV}/ee/bin/ee-g++")
|
set(CMAKE_CXX_COMPILER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-g++" CACHE FILEPATH "CXX compiler")
|
||||||
set(CMAKE_ASM_COMPILER "${PS2DEV}/ee/bin/ee-g++")
|
set(CMAKE_ASM_COMPILER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-g++" CACHE FILEPATH "ASM assembler")
|
||||||
set(CMAKE_DSM_COMPILER "${PS2DEV}/dvp/bin/dvp-as")
|
set(CMAKE_DSM_COMPILER "${PS2DEV}/dvp/bin/dvp-as" CACHE FILEPATH "DSM assembler")
|
||||||
set(CMAKE_AR "${PS2DEV}/ee/bin/ee-ar" CACHE FILEPATH "archiver")
|
set(CMAKE_AR "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-ar" CACHE FILEPATH "archiver")
|
||||||
set(CMAKE_LINKER "${PS2DEV}/ee/bin/ee-ld")
|
set(CMAKE_LINKER "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-ld" CACHE FILEPATH "Linker")
|
||||||
set(CMAKE_RANLIB "${PS2DEV}/ee/bin/ee-ranlib" CACHE FILEPATH "ranlib")
|
set(CMAKE_RANLIB "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-ranlib" CACHE FILEPATH "ranlib")
|
||||||
set(CMAKE_STRIP "${PS2DEV}/ee/bin/ee-strip" CACHE FILEPATH "strip")
|
set(CMAKE_STRIP "${PS2DEV}/ee/bin/mips64r5900el-ps2-elf-strip" CACHE FILEPATH "strip")
|
||||||
|
|
||||||
set(CMAKE_ASM_FLAGS_INIT "-G0 -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\"")
|
set(CMAKE_ASM_FLAGS_INIT "-G0 -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\" -D_EE")
|
||||||
set(CMAKE_C_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\"")
|
set(CMAKE_C_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\" -D_EE")
|
||||||
set(CMAKE_CXX_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\"")
|
set(CMAKE_CXX_FLAGS_INIT "-G0 -fno-common -I\"${PS2SDK}/ee/include\" -I\"${PS2SDK}/common/include\" -D_EE")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-G0 -L\"${PS2SDK}/ee/lib\" -Wl,-r -Wl,-d")
|
set(CMAKE_EXE_LINKER_FLAGS_INIT "-G0 -L\"${PS2SDK}/ee/lib\" -Wl,-r -Wl,-d")
|
||||||
|
|
||||||
set(CMAKE_FIND_ROOT_PATH "${PS2DEV}/ee" "${PS2SDK}/ee")
|
set(CMAKE_FIND_ROOT_PATH "${PS2DEV}/ee" "${PS2SDK}/ee" "${GSKIT}")
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
|
||||||
set(PS2 1)
|
set(PS2 1)
|
||||||
set(EE 1)
|
set(EE 1)
|
||||||
@ -58,7 +66,10 @@ set(CMAKE_EXECUTABLE_SUFFIX ".elf")
|
|||||||
function(add_erl_executable TARGET)
|
function(add_erl_executable TARGET)
|
||||||
cmake_parse_arguments("AEE" "" "OUTPUT_VAR" "" ${ARGN})
|
cmake_parse_arguments("AEE" "" "OUTPUT_VAR" "" ${ARGN})
|
||||||
|
|
||||||
get_target_property(output_dir ${TARGET} RUNTIME_OUTPUT_DIRECTORY)
|
get_target_property(output_dir "${TARGET}" RUNTIME_OUTPUT_DIRECTORY)
|
||||||
|
if(NOT output_dir)
|
||||||
|
set(output_dir ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
get_target_property(output_name ${TARGET} OUTPUT_NAME)
|
get_target_property(output_name ${TARGET} OUTPUT_NAME)
|
||||||
if(NOT output_name)
|
if(NOT output_name)
|
||||||
@ -67,7 +78,7 @@ function(add_erl_executable TARGET)
|
|||||||
set(outfile "${output_dir}/${output_name}.erl")
|
set(outfile "${output_dir}/${output_name}.erl")
|
||||||
|
|
||||||
add_custom_command(OUTPUT "${outfile}"
|
add_custom_command(OUTPUT "${outfile}"
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:${TARGET}>" "${outfile}"
|
COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:${TARGET}>" "${outfile}"
|
||||||
COMMAND "${CMAKE_STRIP}" --strip-unneeded -R .mdebug.eabi64 -R .reginfo -R .comment "${outfile}"
|
COMMAND "${CMAKE_STRIP}" --strip-unneeded -R .mdebug.eabi64 -R .reginfo -R .comment "${outfile}"
|
||||||
DEPENDS ${TARGET}
|
DEPENDS ${TARGET}
|
||||||
)
|
)
|
||||||
|
22
premake5.lua
22
premake5.lua
@ -13,21 +13,21 @@ newoption {
|
|||||||
trigger = "glfwdir64",
|
trigger = "glfwdir64",
|
||||||
value = "PATH",
|
value = "PATH",
|
||||||
description = "Directory of glfw",
|
description = "Directory of glfw",
|
||||||
default = "../glfw-3.3.2.bin.WIN64",
|
default = "../glfw-3.3.4.bin.WIN64",
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "glfwdir32",
|
trigger = "glfwdir32",
|
||||||
value = "PATH",
|
value = "PATH",
|
||||||
description = "Directory of glfw",
|
description = "Directory of glfw",
|
||||||
default = "../glfw-3.3.2.bin.WIN32",
|
default = "../glfw-3.3.4.bin.WIN32",
|
||||||
}
|
}
|
||||||
|
|
||||||
newoption {
|
newoption {
|
||||||
trigger = "sdl2dir",
|
trigger = "sdl2dir",
|
||||||
value = "PATH",
|
value = "PATH",
|
||||||
description = "Directory of sdl2",
|
description = "Directory of sdl2",
|
||||||
default = "../SDL2-2.0.8",
|
default = "../SDL2-2.0.14",
|
||||||
}
|
}
|
||||||
|
|
||||||
workspace "librw"
|
workspace "librw"
|
||||||
@ -56,7 +56,7 @@ workspace "librw"
|
|||||||
defines { "NDEBUG" }
|
defines { "NDEBUG" }
|
||||||
optimize "On"
|
optimize "On"
|
||||||
filter "configurations:ReleaseStatic"
|
filter "configurations:ReleaseStatic"
|
||||||
flags { "StaticRuntime" }
|
staticruntime("On")
|
||||||
|
|
||||||
filter { "platforms:*null" }
|
filter { "platforms:*null" }
|
||||||
defines { "RW_NULL" }
|
defines { "RW_NULL" }
|
||||||
@ -189,7 +189,7 @@ project "playground"
|
|||||||
kind "WindowedApp"
|
kind "WindowedApp"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
skeltool("playground")
|
skeltool("playground")
|
||||||
flags { "WinMain" }
|
entrypoint("WinMainCRTStartup")
|
||||||
removeplatforms { "*null" }
|
removeplatforms { "*null" }
|
||||||
removeplatforms { "ps2" } -- for now
|
removeplatforms { "ps2" } -- for now
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ project "imguitest"
|
|||||||
kind "WindowedApp"
|
kind "WindowedApp"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
skeltool("imguitest")
|
skeltool("imguitest")
|
||||||
flags { "WinMain" }
|
entrypoint("WinMainCRTStartup")
|
||||||
removeplatforms { "*null" }
|
removeplatforms { "*null" }
|
||||||
removeplatforms { "ps2" }
|
removeplatforms { "ps2" }
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ project "lights"
|
|||||||
kind "WindowedApp"
|
kind "WindowedApp"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
skeltool("lights")
|
skeltool("lights")
|
||||||
flags { "WinMain" }
|
entrypoint("WinMainCRTStartup")
|
||||||
removeplatforms { "*null" }
|
removeplatforms { "*null" }
|
||||||
removeplatforms { "ps2" }
|
removeplatforms { "ps2" }
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ project "subrast"
|
|||||||
kind "WindowedApp"
|
kind "WindowedApp"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
skeltool("subrast")
|
skeltool("subrast")
|
||||||
flags { "WinMain" }
|
entrypoint("WinMainCRTStartup")
|
||||||
removeplatforms { "*null" }
|
removeplatforms { "*null" }
|
||||||
removeplatforms { "ps2" }
|
removeplatforms { "ps2" }
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ project "camera"
|
|||||||
kind "WindowedApp"
|
kind "WindowedApp"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
skeltool("camera")
|
skeltool("camera")
|
||||||
flags { "WinMain" }
|
entrypoint("WinMainCRTStartup")
|
||||||
removeplatforms { "*null" }
|
removeplatforms { "*null" }
|
||||||
removeplatforms { "ps2" }
|
removeplatforms { "ps2" }
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ project "im2d"
|
|||||||
kind "WindowedApp"
|
kind "WindowedApp"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
skeltool("im2d")
|
skeltool("im2d")
|
||||||
flags { "WinMain" }
|
entrypoint("WinMainCRTStartup")
|
||||||
removeplatforms { "*null" }
|
removeplatforms { "*null" }
|
||||||
removeplatforms { "ps2" }
|
removeplatforms { "ps2" }
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ project "im3d"
|
|||||||
kind "WindowedApp"
|
kind "WindowedApp"
|
||||||
characterset ("MBCS")
|
characterset ("MBCS")
|
||||||
skeltool("im3d")
|
skeltool("im3d")
|
||||||
flags { "WinMain" }
|
entrypoint("WinMainCRTStartup")
|
||||||
removeplatforms { "*null" }
|
removeplatforms { "*null" }
|
||||||
removeplatforms { "ps2" }
|
removeplatforms { "ps2" }
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ set_target_properties(librw_skeleton
|
|||||||
PROPERTIES
|
PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
EXPORT_NAME skeleton
|
EXPORT_NAME skeleton
|
||||||
|
CXX_STANDARD 11
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -500,7 +500,8 @@ readAsImage(Stream *stream, int32 width, int32 height, int32 depth, int32 format
|
|||||||
line[0] = palette[*idx*4+0];
|
line[0] = palette[*idx*4+0];
|
||||||
line[1] = palette[*idx*4+1];
|
line[1] = palette[*idx*4+1];
|
||||||
line[2] = palette[*idx*4+2];
|
line[2] = palette[*idx*4+2];
|
||||||
line[3] = palette[*idx*4+3];
|
if(img->bpp > 3)
|
||||||
|
line[3] = palette[*idx*4+3];
|
||||||
line += img->bpp;
|
line += img->bpp;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
@ -526,7 +526,7 @@ setFilterMode(uint32 stage, int32 filter, int32 maxAniso = 1)
|
|||||||
setActiveTexture(stage);
|
setActiveTexture(stage);
|
||||||
if(natras->autogenMipmap || natras->numLevels > 1){
|
if(natras->autogenMipmap || natras->numLevels > 1){
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_MIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
|
||||||
}else{
|
}else{
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
|
||||||
@ -627,7 +627,7 @@ setRasterStage(uint32 stage, Raster *raster)
|
|||||||
if(natras->filterMode != filter){
|
if(natras->filterMode != filter){
|
||||||
if(natras->autogenMipmap || natras->numLevels > 1){
|
if(natras->autogenMipmap || natras->numLevels > 1){
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_MIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
|
||||||
}else{
|
}else{
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
|
||||||
@ -660,6 +660,18 @@ setRasterStage(uint32 stage, Raster *raster)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
evictRaster(Raster *raster)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < MAXNUMSTAGES; i++){
|
||||||
|
//assert(rwStateCache.texstage[i].raster != raster);
|
||||||
|
if(rwStateCache.texstage[i].raster != raster)
|
||||||
|
continue;
|
||||||
|
setRasterStage(i, nil);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
setTexture(int32 stage, Texture *tex)
|
setTexture(int32 stage, Texture *tex)
|
||||||
{
|
{
|
||||||
@ -1896,7 +1908,7 @@ termOpenGL(void)
|
|||||||
defaultShader_fullLight_noAT = nil;
|
defaultShader_fullLight_noAT = nil;
|
||||||
|
|
||||||
glDeleteTextures(1, &whitetex);
|
glDeleteTextures(1, &whitetex);
|
||||||
whitetex = nil;
|
whitetex = 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -818,12 +818,15 @@ createNativeRaster(void *object, int32 offset, int32)
|
|||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void evictRaster(Raster *raster);
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
destroyNativeRaster(void *object, int32 offset, int32)
|
destroyNativeRaster(void *object, int32 offset, int32)
|
||||||
{
|
{
|
||||||
Raster *raster = (Raster*)object;
|
Raster *raster = (Raster*)object;
|
||||||
Gl3Raster *natras = PLUGINOFFSET(Gl3Raster, object, offset);
|
Gl3Raster *natras = PLUGINOFFSET(Gl3Raster, object, offset);
|
||||||
#ifdef RW_OPENGL
|
#ifdef RW_OPENGL
|
||||||
|
evictRaster(raster);
|
||||||
switch(raster->type){
|
switch(raster->type){
|
||||||
case Raster::NORMAL:
|
case Raster::NORMAL:
|
||||||
case Raster::TEXTURE:
|
case Raster::TEXTURE:
|
||||||
|
@ -45,7 +45,12 @@ registerUniform(const char *name, UniformType type, int32 num)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
i = findUniform(name);
|
i = findUniform(name);
|
||||||
if(i >= 0) return i;
|
if(i >= 0){
|
||||||
|
Uniform *u = &uniformRegistry.uniforms[i];
|
||||||
|
assert(u->type == type);
|
||||||
|
assert(u->num == num);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
// TODO: print error
|
// TODO: print error
|
||||||
if(uniformRegistry.numUniforms+1 >= MAX_UNIFORMS){
|
if(uniformRegistry.numUniforms+1 >= MAX_UNIFORMS){
|
||||||
assert(0 && "no space for uniform");
|
assert(0 && "no space for uniform");
|
||||||
@ -340,6 +345,7 @@ Shader::destroy(void)
|
|||||||
{
|
{
|
||||||
glDeleteProgram(this->program);
|
glDeleteProgram(this->program);
|
||||||
rwFree(this->uniformLocations);
|
rwFree(this->uniformLocations);
|
||||||
|
rwFree(this->serialNums);
|
||||||
rwFree(this);
|
rwFree(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,12 @@ add_executable(ps2test
|
|||||||
main.cpp
|
main.cpp
|
||||||
mem.h
|
mem.h
|
||||||
ps2.h
|
ps2.h
|
||||||
|
|
||||||
vu/defaultpipe.dsm
|
vu/defaultpipe.dsm
|
||||||
vu/skinpipe.dsm
|
vu/skinpipe.dsm
|
||||||
|
|
||||||
|
vu/light.vu
|
||||||
|
vu/setup_persp.vu
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(ps2test
|
target_link_libraries(ps2test
|
||||||
@ -13,7 +17,7 @@ target_link_libraries(ps2test
|
|||||||
kernel
|
kernel
|
||||||
)
|
)
|
||||||
|
|
||||||
librw_platform_target(ps2test)
|
librw_platform_target(ps2test INSTALL)
|
||||||
|
|
||||||
if(LIBRW_INSTALL)
|
if(LIBRW_INSTALL)
|
||||||
install(TARGETS ps2test
|
install(TARGETS ps2test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user