Add RMODERN build option, main function
This commit is contained in:
parent
c9fe88e193
commit
e2aeb125dc
21
Makefile
21
Makefile
@ -65,6 +65,9 @@ AUDIO_API ?= SDL2
|
|||||||
# Controller backends (can have multiple, space separated): SDL2
|
# Controller backends (can have multiple, space separated): SDL2
|
||||||
CONTROLLER_API ?= SDL2
|
CONTROLLER_API ?= SDL2
|
||||||
|
|
||||||
|
# Modern rendering system (will eventually replace other backends)
|
||||||
|
RMODERN ?= 0
|
||||||
|
|
||||||
# Misc settings for EXTERNAL_DATA
|
# Misc settings for EXTERNAL_DATA
|
||||||
|
|
||||||
BASEDIR ?= res
|
BASEDIR ?= res
|
||||||
@ -255,6 +258,14 @@ else
|
|||||||
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_pc
|
BUILD_DIR := $(BUILD_DIR_BASE)/$(VERSION)_pc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(DEBUG),1)
|
||||||
|
BUILD_DIR := $(BUILD_DIR)_debug
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(RMODERN),1)
|
||||||
|
BUILD_DIR := $(BUILD_DIR)_rmodern
|
||||||
|
endif
|
||||||
|
|
||||||
LIBULTRA := $(BUILD_DIR)/libultra.a
|
LIBULTRA := $(BUILD_DIR)/libultra.a
|
||||||
|
|
||||||
ifeq ($(TARGET_WEB),1)
|
ifeq ($(TARGET_WEB),1)
|
||||||
@ -286,6 +297,10 @@ LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
|
|||||||
SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets src/pc src/pc/gfx src/pc/audio src/pc/controller src/pc/fs src/pc/fs/packtypes
|
SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets src/pc src/pc/gfx src/pc/audio src/pc/controller src/pc/fs src/pc/fs/packtypes
|
||||||
ASM_DIRS :=
|
ASM_DIRS :=
|
||||||
|
|
||||||
|
ifeq ($(RMODERN),1)
|
||||||
|
SRC_DIRS += src/pc/rmodern
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(DISCORDRPC),1)
|
ifeq ($(DISCORDRPC),1)
|
||||||
SRC_DIRS += src/pc/discord
|
SRC_DIRS += src/pc/discord
|
||||||
endif
|
endif
|
||||||
@ -478,6 +493,12 @@ SDLCONFIG := $(CROSS)sdl2-config
|
|||||||
# configure backend flags
|
# configure backend flags
|
||||||
|
|
||||||
BACKEND_CFLAGS := -DRAPI_$(RENDER_API)=1 -DWAPI_$(WINDOW_API)=1 -DAAPI_$(AUDIO_API)=1
|
BACKEND_CFLAGS := -DRAPI_$(RENDER_API)=1 -DWAPI_$(WINDOW_API)=1 -DAAPI_$(AUDIO_API)=1
|
||||||
|
|
||||||
|
# rmodern
|
||||||
|
ifeq ($(RMODERN),1)
|
||||||
|
BACKEND_CFLAGS += -DRMODERN
|
||||||
|
endif
|
||||||
|
|
||||||
# can have multiple controller APIs
|
# can have multiple controller APIs
|
||||||
BACKEND_CFLAGS += $(foreach capi,$(CONTROLLER_API),-DCAPI_$(capi)=1)
|
BACKEND_CFLAGS += $(foreach capi,$(CONTROLLER_API),-DCAPI_$(capi)=1)
|
||||||
BACKEND_LDFLAGS :=
|
BACKEND_LDFLAGS :=
|
||||||
|
@ -171,6 +171,14 @@ static void on_anim_frame(double time) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RMODERN
|
||||||
|
#include "rmodern/rmodern.h"
|
||||||
|
void main_func(void)
|
||||||
|
{
|
||||||
|
rmodern_init();
|
||||||
|
}
|
||||||
|
#else
|
||||||
void main_func(void) {
|
void main_func(void) {
|
||||||
static u64 pool[0x165000/8 / 4 * sizeof(void *)];
|
static u64 pool[0x165000/8 / 4 * sizeof(void *)];
|
||||||
main_pool_init(pool, pool + sizeof(pool) / sizeof(pool[0]));
|
main_pool_init(pool, pool + sizeof(pool) / sizeof(pool[0]));
|
||||||
@ -261,6 +269,7 @@ void main_func(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
parse_cli_opts(argc, argv);
|
parse_cli_opts(argc, argv);
|
||||||
|
18
src/pc/rmodern/rmodern.h
Normal file
18
src/pc/rmodern/rmodern.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* This header file provides the interface between modern rendering functionality,
|
||||||
|
* written in C++, and the rest of the codebase.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RMODERN_H
|
||||||
|
#define RMODERN_H
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void rmodern_init();
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
8
src/pc/rmodern/rmodern_main.cpp
Normal file
8
src/pc/rmodern/rmodern_main.cpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#include "rmodern.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
void rmodern_init()
|
||||||
|
{
|
||||||
|
std::cout << "Hello, world!! ^-^" << std::endl;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user