mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-09 18:06:33 +02:00
Remove dead scripts and a few unneeded files, fix fonttool.py copy command
This commit is contained in:
@@ -247,7 +247,6 @@ structures laid out as follows:
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
cp_first = args.first
|
cp_first = args.first
|
||||||
cp_dest = args.dest
|
|
||||||
if args.last is None:
|
if args.last is None:
|
||||||
cp_last = cp_first
|
cp_last = cp_first
|
||||||
else:
|
else:
|
||||||
@@ -278,7 +277,7 @@ structures laid out as follows:
|
|||||||
ft.commit()
|
ft.commit()
|
||||||
elif args.command == 'copy':
|
elif args.command == 'copy':
|
||||||
for i in range(cp_first, cp_last + 1):
|
for i in range(cp_first, cp_last + 1):
|
||||||
ft.code_points[i + (cp_dest - cp_first)] = ft.code_points[i]
|
ft.code_points[i + (args.dest - cp_first)] = ft.code_points[i]
|
||||||
ft.commit()
|
ft.commit()
|
||||||
elif args.command == 'inspect':
|
elif args.command == 'inspect':
|
||||||
lut = [' ', '░░', '▒▒', '▓▓']
|
lut = [' ', '░░', '▒▒', '▓▓']
|
||||||
|
@@ -1,77 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
|
|
||||||
if len(sys.argv) != 2:
|
|
||||||
name = input('element name: ')
|
|
||||||
else:
|
|
||||||
name = sys.argv[1]
|
|
||||||
|
|
||||||
if re.search('[^A-Z0-9-]', name):
|
|
||||||
sys.exit('element names should only contain uppercase letters, digits and hyphens (you can change the Name property of the element to whatever later though, which is what shows up in menus)')
|
|
||||||
|
|
||||||
path = 'src/simulation/elements/' + name + '.cpp'
|
|
||||||
|
|
||||||
def get_elements():
|
|
||||||
elements = dict()
|
|
||||||
with open('src/simulation/ElementNumbers.h', 'r') as numbers:
|
|
||||||
for nm, pt in re.findall('ELEMENT_DEFINE\\s*\\(\\s*(\\S+)\\s*,\\s*(\\d+)\\s*\\)', numbers.read()):
|
|
||||||
elements[nm] = int(pt)
|
|
||||||
return elements
|
|
||||||
|
|
||||||
elements = get_elements()
|
|
||||||
if name in elements:
|
|
||||||
sys.exit('element already exists')
|
|
||||||
max_id = 0
|
|
||||||
for nm, pt in elements.items():
|
|
||||||
pt_id = int(pt)
|
|
||||||
if max_id < pt_id:
|
|
||||||
max_id = pt_id
|
|
||||||
new_id = max_id + 1
|
|
||||||
|
|
||||||
with open(path, 'w') as elem:
|
|
||||||
elem.write(r"""#include "simulation/ElementCommon.h"
|
|
||||||
|
|
||||||
static int update(UPDATE_FUNC_ARGS);
|
|
||||||
static int graphics(GRAPHICS_FUNC_ARGS);
|
|
||||||
|
|
||||||
void Element::Element_{0}()
|
|
||||||
{{
|
|
||||||
Identifier = "DEFAULT_PT_{0}";
|
|
||||||
Name = "{0}";
|
|
||||||
Colour = PIXPACK(0xFFFFFF);
|
|
||||||
MenuVisible = 1;
|
|
||||||
MenuSection = SC_SPECIAL;
|
|
||||||
Enabled = 1;
|
|
||||||
|
|
||||||
// element properties here
|
|
||||||
|
|
||||||
Update = &update;
|
|
||||||
Graphics = &graphics;
|
|
||||||
}}
|
|
||||||
|
|
||||||
static int update(UPDATE_FUNC_ARGS)
|
|
||||||
{{
|
|
||||||
// update code here
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}}
|
|
||||||
|
|
||||||
static int graphics(GRAPHICS_FUNC_ARGS)
|
|
||||||
{{
|
|
||||||
// graphics code here
|
|
||||||
// return 1 if nothing dynamic happens here
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}}
|
|
||||||
|
|
||||||
""".format(name))
|
|
||||||
elem.close()
|
|
||||||
|
|
||||||
print('element file \'{0}\' successfully created '.format(path))
|
|
||||||
input('now add \'ELEMENT_DEFINE({0}, {1});\' to \'src/simulation/ElementNumbers.h\', then press enter'.format(name, str(new_id)))
|
|
||||||
while True:
|
|
||||||
elements = get_elements()
|
|
||||||
if name in elements and elements[name] == new_id:
|
|
||||||
break
|
|
||||||
input('nope; try doing that again, then press enter')
|
|
@@ -39,7 +39,6 @@ subdir('json')
|
|||||||
if uopt_lua != 'none'
|
if uopt_lua != 'none'
|
||||||
subdir('lua')
|
subdir('lua')
|
||||||
endif
|
endif
|
||||||
subdir('powdertoyjava')
|
|
||||||
subdir('resampler')
|
subdir('resampler')
|
||||||
subdir('simulation')
|
subdir('simulation')
|
||||||
subdir('tasks')
|
subdir('tasks')
|
||||||
|
@@ -1,35 +0,0 @@
|
|||||||
#ifdef USE_JNI
|
|
||||||
#import <jawt_md.h>
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import <AppKit/NSOpenGL.h>
|
|
||||||
|
|
||||||
NSOpenGLPixelFormat* defaultPixelFormat();
|
|
||||||
|
|
||||||
NSOpenGLContext* ensureContext(NSOpenGLContext* openGLContext, NSView *view);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
JAWT* awt;
|
|
||||||
JAWT_DrawingSurface* ds;
|
|
||||||
JAWT_DrawingSurfaceInfo* dsi;
|
|
||||||
JAWT_MacOSXDrawingSurfaceInfo* dsi_mac;
|
|
||||||
NSView *view;
|
|
||||||
NSOpenGLContext* openGLContext;
|
|
||||||
} ContextInfo;
|
|
||||||
|
|
||||||
ContextInfo* getContext(JNIEnv *env, jobject canvas);
|
|
||||||
|
|
||||||
void freeContext(JNIEnv *env, jobject canvas, ContextInfo* ci);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
JNIEXPORT jboolean JNICALL Java_OpenGLCanvas_beginOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_endOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_updateOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_allocOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_releaseOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
@@ -1,169 +0,0 @@
|
|||||||
#ifdef USE_JNI
|
|
||||||
#include "OpenGLCanvasMacOS.h"
|
|
||||||
|
|
||||||
static jfieldID ctxID = NULL;
|
|
||||||
|
|
||||||
NSOpenGLPixelFormat* defaultPixelFormat()
|
|
||||||
{
|
|
||||||
NSOpenGLPixelFormatAttribute attributes [] = {
|
|
||||||
NSOpenGLPFAWindow,
|
|
||||||
NSOpenGLPFADoubleBuffer,
|
|
||||||
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)16,
|
|
||||||
0
|
|
||||||
};
|
|
||||||
return [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
|
|
||||||
}
|
|
||||||
|
|
||||||
NSOpenGLContext* ensureContext(NSOpenGLContext* openGLContext, NSView *view) {
|
|
||||||
NSOpenGLContext* _openGLContext = openGLContext;
|
|
||||||
if (!_openGLContext) {
|
|
||||||
NSOpenGLPixelFormat* pixelFormat = defaultPixelFormat();
|
|
||||||
_openGLContext = [[NSOpenGLContext alloc]
|
|
||||||
initWithFormat:pixelFormat
|
|
||||||
shareContext:nil];
|
|
||||||
[pixelFormat release];
|
|
||||||
}
|
|
||||||
if ([_openGLContext view] != view) {
|
|
||||||
[_openGLContext setView:view];
|
|
||||||
}
|
|
||||||
[_openGLContext makeCurrentContext];
|
|
||||||
|
|
||||||
return _openGLContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
ContextInfo* getContext(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
if (!ctxID) {
|
|
||||||
jclass cls = env->GetObjectClass(canvas);
|
|
||||||
ctxID = env->GetFieldID(cls, "openGLContext", "J");
|
|
||||||
}
|
|
||||||
|
|
||||||
ContextInfo *ci = (ContextInfo *)(long)(env->GetLongField(canvas, ctxID));
|
|
||||||
|
|
||||||
if (!ci) {
|
|
||||||
ci = (ContextInfo *)calloc(sizeof(ContextInfo), 1);
|
|
||||||
ci->awt = (JAWT *)calloc(sizeof(JAWT), 1);
|
|
||||||
env->SetLongField(canvas, ctxID, (jlong)(long)ci);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ci;
|
|
||||||
}
|
|
||||||
|
|
||||||
void freeContext(JNIEnv *env, jobject canvas, ContextInfo* ci)
|
|
||||||
{
|
|
||||||
if (ci) {
|
|
||||||
free(ci->awt);
|
|
||||||
free(ci);
|
|
||||||
env->SetLongField(canvas, ctxID, 0L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_OpenGLCanvas_beginOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
// Lock the drawing surface
|
|
||||||
// You must lock EACH TIME before drawing
|
|
||||||
jint lock = ci->ds->Lock(ci->ds);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
assert((lock & JAWT_LOCK_ERROR) == 0);
|
|
||||||
|
|
||||||
// Get the drawing surface info
|
|
||||||
ci->dsi = ci->ds->GetDrawingSurfaceInfo(ci->ds);
|
|
||||||
|
|
||||||
// Check DrawingSurfaceInfo. This can be NULL on Mac OS X
|
|
||||||
// if the windowing system is not ready
|
|
||||||
if (ci->dsi != NULL) {
|
|
||||||
// Get the platform-specific drawing info
|
|
||||||
// We will use this to get at Cocoa and CoreGraphics
|
|
||||||
// See <JavaVM/jawt_md.h>
|
|
||||||
ci->dsi_mac = (JAWT_MacOSXDrawingSurfaceInfo*)ci->dsi->platformInfo;
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the corresponding peer from the caller canvas
|
|
||||||
ci->view = ci->dsi_mac->cocoaViewRef;
|
|
||||||
ci->openGLContext = ensureContext(ci->openGLContext, ci->view);
|
|
||||||
|
|
||||||
return JNI_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return JNI_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_endOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
[ci->openGLContext flushBuffer];
|
|
||||||
|
|
||||||
// Free the DrawingSurfaceInfo
|
|
||||||
ci->ds->FreeDrawingSurfaceInfo(ci->dsi);
|
|
||||||
if (env->ExceptionOccurred()){
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unlock the drawing surface
|
|
||||||
// You must unlock EACH TIME when done drawing
|
|
||||||
ci->ds->Unlock(ci->ds);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_updateOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
[ci->openGLContext update];
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_allocOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
jboolean result = JNI_FALSE;
|
|
||||||
|
|
||||||
// get the AWT
|
|
||||||
ci->awt->version = JAWT_VERSION_1_4;
|
|
||||||
result = JAWT_GetAWT(env, ci->awt);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
assert(result != JNI_FALSE);
|
|
||||||
|
|
||||||
// Get the drawing surface. This can be safely cached.
|
|
||||||
// Anything below the DS (DSI, contexts, etc)
|
|
||||||
// can possibly change/go away and should not be cached.
|
|
||||||
ci->ds = ci->awt->GetDrawingSurface(env, canvas);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
assert(ci->ds != NULL);
|
|
||||||
|
|
||||||
NSLog(@"Alloc Context %d", ci);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_releaseOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
NSLog(@"Release Context %d", ci);
|
|
||||||
if (ci->openGLContext) {
|
|
||||||
if ([ci->openGLContext view] /* == self */) {
|
|
||||||
[ci->openGLContext clearDrawable];
|
|
||||||
}
|
|
||||||
[ci->openGLContext release];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free the drawing surface (if not caching it)
|
|
||||||
ci->awt->FreeDrawingSurface(ci->ds);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
freeContext(env, canvas, ci);
|
|
||||||
}
|
|
||||||
#endif
|
|
@@ -1,169 +0,0 @@
|
|||||||
#if defined(USE_JNI) && defined(WIN)
|
|
||||||
#include "OpenGLCanvasWin32.h"
|
|
||||||
|
|
||||||
static jfieldID ctxID = NULL;
|
|
||||||
|
|
||||||
int defaultPixelFormat(PIXELFORMATDESCRIPTOR* pfd)
|
|
||||||
{
|
|
||||||
::ZeroMemory( pfd, sizeof( PIXELFORMATDESCRIPTOR ) );
|
|
||||||
pfd->nSize = sizeof( PIXELFORMATDESCRIPTOR );
|
|
||||||
pfd->nVersion = 1;
|
|
||||||
pfd->dwFlags = PFD_DRAW_TO_WINDOW |
|
|
||||||
PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
|
|
||||||
pfd->iPixelType = PFD_TYPE_RGBA;
|
|
||||||
pfd->cColorBits = 24;
|
|
||||||
pfd->cDepthBits = 16;
|
|
||||||
pfd->iLayerType = PFD_MAIN_PLANE;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
HGLRC ensureContext(JAWT_Win32DrawingSurfaceInfo* dsi_win, HGLRC hRC) {
|
|
||||||
|
|
||||||
if (!hRC) {
|
|
||||||
int iFormat;
|
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
|
||||||
defaultPixelFormat(&pfd);
|
|
||||||
|
|
||||||
iFormat = ChoosePixelFormat( dsi_win->hdc, &pfd );
|
|
||||||
SetPixelFormat( dsi_win->hdc, iFormat, &pfd );
|
|
||||||
|
|
||||||
hRC = wglCreateContext( dsi_win->hdc );
|
|
||||||
}
|
|
||||||
if (1 && wglGetCurrentDC() != dsi_win->hdc) {
|
|
||||||
wglMakeCurrent( dsi_win->hdc, hRC );
|
|
||||||
}
|
|
||||||
|
|
||||||
return hRC;
|
|
||||||
}
|
|
||||||
|
|
||||||
ContextInfo* getContext(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci;
|
|
||||||
if (!ctxID) {
|
|
||||||
jclass cls = env->GetObjectClass(canvas);
|
|
||||||
ctxID = env->GetFieldID(cls, "openGLContext", "J");
|
|
||||||
}
|
|
||||||
|
|
||||||
ci = (ContextInfo *)(long)(env->GetLongField(canvas, ctxID));
|
|
||||||
|
|
||||||
if (!ci) {
|
|
||||||
ci = (ContextInfo *)calloc(sizeof(ContextInfo), 1);
|
|
||||||
ci->awt = (JAWT *)calloc(sizeof(JAWT), 1);
|
|
||||||
env->SetLongField(canvas, ctxID, (jlong)(long)ci);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ci;
|
|
||||||
}
|
|
||||||
|
|
||||||
void freeContext(JNIEnv *env, jobject canvas, ContextInfo* ci)
|
|
||||||
{
|
|
||||||
if (ci) {
|
|
||||||
free(ci->awt);
|
|
||||||
free(ci);
|
|
||||||
env->SetLongField(canvas, ctxID, 0L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_OpenGLCanvas_beginOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
jint lock;
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
// Get the drawing surface. This can be safely cached -- not in win32
|
|
||||||
// Anything below the DS (DSI, contexts, etc)
|
|
||||||
// can possibly change/go away and should not be cached.
|
|
||||||
ci->ds = ci->awt->GetDrawingSurface(env, canvas);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
assert(ci->ds != NULL);
|
|
||||||
|
|
||||||
// Lock the drawing surface
|
|
||||||
// You must lock EACH TIME before drawing
|
|
||||||
lock = ci->ds->Lock(ci->ds);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
assert((lock & JAWT_LOCK_ERROR) == 0);
|
|
||||||
|
|
||||||
// Get the drawing surface info
|
|
||||||
ci->dsi = ci->ds->GetDrawingSurfaceInfo(ci->ds);
|
|
||||||
|
|
||||||
// Check DrawingSurfaceInfo. This can be NULL on Mac OS X
|
|
||||||
// if the windowing system is not ready
|
|
||||||
if (ci->dsi != NULL) {
|
|
||||||
// Get the platform-specific drawing info
|
|
||||||
// We will use this to get at Cocoa and CoreGraphics
|
|
||||||
// See <JavaVM/jawt_md.h>
|
|
||||||
ci->dsi_win = (JAWT_Win32DrawingSurfaceInfo*)ci->dsi->platformInfo;
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the corresponding peer from the caller canvas
|
|
||||||
ci->hRC = ensureContext(ci->dsi_win, ci->hRC);
|
|
||||||
|
|
||||||
return JNI_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return JNI_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_endOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
SwapBuffers( ci->dsi_win->hdc );
|
|
||||||
|
|
||||||
// Free the DrawingSurfaceInfo
|
|
||||||
ci->ds->FreeDrawingSurfaceInfo(ci->dsi);
|
|
||||||
if (env->ExceptionOccurred()){
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unlock the drawing surface
|
|
||||||
// You must unlock EACH TIME when done drawing
|
|
||||||
ci->ds->Unlock(ci->ds);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free the drawing surface (if not caching it)
|
|
||||||
ci->awt->FreeDrawingSurface(ci->ds);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_updateOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
wglMakeCurrent( ci->dsi_win->hdc, ci->hRC );
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_allocOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
|
|
||||||
jboolean result = JNI_FALSE;
|
|
||||||
|
|
||||||
// get the AWT
|
|
||||||
ci->awt->version = JAWT_VERSION_1_4;
|
|
||||||
result = JAWT_GetAWT(env, ci->awt);
|
|
||||||
if (env->ExceptionOccurred()) {
|
|
||||||
env->ExceptionDescribe();
|
|
||||||
}
|
|
||||||
assert(result != JNI_FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_releaseOpenGL(JNIEnv *env, jobject canvas)
|
|
||||||
{
|
|
||||||
ContextInfo *ci = getContext(env, canvas);
|
|
||||||
if (ci->hRC) {
|
|
||||||
wglDeleteContext(ci->hRC);
|
|
||||||
}
|
|
||||||
|
|
||||||
freeContext(env, canvas, ci);
|
|
||||||
}
|
|
||||||
#endif
|
|
@@ -1,36 +0,0 @@
|
|||||||
#include "Config.h"
|
|
||||||
#ifdef USE_JNI
|
|
||||||
#import <jawt_md.h>
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <cassert>
|
|
||||||
#include <gl/gl.h>
|
|
||||||
|
|
||||||
int defaultPixelFormat(PIXELFORMATDESCRIPTOR* pfd);
|
|
||||||
|
|
||||||
HGLRC ensureContext(JAWT_Win32DrawingSurfaceInfo* dsi_win, HGLRC hRC);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
JAWT* awt;
|
|
||||||
JAWT_DrawingSurface* ds;
|
|
||||||
JAWT_DrawingSurfaceInfo* dsi;
|
|
||||||
JAWT_Win32DrawingSurfaceInfo* dsi_win;
|
|
||||||
HGLRC hRC;
|
|
||||||
} ContextInfo;
|
|
||||||
|
|
||||||
ContextInfo* getContext(JNIEnv *env, jobject canvas);
|
|
||||||
|
|
||||||
void freeContext(JNIEnv *env, jobject canvas, ContextInfo* ci);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
JNIEXPORT jboolean JNICALL Java_OpenGLCanvas_beginOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_endOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_updateOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_allocOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_OpenGLCanvas_releaseOpenGL(JNIEnv *env, jobject canvas);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
@@ -1,73 +0,0 @@
|
|||||||
#if defined(USE_JNI)
|
|
||||||
|
|
||||||
#include <ctime>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "Config.h"
|
|
||||||
#include "PowderToyJava.h"
|
|
||||||
#include "graphics/Graphics.h"
|
|
||||||
|
|
||||||
#include "game/GameController.h"
|
|
||||||
|
|
||||||
GameController * gameController;
|
|
||||||
ui::Engine * engine;
|
|
||||||
|
|
||||||
int elapsedTime = 0, currentTime = 0, lastTime = 0, currentFrame = 0;
|
|
||||||
float fps = 0, delta = 1.0f;
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_initialise(JNIEnv * env, jobject canvas)
|
|
||||||
{
|
|
||||||
ui::Engine::Ref().g = new Graphics();
|
|
||||||
|
|
||||||
engine = &ui::Engine::Ref();
|
|
||||||
engine->Begin(WINDOWW, WINDOWH);
|
|
||||||
|
|
||||||
gameController = new GameController();
|
|
||||||
engine->ShowWindow(gameController->GetView());
|
|
||||||
engine->SetFps(fps);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_tick(JNIEnv * env, jobject canvas)
|
|
||||||
{
|
|
||||||
engine->Tick();
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_draw(JNIEnv * env, jobject canvas)
|
|
||||||
{
|
|
||||||
engine->Draw();
|
|
||||||
engine->g->Finalise();
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_finish(JNIEnv * env, jobject canvas)
|
|
||||||
{
|
|
||||||
ui::Engine::Ref().CloseWindow();
|
|
||||||
delete gameController;
|
|
||||||
delete ui::Engine::Ref().g;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL Java_PowderToy_getWidth(JNIEnv * env, jobject canvas)
|
|
||||||
{
|
|
||||||
return WINDOWW;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL Java_PowderToy_getHeight(JNIEnv * env, jobject canvas)
|
|
||||||
{
|
|
||||||
return WINDOWH;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_mousePressed(JNIEnv * env, jobject canvas, jint mouseX, jint mouseY, jint mouseButton)
|
|
||||||
{
|
|
||||||
engine->onMouseClick(mouseX, mouseY, mouseButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_mouseReleased(JNIEnv * env, jobject canvas, jint mouseX, jint mouseY, jint mouseButton)
|
|
||||||
{
|
|
||||||
engine->onMouseUnclick(mouseX, mouseY, mouseButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_mouseMoved(JNIEnv * env, jobject canvas, jint mouseX, jint mouseY)
|
|
||||||
{
|
|
||||||
engine->onMouseMove(mouseX, mouseY);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,22 +0,0 @@
|
|||||||
#include "Config.h"
|
|
||||||
#include <jni.h>
|
|
||||||
|
|
||||||
#ifndef POWDERTOYJAVA
|
|
||||||
#define POWDERTOYJAVA
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_initialise(JNIEnv *, jobject);
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_tick(JNIEnv *, jobject);
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_draw(JNIEnv *, jobject);
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_finish(JNIEnv *, jobject);
|
|
||||||
JNIEXPORT jint JNICALL Java_PowderToy_getWidth(JNIEnv * env, jobject canvas);
|
|
||||||
JNIEXPORT jint JNICALL Java_PowderToy_getHeight(JNIEnv * env, jobject canvas);
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_mousePressed(JNIEnv * env, jobject canvas, jint mouseX, jint mouseY, jint mouseButton);
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_mouseReleased(JNIEnv * env, jobject canvas, jint mouseX, jint mouseY, jint mouseButton);
|
|
||||||
JNIEXPORT void JNICALL Java_PowderToy_mouseMoved(JNIEnv * env, jobject canvas, jint mouseX, jint mouseY);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
@@ -1,4 +0,0 @@
|
|||||||
powder_files += files(
|
|
||||||
'OpenGLCanvasWin32.cpp',
|
|
||||||
'PowderToyJava.cpp',
|
|
||||||
)
|
|
@@ -1,217 +0,0 @@
|
|||||||
# ------------------------------------------------------------------
|
|
||||||
# This file is part of bzip2/libbzip2, a program and library for
|
|
||||||
# lossless, block-sorting data compression.
|
|
||||||
#
|
|
||||||
# bzip2/libbzip2 version 1.0.8 of 13 July 2019
|
|
||||||
# Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
|
|
||||||
#
|
|
||||||
# Please read the WARNING, DISCLAIMER and PATENTS sections in the
|
|
||||||
# README file.
|
|
||||||
#
|
|
||||||
# This program is released under the terms of the license contained
|
|
||||||
# in the file LICENSE.
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
|
||||||
|
|
||||||
# To assist in cross-compiling
|
|
||||||
CC=gcc
|
|
||||||
AR=ar
|
|
||||||
RANLIB=ranlib
|
|
||||||
LDFLAGS=
|
|
||||||
|
|
||||||
BIGFILES=-D_FILE_OFFSET_BITS=64
|
|
||||||
CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
|
|
||||||
|
|
||||||
# Where you want it installed when you do 'make install'
|
|
||||||
PREFIX=/usr/local
|
|
||||||
|
|
||||||
|
|
||||||
OBJS= blocksort.o \
|
|
||||||
huffman.o \
|
|
||||||
crctable.o \
|
|
||||||
randtable.o \
|
|
||||||
compress.o \
|
|
||||||
decompress.o \
|
|
||||||
bzlib.o
|
|
||||||
|
|
||||||
all: libbz2.a bzip2 bzip2recover test
|
|
||||||
|
|
||||||
bzip2: libbz2.a bzip2.o
|
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
|
|
||||||
|
|
||||||
bzip2recover: bzip2recover.o
|
|
||||||
$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
|
|
||||||
|
|
||||||
libbz2.a: $(OBJS)
|
|
||||||
rm -f libbz2.a
|
|
||||||
$(AR) cq libbz2.a $(OBJS)
|
|
||||||
@if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
|
|
||||||
-f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
|
|
||||||
echo $(RANLIB) libbz2.a ; \
|
|
||||||
$(RANLIB) libbz2.a ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
check: test
|
|
||||||
test: bzip2
|
|
||||||
@cat words1
|
|
||||||
./bzip2 -1 < sample1.ref > sample1.rb2
|
|
||||||
./bzip2 -2 < sample2.ref > sample2.rb2
|
|
||||||
./bzip2 -3 < sample3.ref > sample3.rb2
|
|
||||||
./bzip2 -d < sample1.bz2 > sample1.tst
|
|
||||||
./bzip2 -d < sample2.bz2 > sample2.tst
|
|
||||||
./bzip2 -ds < sample3.bz2 > sample3.tst
|
|
||||||
cmp sample1.bz2 sample1.rb2
|
|
||||||
cmp sample2.bz2 sample2.rb2
|
|
||||||
cmp sample3.bz2 sample3.rb2
|
|
||||||
cmp sample1.tst sample1.ref
|
|
||||||
cmp sample2.tst sample2.ref
|
|
||||||
cmp sample3.tst sample3.ref
|
|
||||||
@cat words3
|
|
||||||
|
|
||||||
install: bzip2 bzip2recover
|
|
||||||
if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
|
|
||||||
if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
|
|
||||||
if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
|
|
||||||
if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
|
|
||||||
if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
|
|
||||||
cp -f bzip2 $(PREFIX)/bin/bzip2
|
|
||||||
cp -f bzip2 $(PREFIX)/bin/bunzip2
|
|
||||||
cp -f bzip2 $(PREFIX)/bin/bzcat
|
|
||||||
cp -f bzip2recover $(PREFIX)/bin/bzip2recover
|
|
||||||
chmod a+x $(PREFIX)/bin/bzip2
|
|
||||||
chmod a+x $(PREFIX)/bin/bunzip2
|
|
||||||
chmod a+x $(PREFIX)/bin/bzcat
|
|
||||||
chmod a+x $(PREFIX)/bin/bzip2recover
|
|
||||||
cp -f bzip2.1 $(PREFIX)/man/man1
|
|
||||||
chmod a+r $(PREFIX)/man/man1/bzip2.1
|
|
||||||
cp -f bzlib.h $(PREFIX)/include
|
|
||||||
chmod a+r $(PREFIX)/include/bzlib.h
|
|
||||||
cp -f libbz2.a $(PREFIX)/lib
|
|
||||||
chmod a+r $(PREFIX)/lib/libbz2.a
|
|
||||||
cp -f bzgrep $(PREFIX)/bin/bzgrep
|
|
||||||
ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
|
|
||||||
ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
|
|
||||||
chmod a+x $(PREFIX)/bin/bzgrep
|
|
||||||
cp -f bzmore $(PREFIX)/bin/bzmore
|
|
||||||
ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
|
|
||||||
chmod a+x $(PREFIX)/bin/bzmore
|
|
||||||
cp -f bzdiff $(PREFIX)/bin/bzdiff
|
|
||||||
ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
|
|
||||||
chmod a+x $(PREFIX)/bin/bzdiff
|
|
||||||
cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
|
|
||||||
chmod a+r $(PREFIX)/man/man1/bzgrep.1
|
|
||||||
chmod a+r $(PREFIX)/man/man1/bzmore.1
|
|
||||||
chmod a+r $(PREFIX)/man/man1/bzdiff.1
|
|
||||||
echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
|
|
||||||
echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
|
|
||||||
echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
|
|
||||||
echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o libbz2.a bzip2 bzip2recover \
|
|
||||||
sample1.rb2 sample2.rb2 sample3.rb2 \
|
|
||||||
sample1.tst sample2.tst sample3.tst
|
|
||||||
|
|
||||||
blocksort.o: blocksort.c
|
|
||||||
@cat words0
|
|
||||||
$(CC) $(CFLAGS) -c blocksort.c
|
|
||||||
huffman.o: huffman.c
|
|
||||||
$(CC) $(CFLAGS) -c huffman.c
|
|
||||||
crctable.o: crctable.c
|
|
||||||
$(CC) $(CFLAGS) -c crctable.c
|
|
||||||
randtable.o: randtable.c
|
|
||||||
$(CC) $(CFLAGS) -c randtable.c
|
|
||||||
compress.o: compress.c
|
|
||||||
$(CC) $(CFLAGS) -c compress.c
|
|
||||||
decompress.o: decompress.c
|
|
||||||
$(CC) $(CFLAGS) -c decompress.c
|
|
||||||
bzlib.o: bzlib.c
|
|
||||||
$(CC) $(CFLAGS) -c bzlib.c
|
|
||||||
bzip2.o: bzip2.c
|
|
||||||
$(CC) $(CFLAGS) -c bzip2.c
|
|
||||||
bzip2recover.o: bzip2recover.c
|
|
||||||
$(CC) $(CFLAGS) -c bzip2recover.c
|
|
||||||
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f manual.ps manual.html manual.pdf
|
|
||||||
|
|
||||||
DISTNAME=bzip2-1.0.8
|
|
||||||
dist: check manual
|
|
||||||
rm -f $(DISTNAME)
|
|
||||||
ln -s -f . $(DISTNAME)
|
|
||||||
tar cvf $(DISTNAME).tar \
|
|
||||||
$(DISTNAME)/blocksort.c \
|
|
||||||
$(DISTNAME)/huffman.c \
|
|
||||||
$(DISTNAME)/crctable.c \
|
|
||||||
$(DISTNAME)/randtable.c \
|
|
||||||
$(DISTNAME)/compress.c \
|
|
||||||
$(DISTNAME)/decompress.c \
|
|
||||||
$(DISTNAME)/bzlib.c \
|
|
||||||
$(DISTNAME)/bzip2.c \
|
|
||||||
$(DISTNAME)/bzip2recover.c \
|
|
||||||
$(DISTNAME)/bzlib.h \
|
|
||||||
$(DISTNAME)/bzlib_private.h \
|
|
||||||
$(DISTNAME)/Makefile \
|
|
||||||
$(DISTNAME)/LICENSE \
|
|
||||||
$(DISTNAME)/bzip2.1 \
|
|
||||||
$(DISTNAME)/bzip2.1.preformatted \
|
|
||||||
$(DISTNAME)/bzip2.txt \
|
|
||||||
$(DISTNAME)/words0 \
|
|
||||||
$(DISTNAME)/words1 \
|
|
||||||
$(DISTNAME)/words2 \
|
|
||||||
$(DISTNAME)/words3 \
|
|
||||||
$(DISTNAME)/sample1.ref \
|
|
||||||
$(DISTNAME)/sample2.ref \
|
|
||||||
$(DISTNAME)/sample3.ref \
|
|
||||||
$(DISTNAME)/sample1.bz2 \
|
|
||||||
$(DISTNAME)/sample2.bz2 \
|
|
||||||
$(DISTNAME)/sample3.bz2 \
|
|
||||||
$(DISTNAME)/dlltest.c \
|
|
||||||
$(DISTNAME)/manual.html \
|
|
||||||
$(DISTNAME)/manual.pdf \
|
|
||||||
$(DISTNAME)/manual.ps \
|
|
||||||
$(DISTNAME)/README \
|
|
||||||
$(DISTNAME)/README.COMPILATION.PROBLEMS \
|
|
||||||
$(DISTNAME)/README.XML.STUFF \
|
|
||||||
$(DISTNAME)/CHANGES \
|
|
||||||
$(DISTNAME)/libbz2.def \
|
|
||||||
$(DISTNAME)/libbz2.dsp \
|
|
||||||
$(DISTNAME)/dlltest.dsp \
|
|
||||||
$(DISTNAME)/makefile.msc \
|
|
||||||
$(DISTNAME)/unzcrash.c \
|
|
||||||
$(DISTNAME)/spewG.c \
|
|
||||||
$(DISTNAME)/mk251.c \
|
|
||||||
$(DISTNAME)/bzdiff \
|
|
||||||
$(DISTNAME)/bzdiff.1 \
|
|
||||||
$(DISTNAME)/bzmore \
|
|
||||||
$(DISTNAME)/bzmore.1 \
|
|
||||||
$(DISTNAME)/bzgrep \
|
|
||||||
$(DISTNAME)/bzgrep.1 \
|
|
||||||
$(DISTNAME)/Makefile-libbz2_so \
|
|
||||||
$(DISTNAME)/bz-common.xsl \
|
|
||||||
$(DISTNAME)/bz-fo.xsl \
|
|
||||||
$(DISTNAME)/bz-html.xsl \
|
|
||||||
$(DISTNAME)/bzip.css \
|
|
||||||
$(DISTNAME)/entities.xml \
|
|
||||||
$(DISTNAME)/manual.xml \
|
|
||||||
$(DISTNAME)/format.pl \
|
|
||||||
$(DISTNAME)/xmlproc.sh
|
|
||||||
gzip -v $(DISTNAME).tar
|
|
||||||
|
|
||||||
# For rebuilding the manual from sources on my SuSE 9.1 box
|
|
||||||
|
|
||||||
MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \
|
|
||||||
entities.xml manual.xml
|
|
||||||
|
|
||||||
manual: manual.html manual.ps manual.pdf
|
|
||||||
|
|
||||||
manual.ps: $(MANUAL_SRCS)
|
|
||||||
./xmlproc.sh -ps manual.xml
|
|
||||||
|
|
||||||
manual.pdf: $(MANUAL_SRCS)
|
|
||||||
./xmlproc.sh -pdf manual.xml
|
|
||||||
|
|
||||||
manual.html: $(MANUAL_SRCS)
|
|
||||||
./xmlproc.sh -html manual.xml
|
|
314
vsproject.py
314
vsproject.py
@@ -1,314 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
cl_compile = []
|
|
||||||
cl_include = []
|
|
||||||
source_dirs = set()
|
|
||||||
for root, subdirs, files in os.walk('src'):
|
|
||||||
for file in [os.path.join(root, f) for f in files]:
|
|
||||||
lowerfile = file.lower()
|
|
||||||
add_source_dir = False
|
|
||||||
if lowerfile.endswith('.cpp') or lowerfile.endswith('.c'):
|
|
||||||
cl_compile.append(file)
|
|
||||||
add_source_dir = True
|
|
||||||
if lowerfile.endswith('.hpp') or lowerfile.endswith('.h'):
|
|
||||||
cl_include.append(file)
|
|
||||||
add_source_dir = True
|
|
||||||
if add_source_dir:
|
|
||||||
path = Path(root)
|
|
||||||
for i in range(len(path.parents) - 1):
|
|
||||||
parent = path.parents[i]
|
|
||||||
if not str(parent) in source_dirs:
|
|
||||||
source_dirs.add(str(parent))
|
|
||||||
source_dirs.add(os.path.dirname(file))
|
|
||||||
|
|
||||||
sln = open("The-Powder-Toy.sln", 'w')
|
|
||||||
sln.write(r"""Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 2013
|
|
||||||
VisualStudioVersion = 12.0.40629.0
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "The-Powder-Toy", "The-Powder-Toy.vcxproj", "{57F7954F-6975-4DEE-8C4F-F9B083E05985}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Win32 = Debug|Win32
|
|
||||||
Release|Win32 = Release|Win32
|
|
||||||
Static|Win32 = Static|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{57F7954F-6975-4DEE-8C4F-F9B083E05985}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{57F7954F-6975-4DEE-8C4F-F9B083E05985}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{57F7954F-6975-4DEE-8C4F-F9B083E05985}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{57F7954F-6975-4DEE-8C4F-F9B083E05985}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{57F7954F-6975-4DEE-8C4F-F9B083E05985}.Static|Win32.ActiveCfg = Static|Win32
|
|
||||||
{57F7954F-6975-4DEE-8C4F-F9B083E05985}.Static|Win32.Build.0 = Static|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
""")
|
|
||||||
sln.close()
|
|
||||||
|
|
||||||
vcxproj = open("The-Powder-Toy.vcxproj", 'w')
|
|
||||||
vcxproj.write(r"""<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Static|Win32">
|
|
||||||
<Configuration>Static</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{57F7954F-6975-4DEE-8C4F-F9B083E05985}</ProjectGuid>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v142</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<OutDir>$(SolutionDir)Build\</OutDir>
|
|
||||||
<TargetName>Powder</TargetName>
|
|
||||||
<IncludePath>$(ProjectDir)includes;$(ProjectDir)includes/SDL2;$(ProjectDir)includes/luajit-2.0;$(ProjectDir)data;$(ProjectDir)src;$(ProjectDir)resources;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>$(ProjectDir)Libraries;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<OutDir>$(SolutionDir)Build\</OutDir>
|
|
||||||
<TargetName>Powder</TargetName>
|
|
||||||
<IncludePath>$(ProjectDir)includes;$(ProjectDir)includes/SDL2;$(ProjectDir)includes/luajit-2.0;$(ProjectDir)data;$(ProjectDir)src;$(ProjectDir)resources;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>$(ProjectDir)Libraries;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<OutDir>$(SolutionDir)Build\</OutDir>
|
|
||||||
<TargetName>Powder</TargetName>
|
|
||||||
<IncludePath>$(ProjectDir)includes;$(ProjectDir)includes/SDL2;$(ProjectDir)includes/luajit-2.0;$(ProjectDir)data;$(ProjectDir)src;$(ProjectDir)resources;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>$(ProjectDir)Staticlibs;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>WIN;X86;X86_SSE2;USE_SDL;STABLE;GRAVFFT;LUACONSOLE;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
|
||||||
<WarningLevel>Level1</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<FloatingPointModel>Fast</FloatingPointModel>
|
|
||||||
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<TargetMachine>MachineX86</TargetMachine>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;shell32.lib;libbz2.lib;pthreadVC2.lib;luajit2.0.lib;libfftw3f-3.lib;zlib.lib;libcurl.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>WIN;X86;X86_SSE2;USE_SDL;STABLE;GRAVFFT;LUACONSOLE;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<WarningLevel>Level1</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<FloatingPointModel>Fast</FloatingPointModel>
|
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
|
||||||
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<TargetMachine>MachineX86</TargetMachine>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;shell32.lib;libbz2.lib;pthreadVC2.lib;luajit2.0.lib;libfftw3f-3.lib;zlib.lib;libcurl.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>WIN;X86;X86_SSE2;USE_SDL;STABLE;GRAVFFT;LUACONSOLE;ZLIB_WINAPI;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;PTW32_STATIC_LIB;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
|
||||||
<WarningLevel>Level1</WarningLevel>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<FloatingPointModel>Fast</FloatingPointModel>
|
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
|
||||||
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<TargetMachine>MachineX86</TargetMachine>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;shell32.lib;libbz2.lib;pthreadVC2.lib;luajit2.0.lib;libfftw3f-3.lib;zlib.lib;libcurl.lib;ws2_32.lib;Wldap32.lib;crypt32.lib;winmm.lib;dxguid.lib;imm32.lib;version.lib;SetupApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
|
||||||
<IgnoreSpecificDefaultLibraries>
|
|
||||||
</IgnoreSpecificDefaultLibraries>
|
|
||||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="data\font.cpp" />
|
|
||||||
<ClCompile Include="data\hmap.cpp" />
|
|
||||||
<ClCompile Include="data\icon.cpp" />
|
|
||||||
<ClCompile Include="data\images.cpp" />
|
|
||||||
""")
|
|
||||||
vcxproj.write('\n '.join([('<ClCompile Include="' + p + '" />') for p in cl_compile]))
|
|
||||||
vcxproj.write(r"""
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="data\font.h" />
|
|
||||||
<ClInclude Include="data\hmap.h" />
|
|
||||||
<ClInclude Include="data\icon.h" />
|
|
||||||
<ClInclude Include="data\icondoc.h" />
|
|
||||||
<ClInclude Include="data\images.h" />
|
|
||||||
<ClInclude Include="data\IntroText.h" />
|
|
||||||
<ClInclude Include="data\Shaders.h" />
|
|
||||||
<ClInclude Include="resources\resource.h" />
|
|
||||||
""")
|
|
||||||
vcxproj.write('\n '.join([('<ClInclude Include="' + p + '" />') for p in cl_include]))
|
|
||||||
vcxproj.write(r"""
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ResourceCompile Include="resources\powder-res.rc" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="vsproject.py" />
|
|
||||||
<None Include="README.md" />
|
|
||||||
<None Include="SConscript" />
|
|
||||||
<None Include="SConstruct" />
|
|
||||||
<None Include="src\graphics\DrawMethodsDef.inc" />
|
|
||||||
<None Include="src\graphics\OpenGLDrawMethods.inl" />
|
|
||||||
<None Include="src\graphics\RasterDrawMethods.inl" />
|
|
||||||
<None Include="src\lua\socket\socket.lua" />
|
|
||||||
<None Include="src\SDLMain.m" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
||||||
""")
|
|
||||||
vcxproj.close()
|
|
||||||
|
|
||||||
filters = open("The-Powder-Toy.vcxproj.filters", 'w')
|
|
||||||
filters.write(r"""<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="src">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="resources">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="data">
|
|
||||||
<UniqueIdentifier>{fc5911e1-d5ba-4da3-9cfa-5631c6914487}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
""")
|
|
||||||
filters.write('\n '.join([('<Filter Include="' + p + '">\n <UniqueIdentifier>{' + str(uuid.uuid4()) + '}</UniqueIdentifier>\n </Filter>') for p in source_dirs]))
|
|
||||||
filters.write(r"""
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
""")
|
|
||||||
filters.write('\n '.join([('<ClCompile Include="' + p + '">\n <Filter>' + os.path.dirname(p) + '</Filter>\n </ClCompile>') for p in cl_compile]))
|
|
||||||
filters.write(r"""
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="src\simulation\elements\Element.h">
|
|
||||||
<Filter>src\simulation</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="data\font.h">
|
|
||||||
<Filter>data</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="data\hmap.h">
|
|
||||||
<Filter>data</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="data\icon.h">
|
|
||||||
<Filter>data</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="data\icondoc.h">
|
|
||||||
<Filter>data</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="data\images.h">
|
|
||||||
<Filter>data</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="data\IntroText.h">
|
|
||||||
<Filter>data</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="data\Shaders.h">
|
|
||||||
<Filter>data</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
""")
|
|
||||||
filters.write('\n '.join([('<ClInclude Include="' + p + '">\n <Filter>' + os.path.dirname(p) + '</Filter>\n </ClInclude>') for p in cl_include]))
|
|
||||||
filters.write(r"""
|
|
||||||
<ClInclude Include="resources\resource.h">
|
|
||||||
<Filter>resources</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ResourceCompile Include="resources\powder-res.rc">
|
|
||||||
<Filter>resources</Filter>
|
|
||||||
</ResourceCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="src\graphics\DrawMethodsDef.inc">
|
|
||||||
<Filter>src\graphics</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="src\graphics\OpenGLDrawMethods.inl">
|
|
||||||
<Filter>src\graphics</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="src\graphics\RasterDrawMethods.inl">
|
|
||||||
<Filter>src\graphics</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="vsproject.py" />
|
|
||||||
<None Include="SConstruct" />
|
|
||||||
<None Include="SConscript" />
|
|
||||||
<None Include="README.md" />
|
|
||||||
<None Include="src\SDLMain.m" />
|
|
||||||
<None Include="src\lua\socket\socket.lua">
|
|
||||||
<Filter>src\lua\socket</Filter>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
""")
|
|
||||||
filters.close()
|
|
Reference in New Issue
Block a user