Rearrange the files a bit: Move timer/utils to Src and fix a few small

issues
This commit is contained in:
simon.kagstrom 2010-01-29 06:35:40 +00:00
parent 7619e36910
commit 9d1d6190c8
15 changed files with 30 additions and 15 deletions

View File

@ -36,7 +36,7 @@ CPP_SRCS=Src/C64_SC.cpp Src/main.cpp Src/Display.cpp Src/Prefs.cpp Src/SID.cpp \
Src/CIA_SC.cpp Src/CPU1541_SC.cpp Src/CPU_common.cpp Src/Network.cpp \
Src/gui/menu_messages.cpp Src/gui/dialogue_box.cpp Src/gui/widget.cpp \
Src/gui/game_info.cpp Src/gui/status_bar.cpp Src/gui/gui.cpp Src/gui/listener.cpp \
Src/gui/timer.cpp Src/gui/utils.cpp Src/gui/virtual_keyboard.cpp Src/gui/menu.cpp
Src/timer.cpp Src/utils.cpp Src/gui/virtual_keyboard.cpp Src/gui/menu.cpp
C_SRCS=Src/d64-read.c

View File

@ -1,12 +1,12 @@
#include <unistd.h> /* unlink */
#include <C64.h>
#include <utils.hh>
#include "menu.hh"
#include "file_browser.hh"
#include "game_info.hh"
#include "game_info_box.hh"
#include "utils.hh"
static const char *game_exts[] = {".d64", ".D64", ".t64", ".T64",
".prg",".PRG", ".p00", ".P00", NULL};

View File

@ -3,8 +3,9 @@
#include <SDL.h>
#include <SDL_image.h>
#include <utils.hh>
#include "game_info.hh"
#include "utils.hh"
#define VERSION_BASE (0x1978)
#define VERSION_MAGIC (VERSION_BASE + 0)

View File

@ -2,13 +2,14 @@
#include <SDL_ttf.h>
#include <arpa/inet.h>
#include <utils.hh>
#include "menu.hh"
#include "gui.hh"
#include "menu_messages.hh"
#include "help_box.hh"
#include "dialogue_box.hh"
#include "sdl_ttf_font.hh"
#include "utils.hh"
#include "virtual_keyboard.hh"
extern SDL_Surface *screen;

View File

@ -2,10 +2,10 @@
#define __GUI_HH__
#include <SDL.h>
#include <timer.hh>
#include "menu.hh"
#include "font.hh"
#include "timer.hh"
#include "gui_view.hh"
/* Frodo stuff */

View File

@ -1,5 +1,6 @@
#include <utils.hh>
#include "listener.hh"
#include "utils.hh"
ListenerManager::ListenerManager()
{

View File

@ -12,9 +12,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <utils.hh>
#include "menu.hh"
#include "font.hh"
#include "utils.hh"
#include "gui.hh"
#define IS_SUBMENU(p_msg) ( (p_msg)[0] == '^' )

View File

@ -2,11 +2,12 @@
#include <C64.h>
#include <utils.hh>
#include "menu.hh"
#include "file_browser.hh"
#include "game_info.hh"
#include "game_info_box.hh"
#include "utils.hh"
static const char *save_exts[] = {".sav", ".SAV", NULL};

View File

@ -1,8 +1,8 @@
#include <SDL.h>
#include <SDL_ttf.h>
#include <utils.hh>
#include "font.hh"
#include "utils.hh"
#ifndef __SDL_TTF_FONT_HH__
#define __SDL_TTF_FONT_HH__

View File

@ -1,9 +1,10 @@
#ifndef __STATUS_BAR_HH__
#define __STATUS_BAR_HH__
#include <timer.hh>
#include "menu.hh"
#include "gui.hh"
#include "timer.hh"
#define N_STATUS_MESSAGES 8

View File

@ -11,8 +11,9 @@
********************************************************************/
#include <SDL.h>
#include <utils.hh>
#include "virtual_keyboard.hh"
#include "utils.hh"
#include "gui.hh"
typedef struct virtkey

View File

@ -1,8 +1,10 @@
#include "sysdeps.h"
#include "Prefs.h"
#include "timer.hh"
#include "utils.hh"
#include "gui.hh"
#define MS_TO_TICKS(x) ((x) / Gui::gui->np->MsPerFrame)
#define MS_TO_TICKS(x) ((x) / ThePrefs.MsPerFrame)
TimerController::TimerController()
{

View File

@ -5,8 +5,8 @@
#include <sys/stat.h>
#include <SDL_ttf.h>
#include "gui/font.hh"
#include "utils.hh"
#include "font.hh"
TTF_Font *read_and_alloc_font(const char *path, int pt_size)
{
@ -14,13 +14,19 @@ TTF_Font *read_and_alloc_font(const char *path, int pt_size)
SDL_RWops *rw;
Uint8 *data;
FILE *fp = fopen(path, "r");
size_t r;
if (!fp) {
fprintf(stderr, "Could not open font %s\n", path);
return NULL;
}
data = (Uint8*)xmalloc(1 * 1024*1024);
fread(data, 1, 1 * 1024 * 1024, fp);
r = fread(data, 1, 1 * 1024 * 1024, fp);
if (r == 0 || ferror(fp))
{
free(data);
return NULL;
}
rw = SDL_RWFromMem(data, 1 * 1024 * 1024);
if (!rw)
{