summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/history.c12
-rw-r--r--riscos/save.c23
2 files changed, 29 insertions, 6 deletions
diff --git a/riscos/history.c b/riscos/history.c
index f155afa34..aa574ba44 100644
--- a/riscos/history.c
+++ b/riscos/history.c
@@ -106,7 +106,7 @@ void history_add(struct history *history, struct content *content)
char *split;
int width;
osspriteop_area *area;
- os_error *error;
+// os_error *error;
if (!history)
return;
@@ -153,7 +153,7 @@ void history_add(struct history *history, struct content *content)
}
history->current = entry;
- area = malloc(SPRITE_SIZE);
+/* area = malloc(SPRITE_SIZE);
if (!area) {
LOG(("malloc failed"));
return;
@@ -171,7 +171,12 @@ void history_add(struct history *history, struct content *content)
LOG(("0x%x: %s", error->errnum, error->errmess));
return;
}
-
+ */
+ area = thumbnail_initialise(WIDTH / 2, HEIGHT / 2, (os_mode)0x301680b5);
+ if (!area) {
+ LOG(("Thumbnail initialisation failed."));
+ return;
+ }
thumbnail_create(content, area,
(osspriteop_header *) (area + 1),
WIDTH / 2, HEIGHT / 2);
@@ -410,6 +415,7 @@ void ro_gui_history_redraw_tree(struct history_entry *he,
area, (osspriteop_id)header,
colourtrans_CURRENT_MODE, colourtrans_CURRENT_PALETTE,
0, colourtrans_GIVEN_SPRITE, 0, 0, &size);
+ LOG(("Table size of %i", size));
table = xcalloc(size, 1);
xcolourtrans_generate_table_for_sprite(
area, (osspriteop_id)header,
diff --git a/riscos/save.c b/riscos/save.c
index d4bd41b7b..e36d85b85 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -9,6 +9,7 @@
* Save dialog and drag and drop saving (implementation).
*/
+#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -186,11 +187,13 @@ void ro_gui_save_datasave_ack(wimp_message *message)
void ro_gui_save_complete(struct content *c, char *path)
{
- char buf[256], spritename[13];
+ char buf[256];
FILE *fp;
os_error *error;
osspriteop_area *area;
+ osspriteop_header *sprite_header;
char *appname;
+ unsigned int index;
/* Create dir */
error = xosfile_create_dir(path, 0);
@@ -227,7 +230,7 @@ void ro_gui_save_complete(struct content *c, char *path)
warn_user("Failed to acquire dirname");
return;
}
- snprintf(spritename, sizeof spritename, "%s", appname+1);
+/* snprintf(spritename, sizeof spritename, "%s", appname+1);
area = malloc(SPRITE_SIZE);
if (!area) {
LOG(("malloc failed"));
@@ -247,9 +250,23 @@ void ro_gui_save_complete(struct content *c, char *path)
free(area);
return;
}
+*/
+ area = thumbnail_initialise(34, 34, os_MODE8BPP90X90);
+ if (!area) {
+ LOG(("Iconsprite initialisation failed."));
+ return;
+ }
+ sprite_header = (osspriteop_header *)(area + 1);
+ strncpy(sprite_header->name, appname + 1, 12);
+
+ /* !Paint gets confused with uppercase characters
+ */
+ for (int index = 0; index < 12; index++) {
+ sprite_header->name[index] = tolower(sprite_header->name[index]);
+ }
thumbnail_create(c, area,
(osspriteop_header *) ((char *) area + 16),
- WIDTH / 2, HEIGHT / 2);
+ 34, 34);
error = xosspriteop_save_sprite_file(osspriteop_NAME, area, buf);
if (error) {
LOG(("Failed to save iconsprite"));