Commit Graph

34 Commits

Author SHA1 Message Date
John McCardle 232105a893 Squashed commit of the following: [reprs_and_member_names]
Closes #22
Closes #23
Closes #24
Closes #25
Closes #31
Closes #56

commit 43fac8f4f3
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Apr 20 18:32:52 2024 -0400

    Typo in UIFrame repr

commit 3fd5ad93e2
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Apr 20 18:32:30 2024 -0400

    Add UIGridPoint and UIGridPointState repr

commit 03376897b8
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Apr 20 18:32:17 2024 -0400

    Add UIGrid repr

commit 48af072a33
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Apr 20 18:32:05 2024 -0400

    Add UIEntity repr
2024-04-20 18:33:18 -04:00
John McCardle c2de9b08d6 Refactor: remove "s" prefix from "sRender" method ( -> "render") Closes #44 2024-04-20 14:16:14 -04:00
John McCardle a465a9861d Color parsing for UICaption __init__ - closes #58 2024-04-20 13:37:19 -04:00
John McCardle ac7f7052cd Squashed commit of the following: [break_up_ui_h]
Closes #43

No segfault found in cos_play after completing the checklist. Maybe I accidentally fixed it...?

commit 6aa151aba3
Author: John McCardle <mccardle.john@gmail.com>
Date:   Fri Apr 19 21:43:58 2024 -0400

    UISprite.h/.cpp cleanup

commit ec0374ef50
Author: John McCardle <mccardle.john@gmail.com>
Date:   Fri Apr 19 21:37:39 2024 -0400

    UIGridPoint.h/.cpp reorganization

commit 2cb7339535
Author: John McCardle <mccardle.john@gmail.com>
Date:   Fri Apr 19 21:19:25 2024 -0400

    UIGrid.h/.cpp cleanup. I have reservations about the UIEntityCollection[Iter] classes + methods living there, but not enough to fix it right now.

commit 5d6af324bf
Author: John McCardle <mccardle.john@gmail.com>
Date:   Thu Apr 18 22:14:57 2024 -0400

    UIFrame - moving static method into class namespace; no type object access

commit 567218cd7b
Author: John McCardle <mccardle.john@gmail.com>
Date:   Thu Apr 18 21:23:49 2024 -0400

    UIEntity fixes for the UI.h split: There are segfaults in cos_play, I may have missed a type usage or something

commit 76693acd28
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Apr 13 00:18:37 2024 -0400

    delete leftover comments

commit 9efe998a33
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Apr 13 00:17:43 2024 -0400

    some work on UICaption and UICollection; fixing segfaults resulting from mcrfpydef namepace TypeObject usage

commit 714965da45
Author: John McCardle <mccardle.john@gmail.com>
Date:   Fri Apr 12 14:15:00 2024 -0400

    eliminate extra includes on UICaption

commit 8efa25878f
Author: John McCardle <mccardle.john@gmail.com>
Date:   Wed Apr 10 23:41:14 2024 -0400

    remove a lot of stuff

commit c186d8c7f3
Author: John McCardle <mccardle.john@gmail.com>
Date:   Wed Apr 10 23:10:15 2024 -0400

    We are compiling again! Started refactoring UICaption to be more idiomatic

commit 1b6e2a709b
Author: John McCardle <mccardle.john@gmail.com>
Date:   Tue Apr 9 22:42:02 2024 -0400

    Still not quite compiling; as predicted, a lot of interdependency and definition order bugs to untangle

commit aa7553a818
Author: John McCardle <mccardle.john@gmail.com>
Date:   Tue Apr 9 22:41:20 2024 -0400

    PyTexture clean up scribbles and experiments

commit c0201d989a
Author: John McCardle <mccardle.john@gmail.com>
Date:   Mon Apr 8 22:55:00 2024 -0400

    additional unsaved changes

commit 83a63a3093
Author: John McCardle <mccardle.john@gmail.com>
Date:   Mon Apr 8 22:45:00 2024 -0400

    doesn't compile, but UI.h/.cpp code has been divvy'd up.

    refs #43 @2h
2024-04-20 10:32:04 -04:00
John McCardle 1a7186f745 Squashed commit of the following: [standardize_font_handling]
closes #60, closes #5, closes #68

The major functionality added here was proper use of types in the module, by importing after finalization.

commit 5009fa0fb9
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Apr 7 22:44:15 2024 -0400

    PyFont - use the new standard method for instancing

commit a19781b56a
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Apr 7 15:21:17 2024 -0400

    Many hours of pain & research behind this small commit. Safe object building by not messing with types before interpreter is fully initialized

commit 159658521c
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Mar 31 21:41:45 2024 -0400

    Font mostly working, just a few weird bugs with the types of the default items added to the module
2024-04-07 22:51:31 -04:00
John McCardle fbf263a038 Squashed commit of the following: [standardize_vector_handling]
closes #13

Deferring class standardization for the UI.h overhaul.

commit 5edebdd643
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Mar 31 14:21:07 2024 -0400

    PyVector init should be pretty reliable now

commit c13e185289
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Mar 31 13:51:29 2024 -0400

    PyColor fix - Init corrections

commit 8871f6be6e
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 30 22:51:55 2024 -0400

    Parse arguments: no args & Vector object args work, tuples and bare numerics still do not

commit 1c12e8719c
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 30 22:32:28 2024 -0400

    Not bad for a quick first salvo, but I cannot figure out why init isn't cooperating.
2024-03-31 18:00:19 -04:00
John McCardle f82508b753 Squashed commit of the following: [standardize_color_handling]
closes #11

Check the abandoned feature branch for PyLinkedColor, a time-expensive but now abandoned feature to link a color value to a UIDrawable.

There are some TODOs left in the PyColor class, but that can go under cleanup. I'm way over time on this, so I'm taking a small victory :)

commit 572aa52605
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 30 21:18:26 2024 -0400

    More color table updates

commit 01706bd59d
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 30 21:13:31 2024 -0400

    Color wrapup... Cutting PyLinkedColor to simplify my cursedly mortal, finite existence

commit 3991ac13d6
Author: John McCardle <mccardle.john@gmail.com>
Date:   Thu Mar 28 23:50:50 2024 -0400

    Still having segfaults with LinkedColor and captions (specifically outline color, but that might not be the actual cause). PyColor shaping back up in simplified form.

commit 06e24a1b27
Author: John McCardle <mccardle.john@gmail.com>
Date:   Thu Mar 28 20:53:49 2024 -0400

    LinkedColor now reflecting changes to the linked color value. Needs set method + RGBA / color properties

commit 41509dfe96
Author: John McCardle <mccardle.john@gmail.com>
Date:   Wed Mar 27 21:10:03 2024 -0400

    Addressing issues with PyColor by splitting behavior off into PyLinkedColor

commit 13a4ddf41b
Author: John McCardle <mccardle.john@gmail.com>
Date:   Tue Mar 26 23:02:00 2024 -0400

    Build runs again. PyColor objects are being instantiated, with bugs and no test of color changing

commit 1601fc7fab
Author: John McCardle <mccardle.john@gmail.com>
Date:   Mon Mar 25 20:48:08 2024 -0400

    Still doesn't compile, but now the issue is in UI.h overcoupling. Progress!

commit 13672c8fdb
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Mar 24 21:19:37 2024 -0400

    Dabbling around this morning; still not building

commit 79090b553f
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Mar 24 08:36:06 2024 -0400

    Unsaved changes from last night

commit 2cac6f03c6
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 23 23:07:10 2024 -0400

    untested PyColor base implementation

commit 3728e5fcc8
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 23 23:06:36 2024 -0400

    Color naming prototype
2024-03-30 21:20:40 -04:00
John McCardle 4ffe438d1b Squashed commit of the following: [standardize_texture_handling]
closes #18

commit b114ec3085
Author: John McCardle <mccardle.john@gmail.com>
Date:   Thu Mar 21 22:22:35 2024 -0400

    cleaning up for merge

commit d7228172c4
Author: John McCardle <mccardle.john@gmail.com>
Date:   Thu Mar 21 21:39:15 2024 -0400

    Messy, but monumental: PyTexture::pyObject works

    this also coincidentally fixes a weird bug I encountered while
    (mis?)using tp_alloc: by using PyType_GenericAlloc, I avoid the segfault
    that tp_alloc sometimes causes. See the horrible UIDrawable retrieval
    macro that I use in UI.h for a workaround that can probably be replaced
    with this technique

commit 2cf8f94310
Author: John McCardle <mccardle.john@gmail.com>
Date:   Wed Mar 20 21:16:52 2024 -0400

    Radical new example pattern for exposing a C++ class to Python

commit 84a8886da2
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Mar 17 16:29:33 2024 -0400

    Fixed render issue with UIGrid / PyTexture: wasn't positioning or scaling properly after fetching sprite

commit 20f80c4114
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sun Mar 17 16:23:52 2024 -0400

    Fixed sprite indexing error in PyTexture; needs non-square sprite tests, but feeling confident!

commit afd4ff1925
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 16 21:53:24 2024 -0400

    good progress, we're building again. Issue with Grid (tile sprite) textures and I think the sprite indexes are being calculated wrong (x and y transposed?)

commit bfd33102d1
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 16 14:52:35 2024 -0400

    Squashed basically all the compile bugs in UISprite, but UIEntity and UIGrid use textures as well, so they need to be fixed too before the project will build again

commit 47d0e34a17
Author: John McCardle <mccardle.john@gmail.com>
Date:   Sat Mar 16 11:31:39 2024 -0400

    Initial PyTexture class

    no testing done.
    should enable rectangular (non-square) textures

    "sprite" method; let's just overwrite sprites with texture coords
    Hoping to replace awful code like:
    `self->data->sprite.sprite.setTextureRect(self->data->sprite.itex->spriteCoordinates(val));`

    with something like:
    `self->data->sprite = self->data->texture->sprite(val);`
2024-03-21 22:24:42 -04:00
John McCardle cdaf309272 Squashed commit of the following: [raii_pyobjects]
closes #4

commit 8f060dc87b
Author: John McCardle <mccardle.john@gmail.com>
Date:   Fri Mar 15 22:20:03 2024 -0400

    Removing std::cout debugging statements

commit c9d5251c71
Author: John McCardle <mccardle.john@gmail.com>
Date:   Fri Mar 15 20:00:57 2024 -0400

    In-place map modification worked

commit 0a8f67e391
Author: John McCardle <mccardle.john@gmail.com>
Date:   Thu Mar 14 23:13:13 2024 -0400

    Stress test is failing: By removing a timer to a function (from inside that function?) I can immediately cause a segfault.

commit 05d9f6a882
Author: John McCardle <mccardle.john@gmail.com>
Date:   Tue Mar 12 22:27:12 2024 -0400

    wow, good test of Key and Click Callable classes. Cleanup, squash, and merge after I give it a lookover in daylight, though.

commit 972768eb26
Author: John McCardle <mccardle.john@gmail.com>
Date:   Tue Mar 12 21:02:48 2024 -0400

    inital PyCallable work; isolate very well behaved usage of PyObject references behind RAII
2024-03-15 22:20:37 -04:00
John McCardle 2c3c1449ee chore: changing comments to reflect TODOs conversion to issues 2024-03-12 21:03:39 -04:00
John McCardle 8739da8463 Easy cleanup: delete files from the old Entity & UI system that were replaced in EngJam 2023 & 7DRL 2024 2024-03-09 08:59:39 -05:00
John McCardle 45f07b7226 Crypt of Sokoban: incomplete 7DRL game and engine stress-test 2024-03-08 22:26:40 -05:00
John McCardle 9eb9562b9f default debug action fixes: UITestScene now uses the same grave hotkey to start REPL 2024-03-08 22:25:48 -05:00
John McCardle 5ada446360 Window scaling functionality 2024-03-08 16:55:58 -05:00
John McCardle 8e1552eec5 Bounds checking on Grid point access, and correct the formula. Caused segfault on non-square grid size (and was transposing coordinates!) 2024-03-08 14:08:49 -05:00
John McCardle aa7f2ba605 Segfault fixes. Switching scenes broke some assumptions. All PyObject calls from userspace now handle (discard) exceptions and return values. 2024-03-08 12:09:09 -05:00
John McCardle e8240cb380 Exit functionality via game engine, because sys.exit was making a mess 2024-03-08 10:17:26 -05:00
John McCardle db548c9183 Scene switching safety 2024-03-07 13:30:08 -05:00
John McCardle 4b31864b2f Adding text functionality to Caption (why was that missing???) 2024-03-07 12:35:07 -05:00
John McCardle 343669df1e nice-ifying UIFrame __init__ and making debug a bit easier 2024-03-07 11:19:46 -05:00
John McCardle d417bdc8a3 Whoops, some issues with deleting timers. 2024-03-07 09:49:24 -05:00
John McCardle ccd79fc551 quick & dirty timer functionality 2024-03-07 08:59:26 -05:00
John McCardle 9d728ee902 Keyboard initial functionality commit 2024-03-07 08:13:37 -05:00
John McCardle 9587218b28 Mouse input prototype 2024-03-06 21:12:26 -05:00
John McCardle 6a1edfe182 remove more cruft files 2024-03-06 21:10:31 -05:00
John McCardle 145012074c Remove cruft from API. New style objects are now the only objects 2024-03-06 11:04:50 -05:00
John McCardle 30cfa5ca71 Scene switching API 2024-03-06 10:50:19 -05:00
John McCardle 6de3f0e8cf 7DRL 2024 Day 4 updates - UIGrid / mcrfpy.Grid
Massive new set of behaviors:
* Move, resize*, zoom, and pan mcrfpy.Grid instances from Python. Note:
there's a rendering error with resizing, which will have to wait for
after 7DRL.

* Add, remove, and create mcrfpy.Entity instances from Python. The
fields can be edited to change position and sprite. They can be removed
from a grid and/or added to another. the Entity class is closely related
to the EntityCollection class, the Python interface to UIGrid's
std::vector of UIEntities.

* mcrfpy.GridPoint and mcrfyp.GridPointState objects. The GridPoint
class allows access to the "physical" parts of a grid. The
GridPointState class allows access to an entity's knowledge of it. Grids
and Entities have an "at" method that takes a tuple (x,y) and returns
one of these objects.

__repr__ and many other nice things are notably absent - many TODOs were
added to the codebase today. They can get picked up after 7DRL.
2024-03-05 22:37:50 -05:00
John McCardle 08772111de some fixes; instantiating PyUIGrid / mcrfpy.Grid safely now. Many issues remain 2024-03-05 07:42:49 -05:00
John McCardle 4dd4f74120 WIP / UIGrid and related elements added in one giant leap. see TODO / BUGFIX in several places for incomplete functionality. 2024-03-04 23:12:08 -05:00
John McCardle 197211fa76 pre-7DRL 2024 commit: got UIGrid to render. Needs entities, sprite tests, and python API 2024-03-02 00:42:21 -05:00
John McCardle 198ed337e3 Windows build 2024-02-25 15:38:38 -05:00
John McCardle 07b597d6f2 Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup
directories needed:
* build - for cmake output
* deps - stuff needed to compile McRogueface (headers)
	libtcod -> ../modules/libtcod/src/libtcod
	sfml -> ../modules/SFML/include/SFML
	python -> ../modules/cpython/Include
* lib - stuff needed to link McRogueFace (shared objects); also required at runtime
	libtcod -> `../modules/libtcod/buildsys/autotools/.libs/libtcod.so.1.0.24`
	sfml -> `../modules/SFML/build/lib/*`
	python -> `../modules/cpython/libpython3.12.so`; standard lib at ../modules/cpython/build/lib.linux-x86_64-3.12 & ../modules/cpython/Lib

You can get dependencies by:
 - Build from source (i.e. all submodules)
 - Go download them from each project's website
 - install packages from your distro and symlink them to deps/lib directories
2024-02-24 22:48:39 -05:00
John McCardle d0d2eae762 Initial Commit / Linux Combined Proof of Concept example 2023-02-23 19:37:13 -05:00