Skip to content

Commit

Permalink
Left stick support and editor export
Browse files Browse the repository at this point in the history
  • Loading branch information
technicaljicama committed Apr 22, 2023
1 parent cdffef3 commit e157d10
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
51 changes: 51 additions & 0 deletions platform/psp/export/export.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*************************************************************************/
/* export.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/

#include "export.h"
#include "editor/editor_import_export.h"
#include "platform/psp/logo.gen.h"
#include "scene/resources/texture.h"

void register_psp_exporter() {

Image img(_psp_logo);
Ref<ImageTexture> logo = memnew(ImageTexture);
logo->create_from_image(img);

{
Ref<EditorExportPlatformPC> exporter = Ref<EditorExportPlatformPC>(memnew(EditorExportPlatformPC));
exporter->set_binary_extension("PBP");
exporter->set_release_binary32("EBOOT.PBP");
exporter->set_name("PSP");
exporter->set_logo(logo);
exporter->set_chmod_flags(0755);
EditorImportExport::get_singleton()->add_export_platform(exporter);
}
}
31 changes: 31 additions & 0 deletions platform/psp/export/export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*************************************************************************/
/* export.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/

void register_psp_exporter();
Binary file modified platform/psp/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions platform/psp/os_psp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ void OS_PSP::process_keys() {
}
}

InputDefault::JoyAxis ly, lx;

lx.value = (pad.Lx / 127) - 1;
ly.value = (pad.Ly / 127) - 1;

input->joy_axis(0, 0, 0, lx);
input->joy_axis(0, 0, 1, ly);
}

void OS_PSP::delete_main_loop() {
Expand Down

0 comments on commit e157d10

Please sign in to comment.